123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644 |
- <template>
- <div class="addcompany">
- <div class="list" style="padding-bottom: 500rpx">
- <div class="list-row" style="padding-top: 0">
- <div style="height: auto" class="width100">
- <div class="width100 mt24rpx padb24rpx border_bottom_ccc list_date">
- <div class="input_title float_left">
- <span style="color: red">* </span>安全检查类型
- </div>
- <div
- class="float_left width60 whitespacenowrap first_title height50rpx font28rpx"
- style="color: #777"
- >
- <picker
- :disabled="id != null"
- style="input_value float_left"
- @change="bindPickerChange"
- :value="form.testTypeIndex"
- :range="dic_SelectList.rectification_management_update_type"
- range-key="label"
- >
- {{
- !dic_SelectList.rectification_management_update_type[
- form.testTypeIndex
- ].label
- ? "未知类型"
- : dic_SelectList.rectification_management_update_type[
- form.testTypeIndex
- ].label
- }}
- </picker>
- </div>
- <textarea
- :disabled="id != null"
- v-model="form.info"
- :maxlength="2000"
- placeholder="请输入"
- type="textarea"
- style="
- height: 200rpx;
- background: rgba(249, 249, 249, 1);
- padding: 20rpx;
- width: calc(100% - 40rpx);
- "
- />
- <div
- style="
- background: rgba(249, 249, 249, 1);
- text-align: right;
- padding-right: 10px;
- padding-bottom: 10rpx;
- "
- >
- {{ form.info.length }}/2000
- </div>
- </div>
- <div
- class="width100 mt24rpx padb24rpx border_bottom_ccc list_date display_flex"
- style="display: flex"
- >
- <div class="input_title float_left">
- <span style="color: red">* </span>
- 整改位置
- </div>
- <div
- @click="getCurrentLocal()"
- class="float_left width60 first_title font28rpx"
- style="color: #777; height: auto"
- >
- <div
- style="color: #777; height: auto; width: 80%"
- class="float_left input_value"
- >
- {{ form.updateAddress }}
- </div>
- </div>
- </div>
- <div
- class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
- >
- <div class="input_title float_left">
- <span style="color: red">*</span>
- 处理人
- </div>
- <view style="color: #777" class="input_value float_left">
- {{ !form.finishUserName ? "请选择" : form.finishUserName }}
- </view>
- </div>
- <div
- class="width100 mt24rpx padb24rpx border_bottom_ccc list_date"
- style="display: flex"
- >
- <div class="input_title float_left">
- <span style="color: red">*</span>
- 发布人
- </div>
- <view
- style="color: #777; display: flex; height: auto"
- class="input_value float_left"
- >
- {{ form.openUserDeptName }}
- -
- {{ form.openUserName }}
- -
- <!-- {{ form.openUserPhone }} -->
- 0510-13921516068
- <TelNum :num="form.openUserPhone" :showTel="false" />
- </view>
- </div>
- <div
- class="width100 mt24rpx padb24rpx border_bottom_ccc list_date height40rpx"
- >
- <div class="input_title float_left">要求处理日期</div>
- <div
- class="float_left width60 whitespacenowrap first_title height50rpx font28rpx"
- style="color: #777"
- >
- {{ form.needFinishTime }}
- </div>
- </div>
- <div class="width100 mt24rpx border_bottom_ccc list_date">
- <div class="input_title">整改处理前照片</div>
- <div style="margin-top: 24rpx">(支持图片上传10M内,最多6张)</div>
- <div
- class="custom-image-box"
- style="margin-top: 20rpx; margin-bottom: 36rpx"
- >
- <van-uploader
- :multiple="true"
- :file-list="form.infoMorePictureUrlList"
- :deletable="false"
- :show-upload="true"
- disabled
- />
- </div>
- </div>
- <view class="width100 mt24rpx padb24rpx list_date height300rpx">
- <view class="input_title mb16rpx">处理结果:</view>
- <textarea
- v-model="form.finishInfo"
- :maxlength="2000"
- placeholder="请输入"
- type="textarea"
- style="
- height: 200rpx;
- background: rgba(249, 249, 249, 1);
- padding: 20rpx;
- width: calc(100% - 40rpx);
- "
- />
- <div
- style="
- background: rgba(249, 249, 249, 1);
- text-align: right;
- padding-right: 10px;
- padding-bottom: 10rpx;
- "
- >
- {{ form.finishInfo.length }}/2000
- </div>
- </view>
- <div class="width100 mt24rpx border_bottom_ccc list_date">
- <div class="input_title">整改处理后照片</div>
- <div style="margin-top: 24rpx">(支持图片上传10M内,最多6张)</div>
- <div
- class="custom-image-box"
- style="margin-top: 20rpx; margin-bottom: 36rpx"
- >
- <van-uploader
- :max-count="6"
- :show-upload="true"
- @delete="deleteRYXXZP"
- :deletable="form.finishType != 4"
- :file-list="form.finishPictureUrlList"
- @after-read="uploadfinishPictureUrl"
- />
- </div>
- </div>
- </div>
- </div>
- <div class="save_button" @click="save()" v-if="form.finishType == 2">
- 提交
- </div>
- </div>
- <select-dengjiyuan
- ref="selectDengjiyuan"
- :multiple="false"
- :range="range"
- :selectParent="false"
- :foldAll="true"
- rangeKey="name"
- idKey="id"
- @selectDengjiyuan="selectDengjiyuan"
- />
- <multiple-select
- v-model="show"
- :data="companyAllList"
- :default-selected="defaultSelected"
- @confirm="confirm"
- ></multiple-select>
- </div>
- </template>
-
- <script>
- const form = {
- finishType: "3",
- finishInfo: "",
- info: "",
- infoMorePictureUrlList: [],
- finishPictureUrlList: [],
- testTypeIndex: 0,
- year: "2023",
- carDate: "2023-06-30",
- remark: "",
- checkInfo: "",
- updateAddressY: "",
- updateAddressX: "",
- updateAddress: "",
- };
- import TelNum from "../../subPackages/components/tel-number";
- import multipleSelect from "../../subPackages/components/momo-multipleSelect/momo-multipleSelect";
- import tools from "../../subPackages/components/tkitree/tools.js";
- import {
- getSelectUserTwo,
- getSelectDeptTwo,
- getByCodes,
- getUserLocalStorageInfo,
- addRectificationManagement,
- findRectificationManagementInOutById,
- updateListRectificationManagement,
- } from "@/js_sdk/http";
- export default {
- components: {
- multipleSelect,
- TelNum,
- },
- data() {
- return {
- id: null,
- BASE_URI: this.$constant.BASE_URI,
- companyAllList: [],
- defaultSelected: [],
- show: false,
- bizhongIndex: 0,
- testList: [
- { label: "类型1", value: 1 },
- { label: "类型2", value: 2 },
- { label: "类型3", value: 3 },
- { label: "类型4", value: 4 },
- { label: "类型5", value: 5 },
- { label: "类型6", value: 6 },
- { label: "类型7", value: 7 },
- { label: "类型8", value: 8 },
- ],
- settleInTypeIndex: 0,
- range: [],
- zaitiList: [],
- imageStyles: {},
- listStyles: {},
- fileLists: [],
- activeNames: [],
- StatusBar: 0,
- dic_key: ["rectification_management_update_type"],
- dic_SelectList: {},
- search: {
- pageSize: 10,
- pageNum: 1,
- },
- form: { ...form },
- companyAllList: [],
- value: ["0"],
- modeIndex: -1,
- styleIndex: -1,
- current: 0,
- mode: "default",
- dotsStyles: {},
- swiperDotIndex: 0,
- };
- },
- onLoad(option) {
- this.getByCodes();
- this.id = option.id !== "null" ? option.id : null;
- this.form.createdBy = getUserLocalStorageInfo().user.id;
- // qqmapsdk = new QQMapWX({
- // key: "OJ7BZ-ULH6V-XBLPV-ULIMK-APS3H-QHFIP",
- // });
- // this.getCurrentLocal();
- },
- onShow() {},
- methods: {
- transDate(e) {
- console.log(this.$common.transDate(e));
- return this.$common.transDate(e);
- },
- selectDengjiyuan(e) {
- this.form.finishUserName = e[e.length - 1].name;
- this.form.finishUser = e[e.length - 1].id;
- this.$forceUpdate();
- },
- async getSelectUserTwo(key) {
- let that = this;
- let departmentList = await getSelectUserTwo("");
- that.range = tools.transData(
- departmentList.data,
- "id",
- "parentid",
- "children"
- );
- console.log(key);
- that.$refs[key]._show();
- },
- async findRectificationManagementInOutById() {
- let that = this;
- try {
- if (that.id != null) {
- let detail = await findRectificationManagementInOutById(that.id);
- that.form = { ...form };
- that.form = detail;
- that.form.info = detail.info;
- that.form.finishInfo = detail.finishInfo;
- if (detail.finishTime) {
- that.form.finishTime = this.$common.transDate(detail.finishTime);
- } else {
- detail.finishTime = null;
- }
- if (detail.infoMorePictureUrl.length != 0) {
- let infoMorePictureUrlList = detail.infoMorePictureUrl.split(",");
- that.form.infoMorePictureUrlList = infoMorePictureUrlList.map(
- (e) => {
- return {
- name: e,
- imgUrl: "/FileController/download/" + e,
- url:
- that.$constant.BASE_URI + "/FileController/download/" + e,
- isImage: true,
- };
- }
- );
- }
- if (detail.finishPictureUrl && detail.finishPictureUrl.length != 0) {
- let finishPictureUrlList = detail.finishPictureUrl.split(",");
- that.form.finishPictureUrlList = finishPictureUrlList.map((e) => {
- return {
- name: e,
- imgUrl: "/FileController/download/" + e,
- url: that.$constant.BASE_URI + "/FileController/download/" + e,
- isImage: true,
- };
- });
- }
- let index =
- that.dic_SelectList.rectification_management_update_type.findIndex(
- (e) => e.value == detail.updateType
- );
- console.log(index);
- if (index != -1) {
- that.form.testTypeIndex = index;
- that.form.updateType =
- that.rectification_management_update_type[index].value;
- }
- console.log(that.form.finishInfo);
- that.$forceUpdate();
- }
- } catch (error) {}
- },
- selectYear(event) {
- this.form.attributiveYear = event.detail.value;
- this.$forceUpdate();
- },
- selectCarDate(event) {
- this.form.finishTime = event.detail.value;
- this.$forceUpdate();
- },
- bindPickerChange: function (e) {
- this.form.testTypeIndex = e.detail.value;
- this.form.updateType =
- this.dic_SelectList.rectification_management_update_type[
- e.detail.value
- ].value;
- },
- uploadfinishPictureUrl(event) {
- let that = this;
- const { file } = event.detail;
- uni.uploadFile({
- url: that.$constant.BASE_URI + "/wx/fileController/upload",
- filePath: file.url,
- name: "file",
- formData: { user: "test" },
- success(res) {
- // 上传完成需要更新 fileList
- if (!that.form.finishPictureUrlList) {
- that.form.finishPictureUrlList = [];
- }
- console.log(that.form.finishPictureUrlList);
- let data = JSON.parse(res.data);
- that.form.finishPictureUrlList.push({
- imgUrl: "/FileController/download/" + data.data[0],
- id: data.data[0],
- url:
- that.$constant.BASE_URI +
- "/FileController/download/" +
- data.data[0],
- isImage: true,
- });
- that.$forceUpdate();
- },
- fail(res) {},
- });
- },
- confirm(e) {
- var associationCompanyString = [];
- var associationCompany = [];
- for (var p in e) {
- associationCompanyString.push(e[p].label);
- associationCompany.push(e[p].value);
- }
- this.form.associationCompanyString = associationCompanyString.join(",");
- this.form.associationCompany = associationCompany.join(",");
- },
- deleteRYXXZP(event) {
- this.form.finishPictureUrlList.splice(event.detail.index, 1);
- },
- async getByCodes() {
- let data = await getByCodes(JSON.stringify(this.dic_key));
- this.dic_SelectList = this.$common.handleDicList(data);
- this.form.updateType =
- this.dic_SelectList.rectification_management_update_type[0].value;
- this.findRectificationManagementInOutById();
- console.log(this.form.updateType);
- },
- // /wx/SaleController/findRoomInfoListByIds
- async findRoomInfoListByIds() {
- let data = await findRoomInfoListByIds(ids);
- return data;
- },
- async getSelectDeptTwo(key) {
- let that = this;
- let departmentList = await getSelectDeptTwo("");
- that.range = tools.transData(
- departmentList.data,
- "id",
- "parentid",
- "children"
- );
- that.$refs[key]._show();
- },
- async save() {
- let that = this;
- let finishPictureUrl = [];
- if (
- that.form.finishPictureUrlList &&
- that.form.finishPictureUrlList.length > 0
- ) {
- finishPictureUrl = that.form.finishPictureUrlList.map((e) => {
- return e.id;
- });
- }
- console.log(that.form.finishPictureUrl);
- let form = [
- {
- finishType: 3,
- finishTime: this.$common.transServDate(new Date()),
- // checkTime: this.$common.transServDate(new Date()),
- finishUser: getUserLocalStorageInfo().user.id,
- updatedBy: getUserLocalStorageInfo().user.id,
- id: that.form.id,
- finishInfo: that.form.finishInfo,
- finishPictureUrl: finishPictureUrl.toString(),
- },
- ];
- let data = await updateListRectificationManagement({
- entities: JSON.stringify(form),
- });
- if (data.code == 200) {
- that.$showToast("新增成功");
- uni.navigateBack({});
- }
- },
- chossseFile() {
- this.$refs.files.upload();
- },
- onChange(event) {
- this.activeNames = event.detail;
- },
- },
- };
- </script>
- <style scoped lang="scss" scpoed>
- .btn-view {
- width: 100%;
- height: 100rpx;
- padding: 20rpx 10%;
- background-color: #ffffff;
- position: fixed;
- bottom: 0;
- left: 0;
- }
- .btn {
- width: 80%;
- height: 90rpx;
- border-radius: 50rpx 50rpx 50rpx 50rpx;
- background: #1d18bc;
- line-height: 90rpx;
- color: white;
- }
- .save_button {
- width: calc(100% - 64rpx);
- margin: 64rpx 32rpx 0 32rpx;
- background: #1d18bc;
- border-radius: 50rpx;
- height: 88rpx;
- color: white;
- text-align: center;
- line-height: 88rpx;
- }
- .form {
- width: calc(100% - 64rpx);
- background: #ffffff;
- padding: 32rpx;
- margin-top: 64rpx;
- .label {
- height: 53rpx;
- line-height: 53rpx;
- }
- }
- .form_row {
- height: 40rpx;
- font-weight: 400;
- font-size: 24rpx;
- }
- .zaiti_list {
- width: 100%;
- height: 50rpx;
- line-height: 50rpx;
- }
- .idclass {
- width: 147rpx;
- height: 100rpx;
- }
- .dengjibutton {
- margin-top: 24rpx;
- margin-left: 60rpx;
- margin-right: 60rpx;
- width: calc(100% - 120rpx);
- height: 60rpx;
- text-align: center;
- background: #1d18bc;
- color: white;
- line-height: 60rpx;
- }
- .addcompany {
- margin-bottom: 200rpx;
- }
- .addcompany {
- .detailstitle {
- height: 42rpx;
- font-size: 30rpx;
- font-weight: 500;
- color: #333333;
- padding-bottom: 16rpx;
- }
- .typestitle {
- height: 42rpx;
- font-size: 24rpx;
- font-weight: 500;
- padding-bottom: 16rpx;
- margin-bottom: 16rpx;
- }
- }
- </style>
- <style lang="scss">
- ::v-deep .is-open + .uni-collapse-item__wrap {
- height: auto !important;
- }
- ::v-deep .uni-collapse-item__wrap-content {
- height: auto !important;
- }
- .pageconfig {
- background: #ffffff;
- padding: 32rpx;
- }
- .input_title {
- width: 40%;
- font-size: 28rpx;
- height: 40rpx;
- line-height: 40rpx;
- color: #333333;
- }
- .input_value {
- width: 60%;
- font-size: 28rpx;
- height: 40rpx;
- line-height: 40rpx;
- color: #777777;
- }
- .uni-collapse-item__title-box {
- padding: 0 !important;
- }
- .uni-collapse-item__title-text {
- color: #1d18bc !important;
- font-size: 32rpx !important;
- }
- </style>
- <style lang="scss">
- .example-body {
- padding: 10px;
- padding-top: 0;
- }
- .custom-image-box {
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- }
- .text {
- font-size: 14px;
- color: #333;
- }
- .uni-file-picker__item {
- display: none;
- }
- .uploadbutton {
- width: 162rpx;
- height: 44rpx;
- }
- </style>
|