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/ToDoBaoZhou/ToDoBaoZhou.vue | 457 ++++++++++++++++++++++++++++++-------------------------- 1 files changed, 243 insertions(+), 214 deletions(-) diff --git a/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue b/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue index 03fc669..4e07235 100644 --- a/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue +++ b/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue @@ -2,14 +2,15 @@ <view class="container"> <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> <block slot="backText">杩斿洖</block> - <block slot="content">鎵ц</block> + <block slot="content">鍛ㄤ繚鎵ц</block> </cu-custom> <view class="container"> <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> + <view class="divider"><text>鍩烘湰淇℃伅</text></view> + <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鍩烘湰淇℃伅 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> --> <uni-forms-item :label-width="80" name="orderNum" label="宸ュ崟鍙�:"> <uni-easyinput v-model="formData.orderNum" :disabled="true" /> </uni-forms-item> @@ -17,40 +18,30 @@ <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" placeholder="璇烽�夋嫨" :disabled="true" /> </uni-forms-item> - + <uni-forms-item :label-width="80" required name="maintenanceStatus_dictText" label="宸ュ崟鐘舵��:"> + <uni-easyinput v-model="formData.maintenanceStatus_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" required name="installationPosition_dictText" label="瀹夎浣嶇疆:"> + <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> + </uni-forms-item> <uni-forms-item :label-width="80" name="maintenanceDate" label="淇濆吇鏃ユ湡:"> <uni-easyinput v-model="formData.maintenanceDate" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="80" name="operator" label="淇濆吇浜�:"> <uni-easyinput v-model="formData.operator" :disabled="true" /> </uni-forms-item> + <uni-forms-item :label-width="100" name="operatorPhone_dictText" label="淇濆吇浜虹數璇�:"> + <uni-easyinput v-model="formData.operatorPhone_dictText" :disabled="true" /> + </uni-forms-item> <uni-forms-item :label-width="80" name="remark" label="澶囨敞:"> <uni-easyinput v-model="formData.remark" placeholder="璇疯緭鍏ュ娉�" :disabled="true" /> </uni-forms-item> <uni-forms-item :label-width="80" 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" @tap="ChooseImage" v-if="imgList.length<1"> - <text class='cuIcon-cameraadd'></text> - </view> - </view> - + <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" + :sourceType="sourceType" @select="select" @progress="progress" @success="success" + @fail="fail" @delete="deletea" /> </uni-forms-item> - <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鐝粍闀跨‘璁� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> - <uni-forms-item name="outNum" required label="纭绫诲瀷:"> - <uni-data-select :localdata="formData.msListCategory" popup-title="璇烽�夋嫨" @change="changeType" - :clear="false"> - </uni-data-select> - </uni-forms-item> - <uni-forms-item name="outNum" required label="纭鎰忚:"> - <uni-easyinput type="textarea" v-model="formData.ttitle" placeholder="璇疯緭鍏ュ唴瀹�"></uni-easyinput> - </uni-forms-item> --> + </uni-group> </uni-forms> @@ -60,15 +51,15 @@ - - <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斾繚鍏婚」淇℃伅鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <view class="divider"><text>淇濆吇椤逛俊鎭�</text></view> + <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斾繚鍏婚」淇℃伅鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> --> <view class="padding flex flex-direction"> <button :disabled="isClick" class="mini-btn" type="primary" @click.stop="batchnsIpection()" size="mini">鎵归噺淇濆吇姝e父</button> </view> <uni-collapse @change="change"> - <uni-collapse-item :show-animation="true" :show-arrow="true" :accordion="true" title="鏌ョ湅淇濆吇椤�" :border="false" - title-border="none" > + <uni-collapse-item :show-animation="true" :show-arrow="true" :accordion="true" title="鏌ョ湅淇濆吇椤�" + :border="false" title-border="none"> <uni-card margin="10px" spacing="1px" v-for="(item,index) in partTakeAdviceDetailList" :key="index"> <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">琛屽彿:</view> @@ -83,38 +74,32 @@ </view> <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">瀛愪繚鍏婚」:</view> - <view class="flex-sub bg-white padding-xs margin-xs radius text-right" - v-if="item.subItemName!=null && item.subItemName.length>10"> - {{(item.subItemName).toString().substr(0,10)+'...'}} - </view> - <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> + <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.subItemName}} </view> </view> <view class="flex"> <view class="flex-sub text-light bg-white padding-xs margin-xs radius">淇濆吇瑕佹眰:</view> - <view class="flex-sub bg-white padding-xs margin-xs radius text-right" - v-if="item.itemDemand!=null && item.itemDemand.length>10"> - {{(item.itemDemand).toString().substr(0,10)+'...'}} - </view> - <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> + <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.itemDemand}} </view> + </view> <view class="flex"> - <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鏄惁鎶ヤ慨:</view> - <view class="flex-sub bg-white padding-xs text-right margin-xs radius"> - <uni-data-select :localdata="item.type" @change="handleType($event, index)" v-model="item.reportFlag" - :disabled="item.istrue" /> - </view> - </view> - <view class="flex"> - <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鐐规缁撴灉:</view> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">淇濆吇缁撴灉:</view> <view class="flex-sub bg-white padding-xs text-right margin-xs radius"> <uni-data-select :localdata="item.restle" v-model="item.maintenanceResult" @change="handleCode($event, index)" /> + </view> + </view> + + <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鏄惁鎶ヤ慨:</view> + <view class="flex-sub bg-white padding-xs text-right margin-xs radius"> + <uni-data-select :localdata="item.type" @change="handleType($event, index)" + v-model="item.reportFlag" :disabled="item.istrue" /> </view> </view> @@ -147,6 +132,15 @@ mixins: [MescrollMixin], // 浣跨敤mixin data() { return { + // 鍥剧墖鍥炴樉 + fileLists: [], + // 涓婁紶鍥剧墖鐨勬牱寮� + imageStyles: { + width: 90, + height: 90, + }, + // uni.chooseImage鍊硷紝浠庣浉鍐岄�夋嫨锛屾媿鎽� + sourceType: ['album', 'camera'], scrollLeft: 0, searchValue: '', imgList: [], @@ -154,7 +148,8 @@ uploadUrl: "/sys/common/upload", formData: { avatar: [], - id:'' + id: '', + num: '' }, istrue: true, @@ -163,7 +158,7 @@ url: { upload: "/eam/sysFiles/batch_upload", stallList: "/eam/weekMaintenanceOrder/queryById", - getEquipmentList:'eam/equipment/list', + getEquipmentList: 'eam/equipment/list', // getEquipmentList: "eam/equipment/asyncLoadEquipment", BaoList: '/eam/weekMaintenanceOrderDetail/queryList', approval: 'eam/weekMaintenanceOrder/approval' @@ -193,7 +188,8 @@ msg1Title: "", procInstId: '', values: '', - isClick:false + isClick: false, + announcement1: {} } }, @@ -224,8 +220,8 @@ methods: { change(e) { - console.log(e); - }, + console.log(e); + }, batchnsIpection() { uni.showModal({ title: '鎻愮ず', @@ -245,76 +241,116 @@ }, ProductionTask() { - if(this.hasInspectionDateArrived()){ - for (let i = 0; i < this.partTakeAdviceDetailList.length; i++) { - if (this.partTakeAdviceDetailList[i].maintenanceResult == undefined || this.partTakeAdviceDetailList[i] - .maintenanceResult == null || this - .partTakeAdviceDetailList[i].maintenanceResult == '') { - /* this.$tip.error("璇疯緭鍏ラ鏂欐暟閲忥紒"); */ - uni.showToast({ - icon: 'none', - title: '鐐规缁撴灉涓嶈兘涓虹┖' - }); - return false; + if (this.hasInspectionDateArrived()) { + for (let i = 0; i < this.partTakeAdviceDetailList.length; i++) { + if (this.partTakeAdviceDetailList[i].maintenanceResult == undefined || this + .partTakeAdviceDetailList[i] + .maintenanceResult == null || this + .partTakeAdviceDetailList[i].maintenanceResult == '') { + uni.showToast({ + icon: 'none', + title: '鐐规缁撴灉涓嶈兘涓虹┖' + }); + return false; + } } - } - - this.$http.put(this.url.approval, { - confirmComment: '', - id:this.formData.id, - confirmDealType: '', - dataId: this.id, - imageFiles: null, - instanceId: this.procInstId, - tableDetailList: this.partTakeAdviceDetailList, - taskId: this.taskId, - userId: this.assignee, - values: this.values, - maintenanceDate: this.formData.maintenanceDate, - creationMethod: this.formData.creationMethod, - equipmentCode: this.formData.equipmentCode, - equipmentId: this.formData.num, - imageFilesResult: this.formData.avatar, - orderNum: this.formData.orderNum, - remark: this.formData.remark, - standardId: this.formData.standardId, - standardName: this.formData.standardName - }).then(res => { - console.log(res) - this.$tip.loaded(); - if (res.data.success) { + + + + for (let i = 0; i < this.partTakeAdviceDetailList.length; i++) { + if (this.partTakeAdviceDetailList[i].maintenanceResult === "2") { + if (this.partTakeAdviceDetailList[i].reportFlag === undefined || this + .partTakeAdviceDetailList[i].reportFlag === null || this.partTakeAdviceDetailList[i] + .reportFlag === '') { + const index = i + 1 + uni.showModal({ + title: "鎻愮ず", + content: '绗�' + index + '琛屽彿鏄惁鎶ヤ慨蹇呴��', + confirmText: '纭畾', + showCancel: false, + }) + return false; + + } + if (this.partTakeAdviceDetailList[i].exceptionDescription == undefined || this + .partTakeAdviceDetailList[i].exceptionDescription == null || this + .partTakeAdviceDetailList[i].exceptionDescription == '') { + const index = i + 1 + uni.showModal({ + title: "鎻愮ず", + content: '绗�' + index + '琛屽彿寮傚父鎻忚堪蹇呭~', + confirmText: '纭畾', + showCancel: false, + }) + return false; + + } + + + } + } + uni.showLoading({ + mask: true, + title: "鍔犺浇涓�....", + }) + this.$http.put(this.url.approval, { + + confirmComment: null, + id: this.formData.id, + confirmDealType: null, + dataId: this.id, + imageFiles: null, + instanceId: this.procInstId, + tableDetailList: this.partTakeAdviceDetailList, + taskId: this.taskId, + userId: this.assignee, + values: this.values, + maintenanceDate: this.formData.maintenanceDate, + creationMethod: this.formData.creationMethod, + equipmentCode: this.formData.equipmentCode, + equipmentId: this.formData.num, + imageFilesResult: this.formData.avatar, + orderNum: this.formData.orderNum, + remark: this.formData.remark, + standardId: this.formData.standardId, + standardName: this.formData.standardName + }).then(res => { + uni.hideLoading() + if (res.data.success) { + uni.showToast({ + icon: "success", + title: '鎻愪氦鎴愬姛', + duration: 2000 + }); + this.$Router.replaceAll({ + name: 'ToDoList' + }) + + } + }).catch(() => { + this.$tip.loaded(); uni.showToast({ - icon: "success", - title: '鎻愪氦鎴愬姛', + icon: "error", + title: res.data.message, duration: 2000 }); - this.$Router.replaceAll({name: 'ToDoList'}) - - } - }).catch(() => { - this.$tip.loaded(); - uni.showToast({ - icon: "error", - title: res.data.message, - duration: 2000 }); - }); - }else{ + } else { uni.showToast({ icon: "error", title: '鏈埌淇濆吇鏃堕棿', duration: 2000 }); } - + }, changeEquipmentList(e) { this.formData.num = e; }, - - handleType(e,index){ + + handleType(e, index) { console.log(e); }, handleCode(e, index) { @@ -327,48 +363,31 @@ this.partTakeAdviceDetailList[index].istrue = true; } }, - getEquipment() { - 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.records - } else { - uni.showToast({ - icon: "error", - title: res.data.message, - duration: 2000 - }); - - } - }).catch(() => { - this.$tip.error("鑱旂綉澶辫触") - }) - }, - // getEquipment() { - // this.$http.get(this.url.getEquipmentList).then(res => { - // //璁剧疆鍒楄〃鏁版嵁 - // if (res.data.success) { - // this.equipmentList = res.data.result - // } else { - // uni.showToast({ - // icon: "error", - // title: res.data.message, - // duration: 2000 - // }); + getEquipment() { + this.$http.get(this.url.getEquipmentList, { + params: { + pageNo: 1, + pageSize: 9999, + order: 'desc', + column: 'createTime' + }, - // } - // }).catch(() => { - // this.$tip.error("鑱旂綉澶辫触") - // }) - // }, + }).then(res => { + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + this.equipmentList = res.data.result.records + } else { + uni.showToast({ + icon: "error", + title: res.data.message, + duration: 2000 + }); + + } + }).catch(() => { + this.$tip.error("鑱旂綉澶辫触") + }) + }, getList() { this.$http.get(this.url.BaoList, { params: { @@ -409,69 +428,52 @@ //鑱旂綉澶辫触, 缁撴潫鍔犺浇 }) }, - 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); + 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' }) - .catch((err) => { - console.error('鍥剧墖涓婁紶澶辫触:', err); - that.$tip.error('鍥剧墖涓婁紶澶辫触'); + .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); + }); }, - ViewImage(e) { - uni.previewImage({ - urls: this.imgList, - current: e.currentTarget.dataset.url - }); - }, - DelImg(e) { - uni.showModal({ - title: '鎻愮ず', - content: '纭畾瑕佸垹闄よ繖娈靛洖蹇嗗悧锛�', - cancelText: '鍐嶇湅鐪�', - confirmText: '鍐嶈', - success: res => { - if (res.confirm) { - this.imgList.splice(e.currentTarget.dataset.index, 1) - } - } - }) + + + + // 鍒犻櫎 + deletea(e) { + console.log('鍒犻櫎鍥剧墖', e); }, upCallback() { @@ -479,20 +481,22 @@ params: { id: this.id }, - }).then(res => { this.announcement1 = res.data.result console.log("url", res) //璁剧疆鍒楄〃鏁版嵁 if (res.data.success) { - console.log("res", res.data.result.equipmentCode) - this.formData.num = this.announcement1.equipmentId, - this.formData.orderNum = this.announcement1.orderNum, - this.formData.operator = this.announcement1.operator_dictText, - this.formData.maintenanceDate = this.announcement1.maintenanceDate, - this.formData.id=this.announcement1.id, - this.formData.remark = this.announcement1.remark - this.hasInspectionDateArrived(); + this.formData.num = this.announcement1.equipmentId + this.formData.orderNum = this.announcement1.orderNum + this.formData.operator = this.announcement1.operator_dictText + this.formData.installationPosition_dictText = this.announcement1 + .installationPosition_dictText + this.formData.maintenanceStatus_dictText = this.announcement1.maintenanceStatus_dictText + this.formData.operatorPhone_dictText = this.announcement1.operatorPhone_dictText + this.formData.maintenanceDate = this.announcement1.maintenanceDate + this.formData.id = this.announcement1.id + this.formData.remark = this.announcement1.remark + this.hasInspectionDateArrived(); } }).catch(() => { //鑱旂綉澶辫触, 缁撴潫鍔犺浇 @@ -579,4 +583,29 @@ margin-top: 85px; height: auto; } + + .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; + /* 闃叉鏂囧瓧鎹㈣ */ + } </style> \ No newline at end of file -- Gitblit v1.9.3