From 0a48655d2162b709ecb80d249a4085971add6140 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期一, 07 七月 2025 17:26:30 +0800 Subject: [PATCH] 企业微信 --- pages/baoZhou/baoZhouDetils/baoZhouDetils.vue | 197 +++++++++++++++++++++++++++++++------------------ 1 files changed, 124 insertions(+), 73 deletions(-) diff --git a/pages/baoZhou/baoZhouDetils/baoZhouDetils.vue b/pages/baoZhou/baoZhouDetils/baoZhouDetils.vue index b75aff7..e893d82 100644 --- a/pages/baoZhou/baoZhouDetils/baoZhouDetils.vue +++ b/pages/baoZhou/baoZhouDetils/baoZhouDetils.vue @@ -17,19 +17,26 @@ <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" placeholder="璇烽�夋嫨" :disabled="true" /> </uni-forms-item> + + <uni-forms-item name="installationPosition_dictText" :label-width="80" label="瀹夎浣嶇疆:"> + <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> + </uni-forms-item> <uni-forms-item name="maintenanceDate" :label-width="80" label="淇濆吇鏃ユ湡:"> <uni-easyinput v-model="formData.maintenanceDate" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="outNum" :label-width="80" label="淇濆吇浜�:"> + <uni-forms-item name="operator_dictText" :label-width="80" label="淇濆吇浜�:"> <uni-easyinput v-model="formData.operator_dictText" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="outNum" :label-width="80" label="澶囨敞"> + <uni-forms-item name="operatorPhone_dictText" :label-width="80" label="淇濆吇浜虹數璇�:"> + <uni-easyinput v-model="formData.operatorPhone_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="remark" :label-width="80" label="澶囨敞"> <uni-easyinput type="textarea" v-model="formData.remark" :disabled="true" /> </uni-forms-item> <uni-forms-item name="outNum" :label-width="80" label="淇濆吇鍥剧墖:"> <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" :sourceType="sourceType" @select="select" @progress="progress" @success="success" - @fail="fail" @delete="deletea" :readonly="true" /> + @fail="fail" @delete="deletea" :readonly="true" /> </uni-forms-item> </uni-group> </uni-forms> @@ -53,25 +60,11 @@ <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.subItemName}} </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> - {{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> - {{item.itemDemand}} - </view> --> <view class="flex-sub bg-white padding-xs margin-xs radius text-right"> {{item.itemDemand}} </view> @@ -119,7 +112,7 @@ height: 90, }, sourceType: ['album', 'camera'], - ipAndPort:configService.staticURL, + ipAndPort: configService.staticURL, scrollLeft: 0, searchValue: '', imgList: [], @@ -128,7 +121,7 @@ uploadUrl: "/sys/common/upload", formData: { num: '', - avatar:[], + avatar: [], remark: '', inspectionDate: '', }, @@ -137,7 +130,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' }, @@ -194,31 +187,31 @@ handleCode(e) { this.inspectionResult = e; }, - 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, { + 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("鑱旂綉澶辫触") + }) + }, getList() { this.$http.get(this.url.BaoList, { params: { @@ -237,44 +230,102 @@ //鑱旂綉澶辫触, 缁撴潫鍔犺浇 }) }, - + + + // upCallback() { + // this.$http.get(this.url.stallList, { + // 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.operatorPhone_dictText=this.announcement1.operatorPhone_dictText + // this.formData.installationPosition_dictText=this.announcement1.installationPosition_dictText + // this.formData.maintenanceDate = this.announcement1.maintenanceDate + // this.formData.operator = this.announcement1.operator_dictText + // this.formData.remark = this.announcement1.remark + // this.formData.avatar = this.announcement1.imageFiles + // const imageObjects = JSON.parse(this.formData.avatar); + // // 鎻愬彇 filePath 骞舵嫾鎺� IP 鍜岀鍙� + // this.imgList = imageObjects.map(imageObj => { + // return `${this.ipAndPort}${imageObj.filePath}`; + // }); + + // // 鏍规嵁 imgList 鏋勯�� fileLists + // this.fileLists = this.imgList.map(url => ({ + // url: url, + // extname: 'png', + // name: 'eam' + // })); + // } + // }).catch(() => { + // //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + // }) + // }, upCallback() { this.$http.get(this.url.stallList, { 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.maintenanceDate = this.announcement1.maintenanceDate, - this.formData.operator = this.announcement1.operator, - this.formData.remark = this.announcement1.remark, - this.formData.avatar = this.announcement1.imageFiles - const imageObjects = JSON.parse(this.formData.avatar); - // 鎻愬彇 filePath 骞舵嫾鎺� IP 鍜岀鍙� - this.imgList = imageObjects.map(imageObj => { - return `${this.ipAndPort}${imageObj.filePath}`; - }); - - // 鏍规嵁 imgList 鏋勯�� fileLists - this.fileLists = this.imgList.map(url => ({ - url: url, - extname: 'png', - name: 'eam' - })); + this.announcement1 = res.data?.result || {}; + console.log("url", res); + + // 鍒ゆ柇鏄惁鎴愬姛鑾峰彇鏁版嵁 + if (res.data.success && this.announcement1) { + console.log("res", this.announcement1.equipmentCode); + + // 瀹氫箟瀛楁鏄犲皠鍏崇郴 + const fieldMapping = { + num: 'equipmentId', + orderNum: 'orderNum', + operatorPhone_dictText: 'operatorPhone_dictText', + installationPosition_dictText: 'installationPosition_dictText', + maintenanceDate: 'maintenanceDate', + operator_dictText: 'operator_dictText', + remark: 'remark', + avatar: 'imageFiles' + }; + Object.keys(fieldMapping).forEach(key => { + const sourceKey = fieldMapping[key]; + this.formData[key] = this.announcement1[sourceKey] ?? ''; + }); + + // 澶勭悊鍥剧墖鍒楄〃 + this.handleImageFiles(this.formData.avatar); } }).catch(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - }) + // 鑱旂綉澶辫触, 缁撴潫鍔犺浇 + console.error('璇锋眰澶辫触'); + }); }, + // 鍗曠嫭澶勭悊鍥剧墖鏂囦欢鐨勬柟娉� + handleImageFiles(imageFiles) { + try { + const imageObjects = JSON.parse(imageFiles || '[]'); + this.imgList = imageObjects.map(imageObj => { + return `${this.ipAndPort}${imageObj.filePath}`; + }); - + // 鏋勯�� fileLists + this.fileLists = this.imgList.map(url => ({ + url: url, + extname: 'png', + name: 'eam' + })); + } catch (e) { + console.error('瑙f瀽 imageFiles 鍑洪敊:', e); + this.imgList = []; + this.fileLists = []; + } + }, /* 妫�绱� */ getSera(res) { -- Gitblit v1.9.3