From 0a48655d2162b709ecb80d249a4085971add6140 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期一, 07 七月 2025 17:26:30 +0800 Subject: [PATCH] 企业微信 --- pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue | 643 ++++++++++++++++++++++++++++++---------------------------- 1 files changed, 334 insertions(+), 309 deletions(-) diff --git a/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue b/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue index fe98829..82b9e97 100644 --- a/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue +++ b/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue @@ -9,41 +9,50 @@ <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> <uni-group top="1"> - <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旀姤淇熀鏈俊鎭�斺�斺�斺�斺�斺�斺�斺�斺��</view> - <uni-forms-item :label-width="100" name="num" label="宸ュ崟鍙�:"> + <view class="divider"><text>鎶ヤ慨鍩烘湰淇℃伅</text></view> + <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旀姤淇熀鏈俊鎭�斺�斺�斺�斺�斺�斺�斺�斺��</view> --> + <uni-forms-item :label-width="100" name="repairCode" label="宸ュ崟鍙�:"> <uni-easyinput v-model="formData.repairCode" :disabled="true" /> </uni-forms-item> - <uni-forms-item :label-width="100" required name="num" label="璁惧缂栧彿:"> + <uni-forms-item :label-width="100" name="repairStatus_dictText" label="宸ュ崟鐘舵��:"> + <uni-easyinput v-model="formData.repairStatus_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="num" label="璁惧缂栧彿:"> <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" placeholder="璇烽�夋嫨" :disabled="true" /> </uni-forms-item> - + <uni-forms-item :label-width="100" name="installationPosition_dictText" label="瀹夎浣嶇疆:"> + <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="faultName" label="鏁呴殰绠�绉�:"> + <uni-easyinput v-model="formData.faultName" :disabled="true" /> + </uni-forms-item> <uni-forms-item :label-width="100" name="remark" label="鏁呴殰寮�濮嬫椂闂�:"> <uni-easyinput v-model="formData.faultStartTime" :disabled="true" /> </uni-forms-item> - <uni-forms-item :label-width="100" name="outNum" label="缁翠慨璐熻矗浜�:"> - <uni-easyinput v-model="formData.repairer" :disabled="true" /> + <uni-forms-item :label-width="100" name="reporter_dictText" label="鎶ヤ慨浜�:"> + <uni-easyinput v-model="formData.reporter_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="reporterPhone_dictText" label="鎶ヤ慨浜虹數璇�:"> + <uni-easyinput v-model="formData.reporterPhone_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="repairer_dictText" label="缁翠慨浜�:"> + <uni-easyinput v-model="formData.repairer_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="repairerPhone_dictText" label="缁翠慨浜虹數璇�:"> + <uni-easyinput v-model="formData.repairerPhone_dictText" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="100" name="remark" label="澶囨敞:"> <uni-easyinput v-model="formData.remark" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="100" name="outNum" label="鎶ヤ慨鍥剧墖:"> - <view class="grid col-4 grid-square flex-sub"> - <view class="bg-img" v-for="(item,index) in imgList" :key="index" @tap="ViewImage" - :data-url="imgList[index]"> - <image :src="imgList[index]" mode="aspectFill"></image> - <view class="cu-tag bg-red radius" @tap.stop="DelImg" :data-index="index"> - <text class='cuIcon-close'></text> - </view> - </view> - <view class="solids" v-if="imgList.length<1"> - <text class='cuIcon-cameraadd'></text> - </view> - </view> + <uni-file-picker limit="9" :value="fileList" :image-styles="imageStyles" @select="select" + :sourceType="sourceType" @progress="progress" @success="success" @fail="fail" + @delete="deletea" :readonly="readonly" /> </uni-forms-item> - <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旀槸鍚﹂渶瑕侀鐢ㄥ浠垛�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <view class="divider"><text>鏄惁闇�瑕侀鐢ㄥ浠�</text></view> <uni-forms-item :label-width="140" required name="num" label="鏄惁闇�瑕侀鐢ㄥ浠�:"> <uni-data-select v-model="formData.isSpare" :localdata="SpareList" @change="changeisSpareList" placeholder="璇烽�夋嫨" :disabled="isUNDERREPAIR" /> @@ -58,26 +67,17 @@ :disabled="isUNDERREPAIR" /> </uni-forms-item> <uni-forms-item v-show="isShow" :label-width="100" name="outNum" label="缁翠慨鍥剧墖:"> - <view class="grid col-4 grid-square flex-sub"> - <view class="bg-img" v-for="(item,index) in imgTwoList" :key="index" @tap="ViewImageTwo" - :data-url="imgTwoList[index]"> - <image :src="imgTwoList[index]" mode="aspectFill"></image> - <view class="cu-tag bg-red radius" @tap.stop="DelImgTwo" :data-index="index"> - <text class='cuIcon-close'></text> - </view> - </view> - <view class="solids" @tap="ChooseImageTwo" v-if="imgTwoList.length<1"> - <text class='cuIcon-cameraadd'></text> - </view> - </view> - + <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" @select="select" + :sourceType="sourceType" @progress="progress" @success="success" @fail="fail" + @delete="deletea" :readonly="readonlyRepaier" /> </uni-forms-item> </uni-group> </uni-forms> <uni-forms v-show="isShowUNDEREPAIR" ref="form" :modelValue="ScanData" validate-trigger="bind" err-show-type="undertext"> <uni-group top="1"> - <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂鐞嗗憳棰嗙敤澶囦欢鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <view class="divider"><text>绠$悊鍛橀鐢ㄥ浠�</text></view> + <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂鐞嗗憳棰嗙敤澶囦欢鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> --> <uni-forms-item :label-width="100" required name="sparePartDescription" label="澶囦欢鎻忚堪:"> <uni-easyinput type="textarea" v-model="ScanData.sparePartDescription" placeholder="璇疯緭鍏ュ浠舵弿杩�" :disabled="isRuning" /> @@ -88,7 +88,8 @@ <uni-forms v-show="isShowRepari" ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> <uni-group top="1"> - <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂淮淇粨鏋滀笂鎶モ�斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <view class="divider"><text>缁翠慨缁撴灉涓婃姤</text></view> + <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂淮淇粨鏋滀笂鎶モ�斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> --> <uni-forms-item :label-width="140" required name="faultReason" label="鏁呴殰鍘熷洜:"> <uni-easyinput v-model="formData.faultReason" placeholder="璇疯緭鍏ユ晠闅滃師鍥�" :disabled="isRepari" /> </uni-forms-item> @@ -97,24 +98,13 @@ :disabled="isRepari" /> </uni-forms-item> <uni-forms-item :label-width="100" name="outNum" label="缁翠慨鍥剧墖:"> - <view class="grid col-4 grid-square flex-sub"> - <view class="bg-img" v-for="(item,index) in imgThreeList" :key="index" @tap="ViewImageTwo" - :data-url="imgThreeList[index]"> - <image :src="imgThreeList[index]" mode="aspectFill"></image> - <view class="cu-tag bg-red radius" @tap.stop="DelImgTwo" :data-index="index"> - <text class='cuIcon-close'></text> - </view> - </view> - <view class="solids" @tap="ChooseImageThree" v-if="imgThreeList.length<1"> - <text class='cuIcon-cameraadd'></text> - </view> - </view> - + <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" @select="select" + :sourceType="sourceType" @progress="progress" @success="success" @fail="fail" + @delete="deletea" :readonly="readonlyRepaier" /> </uni-forms-item> - </uni-group> </uni-forms> - <view v-show="isSHowBtn" class="padding flex flex-direction"> + <view v-show="isSHowBtn" class="padding flex flex-direction"> <view class="flex-sub bg-blue padding-sm margin-xl radius text-sm text-center text-white" @click.stop="ProductionTask()" hover-class="is-hover">纭畾</view> </view> @@ -133,9 +123,20 @@ mixins: [MescrollMixin], // 浣跨敤mixin data() { return { - isSHowBtn:true, + readonly: false, + readonlyRepaier: false, + // 鍥剧墖鍥炴樉 + fileLists: [], + fileList: [], + // 涓婁紶鍥剧墖鐨勬牱寮� + imageStyles: { + width: 90, + height: 90, + }, + sourceType: ['album', 'camera'], + isSHowBtn: true, isShowRepari: false, - title: '鏄惁闇�瑕侀鐢ㄥ浠�', + title: '', isRepari: false, isRuning: false, isShowUNDEREPAIR: false, @@ -179,8 +180,7 @@ url: { upload: "/eam/sysFiles/batch_upload", stallList: "/eam/eamRepairOrder/queryById", - getEquipmentList:'eam/equipment/list', - // getEquipmentList: "eam/equipment/asyncLoadEquipment", + getEquipmentList: 'eam/equipment/list', approval: '/eam/eamRepairOrder/perform' }, id: '', @@ -208,7 +208,10 @@ msg1Title: "", procInstId: '', values: '', - isShow: true + isShow: true, + flag: '', + from: '', + todoName: '' } }, @@ -225,12 +228,23 @@ }, onLoad(options) { const annItem = JSON.parse(decodeURIComponent(options.item)); - - this.id = annItem.dataId, - this.taskId = annItem.id, - this.procInstId = annItem.procInstId, - this.values = annItem.values, - this.assignee = annItem.assignee + this.flag = options.flag + this.from = options.from + if (this.flag == 'task') { + this.todoName = annItem.taskName + } else { + this.todoName = annItem.name + } + if (this.from === 'detils') { + this.id = annItem.id; + console.log(annItem.id); + } else { + this.id = annItem.dataId; + } + this.taskId = annItem.id + this.procInstId = annItem.procInstId + this.values = annItem.values + this.assignee = annItem.assignee }, created() { this.getEquipment(); @@ -246,8 +260,70 @@ this.isShow = false; } }, + + select(e) { + const tempFilePaths = e.tempFilePaths; + uni.showLoading({ + title: '涓婁紶涓�...' + }); + const uploadPromises = tempFilePaths.map((filePath, index) => { + return new Promise((resolve, reject) => { + this.$http.upload(this.url.upload, { + filePath: filePath, + name: 'file' + }) + .then(uploadRes => { + // 鍋囪鏈嶅姟鍣ㄨ繑鍥炵殑缁撴灉涓寘鍚枃浠惰矾寰� + const serverFilePath = uploadRes.data.result[0]; + this.formData.avatar.push(serverFilePath); + resolve(uploadRes); // 杩斿洖缁撴灉缁� Promise.all + }) + .catch(err => { + console.error(`鍥剧墖 ${index + 1} 涓婁紶澶辫触:`, err); + reject(err); + }); + }); + }); + + Promise.all(uploadPromises) + .then(() => { + uni.hideLoading(); + uni.showToast({ + title: '鍏ㄩ儴涓婁紶鎴愬姛' + }); + }) + .catch(err => { + uni.hideLoading(); + uni.showToast({ + title: '閮ㄥ垎涓婁紶澶辫触', + icon: 'none' + }); + console.error('涓婁紶寮傚父:', err); + }); + }, + // 鍒犻櫎 + deletea(e) { + console.log('鍒犻櫎鍥剧墖', e); + }, ProductionTask() { - if (this.formData.reportStatus == 'WAIT_SPARES') { + if (this.formData.reportStatus == 'UNDER_REPAIR' && this.formData.isSpare == 1) { + + if (this.formData.isSpare == undefined || this.formData.isSpare == null || + this + .formData.isSpare == + '') { + + uni.showToast({ + icon: 'none', + title: '鏄惁闇�瑕侀鐢ㄥ浠朵笉鑳戒负绌�' + }); + return false; + } + } + + + console.log(this.formData.isSpare) + if (this.formData.reportStatus === 'WAIT_SPARES' && this.formData.isSpare == 1 && this.flag !== 'task') { if (this.ScanData.sparePartDescription == undefined || this.ScanData.sparePartDescription == null || this .ScanData.sparePartDescription == @@ -260,59 +336,66 @@ return false; } } - if (this.formData.reportStatus == 'UNDER_REPAIR') { - if (this.formData.faultReason == undefined || this.formData.faultReason == null || - this - .formData.faultReason == - '') { + + if ( + this.formData.reportStatus === 'UNDER_REPAIR' && + this.flag !== 'task' && + (this.formData.isSpare === 0 || this.ScanData.sparePartDescription?.trim()) + ) { + if (this.formData.faultReason == undefined || this.formData.faultReason == null || this.formData + .faultReason == '') { uni.showToast({ icon: 'none', title: '鏁呴殰鍘熷洜涓嶈兘涓虹┖' }); return false; } - if (this.formData.repairDescription == undefined || this.formData.repairDescription == null || - this - .formData.repairDescription == - '') { - + if (this.formData.repairDescription == undefined || this.formData.repairDescription == null || this + .formData.repairDescription == '') { uni.showToast({ icon: 'none', title: '缁翠慨缁撴灉涓嶈兘涓虹┖' }); return false; } - } + uni.showLoading({ + mask: true, + title: "鍔犺浇涓�....", + }) this.$http.post(this.url.approval, { sparePartDescription: this.ScanData.sparePartDescription, dataId: this.id, equipmentId: this.formData.num, faultReason: this.formData.faultReason, id: this.id, - imageFilesResult: this.formData.avatarTwo, + imageFilesResult: this.formData.avatar, instanceId: this.procInstId, isUseSpare: this.formData.isSpare, repairDescription: this.formData.repairDescription, taskId: this.taskId }).then(res => { - console.log(res) - this.$tip.loaded(); + uni.hideLoading() if (res.data.success) { uni.showToast({ icon: "success", title: '鎻愪氦鎴愬姛', duration: 2000 }); - // this.$Router.replace({ - // name: 'ToDoList' - // }) this.$Router.replaceAll({ name: 'ToDoList' + }) + } else { + + uni.showModal({ + title: "鎻愮ず", + content: res.data.message, + confirmText: '纭畾', + showCancel: false, }) } }).catch(() => { @@ -338,11 +421,20 @@ this.partTakeAdviceDetailList[index].istrue = true; } }, + getEquipment() { - this.$http.get(this.url.getEquipmentList).then(res => { + this.$http.get(this.url.getEquipmentList, { + params: { + pageNo: 1, + pageSize: 9999, + order: 'desc', + column: 'createTime' + }, + + }).then(res => { //璁剧疆鍒楄〃鏁版嵁 if (res.data.success) { - this.equipmentList = res.data.result + this.equipmentList = res.data.result.records } else { uni.showToast({ icon: "error", @@ -355,179 +447,8 @@ this.$tip.error("鑱旂綉澶辫触") }) }, - ChooseImageThree() { - var that = this; - uni.chooseImage({ - count: 4, - sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� - sourceType: ['album'], // 浠庣浉鍐岄�夋嫨 - success: (res) => { - // 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰� - that.imgThreeList = res.tempFilePaths; - // 鍒濆鍖� formData.avatar 涓虹┖瀛楃涓� - that.formData.avatarTwo = []; - // 鍒涘缓涓婁紶浠诲姟鐨� Promise 鏁扮粍 - const uploadPromises = res.tempFilePaths.map((filePath, index) => { - return new Promise((resolve, reject) => { - that.$http.upload(that.url.upload, { - filePath: filePath, - name: 'file' - }) - .then(uploadRes => { - // 鍋囪鏈嶅姟鍣ㄨ繑鍥炵殑缁撴灉涓寘鍚枃浠惰矾寰� - const filePath = uploadRes.data.result[0]; - this.formData.avatarTwo.push(filePath); - resolve(filePath); - }) - .catch(err => { - console.error('鍥剧墖' + index + '涓婁紶澶辫触:', err); - reject(err); - }); - }); - }); - - // 骞跺彂鎵ц鎵�鏈変笂浼犱换鍔� - Promise.all(uploadPromises) - .then((uploadedFilePaths) => { - console.log('鎵�鏈夊浘鐗囦笂浼犳垚鍔�:', that.formData.avatar); - }) - .catch((err) => { - console.error('鍥剧墖涓婁紶澶辫触:', err); - that.$tip.error('鍥剧墖涓婁紶澶辫触'); - }); - } - }); - }, - ChooseImage() { - var that = this; - uni.chooseImage({ - count: 4, - sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� - sourceType: ['album'], // 浠庣浉鍐岄�夋嫨 - success: (res) => { - // 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰� - that.imgList = res.tempFilePaths; - - // 鍒濆鍖� formData.avatar 涓虹┖瀛楃涓� - that.formData.avatar = []; - - // 鍒涘缓涓婁紶浠诲姟鐨� Promise 鏁扮粍 - const uploadPromises = res.tempFilePaths.map((filePath, index) => { - return new Promise((resolve, reject) => { - that.$http.upload(that.url.upload, { - filePath: filePath, - name: 'file' - }) - .then(uploadRes => { - // 鍋囪鏈嶅姟鍣ㄨ繑鍥炵殑缁撴灉涓寘鍚枃浠惰矾寰� - const filePath = uploadRes.data.result[0]; - this.formData.avatar.push(filePath); - resolve(filePath); - }) - .catch(err => { - console.error('鍥剧墖' + index + '涓婁紶澶辫触:', err); - reject(err); - }); - }); - }); - - // 骞跺彂鎵ц鎵�鏈変笂浼犱换鍔� - Promise.all(uploadPromises) - .then((uploadedFilePaths) => { - console.log('鎵�鏈夊浘鐗囦笂浼犳垚鍔�:', that.formData.avatar); - }) - .catch((err) => { - console.error('鍥剧墖涓婁紶澶辫触:', err); - that.$tip.error('鍥剧墖涓婁紶澶辫触'); - }); - } - }); - }, - ChooseImageTwo() { - var that = this; - uni.chooseImage({ - count: 4, - sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� - sourceType: ['album'], // 浠庣浉鍐岄�夋嫨 - success: (res) => { - // 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰� - that.imgListTwo = res.tempFilePaths; - - // 鍒濆鍖� formData.avatar 涓虹┖瀛楃涓� - that.formData.avatarTwo = []; - - // 鍒涘缓涓婁紶浠诲姟鐨� Promise 鏁扮粍 - const uploadPromises = res.tempFilePaths.map((filePath, index) => { - return new Promise((resolve, reject) => { - that.$http.upload(that.url.upload, { - filePath: filePath, - name: 'file' - }) - .then(uploadRes => { - const filePath = uploadRes.data.result[0]; - this.formData.avatarTwo.push(filePath); - resolve(filePath); - }) - .catch(err => { - console.error('鍥剧墖' + index + '涓婁紶澶辫触:', err); - reject(err); - }); - }); - }); - - // 骞跺彂鎵ц鎵�鏈変笂浼犱换鍔� - Promise.all(uploadPromises) - .then((uploadedFilePaths) => { - console.log('鎵�鏈夊浘鐗囦笂浼犳垚鍔�:', that.formData.avatarTwo); - }) - .catch((err) => { - console.error('鍥剧墖涓婁紶澶辫触:', err); - that.$tip.error('鍥剧墖涓婁紶澶辫触'); - }); - } - }); - }, - ViewImageTwo(e) { - uni.previewImage({ - urls: this.imgListTwo, - current: e.currentTarget.dataset.url - }); - }, - - ViewImage(e) { - uni.previewImage({ - urls: this.imgList, - current: e.currentTarget.dataset.url - }); - }, - DelImgTwo(e) { - uni.showModal({ - title: '鎻愮ず', - content: '纭畾瑕佸垹闄よ繖娈靛洖蹇嗗悧锛�', - cancelText: '鍐嶇湅鐪�', - confirmText: '鍐嶈', - success: res => { - if (res.confirm) { - this.imgListTwo.splice(e.currentTarget.dataset.index, 1) - } - } - }) - }, - DelImg(e) { - uni.showModal({ - title: '鎻愮ず', - content: '纭畾瑕佸垹闄よ繖娈靛洖蹇嗗悧锛�', - cancelText: '鍐嶇湅鐪�', - confirmText: '鍐嶈', - success: res => { - if (res.confirm) { - this.imgList.splice(e.currentTarget.dataset.index, 1) - } - } - }) - }, upCallback() { this.$http.get(this.url.stallList, { @@ -541,54 +462,138 @@ //璁剧疆鍒楄〃鏁版嵁 if (res.data.success) { this.formData.reportStatus = this.announcement1.reportStatus - + this.title = this.todoName ?? '璇︽儏'; if (this.announcement1.reportStatus === 'WAIT_CONFIRM') { - this.title = '鎿嶄綔宸ョ‘璁�'; - this.isUNDERREPAIR = true; - } else if (this.announcement1.reportStatus === 'WAIT_SPARES') { - this.title = '绠$悊鍛橀鐢ㄥ浠�'; - this.isUNDERREPAIR = true; - this.isShowUNDEREPAIR = true; - - } else if (this.announcement1.reportStatus === 'UNDER_REPAIR') { - if (this.announcement1.isUseSpare == 1) { - this.title = '缁翠慨缁撴灉涓婃姤'; - } else { - this.title = '鏄惁闇�瑕侀鐢ㄥ浠�'; + if (this.flag == 'task') { + // this.title = '缁翠慨鎵ц'; + this.isUNDERREPAIR = true + this.readonly = true + this.isRuning = true + this.isSHowBtn = false + this.readonlyRepaier = true + this.isShowRepari = false + } else if (this.flag !== 'task') { + // this.title = '鎿嶄綔宸ョ‘璁�'; + this.isUNDERREPAIR = true + this.readonly = true + this.isRuning = true + this.isSHowBtn = true + this.readonlyRepaier = true + this.isShowRepari = false } - this.isUNDERREPAIR = true; - this.isShowUNDEREPAIR = true; - this.isRuning = true; - this.isShowRepari = true; - - }else if (this.announcement1.reportStatus === 'COMPLETE') { - if (this.announcement1.isUseSpare == 0) { - this.title = '绠$悊鍛橀鐢ㄥ浠�'; - this.isShowRepari=false; - this.isSHowBtn=false; - this.isRepari; + } else if (this.announcement1.reportStatus === 'WAIT_SPARES') { + if (this.flag == 'task' && this.announcement1.isUseSpare == 1) { + // this.title = '鏄惁闇�瑕侀鐢ㄥ浠�'; + this.isShowUNDEREPAIR = false; this.isUNDERREPAIR = true; - + this.readonly = true + + this.isSHowBtn = false; } else { - this.title = '鎿嶄綔宸ョ‘璁�'; + // this.title = '绠$悊鍛橀鐢ㄥ浠�'; + this.readonly = true this.isUNDERREPAIR = true; this.isShowUNDEREPAIR = true; - this.isRuning=true; - this.isShowRepari=true; - this.isRepari=true; - this.isSHowBtn=false; } - - - - - + + + } else if (this.announcement1.reportStatus === 'UNDER_REPAIR') { + if (this.announcement1.isUseSpare == 1 && this.flag == 'task') { + // this.title = '绠$悊鍛橀鐢ㄥ浠�'; + this.isShowRepari = true; + this.readonlyRepaier = true + this.isShowUNDEREPAIR = true; + this.isUNDERREPAIR = true; + this.isRuning = true; + this.isRepari = true; + this.readonly = true + this.isSHowBtn = false; + + } else if (this.announcement1.isUseSpare == 1 && this.flag !== 'task') { + // this.title = '缁翠慨鎵ц' + this.isUNDERREPAIR = true + this.readonly = true + this.isShowUNDEREPAIR = true + this.isRuning = true + this.isShowRepari = true + + } else if (this.announcement1.isUseSpare == 0 && this.flag == 'task') { + this.readonlyRepaier = true + this.isUNDERREPAIR = true; + this.isRuning = true; + this.isRepari = true; + this.readonly = true + this.isSHowBtn = false; + + } else { + // this.title = '鏄惁闇�瑕侀鐢ㄥ浠�' + this.isSHowBtn = true + this.readonly = true + } + } else if (this.announcement1.reportStatus === 'COMPLETE') { + if (this.flag == 'task' && this.announcement1.isUseSpare == 0) { + // this.title = '鎿嶄綔宸ョ‘璁�' + this.isUNDERREPAIR = true + this.isShowUNDEREPAIR = false + this.readonly = true + this.readonlyRepaier = true + this.isRuning = true + this.isShowRepari = false + this.isRepari = false + this.isSHowBtn = false + } else if (this.flag == 'task' && this.announcement1.isUseSpare == 1) { + // this.title = '鎿嶄綔宸ョ‘璁�' + this.isUNDERREPAIR = true + this.isShowUNDEREPAIR = true + this.isRuning = true + this.readonlyRepaier = true + this.isShowRepari = true + this.isRepari = true + this.readonly = true + this.isSHowBtn = false; + } else if (this.flag !== 'task' && this.announcement1.isUseSpare == 0) { + // this.title = '缁翠慨鎵ц' + this.isUNDERREPAIR = true + this.readonlyRepaier = true + this.readonly = true + this.isRuning = true + + } } + console.log(this.announcement1.reportImageFiles) + if (this.announcement1.reportImageFiles) { + try { + const parsedData = JSON.parse(this.announcement1.reportImageFiles); + this.imageFilesList = parsedData; + this.imgList = parsedData.map(imageObj => { + return `${this.ipAndPort}${imageObj.filePath}`; + }); + + this.fileList = this.imgList.map(url => ({ + url: url, + extname: 'png', + name: 'eam' + })); + } catch (error) { + console.error('JSON 瑙f瀽澶辫触:', error); + this.imageFilesList = []; + this.imgList = []; + this.fileList = []; + } + } + console.log(this.fileLists) this.formData.num = this.announcement1.equipmentId + this.formData.repairStatus_dictText = this.announcement1.repairStatus_dictText this.formData.repairCode = this.announcement1.repairCode - this.formData.repairer = this.announcement1.repairer + this.formData.installationPosition_dictText = this.announcement1 + .installationPosition_dictText + this.formData.faultName = this.announcement1.faultName + this.formData.repairer_dictText = this.announcement1.repairer_dictText + this.formData.repairerPhone_dictText = this.announcement1.repairerPhone_dictText + this.formData.reporter_dictText = this.announcement1.reporter_dictText + this.formData.reporterPhone_dictText = this.announcement1.reporterPhone_dictText this.formData.faultStartTime = this.announcement1.faultStartTime this.formData.remark = this.announcement1.remark this.formData.repairDescription = this.announcement1.repairDescription @@ -600,29 +605,26 @@ this.isShow = true; } this.ScanData.sparePartDescription = this.announcement1.sparePartDescription - this.formData.avatar = this.announcement1.reportImageFiles - this.imageFilesList = JSON.parse(this.formData.avatar) - const imageObjects = JSON.parse(this.formData.avatar) - this.imgList = imageObjects.map(imageObj => { - return `${this.ipAndPort}${imageObj.filePath}`; - }) - this.formData.avatarTwo = this.announcement1.imageFiles - this.imageAvatarTwo = JSON.parse(this.formData.avatarTwo) - const imageObjectTwo = JSON.parse(this.formData.avatarTwo) - if(this.formData.isSpare == 1){ - this.imgThreeList = imageObjectTwo.map(imageObj => { - return `${this.ipAndPort}${imageObj.filePath}`; - }) - }else{ - this.imgTwoList = imageObjectTwo.map(imageObj => { - return `${this.ipAndPort}${imageObj.filePath}`; - }) + if (this.announcement1.imageFiles) { + try { + const parsedDataIn = JSON.parse(this.announcement1.imageFiles); + this.imageAvatarTwo = parsedDataIn; + this.imgTwoList = parsedDataIn.map(imageObj => { + return `${this.ipAndPort}${imageObj.filePath}`; + }); + + this.fileLists = this.imgTwoList.map(url => ({ + url: url, + extname: 'png', + name: 'eam' + })); + } catch (error) { + console.error('JSON 瑙f瀽澶辫触:', error); + this.imageAvatarTwo = []; + this.imgTwoList = []; + this.fileLists = []; + } } - - - - - } }).catch(() => { //鑱旂綉澶辫触, 缁撴潫鍔犺浇 @@ -686,7 +688,30 @@ border-color: #55aaff; } + .divider { + display: flex; + align-items: center; + text-align: center; + color: gray; + /* 鏂囧瓧棰滆壊 */ + margin: 20px 0; + /* 涓婁笅闂磋窛 */ + } + .divider::before, + .divider::after { + content: ''; + flex: 1; + border-bottom: 1px solid gray; + /* 妯嚎棰滆壊 */ + margin: 0 16px; + /* 妯嚎涓庢枃瀛椾箣闂寸殑闂磋窛 */ + } + + .divider text { + white-space: nowrap; + /* 闃叉鏂囧瓧鎹㈣ */ + } .content { margin-top: 5px; -- Gitblit v1.9.3