From 1d18ff904468e4a864312bdcf6d7c6a7c0477721 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期五, 25 四月 2025 14:57:36 +0800 Subject: [PATCH] 项目提交 --- pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils.vue | 334 ++ pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue | 703 ++++ pages/baoZhou/baoZhouDetils/baoZhouDetils.vue | 417 ++ pages/user/useredit.vue | 3 pages/maintenanceReport/maintenanceReport.vue | 419 ++ pages/baoZhou/baoZhou.vue | 394 ++ pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils.vue | 583 +++ pages/TaskManager/TaskManagerDeils/TaskManagerDeils.vue | 398 ++ pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue | 582 +++ pages/device/deviceWebDeils/deviceWebDeils.vue | 196 pages/checkList/checkList.vue | 402 ++ pages/ToDoList/ToDoListDeils/ToDoListDeils.vue | 28 pages/reportRepair/reportRepair.vue | 411 ++ pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure.vue | 598 ++++ common/service/config.service.js | 9 pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure.vue | 851 +++++ pages.json | 112 static/icon/icon_home.png | 0 pages/device/device.vue | 111 pages/TaskManager/TaskManagerList.vue | 88 pages/ToDoList/ToDoList.vue | 222 + pages/selectEquipment/selectEquipment.vue | 318 ++ pages/reportRepair/reportRepairList/reportRepairList.vue | 373 ++ common/router/modules/routes.js | 109 manifest.json | 4 pages/checkList/checkListDetils/checkListDetils.vue | 407 ++ pages/reportRepair/reportRepairDeils/reportRepairDeils.vue | 321 ++ pages/searEquipment/searEquipment.vue | 309 ++ common/util/work.js | 72 pages/device/deviceDeils/deviceDeils.vue | 122 30 files changed, 8,460 insertions(+), 436 deletions(-) diff --git a/common/router/modules/routes.js b/common/router/modules/routes.js index e899a9f..860907f 100644 --- a/common/router/modules/routes.js +++ b/common/router/modules/routes.js @@ -177,6 +177,115 @@ }, }, { + path: '/pages/checkList/checkList', + name: 'checkList', + meta: { + title: '鐐规', + }, + }, + { + path: '/pages/checkList/checkListDetils/checkListDetils', + name: 'checkListDetils', + meta: { + title: '鐐规璇︽儏', + }, + }, + { + path: '/pages/baoZhou/baoZhou', + name: 'baoZhou', + meta: { + title: '鍛ㄤ繚', + }, + }, + { + path: '/pages/baoZhou/baoZhouDetils/baoZhouDetils', + name: 'baoZhouDetils', + meta: { + title: '鍛ㄤ繚璇︽儏', + }, + }, + { + path: '/pages/reportRepair/reportRepair', + name: 'reportRepair', + meta: { + title: '鎶ヤ慨', + }, + }, + { + path: '/pages/maintenanceReport/maintenanceReport', + name: 'maintenanceReport', + meta: { + title: '缁翠慨', + }, + }, + { + path: '/pages/reportRepair/reportRepairDeils/reportRepairDeils', + name: 'maintenanceReport', + meta: { + title: '缁翠慨', + }, + }, + { + path: '/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils', + name: 'maintenanceReport', + meta: { + title: '缁翠慨-璇︽儏', + }, + }, + { + path: '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils', + name: 'ToDoCheckDetils', + meta: { + title: '鐐规-鎵ц', + }, + }, + + { + path: '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure', + name: 'ToDoListCheckSure', + meta: { + title: '鐐规-鐝粍闀跨‘璁�', + }, + }, + { + path: '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts', + name: 'ToDoSpareParts', + meta: { + title: '璁惧缁翠慨-鏄惁闇�瑕侀鐢ㄥ浠�', + }, + }, + { + path: '/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou', + name: 'ToDoSpareParts', + meta: { + title: '鍛ㄤ繚-鎵ц', + }, + }, + { + path: '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure', + name: 'ToDoSpareParts', + meta: { + title: '鍛ㄤ繚-鐝粍闀跨‘璁�', + }, + }, + { + path: '/pages/selectEquipment/selectEquipment', + name: 'selectEquipment', + meta: { + title: '閫夋嫨璁惧', + }, + }, + + + { + path: '/pages/reportRepair/reportRepairList/reportRepairList', + name: 'reportRepairList', + meta: { + title: '鎶ヤ慨鍒楄〃', + }, + }, + + { path: '/pages/annotation/annotationDetail', name: 'annotationDetail', meta: { diff --git a/common/service/config.service.js b/common/service/config.service.js index 7a24a16..2b48824 100644 --- a/common/service/config.service.js +++ b/common/service/config.service.js @@ -1,17 +1,16 @@ let BASE_URL = '/jeecg-boot' - - if (process.env.NODE_ENV == 'development') { BASE_URL = '/jeecg-boot' // 寮�鍙戠幆澧� } else { BASE_URL = '/jeecg-boot' // 鐢熶骇鐜 } -let staticDomainURL = BASE_URL+ '/sys/common/static'; - +let staticDomainURL ='/sys/common/static'; +let staticURL ='https://192.168.1.42:9999/jeecg-boot/sys/common/static'; const configService = { apiUrl: BASE_URL, - staticDomainURL: staticDomainURL + staticDomainURL: staticDomainURL, + staticURL:staticURL }; export default configService diff --git a/common/util/work.js b/common/util/work.js index 1489ed1..a86b077 100644 --- a/common/util/work.js +++ b/common/util/work.js @@ -98,46 +98,14 @@ icon:icon_prefix+"xinwen.png", description:"璁惧鐐规", useCount:10000, - page:'helloWorld' + page:'checkList' },{ title:"鍛ㄤ繚", icon:icon_prefix+"toupiao.png", description:"璁惧鍛ㄤ繚", useCount:10000, - page:'helloWorld' + page:'baoZhou' } - // ,{ - // title:"浜屼繚", - // icon:icon_prefix+"renwu.png", - // description:"璁惧浜屼繚", - // useCount:10000, - // page:'helloWorld' - // },{ - // title:"涓変繚", - // icon:icon_prefix+"wendang.png", - // description:"璁惧涓変繚", - // useCount:10000, - // page:'helloWorld' - // } - // ,{ - // title:"鍚堝悓", - // icon:icon_prefix+"hetong.png", - // description:"鍚堝悓", - // useCount:10000, - // page:'helloWorld' - // },{ - // title:"浼氳", - // icon:icon_prefix+"huiyi.png", - // description:"浼氳", - // useCount:10000, - // page:'helloWorld' - // },{ - // title:"瀹㈡埛鍏崇郴", - // icon:icon_prefix+"tongzhi.png", - // description:"瀹㈡埛鍏崇郴", - // useCount:10000, - // page:'helloWorld' - // } ] } @@ -153,45 +121,13 @@ icon:icon_prefix+"xinwen.png", description:"璁惧鎶ヤ慨", useCount:10000, - page:'helloWorld' + page:'reportRepairList' },{ title:"缁翠慨", icon:icon_prefix+"toupiao.png", description:"璁惧缁翠慨", useCount:10000, - page:'helloWorld' + page:'maintenanceReport' } - // ,{ - // title:"浜屼繚", - // icon:icon_prefix+"renwu.png", - // description:"璁惧浜屼繚", - // useCount:10000, - // page:'helloWorld' - // },{ - // title:"涓変繚", - // icon:icon_prefix+"wendang.png", - // description:"璁惧涓変繚", - // useCount:10000, - // page:'helloWorld' - // } - // ,{ - // title:"鍚堝悓", - // icon:icon_prefix+"hetong.png", - // description:"鍚堝悓", - // useCount:10000, - // page:'helloWorld' - // },{ - // title:"浼氳", - // icon:icon_prefix+"huiyi.png", - // description:"浼氳", - // useCount:10000, - // page:'helloWorld' - // },{ - // title:"瀹㈡埛鍏崇郴", - // icon:icon_prefix+"tongzhi.png", - // description:"瀹㈡埛鍏崇郴", - // useCount:10000, - // page:'helloWorld' - // } ] } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 3f8c2a5..1873248 100644 --- a/manifest.json +++ b/manifest.json @@ -86,12 +86,12 @@ "base" : "/h5" }, "devServer" : { - "port" : "3000", + "port" : "8080", "https" : true, "proxy": { /**閰嶇疆鏈嶅姟鍣ㄨ矾寰�**/ "/jeecg-boot": { - "target": "https://192.168.1.94:9999",// 鐩爣鏈嶅姟鍣� + "target": "https://192.168.1.42:9999",// 鐩爣鏈嶅姟鍣� "changeOrigin": true } } diff --git a/pages.json b/pages.json index 7d0e53d..a32bc70 100644 --- a/pages.json +++ b/pages.json @@ -214,6 +214,118 @@ { "navigationBarTitleText" : "" } + }, + { + "path" : "pages/checkList/checkList", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/checkList/checkListDetils/checkListDetils", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/baoZhou/baoZhou", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/baoZhou/baoZhouDetils/baoZhouDetils", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/reportRepair/reportRepair", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/maintenanceReport/maintenanceReport", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/searEquipment/searEquipment", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/reportRepair/reportRepairList/reportRepairList", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/reportRepair/reportRepairDeils/reportRepairDeils", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/ToDoList/ToDoSpareParts/ToDoSpareParts", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/selectEquipment/selectEquipment", + "style" : + { + "navigationBarTitleText" : "" + } } diff --git a/pages/TaskManager/TaskManagerDeils/TaskManagerDeils.vue b/pages/TaskManager/TaskManagerDeils/TaskManagerDeils.vue index c20b66f..399d52f 100644 --- a/pages/TaskManager/TaskManagerDeils/TaskManagerDeils.vue +++ b/pages/TaskManager/TaskManagerDeils/TaskManagerDeils.vue @@ -2,7 +2,7 @@ <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"> @@ -11,28 +11,20 @@ <uni-group top="1"> <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鍩烘湰淇℃伅 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> <uni-forms-item name="num" label="宸ュ崟鍙�:"> - <uni-easyinput v-model="formData.equipmentCode" :disabled="true" /> + <uni-easyinput v-model="formData.orderNum" :disabled="true" /> </uni-forms-item> - <uni-forms-item required name="num" label="璁惧缂栫爜:"> - <uni-easyinput v-model="formData.equipmentCode" :disabled="true" /> + <uni-forms-item required name="num" label="璁惧缂栧彿:"> + <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" + placeholder="璇烽�夋嫨" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="remark" label="鏍囧噯鍚嶇О:"> - <uni-easyinput v-model="formData.equipmentName" :disabled="true" /> + <uni-forms-item name="remark" label="鐐规鏃ユ湡:"> + <uni-easyinput v-model="formData.inspectionDate" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="remark" label="淇濆吇鏃ユ湡:"> - <uni-easyinput v-model="formData.equipmentModel" :disabled="true" /> + <uni-forms-item name="outNum" label="鐐规浜�:"> + <uni-easyinput v-model="formData.operator" :disabled="true" /> </uni-forms-item> - <uni-forms-item name="outNum" label="淇濆吇浜�:"> - <uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" /> - </uni-forms-item> - <uni-forms-item name="outNum" label="淇濆吇鍛ㄦ湡:"> - <uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" /> - </uni-forms-item> - <uni-forms-item name="outNum" label="澶囨敞:"> - <uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" /> - </uni-forms-item> - <uni-forms-item name="outNum" label="淇濆吇鍥剧墖:"> + <uni-forms-item 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]"> @@ -41,22 +33,12 @@ <text class='cuIcon-close'></text> </view> </view> - <view class="solids" @tap="ChooseImage" v-if="imgList.length<1"> + <view class="solids" v-if="imgList.length<1"> <text class='cuIcon-cameraadd'></text> </view> </view> </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> <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 淇濆吇椤逛俊鎭� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> @@ -71,64 +53,65 @@ <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 text-bold radius text-right"> - {{item.title}} + {{item.itemName}} </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.small!=null && item.small.length>10"> - {{(item.small).toString().substr(0,10)+'...'}} - </view> - <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> - {{item.small}} - </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.yaoqiu!=null && item.yaoqiu.length>10"> - {{(item.yaoqiu).toString().substr(0,10)+'...'}} + 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.yaoqiu}} + {{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.restle" :clear="true" /> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鐐规缁撴灉:</view> + + <uni-data-select :localdata="restle" v-model="item.inspectionResult" @change="handleCode()" + :clear="true" :disabled="true" /> - </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-easyinput v-model="item.desc" :disabled="true" /> + <uni-easyinput v-model="item.exceptionDescription" :disabled="true" /> </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.type" /> - + <uni-data-select :localdata="item.type" v-model="item.reportFlag" :disabled="true" /> </view> </view> - </uni-card> + <uni-forms v-if="isDisplayConfirm == 'WAIT_CONFIRM' || isDisplayConfirm == 'COMPLETE'" ref="form" + :modelValue="ScanData" validate-trigger="bind" err-show-type="undertext"> + <uni-group top="1"> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鐝粍闀跨‘璁� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <uni-forms-item required name="typeName" label="澶勭悊绫诲瀷:"> + <uni-data-select v-model="ScanData.typeName" :localdata="ScanData.handlingType" + @change="changehandlingType" placeholder="璇烽�夋嫨" :disabled="true" /> + </uni-forms-item> + <uni-forms-item required name="handlingSuggestion" label="澶勭悊鎰忚:"> + <uni-easyinput type="textarea" v-model="ScanData.handlingSuggestion" :disabled="true" /> + </uni-forms-item> + </uni-group> + </uni-forms> </view> </view> </template> <script> import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + import configService from '@/common/service/config.service.js'; export default { mixins: [MescrollMixin], // 浣跨敤mixin data() { @@ -136,28 +119,42 @@ scrollLeft: 0, searchValue: '', imgList: [], + equipmentList: [], uploadUrl: "/sys/common/upload", - formData: {}, - partTakeAdviceDetailList: [{ - title: "鏈哄簥绌烘皵杩囨护", - small: "澶栧3鍙婄璺�", - yaoqiu: "杩囨护缃�,杩囨护妫夊畬濂斤紝鏃犳补", - restle: [{ - text: "姝e父", - value: 0 + ScanData: { + typeName: '', + handlingType: [{ + text: "閫氳繃", + value: "1" }, { - text: "寮傚父", - value: 1 + text: "椹冲洖", + value: "2" } - ] - - }], + ], + handlingSuggestion: '' + }, + formData: { + num: '', + avatar: '', + orderNum: '', + inspectionDate: '', + operator: '' + }, + istrue: true, + partTakeAdviceDetailList: [], NavBarColor: this.NavBarColor, url: { - stallList: "/eam/equipment/queryById" + upload: "/eam/sysFiles/batch_upload", + stallList: "/eam/eamInspectionOrder/queryById", + // getEquipmentList: "eam/equipment/asyncLoadEquipment", + getEquipmentList:'eam/equipment/list', + BaoList: 'eam/eamInspectionOrderDetail/queryList', + approval: 'eam/eamInspectionOrder/approval' }, id: '', + taskId: '', + inspectionResult: '', upOption: { page: { num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� @@ -178,7 +175,10 @@ }, msg1Count: 0, msg2Count: 0, - msg1Title: "" + msg1Title: "", + procInstId: '', + values: '', + isDisplayConfirm: false } }, computed: { @@ -192,38 +192,237 @@ return style }, }, + onLoad(options) { + const annItem = JSON.parse(decodeURIComponent(options.item)); - - onShow() { - - }, - - onLoad: function(option) { - const annItem = JSON.parse(decodeURIComponent(option.item)); - this.id = annItem.id + this.id = annItem.dataId + this.taskId = annItem.id + this.procInstId = annItem.procInstId + this.values = annItem.values + this.assignee = annItem.assignee + const imageFiles = annItem.imageFiles + this.ipAndPort = configService.staticURL + // const ipAndPort = 'https://192.168.1.42:9999/jeecg-boot/sys/common/static' + '/' + if (imageFiles) { + const fileArray = imageFiles.split(','); + this.imgList = fileArray.map(file => { + return ipAndPort + file.trim(); + }); + } }, created() { - this.upCallback() + this.getEquipment(); + this.getList(); + this.upCallback(); }, + methods: { + changehandlingType(e) { + this.ScanData.typeName = e; + }, + ProductionTask() { + if (this.ScanData.typeName == undefined || this.ScanData.typeName == null || this.ScanData.typeName == + '') { + + uni.showToast({ + icon: 'none', + title: '澶勭悊绫诲瀷涓嶈兘涓虹┖' + }); + return false; + } + if (this.ScanData.handlingSuggestion == undefined || this.ScanData.handlingSuggestion == null || this + .ScanData.handlingSuggestion == + '') { + + uni.showToast({ + icon: 'none', + title: '澶勭悊鎰忚涓嶈兘涓虹┖' + }); + return false; + } + this.$http.post(this.url.approval, { + /** + * 纭鎰忚 + */ + confirmComment: this.ScanData.handlingSuggestion, + /** + * 纭绫诲瀷 1 閫氳繃 2 椹冲洖 + */ + confirmDealType: this.ScanData.typeName, + dataId: this.id, + fileList: this.formData.avatar, // 鍖呭惈涓婁紶鍚庣殑鍥剧墖璺緞,, + instanceId: this.procInstId, + tableDetailList: this.partTakeAdviceDetailList, + taskId: this.taskId, + userId: this.assignee, + values: this.values + }).then(res => { + console.log(res) + this.$tip.loaded(); + if (res.data.success) { + uni.showToast({ + icon: "success", + title: '鎻愪氦鎴愬姛', + duration: 2000 + }); + this.$Router.replace({ + name: 'ToDoList' + }) + + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: '鎻愪氦澶辫触', + duration: 2000 + }); + }); + }, + + changeEquipmentList(e) { + this.formData.num = e; + }, + handleCode(e, index) { + console.log(index); + // 鏍规嵁 e 鐨勫�兼潵鍒ゆ柇鏄惁闇�瑕佹洿鏂� isTrue 鐨勭姸鎬� + if (e === 2) { + this.partTakeAdviceDetailList[index].istrue = false; + + } else { + this.partTakeAdviceDetailList[index].istrue = true; + } + }, + // 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 + // }); + + // } + // }).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: { + orderId: this.id + }, + + }).then(res => { + this.partTakeAdviceDetailList = res.data.result; + const restle = []; + this.partTakeAdviceDetailList.forEach(item => { + item.restle = [{ + text: "姝e父", + value: 1 + }, + { + text: "寮傚父", + value: 2 + } + ]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍 + item.type = [{ + text: "鍚�", + value: 0 + }, + { + text: "鏄�", + value: 1 + } + ]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍 + item.istrue = true; + }); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data.result) + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, ChooseImage() { var that = this; uni.chooseImage({ - count: 4, //榛樿9 - sizeType: ['original', 'compressed'], //鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� - sourceType: ['album'], //浠庣浉鍐岄�夋嫨 + count: 4, + sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� + sourceType: ['album'], // 浠庣浉鍐岄�夋嫨 success: (res) => { - that.$http.upload(that.uploadUrl, { - filePath: res.tempFilePaths[0], - name: 'file' - }) - .then(res => { - that.myFormData.avatar = res.data.message; - }) - .catch(err => { - that.$tip.error(err.data.message) + // 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰� + 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].filePath; + // 杩藉姞鍒� formData.avatar 涓紝骞剁敤閫楀彿鍒嗛殧 + if (that.formData.avatar) { + that.formData.avatar += ',' + filePath; + } else { + that.formData.avatar = filePath; + } + console.log('鍥剧墖' + index + '涓婁紶瀹屾垚:', filePath); + resolve(filePath); + }) + .catch(err => { + console.error('鍥剧墖' + index + '涓婁紶澶辫触:', err); + reject(err); + }); }); - this.imgList = res.tempFilePaths + }); + + // 骞跺彂鎵ц鎵�鏈変笂浼犱换鍔� + Promise.all(uploadPromises) + .then((uploadedFilePaths) => { + console.log('鎵�鏈夊浘鐗囦笂浼犳垚鍔�:', that.formData.avatar); + }) + .catch((err) => { + console.error('鍥剧墖涓婁紶澶辫触:', err); + that.$tip.error('鍥剧墖涓婁紶澶辫触'); + }); } }); }, @@ -250,12 +449,7 @@ upCallback() { this.$http.get(this.url.stallList, { params: { - pageNo: 999, - pageSize: 1, - order: 'asc', - column: 'createTime', id: this.id - }, }).then(res => { @@ -264,7 +458,19 @@ //璁剧疆鍒楄〃鏁版嵁 if (res.data.success) { console.log("res", res.data.result.equipmentCode) - this.formData = this.announcement1 + this.formData.num = this.announcement1.equipmentId, + this.formData.orderNum = this.announcement1.orderNum, + this.formData.operator = this.announcement1.operator, + this.formData.inspectionDate = this.announcement1.inspectionDate, + this.formData.avatar = this.announcement1.imageFiles, + this.ScanData.handlingSuggestion = this.announcement1.confirmComment, + this.ScanData.typeName = this.announcement1.confirmDealType + this.isDisplayConfirm = this.announcement1.inspectionStatus + if (this.announcement1.inspectionStatus == 'WAIT_CONFIRM' || this.announcement1 + .inspectionStatus == 'COMPLETE') { + thihs.isDisplayConfirm = true + } + } }).catch(() => { //鑱旂綉澶辫触, 缁撴潫鍔犺浇 diff --git a/pages/TaskManager/TaskManagerList.vue b/pages/TaskManager/TaskManagerList.vue index fcacc98..545dfa2 100644 --- a/pages/TaskManager/TaskManagerList.vue +++ b/pages/TaskManager/TaskManagerList.vue @@ -48,11 +48,12 @@ </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"> - {{item.description}} + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">浠诲姟鍚嶇О:</view> + <view class="flex-sub bg-white padding-xs margin-xs text-orange radius text-right"> + {{item.taskName}} </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 text-blue radius text-right"> @@ -60,13 +61,13 @@ </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 margin-xs radius text-right"> - {{item.taskName}} + {{item.description}} </view> </view> + </uni-card> </view> </mescroll-uni> @@ -120,7 +121,7 @@ }, computed: { top() { - return this.CustomBar * 2 + 130 + return this.CustomBar * 2 + 50 }, style() { var StatusBar = this.StatusBar; @@ -144,13 +145,74 @@ * @param {Object} item * 璇︽儏椤甸潰 */ + // onClickProductionTask(item) { + // const name = item.category_dictText + // const type= item.taskName + // if (name == '璁惧鐐规' && type =='鐝粍闀跨‘璁�') { + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure?item=' + + // encodeURIComponent(JSON.stringify(item)) + // }) + // }else if(name == '璁惧鍛ㄤ繚' && type =='鐝粍闀跨‘璁�'){ + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure?item=' + + // encodeURIComponent(JSON.stringify(item)) + // }) + // } + + + + + // }, onClickProductionTask(item) { - uni.navigateTo({ - url: '/pages/TaskManager/TaskManagerDeils/TaskManagerDeils?item=' + - encodeURIComponent(JSON.stringify(item)) - - }) - + const name = item.taskName; + const type = item.category_dictText; + let url = ''; + + switch (true) { + case (name === '鏄惁闇�瑕侀鐢ㄥ浠�' && type === '璁惧缁翠慨'): + url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts'; + break; + case (name === '鐐规鎵ц' && type === '璁惧鐐规'): + url = '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure'; + break; + case (name === '鍛ㄤ繚鎵ц' && type === '璁惧鍛ㄤ繚'): + url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure'; + break; + case (name === '鐝粍闀跨‘璁�' && type === '璁惧鐐规'): + url = '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure'; + break; + case (name === '鐝粍闀跨‘璁�' && type === '璁惧鍛ㄤ繚'): + url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure'; + break; + case (name === '璁剧鍛樺垵楠�' && type === '璁惧鍛ㄤ繚'): + url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure'; + break; + case (name === '璁捐兘閮ㄧ粓楠�' && type === '璁惧鍛ㄤ繚'): + url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure'; + break; + case (name === '绠$悊鍛橀鐢ㄥ浠�' && type === '璁惧缁翠慨'): + url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts'; + break; + case (name === '鎿嶄綔宸ョ‘璁�' && type === '璁惧缁翠慨'): + url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts'; + break; + case (name === '缁翠慨鎵ц' && type === '璁惧缁翠慨'): + url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts'; + break; + case (name === '鐐规宸ュ崟' && type === '璁惧鐐规'): + url = '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure'; + break; + default: + console.warn(`No URL found for name: ${name} and type: ${type}`); + return; + } + + if (url) { + uni.navigateTo({ + url: `${url}?item=${encodeURIComponent(JSON.stringify(item))}` + }); + } }, search() { diff --git a/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue b/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue new file mode 100644 index 0000000..03fc669 --- /dev/null +++ b/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou.vue @@ -0,0 +1,582 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</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> + <uni-forms-item :label-width="80" name="orderNum" label="宸ュ崟鍙�:"> + <uni-easyinput v-model="formData.orderNum" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" required 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="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="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-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> + + + + + + + + + <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-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> + <view class="flex-sub bg-white padding-xs margin-xs radius text-right">{{index+1}} + </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 text-bold radius text-right"> + {{item.itemName}} + </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.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> + <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 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-easyinput v-model="item.exceptionDescription" :disabled="item.istrue" /> + </view> + </view> + </uni-card> + </uni-collapse-item> + </uni-collapse> + + + + <view 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> + + + + </view> + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + scrollLeft: 0, + searchValue: '', + imgList: [], + equipmentList: [], + uploadUrl: "/sys/common/upload", + formData: { + avatar: [], + id:'' + + }, + istrue: true, + partTakeAdviceDetailList: [], + NavBarColor: this.NavBarColor, + url: { + upload: "/eam/sysFiles/batch_upload", + stallList: "/eam/weekMaintenanceOrder/queryById", + getEquipmentList:'eam/equipment/list', + // getEquipmentList: "eam/equipment/asyncLoadEquipment", + BaoList: '/eam/weekMaintenanceOrderDetail/queryList', + approval: 'eam/weekMaintenanceOrder/approval' + }, + id: '', + taskId: '', + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msg1Count: 0, + msg2Count: 0, + msg1Title: "", + procInstId: '', + values: '', + isClick:false + + } + }, + computed: { + top() { + return this.CustomBar * 2 + 160 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + 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 + }, + created() { + this.getEquipment(); + this.getList(); + this.upCallback(); + }, + + methods: { + change(e) { + console.log(e); + }, + batchnsIpection() { + uni.showModal({ + title: '鎻愮ず', + content: '纭畾鎵归噺淇濆吇姝e父锛�', + cancelText: '鍐嶇湅鐪�', + confirmText: '纭畾', + success: res => { + if (res.confirm) { + for (let i = 0; i < this.partTakeAdviceDetailList.length; i++) { + this.partTakeAdviceDetailList[i].maintenanceResult = '1'; + } + this.isClick = true; + } + } + }) + + + }, + 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; + } + } + + 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) { + uni.showToast({ + icon: "success", + title: '鎻愪氦鎴愬姛', + duration: 2000 + }); + this.$Router.replaceAll({name: 'ToDoList'}) + + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: res.data.message, + duration: 2000 + }); + }); + }else{ + uni.showToast({ + icon: "error", + title: '鏈埌淇濆吇鏃堕棿', + duration: 2000 + }); + } + + }, + + changeEquipmentList(e) { + this.formData.num = e; + }, + + handleType(e,index){ + console.log(e); + }, + handleCode(e, index) { + console.log(index); + // 鏍规嵁 e 鐨勫�兼潵鍒ゆ柇鏄惁闇�瑕佹洿鏂� isTrue 鐨勭姸鎬� + if (e == '2') { + this.partTakeAdviceDetailList[index].istrue = false; + + } else if (e == '1') { + 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 + // }); + + // } + // }).catch(() => { + // this.$tip.error("鑱旂綉澶辫触") + // }) + // }, + getList() { + this.$http.get(this.url.BaoList, { + params: { + orderId: this.id + }, + + }).then(res => { + this.partTakeAdviceDetailList = res.data.result; + const restle = []; + this.partTakeAdviceDetailList.forEach(item => { + item.restle = [{ + text: "姝e父", + value: '1' + }, + { + text: "寮傚父", + value: '2' + } + ]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍 + item.type = [{ + text: "鍚�", + value: 0 + }, + { + text: "鏄�", + value: 1 + } + ]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍 + item.istrue = true; + }); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data.result) + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + 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('鍥剧墖涓婁紶澶辫触'); + }); + } + }); + }, + 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) + } + } + }) + }, + + 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.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(); + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + + hasInspectionDateArrived() { + // 鑾峰彇褰撳墠鏃堕棿 + const now = new Date(); + // 鑾峰彇鐐规鏃ユ湡 + const maintenanceDate = new Date(this.formData.maintenanceDate); + // 璁$畻褰撳墠鏃堕棿涓庣偣妫�鏃ユ湡涔嬮棿鐨勫皬鏃跺樊 + const diffInHours = (maintenanceDate - now) / (1000 * 60 * 60); + // 濡傛灉灏忔椂宸皬浜庣瓑浜�0锛岃〃绀哄綋鍓嶆椂闂村凡鍒拌揪鎴栬秴杩囩偣妫�鏃ユ湡 + return diffInHours <= 0; + }, + + /* 妫�绱� */ + getSera(res) { + this.msgList = []; + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + equipmentCode: res + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + } + }, + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure.vue b/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure.vue new file mode 100644 index 0000000..dcbebf3 --- /dev/null +++ b/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure.vue @@ -0,0 +1,851 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">{{title}}</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> + <uni-forms-item :label-width="80" name="num" label="宸ュ崟鍙�:"> + <uni-easyinput v-model="formData.orderNum" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" required 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="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="80" name="remark" label="澶囨敞:"> + <uni-easyinput v-model="formData.remark" :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" v-if="imgList.length<1"> + <text class='cuIcon-cameraadd'></text> + </view> + </view> + + </uni-forms-item> + </uni-group> + </uni-forms> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 淇濆吇椤逛俊鎭� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + + <uni-collapse> + <uni-collapse-item :show-animation="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> + <view class="flex-sub bg-white padding-xs margin-xs radius text-right">{{index+1}} + </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 text-bold radius text-right"> + {{item.itemName}} + </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.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> + <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" 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 bg-white padding-xs text-right margin-xs radius"> + <uni-data-select :localdata="item.restle" v-model="item.maintenanceResult" + @change="handleCode($event, index)" :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 bg-white padding-xs text-right margin-xs radius"> + <uni-easyinput v-model="item.exceptionDescription" :disabled="item.istrue" /> + </view> + </view> + </uni-card> + </uni-collapse-item> + </uni-collapse> + + + <uni-forms ref="form" :modelValue="ScanData" validate-trigger="bind" err-show-type="undertext"> + <uni-group top="1"> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂彮缁勯暱纭淇℃伅鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <uni-forms-item :label-width="80" required name="typeName" label="澶勭悊绫诲瀷:"> + <uni-data-select v-model="ScanData.typeName" :localdata="ScanData.handlingType" + @change="changehandlingType" placeholder="璇烽�夋嫨" :disabled="isShowSure" /> + </uni-forms-item> + <uni-forms-item :label-width="80" required name="handlingSuggestion" label="澶勭悊鎰忚:"> + <uni-easyinput type="textarea" v-model="ScanData.handlingSuggestion" :disabled="isShowSure" /> + </uni-forms-item> + + </uni-group> + </uni-forms> + <uni-forms v-show="isHideFist" ref="form" :modelValue="ScanData" validate-trigger="bind" + err-show-type="undertext"> + <uni-group top="1"> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斿垵楠屾敹淇℃伅鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <uni-forms-item :label-width="80" required name="initialAcceptanceComment" label="鍒濆鎰忚:"> + <uni-easyinput type="textarea" v-model="ScanData.initialAcceptanceComment" placeholder="璇疯緭鍏ユ剰瑙�" + :disabled="isShowLast" /> + </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 imgListinitialAccept" :key="index" + @tap="ViewImageFile" :data-url="imgListinitialAccept[index]"> + <image :src="imgListinitialAccept[index]" mode="aspectFill"></image> + <view class="cu-tag bg-red radius" @tap.stop="DelImgFile" :data-index="index"> + <text class='cuIcon-close'></text> + </view> + </view> + <view class="solids" @click="ChooseImageFile()" v-if="imgListinitialAccept.length<1"> + <text class='cuIcon-cameraadd'></text> + </view> + </view> + + </uni-forms-item> + </uni-group> + </uni-forms> + <uni-forms v-show="isHideLast" ref="form" :modelValue="ScanData" validate-trigger="bind" + err-show-type="undertext"> + <uni-group top="1"> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旂粓楠屾敹淇℃伅鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <uni-forms-item :label-width="80" required name="finalAcceptanceComment" label="缁堥獙鏀舵剰瑙�:"> + <uni-easyinput type="textarea" v-model="ScanData.finalAcceptanceComment" placeholder="璇疯緭鍏ユ剰瑙�" + :disabled="isfinal" /> + </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 imgListfinalAcceptanceFilesResult" :key="index" + @tap="ViewImageFinal" :data-url="imgListfinalAcceptanceFilesResult[index]"> + <image :src="imgListfinalAcceptanceFilesResult[index]" mode="aspectFill"></image> + <view class="cu-tag bg-red radius" @tap.stop="DelImgFinal" :data-index="index"> + <text class='cuIcon-close'></text> + </view> + </view> + <view class="solids" @click="ChooseImageFinal()" + v-if="imgListfinalAcceptanceFilesResult.length<1"> + <text class='cuIcon-cameraadd'></text> + </view> + </view> + + </uni-forms-item> + </uni-group> + </uni-forms> + <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> + + </view> + </view> +</template> + +<script> + import configService from "@/common/service/config.service.js"; + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + title: '', + isShowBtn: true, + isHideLast: false, + isHideFist: false, + isShowSure: false, + scrollLeft: 0, + isfinal: false, + searchValue: '', + imgList: [], + imgListinitialAccept: [], + imgListfinalAcceptanceFilesResult: [], + equipmentList: [], + uploadUrl: "/sys/common/upload", + ScanData: { + typeName: '', + initialAcceptanceComment: '', + handlingType: [{ + text: "閫氳繃", + value: "1" + }, + { + text: "椹冲洖", + value: "2" + } + ], + handlingSuggestion: '' + }, + formData: { + avatar: [], + avatarFile: [], + avatarFinal: [], + id: '', + maintenanceStatus: '' + }, + istrue: true, + ipAndPort: configService.staticURL, + partTakeAdviceDetailList: [], + NavBarColor: this.NavBarColor, + url: { + upload: "/eam/sysFiles/batch_upload", + stallList: "/eam/weekMaintenanceOrder/queryById", + // getEquipmentList: "eam/equipment/asyncLoadEquipment", + getEquipmentList:'eam/equipment/list', + BaoList: '/eam/weekMaintenanceOrderDetail/queryList', + approval: 'eam/weekMaintenanceOrder/approval' + }, + id: '', + taskId: '', + inspectionResult: '', + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + isShowLast: false, + msg1Count: 0, + msg2Count: 0, + msg1Title: "", + procInstId: '', + values: '', + imageFiles: '', + imageFilesList: [], + imageFilesnitialAcceptList: [] + } + }, + computed: { + top() { + return this.CustomBar * 2 + 160 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + onLoad(options) { + const annItem = JSON.parse(decodeURIComponent(options.item)); + this.variables = annItem.variables + this.id = annItem.dataId + this.taskId = annItem.id + this.procInstId = annItem.procInstId + this.assignee = annItem.assignee + }, + created() { + this.getEquipment(); + this.getList(); + this.upCallback(); + }, + + methods: { + changehandlingType(e) { + this.ScanData.typeName = e; + }, + ProductionTask() { + if (this.formData.maintenanceStatus == 'WAIT_FINAL_ACCEPTANCE') { + + if (this.ScanData.finalAcceptanceComment == undefined || this.ScanData.finalAcceptanceComment == + null || this.ScanData.finalAcceptanceComment == + '') { + + uni.showToast({ + icon: 'none', + title: '璇疯緭鍏ョ粓楠屾敹鎰忚!' + }); + return false; + } + } + if (this.formData.maintenanceStatus == 'WAIT_INITIAL_ACCEPTANCE') { + + if (this.ScanData.initialAcceptanceComment == undefined || this.ScanData.initialAcceptanceComment == + null || this.ScanData.acceptanceComment == + '') { + + uni.showToast({ + icon: 'none', + title: '璇疯緭鍏ュ垵楠屾敹鎰忚!' + }); + return false; + } + } + + + if (this.ScanData.typeName == undefined || this.ScanData.typeName == null || this.ScanData.typeName == + '') { + + uni.showToast({ + icon: 'none', + title: '澶勭悊绫诲瀷涓嶈兘涓虹┖' + }); + return false; + } + if (this.ScanData.handlingSuggestion == undefined || this.ScanData.handlingSuggestion == null || this + .ScanData.handlingSuggestion == + '') { + + uni.showToast({ + icon: 'none', + title: '澶勭悊鎰忚涓嶈兘涓虹┖' + }); + return false; + } + this.$http.put(this.url.approval, { + finalAcceptanceFilesResult: this.formData.avatarFinal, + finalAcceptanceComment: this.ScanData.finalAcceptanceComment, + initialAcceptanceFilesResult: this.formData.avatarFile, + initialAcceptanceComment: this.ScanData.initialAcceptanceComment, + confirmComment: this.ScanData.handlingSuggestion, + confirmDealType: this.ScanData.typeName, + id: this.formData.id, + dataId: this.id, + instanceId: this.procInstId, + tableDetailList: this.partTakeAdviceDetailList, + taskId: this.taskId, + userId: this.assignee, + maintenanceDate: this.formData.maintenanceDate, + equipmentId: this.formData.num, + imageFilesResult: this.imageFilesList, + remark: this.formData.remark, + standardId: this.formData.standardId, + standardName: this.formData.standardName + }).then(res => { + console.log(res) + this.$tip.loaded(); + if (res.data.success) { + uni.showToast({ + icon: "success", + title: '鎻愪氦鎴愬姛', + duration: 2000 + }); + // this.$Router.replace({ + // name: 'ToDoList' + // }) + this.$Router.replaceAll({ + name: 'ToDoList' + }) + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: '鎻愪氦澶辫触', + duration: 2000 + }); + }); + }, + + changeEquipmentList(e) { + this.formData.num = e; + }, + handleCode(e, index) { + console.log(index); + // 鏍规嵁 e 鐨勫�兼潵鍒ゆ柇鏄惁闇�瑕佹洿鏂� isTrue 鐨勭姸鎬� + if (e == '2') { + this.partTakeAdviceDetailList[index].istrue = false; + } else if (e == '1') { + this.partTakeAdviceDetailList[index].istrue = true; + } + }, + // 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 + // }); + + // } + // }).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: { + orderId: this.id + }, + + }).then(res => { + this.partTakeAdviceDetailList = res.data.result; + const restle = []; + this.partTakeAdviceDetailList.forEach(item => { + item.restle = [{ + text: "姝e父", + value: '1' + }, + { + text: "寮傚父", + value: '2' + } + ]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍 + item.type = [{ + text: "鍚�", + value: 0 + }, + { + text: "鏄�", + value: 1 + } + ]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍 + item.istrue = true; + }); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data.result) + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + + ChooseImageFinal() { + var that = this; + uni.chooseImage({ + count: 4, + sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� + sourceType: ['album'], // 浠庣浉鍐岄�夋嫨 + success: (res) => { + // 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰� + that.imgListfinalAcceptanceFilesResult = res.tempFilePaths; + + // 鍒濆鍖� formData.avatar 涓虹┖瀛楃涓� + that.formData.avatarFinal = []; + + // 鍒涘缓涓婁紶浠诲姟鐨� 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.avatarFinal.push(filePath); + resolve(filePath); + }) + .catch(err => { + console.error('鍥剧墖' + index + '涓婁紶澶辫触:', err); + reject(err); + }); + }); + }); + + // 骞跺彂鎵ц鎵�鏈変笂浼犱换鍔� + Promise.all(uploadPromises) + .then((uploadedFilePaths) => { + console.log('鎵�鏈夊浘鐗囦笂浼犳垚鍔�:', that.formData.avatarFinal); + }) + .catch((err) => { + console.error('鍥剧墖涓婁紶澶辫触:', err); + that.$tip.error('鍥剧墖涓婁紶澶辫触'); + }); + } + }); + }, + + ChooseImageFile() { + var that = this; + uni.chooseImage({ + count: 4, + sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� + sourceType: ['album'], // 浠庣浉鍐岄�夋嫨 + success: (res) => { + // 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰� + that.imgListinitialAccept = res.tempFilePaths; + + // 鍒濆鍖� formData.avatar 涓虹┖瀛楃涓� + that.formData.avatarFile = []; + + // 鍒涘缓涓婁紶浠诲姟鐨� 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.avatarFile.push(filePath); + resolve(filePath); + }) + .catch(err => { + console.error('鍥剧墖' + index + '涓婁紶澶辫触:', err); + reject(err); + }); + }); + }); + + // 骞跺彂鎵ц鎵�鏈変笂浼犱换鍔� + Promise.all(uploadPromises) + .then((uploadedFilePaths) => { + console.log('鎵�鏈夊浘鐗囦笂浼犳垚鍔�:', that.formData.avatarFile); + }) + .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('鍥剧墖涓婁紶澶辫触'); + }); + } + }); + }, + ViewImageFinal(e) { + uni.previewImage({ + urls: this.imgListfinalAcceptanceFilesResult, + current: e.currentTarget.dataset.url + }); + }, + ViewImage(e) { + uni.previewImage({ + urls: this.imgList, + current: e.currentTarget.dataset.url + }); + }, + ViewImageFile(e) { + uni.previewImage({ + urls: this.imgListinitialAccept, + current: e.currentTarget.dataset.url + }); + }, + DelImgFinal(e) { + uni.showModal({ + title: '鎻愮ず', + content: '纭畾瑕佸垹闄よ繖娈靛洖蹇嗗悧锛�', + cancelText: '鍐嶇湅鐪�', + confirmText: '鍐嶈', + success: res => { + if (res.confirm) { + this.imgListfinalAcceptanceFilesResult.splice(e.currentTarget.dataset.index, 1) + } + } + }) + }, + DelImgFile(e) { + uni.showModal({ + title: '鎻愮ず', + content: '纭畾瑕佸垹闄よ繖娈靛洖蹇嗗悧锛�', + cancelText: '鍐嶇湅鐪�', + confirmText: '鍐嶈', + success: res => { + if (res.confirm) { + this.imgListinitialAccept.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() { + console.log(configService.staticURL) + 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.operator = this.announcement1.operator_dictText + this.formData.maintenanceDate = this.announcement1.maintenanceDate + this.formData.remark = this.announcement1.remark + this.ScanData.finalAcceptanceComment = this.announcement1.finalAcceptanceComment + this.formData.maintenanceStatus = this.announcement1.maintenanceStatus + switch (this.formData.maintenanceStatus) { + /** + * 鍒濇 + */ + case 'WAIT_INITIAL_ACCEPTANCE': + this.title = '鍒濇' + this.isShowSure = true; + this.isHideFist = true; + break + /** + * 缁堥獙 + */ + case 'WAIT_FINAL_ACCEPTANCE': + this.title = '缁堥獙' + this.isHideFist = true; + this.isShowLast = true; + this.isShowSure = true; + this.isHideLast = true; + break + /** + * 鎵ц + */ + case 'WAIT_CONFIRM': + this.title = '鎵ц' + this.isHideLast = false + this.isHideFist = false + this.isShowBtn=false + this.isShowSure=true + break + case 'COMPLETE': + this.isShowSure = true; + this.isHideLast = true + this.isHideFist = true + this.isShowLast = true + this.isfinal = true + this.isShowBtn = false + this.title = '璇︽儏' + break + } + this.ScanData.initialAcceptanceComment = this.announcement1.initialAcceptanceComment + this.ScanData.typeName = this.announcement1.confirmDealType + this.formData.id = this.announcement1.id + this.ScanData.handlingSuggestion = this.announcement1.confirmComment + this.formData.avatar = this.announcement1.imageFiles + this.imageFilesList = JSON.parse(this.formData.avatar) + const imageObjects = JSON.parse(this.formData.avatar); + // 鎻愬彇 filePath 骞舵嫾鎺� IP 鍜岀鍙� + this.imgList = imageObjects.map(imageObj => { + return `${this.ipAndPort}${imageObj.filePath}`; + }); + this.formData.avatarFile = this.announcement1.initialAcceptanceFiles, + this.imageFilesnitialAcceptList = JSON.parse(this.formData.avatarFile) + const imageObjectInIt = JSON.parse(this.formData.avatarFile); + // 鎻愬彇 filePath 骞舵嫾鎺� IP 鍜岀鍙� + this.imgListinitialAccept = imageObjectInIt.map(imageObj => { + return `${this.ipAndPort}${imageObj.filePath}`; + }); + + this.formData.avatarFinal = this.announcement1.finalAcceptanceFiles, + this.imageObjectFinal = JSON.parse(this.formData.avatarFinal) + const imageObjectFinal = JSON.parse(this.formData.avatarFinal); + // 鎻愬彇 filePath 骞舵嫾鎺� IP 鍜岀鍙� + this.imgListfinalAcceptanceFilesResult = imageObjectFinal.map(imageObj => { + return `${this.ipAndPort}${imageObj.filePath}`; + }); + + + + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + + + + /* 妫�绱� */ + getSera(res) { + this.msgList = []; + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + equipmentCode: res + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + } + }, + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/ToDoList/ToDoList.vue b/pages/ToDoList/ToDoList.vue index 1989d82..ec6a11d 100644 --- a/pages/ToDoList/ToDoList.vue +++ b/pages/ToDoList/ToDoList.vue @@ -35,7 +35,7 @@ </view> <view class="container"> - + <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback"> <!-- 鍒楄〃淇℃伅寮�濮� --> <view class="content"> @@ -47,12 +47,7 @@ {{item.flowName}} </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"> - {{item.title}} - </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 text-blue radius text-right"> @@ -61,17 +56,23 @@ </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 text-blue radius text-right"> + <view class="flex-sub bg-white padding-xs margin-xs text-yellow radius text-right"> {{item.preNode}} </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"> + <view class="flex-sub bg-white padding-xs margin-xs text-olive radius text-right"> {{item.name}} </view> - </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"> + {{item.title}} + </view> + </view> </uni-card> </view> @@ -87,7 +88,7 @@ data() { return { type: 'top', - scrollLeft:0, + scrollLeft: 0, formData: { num: '', partNumNameModel: '' @@ -95,7 +96,7 @@ NavBarColor: this.NavBarColor, activeColor: '#5277A6', url: { - + stallList: "/assign/flow/toTaskBySelf" }, @@ -126,7 +127,7 @@ }, computed: { top() { - return this.CustomBar * 2 + 130 + return this.CustomBar * 2 + 50 }, style() { var StatusBar = this.StatusBar; @@ -145,58 +146,176 @@ created() {}, methods: { - + /** * @param {Object} item * 璇︽儏椤甸潰 */ onClickProductionTask(item) { - - uni.navigateTo({ - url: '/pages/ToDoList/ToDoListDeils/ToDoListDeils?item=' + - encodeURIComponent(JSON.stringify(item)) + const name = item.name; + const type = item.category_dictText; + let url = ''; - }) - + switch (true) { + case (name === '鏄惁闇�瑕侀鐢ㄥ浠�' && type === '璁惧缁翠慨'): + url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts'; + break; + case (name === '鐐规鎵ц' && type === '璁惧鐐规'): + url = '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils'; + break; + case (name === '鍛ㄤ繚鎵ц' && type === '璁惧鍛ㄤ繚'): + url = '/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou'; + break; + case (name === '鐝粍闀跨‘璁�' && type === '璁惧鐐规'): + url = '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure'; + break; + case (name === '鐝粍闀跨‘璁�' && type === '璁惧鍛ㄤ繚'): + url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure'; + break; + case (name === '璁剧鍛樺垵楠�' && type === '璁惧鍛ㄤ繚'): + url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure'; + break; + case (name === '璁捐兘閮ㄧ粓楠�' && type === '璁惧鍛ㄤ繚'): + url = '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure'; + break; + case (name === '绠$悊鍛橀鐢ㄥ浠�' && type === '璁惧缁翠慨'): + url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts'; + break; + case (name === '鎿嶄綔宸ョ‘璁�' && type === '璁惧缁翠慨'): + url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts'; + break; + case (name === '缁翠慨鎵ц' && type === '璁惧缁翠慨'): + url = '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts'; + break; + case (name === '鐐规宸ュ崟' && type === '璁惧鐐规'): + url = '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils'; + break; + default: + console.warn(`No URL found for name: ${name} and type: ${type}`); + return; + } + + if (url) { + uni.navigateTo({ + url: `${url}?item=${encodeURIComponent(JSON.stringify(item))}` + }); + } }, + + + // onClickProductionTask(item) { + // const name = item.name + // const type=item.category_dictText + // if (name == '鏄惁闇�瑕侀鐢ㄥ浠�' && type=='璁惧缁翠慨') { + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts?item=' + + // encodeURIComponent(JSON.stringify(item)) + // }) + // } else if (name == '鐐规鎵ц' && type=='璁惧鐐规') { + + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils?item=' + + // encodeURIComponent(JSON.stringify(item)) + + // }) + // } else if (name == '鍛ㄤ繚鎵ц' && type=='璁惧鍛ㄤ繚') { + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoBaoZhou/ToDoBaoZhou?item=' + + // encodeURIComponent(JSON.stringify(item)) + + // }) + // }else if (name == '鐝粍闀跨‘璁�' && type=='璁惧鐐规') { + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure?item=' + + // encodeURIComponent(JSON.stringify(item)) + + // }) + // }else if (name == '鐝粍闀跨‘璁�' && type=='璁惧鍛ㄤ繚') { + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure?item=' + + // encodeURIComponent(JSON.stringify(item)) + + // }) + // }else if (name == '璁剧鍛樺垵楠�' && type=='璁惧鍛ㄤ繚') { + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure?item=' + + // encodeURIComponent(JSON.stringify(item)) + + // }) + // }else if (name == '璁捐兘閮ㄧ粓楠�' && type=='璁惧鍛ㄤ繚') { + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoBaoZhouSure/ToDoBaoZhouSure?item=' + + // encodeURIComponent(JSON.stringify(item)) + + // }) + // }else if (name == '绠$悊鍛橀鐢ㄥ浠�' && type=='璁惧缁翠慨') { + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts?item=' + + // encodeURIComponent(JSON.stringify(item)) + + // }) + // }else if (name == '鎿嶄綔宸ョ‘璁�' && type=='璁惧缁翠慨') { + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts?item=' + + // encodeURIComponent(JSON.stringify(item)) + + // }) + // }else if (name == '缁翠慨鎵ц' && type=='璁惧缁翠慨') { + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoSpareParts/ToDoSpareParts?item=' + + // encodeURIComponent(JSON.stringify(item)) + + // }) + // }else if (name == '鐐规宸ュ崟' && type=='璁惧鐐规') { + // uni.navigateTo({ + // url: '/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils?item=' + + // encodeURIComponent(JSON.stringify(item)) + + // }) + // } + + + + // }, + search() { this.$refs.popup.open(); }, - + upCallback(page) { - this.$http.get(this.url.stallList, { - params: { - pageNo: page.num, - pageSize: page.size, - order: 'asc', - column: 'createTime' - }, + this.$http.get(this.url.stallList, { + params: { + pageNo: page.num, + pageSize: page.size, + order: 'asc', + column: 'createTime' + }, - }).then(res => { - this.announcement1 = res.data.result.records - this.mescroll.endSuccess(this.announcement1.length); - console.log("url", res) - //璁剧疆鍒楄〃鏁版嵁 - if (res.data.success) { - console.log("res", res.data) - this.msg1Count = res.data.result.total - this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; - for (let annItem of this.announcement1) { - this.msgList.push(annItem) - } + }).then(res => { + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) } - if (page.num == 1) { - this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 - this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� - } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } - }).catch(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - this.mescroll.endErr(); - }) - + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + }, @@ -342,7 +461,6 @@ </script> <style> - .is-hover { color: rgba(255, 255, 255, 0.6); background-color: #55aaff; @@ -350,7 +468,7 @@ } - + .content { margin-top: 5px; } diff --git a/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure.vue b/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure.vue new file mode 100644 index 0000000..b758296 --- /dev/null +++ b/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure.vue @@ -0,0 +1,598 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">{{title}}</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> + <uni-forms-item :label-width="80" name="num" label="宸ュ崟鍙�:"> + <uni-easyinput v-model="formData.orderNum" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" required 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="80" name="remark" label="鐐规鏃ユ湡:"> + <uni-easyinput v-model="formData.inspectionDate" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" name="outNum" label="鐐规浜�:"> + <uni-easyinput v-model="formData.operator" :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" v-if="imgList.length<1"> + <text class='cuIcon-cameraadd'></text> + </view> + </view> + + </uni-forms-item> + </uni-group> + </uni-forms> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 淇濆吇椤逛俊鎭� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + + <uni-collapse> + <uni-collapse-item :show-animation="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> + <view class="flex-sub bg-white padding-xs margin-xs radius text-right">{{index+1}} + </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 text-bold radius text-right"> + {{item.itemName}} + </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> + <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" 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 bg-white padding-xs text-right margin-xs radius"> + <uni-data-select :localdata="item.restle" v-model="item.inspectionResult" + @change="handleCode($event, index)" :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 bg-white padding-xs text-right margin-xs radius"> + <uni-easyinput v-model="item.exceptionDescription" :disabled="item.istrue" /> + </view> + </view> + </uni-card> + </uni-collapse-item> + </uni-collapse> + + + <uni-forms v-show="isShowTeam" ref="form" :modelValue="ScanData" validate-trigger="bind" err-show-type="undertext"> + <uni-group top="1"> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鐝粍闀跨‘璁や俊鎭� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <uni-forms-item :label-width="80" required name="typeName" label="澶勭悊绫诲瀷:"> + <uni-data-select v-model="ScanData.typeName" :localdata="ScanData.handlingType" + @change="changehandlingType" placeholder="璇烽�夋嫨" :disabled="isTouch" /> + </uni-forms-item> + <uni-forms-item :label-width="80" required name="handlingSuggestion" label="澶勭悊鎰忚:"> + <uni-easyinput type="textarea" v-model="ScanData.handlingSuggestion" :disabled="isTouch" /> + </uni-forms-item> + + </uni-group> + </uni-forms> + + <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> + + </view> + </view> +</template> + +<script> + import configService from "@/common/service/config.service.js"; + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + isShowTeam:false, + isShowBtn: true, + title: '鐝粍闀跨‘璁�', + isTouch: false, + scrollLeft: 0, + searchValue: '', + imgList: [], + equipmentList: [], + uploadUrl: "/sys/common/upload", + ScanData: { + typeName: '', + handlingType: [{ + text: "閫氳繃", + value: "1" + }, + { + text: "椹冲洖", + value: "2" + } + ], + handlingSuggestion: '' + }, + formData: { + num: '', + avatar: [], + orderNum: '', + operator: '', + inspectionDate: '' + + }, + ipAndPort: configService.staticURL, + istrue: true, + partTakeAdviceDetailList: [], + NavBarColor: this.NavBarColor, + url: { + upload: "/eam/sysFiles/batch_upload", + stallList: "/eam/eamInspectionOrder/queryById", + // getEquipmentList: "eam/equipment/asyncLoadEquipment", + getEquipmentList: 'eam/equipment/list', + BaoList: 'eam/eamInspectionOrderDetail/queryList', + approval: 'eam/eamInspectionOrder/approval' + }, + id: '', + taskId: '', + imageFilesList: [], + inspectionResult: '', + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msg1Count: 0, + msg2Count: 0, + msg1Title: "", + procInstId: '', + values: '' + + + } + }, + computed: { + top() { + return this.CustomBar * 2 + 160 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + 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 + + }, + created() { + this.getEquipment(); + this.getList(); + this.upCallback(); + }, + + methods: { + changehandlingType(e) { + this.ScanData.typeName = e; + }, + ProductionTask() { + if (this.hasInspectionDateArrived()) { + if (this.ScanData.typeName == undefined || this.ScanData.typeName == null || this.ScanData.typeName == + '') { + + uni.showToast({ + icon: 'none', + title: '澶勭悊绫诲瀷涓嶈兘涓虹┖' + }); + return false; + } + if (this.ScanData.handlingSuggestion == undefined || this.ScanData.handlingSuggestion == null || this + .ScanData.handlingSuggestion == + '') { + + uni.showToast({ + icon: 'none', + title: '澶勭悊鎰忚涓嶈兘涓虹┖' + }); + return false; + } + this.$http.post(this.url.approval, { + /** + * 纭鎰忚 + */ + confirmComment: this.ScanData.handlingSuggestion, + /** + * 纭绫诲瀷 1 閫氳繃 2 椹冲洖 + */ + confirmDealType: this.ScanData.typeName, + dataId: this.id, + fileList: this.imageFilesList, // 鍖呭惈涓婁紶鍚庣殑鍥剧墖璺緞,, + instanceId: this.procInstId, + tableDetailList: this.partTakeAdviceDetailList, + taskId: this.taskId, + userId: this.assignee, + values: this.values + }).then(res => { + console.log(res) + this.$tip.loaded(); + if (res.data.success) { + uni.showToast({ + icon: "success", + title: '鎻愪氦鎴愬姛', + duration: 2000 + }); + // this.$Router.replace({ + // name: 'ToDoList' + // }) + this.$Router.replaceAll({ + name: 'ToDoList' + }) + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: res.data.message, + duration: 2000 + }); + }); + } else { + uni.showToast({ + icon: "error", + title: '鏈埌鐐规鏃ユ湡涓嶈兘鎻愬墠鐐规', + duration: 2000 + }); + + } + + }, + + changeEquipmentList(e) { + this.formData.num = e; + }, + handleCode(e, index) { + console.log(index); + // 鏍规嵁 e 鐨勫�兼潵鍒ゆ柇鏄惁闇�瑕佹洿鏂� isTrue 鐨勭姸鎬� + // 鏍规嵁 e 鐨勫�兼潵鍒ゆ柇鏄惁闇�瑕佹洿鏂� isTrue 鐨勭姸鎬� + if (e == '2') { + this.partTakeAdviceDetailList[index].istrue = false; + + } else if (e == '1') { + 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 + // }); + + // } + // }).catch(() => { + // this.$tip.error("鑱旂綉澶辫触") + // }) + // }, + getList() { + this.$http.get(this.url.BaoList, { + params: { + orderId: this.id + }, + + }).then(res => { + this.partTakeAdviceDetailList = res.data.result; + const restle = []; + this.partTakeAdviceDetailList.forEach(item => { + item.restle = [{ + text: "姝e父", + value: '1' + }, + { + text: "寮傚父", + value: '2' + } + ]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍 + item.type = [{ + text: "鍚�", + value: 0 + }, + { + text: "鏄�", + value: 1 + } + ]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍 + item.istrue = true; + }); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data.result) + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + ChooseImage() { + var that = this; + uni.chooseImage({ + count: 4, + sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� + sourceType: ['album'], // 浠庣浉鍐岄�夋嫨 + success: (res) => { + // 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰� + that.imgList = res.tempFilePaths; + + // 鍒濆鍖� formData.avatar 涓虹┖瀛楃涓� + + + // 鍒濆鍖� 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); + console.log(this.formData.avatar) + 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('鍥剧墖涓婁紶澶辫触'); + }); + } + }); + }, + 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) + } + } + }) + }, + + 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(this.announcement1.operator_dictText) + this.formData.operator = this.announcement1.operator_dictText + this.formData.num = this.announcement1.equipmentId + this.formData.orderNum = this.announcement1.orderNum + this.formData.inspectionDate = this.announcement1.inspectionDate + this.formData.inspectionStatus = this.announcement1.inspectionStatus + this.ScanData.typeName = this.announcement1.confirmDealType + this.formData.confirmComment = this.announcement1.confirmDealType_dictText + this.ScanData.handlingSuggestion = this.announcement1.confirmComment + + if (this.formData.inspectionStatus == 'COMPLETE') { + this.title = '璇︽儏' + this.isTouch = true + this.isShowTeam=true + this.isShowBtn = false + } else if (this.formData.inspectionStatus == 'WAIT_CONFIRM') { + this.title = '鐐规寮�濮�'; + this.isShowTeam=true + this.isTouch=true + this.isShowBtn=false + } + this.formData.avatar = this.announcement1.imageFiles + 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.hasInspectionDateArrived(); + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + + hasInspectionDateArrived() { + // 鑾峰彇褰撳墠鏃堕棿 + const now = new Date(); + // 鑾峰彇鐐规鏃ユ湡 + const inspectionDate = new Date(this.formData.inspectionDate); + // 璁$畻褰撳墠鏃堕棿涓庣偣妫�鏃ユ湡涔嬮棿鐨勫皬鏃跺樊 + const diffInHours = (inspectionDate - now) / (1000 * 60 * 60); + // 濡傛灉灏忔椂宸皬浜庣瓑浜�0锛岃〃绀哄綋鍓嶆椂闂村凡鍒拌揪鎴栬秴杩囩偣妫�鏃ユ湡 + return diffInHours <= 0; + }, + + /* 妫�绱� */ + getSera(res) { + this.msgList = []; + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + equipmentCode: res + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + } + }, + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils.vue b/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils.vue new file mode 100644 index 0000000..b166a9d --- /dev/null +++ b/pages/ToDoList/ToDoListDeils/ToDoCheckDetils/ToDoCheckDetils.vue @@ -0,0 +1,583 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</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> + <uni-forms-item :label-width="80" name="orderNum" label="宸ュ崟鍙�:"> + <uni-easyinput v-model="formData.orderNum" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" required 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="80" name="remark" label="鐐规鏃ユ湡:"> + <uni-easyinput v-model="formData.inspectionDate" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" name="outNum" label="鐐规浜�:"> + <uni-easyinput v-model="formData.operator" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" name="remark" label="澶囨敞:"> + <uni-easyinput type="textarea" v-model="formData.remark" :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-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> + + + + + + + + <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> + <uni-collapse-item :show-animation="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> + <view class="flex-sub bg-white padding-xs margin-xs radius text-right">{{index+1}} + </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 text-bold radius text-right"> + {{item.itemName}} + </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.small!=null && item.small.length>10"> + {{(item.small).toString().substr(0,10)+'...'}} + </view> + + <view class="flex-sub bg-white padding-xs margin-xs radius text-right" v-else> + {{item.small}} + </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> + <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" 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 bg-white padding-xs text-right margin-xs radius"> + <uni-data-select :localdata="item.restle" v-model="item.inspectionResult" + @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-easyinput v-model="item.exceptionDescription" :disabled="item.istrue" /> + </view> + </view> + </uni-card> + </uni-collapse-item> + </uni-collapse> + + + + <view 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> + + + + </view> + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + isClick: false, + scrollLeft: 0, + searchValue: '', + imgList: [], + equipmentList: [], + uploadUrl: "/sys/common/upload", + formData: { + num: '', + avatar: [] + }, + istrue: true, + partTakeAdviceDetailList: [], + NavBarColor: this.NavBarColor, + url: { + upload: "/eam/sysFiles/batch_upload", + stallList: "/eam/eamInspectionOrder/queryById", + getEquipmentList: 'eam/equipment/list', + // getEquipmentList: "eam/equipment/asyncLoadEquipment", + BaoList: 'eam/eamInspectionOrderDetail/queryList', + approval: 'eam/eamInspectionOrder/approval' + }, + id: '', + taskId: '', + inspectionResult: '', + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msg1Count: 0, + msg2Count: 0, + msg1Title: "", + procInstId: '', + values: '' + + } + }, + computed: { + top() { + return this.CustomBar * 2 + 160 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + 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 + }, + created() { + this.getEquipment(); + this.getList(); + this.upCallback(); + }, + + methods: { + + batchnsIpection() { + uni.showModal({ + title: '鎻愮ず', + content: '纭畾鎵归噺鐐规姝e父锛�', + cancelText: '鍐嶇湅鐪�', + confirmText: '纭畾', + success: res => { + if (res.confirm) { + for (let i = 0; i < this.partTakeAdviceDetailList.length; i++) { + this.partTakeAdviceDetailList[i].inspectionResult = '1'; + } + this.isClick = true; + } + } + }) + + + }, + ProductionTask() { + if (this.hasInspectionDateArrived()) { + for (let i = 0; i < this.partTakeAdviceDetailList.length; i++) { + if (this.partTakeAdviceDetailList[i].inspectionResult == undefined || this + .partTakeAdviceDetailList[i] + .inspectionResult == null || this + .partTakeAdviceDetailList[i].inspectionResult == '') { + /* this.$tip.error("璇疯緭鍏ラ鏂欐暟閲忥紒"); */ + uni.showToast({ + icon: 'none', + title: '鐐规缁撴灉涓嶈兘涓虹┖' + }); + return false; + } + } + + uni.showLoading({ + mask: true, + title: "鍔犺浇涓�....", + }) + this.$http.post(this.url.approval, { + /** + * 纭鎰忚 + */ + confirmComment: '', + /** + * 纭绫诲瀷 1 閫氳繃 2 椹冲洖 + */ + confirmDealType: '', + dataId: this.id, + fileList: this.formData.avatar, // 鍖呭惈涓婁紶鍚庣殑鍥剧墖璺緞,, + instanceId: this.procInstId, + tableDetailList: this.partTakeAdviceDetailList, + taskId: this.taskId, + userId: this.assignee, + values: this.values + }).then(res => { + uni.hideLoading() + if (res.data.success) { + uni.showToast({ + icon: "success", + title: '鎻愪氦鎴愬姛', + duration: 2000 + }); + // this.$Router.replace({ + // name: 'ToDoList' + // }) + this.$Router.replaceAll({ + name: 'ToDoList' + }) + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: res.data.message, + duration: 2000 + }); + }); + + } else { + uni.showToast({ + icon: "error", + title: '鏈埌鐐规鏃ユ湡涓嶈兘鎻愬墠鐐规', + duration: 2000 + }); + } + + }, + + changeEquipmentList(e) { + this.formData.num = e; + }, + handleCode(e, index) { + console.log(index); + // 鏍规嵁 e 鐨勫�兼潵鍒ゆ柇鏄惁闇�瑕佹洿鏂� isTrue 鐨勭姸鎬� + if (e == '2') { + this.partTakeAdviceDetailList[index].istrue = false; + + } else if (e == '1') { + this.partTakeAdviceDetailList[index].istrue = true; + } + }, + // 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 + // }); + + // } + // }).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: { + orderId: this.id + }, + + }).then(res => { + this.partTakeAdviceDetailList = res.data.result; + const restle = []; + this.partTakeAdviceDetailList.forEach(item => { + item.restle = [{ + text: "姝e父", + value: '1' + }, + { + text: "寮傚父", + value: '2' + } + ]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍 + item.type = [{ + text: "鍚�", + value: 0 + }, + { + text: "鏄�", + value: 1 + } + ]; // 鏂板瓧娈碉紝鍊间负涓�涓┖鏁扮粍 + item.istrue = true; + }); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data.result) + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + 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); + console.log(this.formData.avatar) + 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('鍥剧墖涓婁紶澶辫触'); + }); + } + }); + }, + 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) + } + } + }) + }, + + 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.operator = this.announcement1.operator, + this.formData.inspectionDate = this.announcement1.inspectionDate + this.hasInspectionDateArrived(); + + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + hasInspectionDateArrived() { + // 鑾峰彇褰撳墠鏃堕棿 + const now = new Date(); + // 鑾峰彇鐐规鏃ユ湡 + const inspectionDate = new Date(this.formData.inspectionDate); + // 璁$畻褰撳墠鏃堕棿涓庣偣妫�鏃ユ湡涔嬮棿鐨勫皬鏃跺樊 + const diffInHours = (inspectionDate - now) / (1000 * 60 * 60); + // 濡傛灉灏忔椂宸皬浜庣瓑浜�0锛岃〃绀哄綋鍓嶆椂闂村凡鍒拌揪鎴栬秴杩囩偣妫�鏃ユ湡 + return diffInHours <= 0; + }, + + + + /* 妫�绱� */ + getSera(res) { + this.msgList = []; + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + equipmentCode: res + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + } + }, + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #179b16; + border-color: #179b16; + } + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/ToDoList/ToDoListDeils/ToDoListDeils.vue b/pages/ToDoList/ToDoListDeils/ToDoListDeils.vue index 61bbb0f..5feaf0d 100644 --- a/pages/ToDoList/ToDoListDeils/ToDoListDeils.vue +++ b/pages/ToDoList/ToDoListDeils/ToDoListDeils.vue @@ -2,7 +2,7 @@ <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"> @@ -75,6 +75,12 @@ </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"/> + </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.small!=null && item.small.length>10"> @@ -100,7 +106,7 @@ <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.restle" :clear="true" /> + <uni-data-select :localdata="item.restle" /> </view> </view> @@ -112,13 +118,7 @@ </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" /> - - </view> - </view> + </uni-card> @@ -148,6 +148,15 @@ }, { text: "寮傚父", + value: 1 + } + ], + type: [{ + text: "鏄�", + value: 0 + }, + { + text: "鍚�", value: 1 } ] @@ -275,7 +284,6 @@ /* 妫�绱� */ getSera(res) { - this.msgList = []; if (keyword == 0) { this.$http.get(this.url.stallList, { params: { diff --git a/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue b/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue new file mode 100644 index 0000000..fe98829 --- /dev/null +++ b/pages/ToDoList/ToDoSpareParts/ToDoSpareParts.vue @@ -0,0 +1,703 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">{{title}}</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> + <uni-forms-item :label-width="100" name="num" label="宸ュ崟鍙�:"> + <uni-easyinput v-model="formData.repairCode" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="100" required 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="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> + <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-forms-item> + + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�旀槸鍚﹂渶瑕侀鐢ㄥ浠垛�斺�斺�斺�斺�斺�斺�斺�斺��</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" /> + </uni-forms-item> + + <uni-forms-item v-show="isShow" :label-width="140" required name="faultReason" label="鏁呴殰鍘熷洜:"> + <uni-easyinput v-model="formData.faultReason" placeholder="璇疯緭鍏ユ晠闅滃師鍥�" :disabled="isUNDERREPAIR" /> + </uni-forms-item> + <uni-forms-item v-show="isShow" required :label-width="140" name="repairDescription" + label="缁翠慨缁撴灉鎻忚堪:"> + <uni-easyinput v-model="formData.repairDescription" placeholder="璇疯緭鍏ョ淮淇粨鏋滄弿杩�" + :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-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> + <uni-forms-item :label-width="100" required name="sparePartDescription" label="澶囦欢鎻忚堪:"> + <uni-easyinput type="textarea" v-model="ScanData.sparePartDescription" placeholder="璇疯緭鍏ュ浠舵弿杩�" + :disabled="isRuning" /> + </uni-forms-item> + + </uni-group> + </uni-forms> + <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> + <uni-forms-item :label-width="140" required name="faultReason" label="鏁呴殰鍘熷洜:"> + <uni-easyinput v-model="formData.faultReason" placeholder="璇疯緭鍏ユ晠闅滃師鍥�" :disabled="isRepari" /> + </uni-forms-item> + <uni-forms-item required :label-width="140" name="repairDescription" label="缁翠慨缁撴灉鎻忚堪:"> + <uni-easyinput v-model="formData.repairDescription" placeholder="璇疯緭鍏ョ淮淇粨鏋滄弿杩�" + :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-forms-item> + + </uni-group> + </uni-forms> + <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> + + </view> + </view> +</template> + +<script> + import { + title + } from "process"; + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + import configService from "@/common/service/config.service"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + isSHowBtn:true, + isShowRepari: false, + title: '鏄惁闇�瑕侀鐢ㄥ浠�', + isRepari: false, + isRuning: false, + isShowUNDEREPAIR: false, + isUNDERREPAIR: false, + SpareList: [{ + text: "鏄�", + value: 1 + + }, + { + text: "鍚�", + value: 0 + } + ], + ipAndPort: configService.staticURL, + imgTwoList: [], + imgThreeList: [], + scrollLeft: 0, + searchValue: '', + imgList: [], + imageAvatarTwo: [], + imageFilesList: [], + equipmentList: [], + uploadUrl: "/sys/common/upload", + ScanData: { + sparePartDescription: '' + }, + formData: { + reportStatus: '', + avatarTwo: [], + isSpare: 0, + num: '', + avatar: [], + repairer: '', + faultStartTime: '', + repairCode: '' + }, + istrue: true, + partTakeAdviceDetailList: [], + NavBarColor: this.NavBarColor, + url: { + upload: "/eam/sysFiles/batch_upload", + stallList: "/eam/eamRepairOrder/queryById", + getEquipmentList:'eam/equipment/list', + // getEquipmentList: "eam/equipment/asyncLoadEquipment", + approval: '/eam/eamRepairOrder/perform' + }, + id: '', + taskId: '', + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msg1Count: 0, + msg2Count: 0, + msg1Title: "", + procInstId: '', + values: '', + isShow: true + + } + }, + computed: { + top() { + return this.CustomBar * 2 + 160 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + 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 + }, + created() { + this.getEquipment(); + this.upCallback(); + }, + + methods: { + changeisSpareList(e) { + this.formData.isSpare = e; + if (e == 0) { + this.isShow = true; + } else if (e == 1) { + this.isShow = false; + } + }, + ProductionTask() { + if (this.formData.reportStatus == 'WAIT_SPARES') { + if (this.ScanData.sparePartDescription == undefined || this.ScanData.sparePartDescription == null || + this + .ScanData.sparePartDescription == + '') { + + uni.showToast({ + icon: 'none', + title: '澶囦欢鎻忚堪涓嶈兘涓虹┖' + }); + return false; + } + } + if (this.formData.reportStatus == 'UNDER_REPAIR') { + + 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 == + '') { + + uni.showToast({ + icon: 'none', + title: '缁翠慨缁撴灉涓嶈兘涓虹┖' + }); + return false; + } + + } + + + 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, + instanceId: this.procInstId, + isUseSpare: this.formData.isSpare, + repairDescription: this.formData.repairDescription, + taskId: this.taskId + }).then(res => { + console.log(res) + this.$tip.loaded(); + if (res.data.success) { + uni.showToast({ + icon: "success", + title: '鎻愪氦鎴愬姛', + duration: 2000 + }); + // this.$Router.replace({ + // name: 'ToDoList' + // }) + this.$Router.replaceAll({ + name: 'ToDoList' + }) + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: res.data.message, + duration: 2000 + }); + }); + }, + + changeEquipmentList(e) { + this.formData.num = e; + }, + handleCode(e, index) { + console.log(index); + // 鏍规嵁 e 鐨勫�兼潵鍒ゆ柇鏄惁闇�瑕佹洿鏂� isTrue 鐨勭姸鎬� + if (e === 2) { + this.partTakeAdviceDetailList[index].istrue = false; + + } else { + this.partTakeAdviceDetailList[index].istrue = true; + } + }, + 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 + }); + + } + }).catch(() => { + 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, { + params: { + id: this.id + }, + + }).then(res => { + this.announcement1 = res.data.result + console.log("url", res.data.result.reportStatus) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + this.formData.reportStatus = this.announcement1.reportStatus + + 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 = '鏄惁闇�瑕侀鐢ㄥ浠�'; + } + + 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; + this.isUNDERREPAIR = true; + + } else { + this.title = '鎿嶄綔宸ョ‘璁�'; + this.isUNDERREPAIR = true; + this.isShowUNDEREPAIR = true; + this.isRuning=true; + this.isShowRepari=true; + this.isRepari=true; + this.isSHowBtn=false; + } + + + + + + + } + this.formData.num = this.announcement1.equipmentId + this.formData.repairCode = this.announcement1.repairCode + this.formData.repairer = this.announcement1.repairer + this.formData.faultStartTime = this.announcement1.faultStartTime + this.formData.remark = this.announcement1.remark + this.formData.repairDescription = this.announcement1.repairDescription + this.formData.faultReason = this.announcement1.faultReason + this.formData.isSpare = this.announcement1.isUseSpare + if (this.formData.isSpare == 1) { + this.isShow = false; + } else if (this.formData.isSpare == 0) { + 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}`; + }) + } + + + + + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + + + + /* 妫�绱� */ + getSera(res) { + this.msgList = []; + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + equipmentCode: res + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + } + }, + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/baoZhou/baoZhou.vue b/pages/baoZhou/baoZhou.vue new file mode 100644 index 0000000..87e81cb --- /dev/null +++ b/pages/baoZhou/baoZhou.vue @@ -0,0 +1,394 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">鍛ㄤ繚</block> + </cu-custom> + + <view style="width: 100%;"> + <uni-popup ref="popup" background-color="#fff" :type="type"> + <view class="popupView"> + <!-- 鍩虹琛ㄥ崟鏍¢獙 --> + <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> + <uni-group title="" top="0"> + <uni-forms-item name="numbers" label="棰嗘枡鐢宠鍗曞彿:"> + <uni-easyinput type="text" v-model="formData.num" placeholder="璇疯緭鍏ラ鏂欑敵璇峰崟鍙锋绱�" /> + </uni-forms-item> + <uni-forms-item name="name" label="棰嗘枡浜у搧:"> + <uni-easyinput v-model="formData.partNumNameModel" placeholder="璇疯緭鍏ラ鏂欎骇鍝�" /> + </uni-forms-item> + </uni-group> + </uni-forms> + <view class="flex"> + + <view + class="cuIcon-search flex-sub bg-blue padding-sm margin-xs margin-left-lg margin-right-lg text-sm text-center" + @click="getSera">鏌ヨ + </view> + <view + class="cuIcon-refresh flex-sub bg-white solids padding-sm margin-xs radius text-sm text-center margin-left-lg margin-right-lg" + @click="resetTask">閲嶇疆</view> + </view> + + </view> + </uni-popup> + </view> + + <view class="container"> + + <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback"> + <!-- 鍒楄〃淇℃伅寮�濮� --> + <view class="content"> + <uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index" + @click="onClickProductionTask(item)"> + <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 text-bold radius text-right"> + {{item.orderNum}} + </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"> + {{item.equipmentCode}} + </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 text-blue radius text-right"> + {{item.maintenanceDate}} + </view> + </view> + <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鎿嶄綔:</view> + <view class="flex-sub bg-blue padding-xs margin-xs radius text-sm text-center" + @click.stop="handleStartWork(item)" hover-class="is-hover">棰嗗彇</view> + + </view> + + + </uni-card> + </view> + + </mescroll-uni> + </view> + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + type: 'top', + scrollLeft: 0, + formData: { + num: '', + partNumNameModel: '' + }, + NavBarColor: this.NavBarColor, + activeColor: '#5277A6', + url: { + + stallList: "/eam/weekMaintenanceOrder/list", + collect: "eam/weekMaintenanceOrder/collect" + }, + + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msgList: [], //鍒楄〃鏁版嵁 + announcement1: [], + msg1Count: 0, + msg2Count: 0, + msg1Title: "" + } + }, + computed: { + top() { + return this.CustomBar * 2 + 50 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + + + onShow() { + if (this.mescroll) { + this.mescroll.resetUpScroll() + } + }, + + created() {}, + methods: { + /** + * 棰嗗彇 + */ + handleStartWork(item) { + + this.$tip.loading(); + this.$http.get(this.url.collect, { + params: { + id: item.id, + }, + }).then(res => { + console.log(res) + this.$tip.loaded(); + if (res.data.success) { + uni.showToast({ + icon: "success", + title: '棰嗗彇鎴愬姛', + duration: 2000 + }); + this.mescroll.resetUpScroll() + } else { + uni.showModal({ + title: "鎻愮ず", + content: res.data.message, + confirmText: '纭畾', + showCancel: false, + }) + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: '棰嗗彇澶辫触', + duration: 2000 + }); + }); + }, + /** + * @param {Object} item + * 璇︽儏椤甸潰 + */ + onClickProductionTask(item) { + + uni.navigateTo({ + url: '/pages/baoZhou/baoZhouDetils/baoZhouDetils?item=' + + encodeURIComponent(JSON.stringify(item)) + }) + }, + + search() { + this.$refs.popup.open(); + }, + upCallback(page) { + this.$http.get(this.url.stallList, { + params: { + pageNo: page.num, + pageSize: page.size, + order: 'desc', + column: 'createTime', + maintenanceStatus: 'WAIT_MAINTENANCE' + }, + + }).then(res => { + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + }, + + + resetTask() { + this.formData.num = '' + this.formData.partNumNameModel = '' + this.$refs.popup.close(); + this.mescroll.resetUpScroll() + + }, + /* 妫�绱� */ + getSera() { + this.$refs.popup.close(); + let keyword = this.TabCur + this.msgList = []; + + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*', + status: 'published' + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } else if (keyword == 1) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + status: 'training', + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*' + + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg2Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } else if (keyword == 2) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + status: 'completed', + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*' + + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg3Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } + + + + + + }, + + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/baoZhou/baoZhouDetils/baoZhouDetils.vue b/pages/baoZhou/baoZhouDetils/baoZhouDetils.vue new file mode 100644 index 0000000..b0b24c6 --- /dev/null +++ b/pages/baoZhou/baoZhouDetils/baoZhouDetils.vue @@ -0,0 +1,417 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</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> + <uni-forms-item name="num" :label-width="80" label="宸ュ崟鍙�:"> + <uni-easyinput v-model="formData.orderNum" :disabled="true" /> + </uni-forms-item> + <uni-forms-item required name="num" :label-width="80" label="璁惧缂栧彿:"> + <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" + placeholder="璇烽�夋嫨" :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-easyinput v-model="formData.operator_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="outNum" :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="淇濆吇鍥剧墖:"> + <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-forms-item> + </uni-group> + </uni-forms> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 淇濆吇椤逛俊鎭� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <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> + <view class="flex-sub bg-white padding-xs margin-xs radius text-right">{{index+1}} + </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 text-bold radius text-right"> + {{item.itemName}} + </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.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> + + <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">淇濆吇缁撴灉:</view> + <uni-data-select :localdata="restle" v-model="item.maintenanceResult" @change="handleCode()" + :clear="true" :disabled="true" /> + + </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-easyinput v-model="item.exceptionDescription" :disabled="true" /> + </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" v-model="item.reportFlag" :disabled="true" /> + </view> + </view> + </uni-card> + + + </view> + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + import configService from '@/common/service/config.service.js'; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + ipAndPort:configService.staticURL, + scrollLeft: 0, + searchValue: '', + imgList: [], + equipmentList: [], + restle: [], + uploadUrl: "/sys/common/upload", + formData: { + num: '', + avatar:[], + remark: '', + inspectionDate: '', + }, + partTakeAdviceDetailList: [], + NavBarColor: this.NavBarColor, + url: { + upload: "/eam/sysFiles/batch_upload", + stallList: "/eam/weekMaintenanceOrder/queryById", + getEquipmentList:'eam/equipment/list', + // getEquipmentList: "eam/equipment/asyncLoadEquipment", + BaoList: '/eam/weekMaintenanceOrderDetail/queryList' + }, + id: '', + inspectionResult: '', + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msg1Count: 0, + msg2Count: 0, + msg1Title: "" + } + }, + computed: { + top() { + return this.CustomBar * 2 + 50 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + onLoad(options) { + const annItem = JSON.parse(decodeURIComponent(options.item)); + this.id = annItem.id + }, + created() { + this.upCallback(); + this.getEquipment(); + this.getList(); + + }, + methods: { + changeEquipmentList(e) { + this.formData.num = e; + }, + handleCode(e) { + this.inspectionResult = e; + }, + // 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 + // }); + + // } + // }).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: { + orderId: this.id + }, + + }).then(res => { + this.partTakeAdviceDetailList = res.data.result + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data.result) + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + 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]; + // 杩藉姞鍒� formData.avatar 涓紝骞剁敤閫楀彿鍒嗛殧 + 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('鍥剧墖涓婁紶澶辫触'); + }); + } + }); + }, + 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) + } + } + }) + }, + + 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}`; + }); + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + + + + /* 妫�绱� */ + getSera(res) { + this.msgList = []; + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + equipmentCode: res + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + } + }, + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/checkList/checkList.vue b/pages/checkList/checkList.vue new file mode 100644 index 0000000..5b30de1 --- /dev/null +++ b/pages/checkList/checkList.vue @@ -0,0 +1,402 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">鐐规鍒楄〃</block> + </cu-custom> + + <view style="width: 100%;"> + <uni-popup ref="popup" background-color="#fff" :type="type"> + <view class="popupView"> + <!-- 鍩虹琛ㄥ崟鏍¢獙 --> + <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> + <uni-group title="" top="0"> + <uni-forms-item name="numbers" label="棰嗘枡鐢宠鍗曞彿:"> + <uni-easyinput type="text" v-model="formData.num" placeholder="璇疯緭鍏ラ鏂欑敵璇峰崟鍙锋绱�" /> + </uni-forms-item> + <uni-forms-item name="name" label="棰嗘枡浜у搧:"> + <uni-easyinput v-model="formData.partNumNameModel" placeholder="璇疯緭鍏ラ鏂欎骇鍝�" /> + </uni-forms-item> + </uni-group> + </uni-forms> + <view class="flex"> + + <view + class="cuIcon-search flex-sub bg-blue padding-sm margin-xs margin-left-lg margin-right-lg text-sm text-center" + @click="getSera">鏌ヨ + </view> + <view + class="cuIcon-refresh flex-sub bg-white solids padding-sm margin-xs radius text-sm text-center margin-left-lg margin-right-lg" + @click="resetTask">閲嶇疆</view> + </view> + + </view> + </uni-popup> + </view> + + <view class="container"> + + <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback"> + <!-- 鍒楄〃淇℃伅寮�濮� --> + <view class="content"> + <uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index" + @click="onClickProductionTask(item)"> + <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 text-bold radius text-right"> + {{item.orderNum}} + </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"> + {{item.equipmentCode}} + </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 text-blue radius text-right"> + {{item.inspectionDate}} + </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 text-blue radius text-right"> + {{item.expirationTime}} + </view> + </view> + + + <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鎿嶄綔:</view> + <view class="flex-sub bg-blue padding-xs margin-xs radius text-sm text-center" + @click.stop="handleStartWork(item)" hover-class="is-hover">棰嗗彇</view> + + </view> + </uni-card> + </view> + + </mescroll-uni> + </view> + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + type: 'top', + scrollLeft: 0, + formData: { + num: '', + partNumNameModel: '' + }, + NavBarColor: this.NavBarColor, + activeColor: '#5277A6', + url: { + stallList: "eam/eamInspectionOrder/list", + receive: "eam/eamInspectionOrder/receiveInspectionOrder" + }, + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msgList: [], //鍒楄〃鏁版嵁 + announcement1: [], + msg1Count: 0, + msg2Count: 0, + msg1Title: "" + } + }, + computed: { + top() { + return this.CustomBar * 2 + 50 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + + + onShow() { + if (this.mescroll) { + this.mescroll.resetUpScroll() + } + }, + + created() {}, + methods: { + /** + * 棰嗗彇 + */ + handleStartWork(item) { + + this.$tip.loading(); + this.$http.get(this.url.receive, { + params: { + id: item.id, + }, + }).then(res => { + console.log(res) + this.$tip.loaded(); + if (res.data.success) { + uni.showToast({ + icon: "success", + title: '棰嗗彇鎴愬姛', + duration: 2000 + }); + this.mescroll.resetUpScroll() + } else { + uni.showModal({ + title: "鎻愮ず", + content: res.data.message, + confirmText: '纭畾', + showCancel: false, + }) + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: '棰嗗彇澶辫触', + duration: 2000 + }); + }); + }, + /** + * @param {Object} item + * 璇︽儏椤甸潰 + */ + onClickProductionTask(item) { + + uni.navigateTo({ + url: '/pages/checkList/checkListDetils/checkListDetils?item=' + + encodeURIComponent(JSON.stringify(item)) + + }) + + }, + + search() { + this.$refs.popup.open(); + }, + + + upCallback(page) { + this.$http.get(this.url.stallList, { + params: { + pageNo: page.num, + pageSize: page.size, + order: 'desc', + column: 'createTime', + inspectionStatus: 'WAIT_INSPECTION' + }, + + }).then(res => { + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + }, + + + resetTask() { + this.formData.num = '' + this.formData.partNumNameModel = '' + this.$refs.popup.close(); + this.mescroll.resetUpScroll() + + }, + /* 妫�绱� */ + getSera() { + this.$refs.popup.close(); + let keyword = this.TabCur + this.msgList = []; + + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*', + status: 'published' + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } else if (keyword == 1) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + status: 'training', + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*' + + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg2Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } else if (keyword == 2) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + status: 'completed', + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*' + + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg3Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } + + + + + + }, + + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/checkList/checkListDetils/checkListDetils.vue b/pages/checkList/checkListDetils/checkListDetils.vue new file mode 100644 index 0000000..fc70d2c --- /dev/null +++ b/pages/checkList/checkListDetils/checkListDetils.vue @@ -0,0 +1,407 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</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> + <uni-forms-item name="num" :label-width="80" label="宸ュ崟鍙�:"> + <uni-easyinput v-model="formData.orderNum" :disabled="true" /> + </uni-forms-item> + <uni-forms-item required name="num" :label-width="80" label="璁惧缂栧彿:"> + <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" + placeholder="璇烽�夋嫨" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="inspectionDate" :label-width="80" label="鐐规鏃ユ湡:"> + <uni-easyinput v-model="formData.inspectionDate" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="outNum" :label-width="80" label="鐐规浜�:"> + <uni-easyinput v-model="formData.operator" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="outNum" :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="鐐规鍥剧墖:"> + <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-forms-item> + </uni-group> + </uni-forms> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 淇濆吇椤逛俊鎭� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <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> + <view class="flex-sub bg-white padding-xs margin-xs radius text-right">{{index+1}} + </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 text-bold radius text-right"> + {{item.itemName}} + </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> + + <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鐐规缁撴灉:</view> + <uni-data-select :localdata="restle" v-model="item.inspectionResult" @change="handleCode()" + :clear="true" :disabled="true" /> + </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-easyinput v-model="item.exceptionDescription" :disabled="true" /> + </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" v-model="item.reportFlag" :disabled="true" /> + </view> + </view> + </uni-card> + + + </view> + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + import configService from '@/common/service/config.service.js'; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + ipAndPort: configService.staticURL, + scrollLeft: 0, + searchValue: '', + imgList: [], + equipmentList: [], + restle: [], + uploadUrl: "/sys/common/upload", + formData: { + num: '', + avatar: [], + remark: '', + inspectionDate: '', + }, + partTakeAdviceDetailList: [], + NavBarColor: this.NavBarColor, + url: { + upload: "/eam/sysFiles/batch_upload", + stallList: "/eam/eamInspectionOrder/queryById", + getEquipmentList:'eam/equipment/list', + // getEquipmentList: "eam/equipment/asyncLoadEquipment", + BaoList: 'eam/eamInspectionOrderDetail/queryList' + }, + id: '', + inspectionResult: '', + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msg1Count: 0, + msg2Count: 0, + msg1Title: "" + } + }, + computed: { + top() { + return this.CustomBar * 2 + 50 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + onLoad(options) { + const annItem = JSON.parse(decodeURIComponent(options.item)); + this.id = annItem.id + }, + created() { + this.upCallback(); + this.getEquipment(); + this.getList(); + + }, + methods: { + changeEquipmentList(e) { + this.formData.num = e; + }, + 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).then(res => { + // //璁剧疆鍒楄〃鏁版嵁 + // if (res.data.success) { + // this.equipmentList = res.data.result + // } else { + // uni.showToast({ + // icon: "error", + // title: res.data.message, + // duration: 2000 + // }); + + // } + // }).catch(() => { + // this.$tip.error("鑱旂綉澶辫触") + // }) + // }, + getList() { + this.$http.get(this.url.BaoList, { + params: { + orderId: this.id + }, + + }).then(res => { + this.partTakeAdviceDetailList = res.data.result + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data.result) + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + ChooseImage() { + var that = this; + uni.chooseImage({ + count: 4, + sizeType: ['original', 'compressed'], // 鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� + sourceType: ['album'], // 浠庣浉鍐岄�夋嫨 + success: (res) => { + // 瀛樺偍閫夋嫨鐨勫浘鐗囪矾寰� + that.imgList = res.tempFilePaths; + 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]; + // 杩藉姞鍒� formData.avatar 涓紝骞剁敤閫楀彿鍒嗛殧 + 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('鍥剧墖涓婁紶澶辫触'); + }); + } + }); + }, + 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) + } + } + }) + }, + + 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) { + + this.formData.num = this.announcement1.equipmentId + this.formData.orderNum = this.announcement1.orderNum + this.formData.operator = this.announcement1.operator + this.formData.remark=this.announcement1.remark + this.formData.inspectionDate = this.announcement1.inspectionDate + this.formData.avatar = this.announcement1.imageFiles + if(!this.formData.avatar == null){ + this.imgList = JSON.parse(this.formData.avatar) + const imageObjects = JSON.parse(this.formData.avatar);a + // 鎻愬彇 filePath 骞舵嫾鎺� IP 鍜岀鍙� + this.imgList = imageObjects.map(imageObj => { + return `${this.ipAndPort}${imageObj.filePath}`; + }); + } + + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + + + + /* 妫�绱� */ + getSera(res) { + this.msgList = []; + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + equipmentCode: res + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + } + }, + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/device/device.vue b/pages/device/device.vue index e76021f..55df6ab 100644 --- a/pages/device/device.vue +++ b/pages/device/device.vue @@ -1,13 +1,12 @@ <template> <view class="container"> - <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> - <block slot="backText">杩斿洖</block> + <cu-custom :bgColor="NavBarColor"> <block slot="content">璁惧</block> </cu-custom> <view class="container"> - <uni-search-bar @confirm="search" :focus="true" v-model="searchValue" @blur="blur" @focus="focus" - @input="input" @cancel="cancel" @clear="clear"> + <uni-search-bar @confirm="search" :focus="true" v-model="searchValue" placeholder="璇烽�氳繃鍚嶇О妫�绱�" + @input="input" @cancel="cancel()" cancelButton="always"> </uni-search-bar> <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback"> <!-- 鍒楄〃淇℃伅寮�濮� --> @@ -33,31 +32,6 @@ {{item.assetStatus_dictText}} </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 text-orange radius text-right"> - {{item.maintenanceStatus_dictText}} - </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"> - {{item.orgId_dictText}} - </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"> - {{item.equipmentManager_dictText}} - </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 text-bold radius text-right"> - {{item.equipmentCategory_dictText}} - </view> - </view> --> </uni-card> </view> @@ -72,6 +46,7 @@ mixins: [MescrollMixin], // 浣跨敤mixin data() { return { + scrollLeft: 0, searchValue: '', formData: { @@ -106,7 +81,8 @@ announcement1: [], msg1Count: 0, msg2Count: 0, - msg1Title: "" + msg1Title: "", + name: '' } }, computed: { @@ -134,15 +110,20 @@ }, created() {}, methods: { + + cancel() { + + this.mescroll.resetUpScroll() + }, search(res) { - console.log(res) - this.getSera(res) + this.name = res + this.getSera() }, /** * @param {Object} item * 璇︽儏椤甸潰 */ - + onClickProductionTask(item) { uni.navigateTo({ url: '/pages/device/deviceDeils/deviceDeils?item=' + encodeURIComponent(JSON.stringify(item)) @@ -187,40 +168,40 @@ /* 妫�绱� */ getSera(res) { this.msgList = []; - if (keyword == 0) { - this.$http.get(this.url.stallList, { - params: { - pageNo: 1, - pageSize: 999, - order: "desc", - column: "createTime", - equipmentCode: res - } - }).then(res => { - //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; - this.announcement1 = res.data.result.records - this.mescroll.endSuccess(this.announcement1.length); - console.log("url", res) - //璁剧疆鍒楄〃鏁版嵁 - if (res.data.success) { - console.log("res", res.data) - this.msg1Count = res.data.result.total - this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; - for (let annItem of this.announcement1) { - this.msgList.push(annItem) - } - } - if (page.num == 1) { - this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 - this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� - } + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + equipmentCode: this.name.value + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; - }).catch(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - this.mescroll.endErr(); - }) - } + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + }, mescrollInit(mescroll) { diff --git a/pages/device/deviceDeils/deviceDeils.vue b/pages/device/deviceDeils/deviceDeils.vue index de81e47..dd2793f 100644 --- a/pages/device/deviceDeils/deviceDeils.vue +++ b/pages/device/deviceDeils/deviceDeils.vue @@ -10,47 +10,53 @@ <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> <uni-group top="1"> - <uni-forms-item name="num" label="璁惧鍥剧墖:"> - <image style="height: 100px; width: 300px;" :src="formData.equipmentImagel?formData.equipmentImage:'/static/zhanwei.png'"></image> - </uni-forms-item> - <uni-forms-item required name="num" label="璁惧缂栧彿:"> - <uni-easyinput v-model="formData.equipmentCode" :disabled="true" /> - </uni-forms-item> - - <uni-forms-item name="remark" label="璁惧鍚嶇О:"> - <uni-easyinput v-model="formData.equipmentName" :disabled="true" /> - </uni-forms-item> - <uni-forms-item name="remark" label="璁惧鍨嬪彿:"> - <uni-easyinput v-model="formData.equipmentModel" :disabled="true" /> - </uni-forms-item> - <uni-forms-item name="outNum" label="璁惧瑙勬牸:"> - <uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" /> - </uni-forms-item> - <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鍩烘湰淇℃伅 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> - <uni-forms-item name="taskCode" label="璁惧鍒嗙被:"> - <uni-easyinput :disabled="true" v-model="formData.equipmentCategory"/> - </uni-forms-item> - <uni-forms-item name="endLocation" label="鍑哄巶鏃ユ湡:"> - <uni-easyinput :disabled="true" v-model="formData.leaveFactoryDate" /> - - </uni-forms-item> - <uni-forms-item name="endLocation" label="楠屾敹鏃ユ湡:"> - <uni-easyinput :disabled="true" v-model="formData.acceptanceCheckDate" /> - - </uni-forms-item> - - <uni-forms-item name="endLocation" label="瀹夎浣嶇疆:"> - <uni-easyinput :disabled="true" v-model="formData.installationPosition" /> - </uni-forms-item> - <uni-forms-item name="endLocation" label="璧勪骇鐘舵��:"> - <uni-easyinput :disabled="true" v-model="formData.assetStatus" /> - </uni-forms-item> - <uni-forms-item name="endLocation" label="璁惧绠$悊鍛�:"> - <uni-easyinput :disabled="true" v-model="formData.equipmentManager" /> - </uni-forms-item> - + <uni-forms-item :label-width="100" required name="num" label="璁惧缂栧彿:"> + <uni-easyinput v-model="formData.equipmentCode" :disabled="true" /> + </uni-forms-item> + + <uni-forms-item :label-width="100" name="remark" label="璁惧鍚嶇О:"> + <uni-easyinput v-model="formData.equipmentName" :disabled="true" /> + </uni-forms-item> + <!-- <uni-forms-item :label-width="100" name="outNum" label="鍏抽敭璁惧鏍囪瘑:"> + <uni-easyinput v-model="formData.equipmentImportance" :disabled="true" /> + </uni-forms-item> --> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鍩烘湰淇℃伅 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <uni-forms-item :label-width="100" name="taskCode" label="缁翠慨鐘舵��:"> + <uni-easyinput :disabled="true" v-model="formData.repairStatus_dictText" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="淇濆吇鐘舵��:"> + <uni-easyinput :disabled="true" v-model="formData.maintenanceStatus_dictText" /> + + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="浣跨敤杞﹂棿:"> + <uni-easyinput :disabled="true" v-model="formData.orgId_dictText" /> + + </uni-forms-item> + + <uni-forms-item :label-width="100" name="endLocation" label="瀹夎浣嶇疆:"> + <uni-easyinput :disabled="true" v-model="formData.installationPosition" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="鎶�鏈姸鎬�:"> + <uni-easyinput :disabled="true" v-model="formData.technologyStatus_dictText" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="璁惧绠$悊鍛�:"> + <uni-easyinput :disabled="true" v-model="formData.equipmentManager_dictText" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="鍑哄巶鏃ユ湡:"> + <uni-easyinput :disabled="true" v-model="formData.leaveFactoryDate" /> + </uni-forms-item> </uni-group> </uni-forms> + <view class="flex margin-bottom-xs"> + <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" + @click="goReportRepair()">鎶ヤ慨</button> + <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" + @click="goCheck()">鐐规</button> + <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" + @click="goBaoZhou()">鍛ㄤ繚</button> + <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" + @click="goMaintenance()">缁翠慨</button> + </view> </view> </view> </template> @@ -117,6 +123,44 @@ this.upCallback() }, methods: { + goHome() { + uni.reLaunch({ + url: '/pages/index/index' + }) + }, + /** + * 鎶ヤ慨 + */ + goReportRepair() { + console.log('getSera 鏂规硶琚皟鐢�'); + uni.navigateTo({ + url: `/pages/reportRepair/reportRepair?equipmentId=${encodeURIComponent(this.id)}`, + }); + }, + /** + * 鐐规 + */ + goCheck() { + uni.navigateTo({ + url: '/pages/checkList/checkList', + }); + }, + /** + * 鍛ㄤ繚 + */ + goBaoZhou() { + uni.navigateTo({ + url: '/pages/baoZhou/baoZhou', + }); + }, + /** + * 缁翠慨 + */ + goMaintenance() { + uni.navigateTo({ + url: '/pages/maintenanceReport/maintenanceReport', + }); + }, upCallback() { this.$http.get(this.url.stallList, { params: { diff --git a/pages/device/deviceWebDeils/deviceWebDeils.vue b/pages/device/deviceWebDeils/deviceWebDeils.vue index b2519bf..0a52107 100644 --- a/pages/device/deviceWebDeils/deviceWebDeils.vue +++ b/pages/device/deviceWebDeils/deviceWebDeils.vue @@ -2,72 +2,65 @@ <view class="container"> <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> <block slot="backText">杩斿洖</block> - <!-- <cu-custom :bgColor="NavBarColor" backRouterName="index"> - <block slot="right"> - <view @tap="$debounce(BackPage)"> - <view class="cuIcon-back back">杩斿洖</view> - </view> - </block> --> <block slot="content">璁惧璇︽儏</block> + <block slot="right"> + <view @click="goHome"> + <image class="search" src="/static/icon/icon_home.png" style="width: 25px; height: 25px;" alt="" /> + </view> + </block> </cu-custom> <view class="container"> <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> <uni-group top="1"> - - <uni-forms-item name="num" label="璁惧鍥剧墖:"> - <image style="height: 100px; width: 300px;" - :src="formData.equipmentImagel?formData.equipmentImage:'/static/zhanwei.png'"></image> - </uni-forms-item> - <uni-forms-item required name="num" label="璁惧缂栧彿:"> - <uni-easyinput v-model="formData.equipmentCode" :disabled="true" /> - </uni-forms-item> - - <uni-forms-item name="remark" label="璁惧鍚嶇О:"> - <uni-easyinput v-model="formData.equipmentName" :disabled="true" /> - </uni-forms-item> - <uni-forms-item name="remark" label="璁惧鍨嬪彿:"> - <uni-easyinput v-model="formData.equipmentModel" :disabled="true" /> - </uni-forms-item> - <uni-forms-item name="outNum" label="璁惧瑙勬牸:"> - <uni-easyinput v-model="formData.equipmentSpecification" :disabled="true" /> - </uni-forms-item> - <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鍩烘湰淇℃伅 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> - <uni-forms-item name="taskCode" label="璁惧鍒嗙被:"> - <uni-easyinput :disabled="true" v-model="formData.equipmentCategory" /> - </uni-forms-item> - <uni-forms-item name="endLocation" label="鍑哄巶鏃ユ湡:"> - <uni-easyinput :disabled="true" v-model="formData.leaveFactoryDate" /> - - </uni-forms-item> - <uni-forms-item name="endLocation" label="楠屾敹鏃ユ湡:"> - <uni-easyinput :disabled="true" v-model="formData.acceptanceCheckDate" /> - - </uni-forms-item> - - <uni-forms-item name="endLocation" label="瀹夎浣嶇疆:"> - <uni-easyinput :disabled="true" v-model="formData.installationPosition" /> - </uni-forms-item> - <uni-forms-item name="endLocation" label="璧勪骇鐘舵��:"> - <uni-easyinput :disabled="true" v-model="formData.assetStatus" /> - </uni-forms-item> - <uni-forms-item name="endLocation" label="璁惧绠$悊鍛�:"> - <uni-easyinput :disabled="true" v-model="formData.equipmentManager" /> - </uni-forms-item> - + + <uni-forms-item :label-width="100" required name="num" label="璁惧缂栧彿:"> + <uni-easyinput v-model="formData.equipmentCode" :disabled="true" /> + </uni-forms-item> + + <uni-forms-item :label-width="100" name="remark" label="璁惧鍚嶇О:"> + <uni-easyinput v-model="formData.equipmentName" :disabled="true" /> + </uni-forms-item> + <!-- <uni-forms-item :label-width="100" name="outNum" label="鍏抽敭璁惧鏍囪瘑:"> + <uni-easyinput v-model="formData.equipmentImportance" :disabled="true" /> + </uni-forms-item> --> + <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 鍩烘湰淇℃伅 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> + <uni-forms-item :label-width="100" name="taskCode" label="缁翠慨鐘舵��:"> + <uni-easyinput :disabled="true" v-model="formData.repairStatus_dictText" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="淇濆吇鐘舵��:"> + <uni-easyinput :disabled="true" v-model="formData.maintenanceStatus_dictText" /> + + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="浣跨敤杞﹂棿:"> + <uni-easyinput :disabled="true" v-model="formData.orgId_dictText" /> + + </uni-forms-item> + + <uni-forms-item :label-width="100" name="endLocation" label="瀹夎浣嶇疆:"> + <uni-easyinput :disabled="true" v-model="formData.installationPosition" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="鎶�鏈姸鎬�:"> + <uni-easyinput :disabled="true" v-model="formData.technologyStatus_dictText" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="璁惧绠$悊鍛�:"> + <uni-easyinput :disabled="true" v-model="formData.equipmentManager_dictText" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="endLocation" label="鍑哄巶鏃ユ湡:"> + <uni-easyinput :disabled="true" v-model="formData.leaveFactoryDate" /> + </uni-forms-item> </uni-group> </uni-forms> - - <view class="flex"> - <button class="flex-sub cu-btn bg-blue margin-sm padding-sm lg" hover-class="is-hover" - @click="getSera()">鐐规</button> - <button class="flex-sub cu-btn bg-blue margin-sm padding-sm lg" hover-class="is-hover" - @click="resetTask">淇濆吇</button> - <button class="flex-sub cu-btn bg-blue margin-sm padding-sm lg" hover-class="is-hover" - @click="resetTask">缁翠慨</button> - <button class="flex-sub cu-btn bg-blue margin-sm padding-sm lg" hover-class="is-hover" - @click="resetTask">鍛ㄥ吇</button> + <view class="flex margin-bottom-xs"> + <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" + @click="goReportRepair()">鎶ヤ慨</button> + <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" + @click="goCheck()">鐐规</button> + <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" + @click="goBaoZhou()">鍛ㄤ繚</button> + <button class="flex-sub cu-btn bg-blue margin-sm lg" hover-class="is-hover" + @click="goMaintenance()">缁翠慨</button> </view> </view> </view> @@ -164,41 +157,74 @@ }, created() {}, methods: { - getSera() { + + goHome() { + uni.reLaunch({ + url: '/pages/index/index' + }) + }, + /** + * 鎶ヤ慨 + */ + goReportRepair() { console.log('getSera 鏂规硶琚皟鐢�'); uni.navigateTo({ - url: '/pages/TaskManager/TaskManagerList' + url: `/pages/reportRepair/reportRepair?equipmentId=${encodeURIComponent(this.id)}`, }); }, - upCallback() { - console.log("id", this.id) - this.$http.get(this.url.stallList, { - params: { - pageNo: 999, - pageSize: 1, - order: 'asc', - column: 'createTime', - id: this.id - }, + /** + * 鐐规 + */ + goCheck() { + uni.navigateTo({ + url: '/pages/checkList/checkList', + }); + }, + /** + * 鍛ㄤ繚 + */ + goBaoZhou() { + uni.navigateTo({ + url: '/pages/baoZhou/baoZhou', + }); + }, + /** + * 鍛ㄤ繚 + */ + goMaintenance() { + uni.navigateTo({ + url: '/pages/maintenanceReport/maintenanceReport', + }); + }, + upCallback() { + console.log("id", this.id) + this.$http.get(this.url.stallList, { + params: { + pageNo: 999, + pageSize: 1, + order: 'asc', + column: 'createTime', + 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 = this.announcement1 - } - }).catch(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - }) - }, + }).then(res => { + this.announcement1 = res.data.result + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data.result.equipmentCode) + this.formData = this.announcement1 + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, - mescrollInit(mescroll) { - console.log('mescrollInit') - this.mescroll = mescroll; + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, }, - }, } </script> diff --git a/pages/maintenanceReport/maintenanceReport.vue b/pages/maintenanceReport/maintenanceReport.vue new file mode 100644 index 0000000..6508047 --- /dev/null +++ b/pages/maintenanceReport/maintenanceReport.vue @@ -0,0 +1,419 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">缁翠慨</block> + </cu-custom> + + <view style="width: 100%;"> + <uni-popup ref="popup" background-color="#fff" :type="type"> + <view class="popupView"> + <!-- 鍩虹琛ㄥ崟鏍¢獙 --> + <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> + <uni-group title="" top="0"> + <uni-forms-item name="numbers" label="棰嗘枡鐢宠鍗曞彿:"> + <uni-easyinput type="text" v-model="formData.num" placeholder="璇疯緭鍏ラ鏂欑敵璇峰崟鍙锋绱�" /> + </uni-forms-item> + <uni-forms-item name="name" label="棰嗘枡浜у搧:"> + <uni-easyinput v-model="formData.partNumNameModel" placeholder="璇疯緭鍏ラ鏂欎骇鍝�" /> + </uni-forms-item> + </uni-group> + </uni-forms> + <view class="flex"> + + <view + class="cuIcon-search flex-sub bg-blue padding-sm margin-xs margin-left-lg margin-right-lg text-sm text-center" + @click="getSera">鏌ヨ + </view> + <view + class="cuIcon-refresh flex-sub bg-white solids padding-sm margin-xs radius text-sm text-center margin-left-lg margin-right-lg" + @click="resetTask">閲嶇疆</view> + </view> + + </view> + </uni-popup> + </view> + <view class="container"> + <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback"> + <!-- 鍒楄〃淇℃伅寮�濮� --> + <view class="content"> + <uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index" + @click="onClickProductionTask(item)"> + + + <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 text-bold radius text-right"> + {{item.equipmentId_dictText}} + </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"> + {{item.faultName}} + </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 text-blue radius text-right"> + {{item.faultStartTime}} + </view> + </view> + + + <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鎿嶄綔:</view> + <view class="flex-sub bg-blue padding-xs margin-xs radius text-sm text-center" + @click.stop="handleStartWork(item)" hover-class="is-hover">棰嗗彇</view> + + </view> + </uni-card> + </view> + + </mescroll-uni> + </view> + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + type: 'top', + scrollLeft: 0, + formData: { + num: '', + partNumNameModel: '' + }, + NavBarColor: this.NavBarColor, + activeColor: '#5277A6', + url: { + stallList: "/eam/eamReportRepair/list", + add:'/eam/eamRepairOrder/add' + }, + + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msgList: [], //鍒楄〃鏁版嵁 + announcement1: [], + msg1Count: 0, + msg2Count: 0, + msg1Title: "" + } + }, + computed: { + top() { + return this.CustomBar * 2 + 50 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + + + onShow() { + if (this.mescroll) { + this.mescroll.resetUpScroll() + } + }, + + created() {}, + methods: { + + /** + * 棰嗗彇 + */ + handleStartWork(item) { + + this.$tip.loading(); + this.$http.post(this.url.add, { + + actualEndTime: item.actualEndTime, + actualStartTime: item.actualStartTime, + createBy: item.actualStartTime, + createTime: item.createTime, + delFlag: item.delFlag, + equipmentId:item.equipmentId, + equipmentName: item.equipmentName, + faultReason:item.faultReason, + id: item.faultReason, + imageFiles:item.imageFiles, + imageFilesResult:null, + outsourcedEndTime:item.outsourcedEndTime, + outsourcedFlag:item.outsourcedFlag, + outsourcedPerson: item.outsourcedPerson, + outsourcedRepairDescription:item.outsourcedRepairDescription, + outsourcedStartTime:item.outsourcedStartTime, + repairCode:item.repairCode, + repairDescription:item.repairDescription, + repairStatus:item.repairStatus, + repairer:item.repairer, + reportId:item.id, + updateBy:item.updateBy, + updateTime: item.updateTime + + }).then(res => { + console.log(res) + this.$tip.loaded(); + if (res.data.success) { + uni.showToast({ + icon: "success", + title: '棰嗗彇鎴愬姛', + duration: 2000 + }); + this.mescroll.resetUpScroll() + } else { + uni.showModal({ + title: "鎻愮ず", + content: res.data.message, + confirmText: '纭畾', + showCancel: false, + }) + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: '棰嗗彇澶辫触', + duration: 2000 + }); + }); + }, + /** + * @param {Object} item + * 璇︽儏椤甸潰 + */ + onClickProductionTask(item) { + + uni.navigateTo({ + url: '/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils?item=' + + encodeURIComponent(JSON.stringify(item)) + + }) + }, + + search() { + this.$refs.popup.open(); + }, + + + upCallback(page) { + this.$http.get(this.url.stallList, { + params: { + pageNo: page.num, + pageSize: page.size, + order: 'desc', + column: 'createTime', + repairStatus: 'WAIT_REPAIR' + }, + + }).then(res => { + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + }, + + + resetTask() { + this.formData.num = '' + this.formData.partNumNameModel = '' + this.$refs.popup.close(); + this.mescroll.resetUpScroll() + + }, + /* 妫�绱� */ + getSera() { + this.$refs.popup.close(); + let keyword = this.TabCur + this.msgList = []; + + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*', + status: 'published' + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } else if (keyword == 1) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + status: 'training', + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*' + + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg2Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } else if (keyword == 2) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + status: 'completed', + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*' + + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg3Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } + + + + + + }, + + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils.vue b/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils.vue new file mode 100644 index 0000000..a2deddc --- /dev/null +++ b/pages/maintenanceReport/maintenanceReportDetils/maintenanceReportDetils.vue @@ -0,0 +1,334 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</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"> + <uni-forms-item name="num" :label-width="100" label="宸ュ崟鍙�:"> + <uni-easyinput v-model="formData.repairCode" :disabled="true" /> + </uni-forms-item> + <uni-forms-item required name="num" :label-width="100" label="璁惧缂栧彿:"> + <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" + placeholder="璇烽�夋嫨" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="actualStartTime" :label-width="100" label="缁翠慨寮�濮嬫椂闂�:"> + <uni-easyinput v-model="formData.actualStartTime" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="outNum" :label-width="100" label="缁翠慨璐熻矗浜�:"> + <uni-easyinput v-model="formData.repairer" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="outNum" :label-width="100" label="鏁呴殰鎻忚堪:"> + <uni-easyinput v-model="formData.faultDescription" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="remark" :label-width="100" label="澶囨敞:"> + <uni-easyinput v-model="formData.remark" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="outNum" :label-width="100" 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-forms-item> + </uni-group> + </uni-forms> + + </view> + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + import configService from '@/common/service/config.service.js' + + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + ipAndPort: configService.staticURL, + scrollLeft: 0, + searchValue: '', + imgList: [], + equipmentList: [], + uploadUrl: "/sys/common/upload", + formData: { + num: '', + avatar: [] + }, + NavBarColor: this.NavBarColor, + url: { + upload: "/eam/sysFiles/batch_upload", + stallList: "/eam/eamRepairOrder/queryById", + getEquipmentList:'eam/equipment/list' + // getEquipmentList: "eam/equipment/asyncLoadEquipment" + }, + id: '', + serverBaseUrl: '', + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msg1Count: 0, + msg2Count: 0, + msg1Title: "" + } + }, + computed: { + top() { + return this.CustomBar * 2 + 50 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + + onLoad(options) { + const annItem = JSON.parse(decodeURIComponent(options.item)); + this.id = annItem.id + }, + created() { + this.getEquipment(); + this.upCallback(); + }, + methods: { + changeEquipmentList(e) { + this.formData.num = e; + }, + 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]; + // 杩藉姞鍒� formData.avatar 涓紝骞剁敤閫楀彿鍒嗛殧 + 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('鍥剧墖涓婁紶澶辫触'); + }); + } + }); + }, + 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) + } + } + }) + }, + + 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) + this.formData.repairCode=this.announcement1.repairCode + this.formData.num = this.announcement1.equipmentId + this.formData.actualStartTime = this.announcement1.actualStartTime + this.formData.repairer = this.announcement1.repairer + this.formData.faultDescription = this.announcement1.faultDescription + this.formData.remark = this.announcement1.remark + this.formData.avatar = this.announcement1.reportImageFiles + this.imgList = JSON.parse(this.formData.avatar) + const imageObjects = JSON.parse(this.formData.avatar); + // 鎻愬彇 filePath 骞舵嫾鎺� IP 鍜岀鍙� + this.imgList = imageObjects.map(imageObj => { + return `${this.ipAndPort}${imageObj.filePath}`; + }); + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + // 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 + // }); + + // } + // }).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("鑱旂綉澶辫触") + }) + }, + + /* 妫�绱� */ + getSera(res) { + this.msgList = []; + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + equipmentCode: res + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + } + }, + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/reportRepair/reportRepair.vue b/pages/reportRepair/reportRepair.vue new file mode 100644 index 0000000..e48e7d3 --- /dev/null +++ b/pages/reportRepair/reportRepair.vue @@ -0,0 +1,411 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">鏂板-鎶ヤ慨</block> + </cu-custom> + + <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> + <uni-group top="1"> + <!-- <uni-forms-item required name="num" label="璁惧缂栧彿:"> + <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" + placeholder="璇烽�夋嫨" /> + </uni-forms-item> --> + <uni-forms-item required name="num" label="璁惧缂栧彿:"> + <uni-easyinput v-model=" formData.numSear" placeholder="璇烽�夋嫨" :disabled="true" suffixIcon="search" + @iconClick="OnenterpriseId()" /> + </uni-forms-item> + <uni-forms-item required name="name" label="鏁呴殰绠�绉�:"> + <uni-data-select v-model="formData.faultName" :localdata="formData.faultNameList" + @change="changefaultNameList" placeholder="璇烽�夋嫨" /> + </uni-forms-item> + <uni-forms-item required name="faultType" label="鏁呴殰鍒嗙被:"> + <uni-easyinput v-model="formData.faultType" :disabled='true' /> + </uni-forms-item> + <uni-forms-item required name="faultDescription" label="鏁呴殰鎻忚堪:"> + <uni-easyinput v-model="formData.faultDescription" :disabled='true' /> + </uni-forms-item> + + <uni-forms-item required name="desc" label="鏁呴殰寮�濮嬫椂闂�:"> + <uni-datetime-picker type="datetime" v-model="formData.loadTime" /> + </uni-forms-item> + <uni-forms-item required name="name" label="鏄惁鍋滄満:"> + <uni-data-select v-model="formData.breakdownFlag" :localdata="isTrueList" @change="changeisTrueList" + placeholder="璇烽�夋嫨" /> + </uni-forms-item> + <uni-forms-item 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-forms-item> + + <uni-forms-item name="faultDescription" label="澶囨敞:"> + <uni-easyinput type="textarea" v-model="formData.remark" /> + </uni-forms-item> + </uni-group> + </uni-forms> + + <view 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> + + + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + id: '', + equipmentList: [], + isTrueList: [{ + text: "鏄�", + value: "0" + }, + { + text: "鍚�", + value: "1" + } + ], + type: 'top', + scrollLeft: 0, + imgList: [], + formData: { + avatar: [], + numSear: '', + remark: '', + num: '', + faultNameList: [], + faultName: '', + faultType: '', + breakdownFlag: '', + loadTime: Date.now(), + faultDescription: '' + }, + NavBarColor: this.NavBarColor, + activeColor: '#5277A6', + url: { + part: 'eam/equipment/list', + upload: "/eam/sysFiles/batch_upload", + add: "/eam/eamReportRepair/add", + getEquipmentList: "eam/equipment/asyncLoadEquipment", + faultReasonList: 'eam/equipmentFaultReason/list' + }, + + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msgList: [], //鍒楄〃鏁版嵁 + announcement1: [], + msg1Count: 0, + msg2Count: 0, + msg1Title: "" + } + }, + computed: { + top() { + return this.CustomBar * 2 + 130 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + + + onShow() { + if (this.mescroll) { + this.mescroll.resetUpScroll() + } + let that = this + uni.$off('selectPart'); + uni.$on('selectPart', function(e) { + console.log('鐩戝惉鍒颁簨浠舵潵鑷� selectMould 锛屾惡甯﹀弬鏁� msg 涓猴細', e.msg) + const annItem = JSON.parse(e.msg); + that.formData.numSear = annItem.equipmentCode + '[' + annItem.equipmentName + ']' + that.formData.num = annItem.id + + }); + }, + + + onLoad(options) { + const decodedEquipmentId = decodeURIComponent(options.equipmentId); + this.formData.num = decodedEquipmentId; + this.getSera() + }, + created() { + // this.getEquipment(); + this.getfaultReasonList(); + }, + methods: { + getSera() { + //鑱旂綉鍔犺浇鏁版嵁 + this.$http.get(this.url.part, { + params: { + pageNo: 1, + pageSize: 10, + order: "desc", + column: "createTime", + id: this.formData.num + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + this.announcement1 = res.data.result.records[0] + console.log(this.announcement1); + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + this.formData.numSear = this.announcement1.equipmentCode + '[' + this.announcement1 + .equipmentName + + ']' + } + + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + + }, + /** + * 璁惧淇℃伅 + */ + OnenterpriseId() { + uni.navigateTo({ + url: "/pages/selectEquipment/selectEquipment" + }) + }, + changefaultNameList(e) { + this.formData.faultName = e; + if (e == '1902250920983339009') { + this.formData.faultType = this.formData.faultNameList[0].faultCategory_dictText; + this.formData.faultDescription = this.formData.faultNameList[0].faultDescription; + } else if (e == '1909114668383875074') { + this.formData.faultType = this.formData.faultNameList[1].faultCategory_dictText; + this.formData.faultDescription = this.formData.faultNameList[1].faultDescription; + } else if (e == '1909877534952710145') { + this.formData.faultType = this.formData.faultNameList[2].faultCategory_dictText; + this.formData.faultDescription = this.formData.faultNameList[2].faultDescription; + } + }, + getfaultReasonList() { + this.$http.get(this.url.faultReasonList).then(res => { + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + this.formData.faultNameList = 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 + // }); + + // } + // }).catch(() => { + // this.$tip.error("鑱旂綉澶辫触") + // }) + // }, + // changeEquipmentList(e) { + // this.formData.num = e; + // }, + changeisTrueList(e) { + this.formData.breakdownFlag = e; + }, + + 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('鍥剧墖涓婁紶澶辫触'); + }); + } + }); + }, + 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) + } + } + }) + }, + + + ProductionTask() { + if (this.formData.num == 0 || this.formData.num == undefined) { + uni.showToast({ + icon: "none", + title: '璁惧缂栧彿涓虹┖!', + duration: 2000 + }); + return false + } + if (this.formData.faultName == 0 || this.formData.faultName == undefined) { + uni.showToast({ + icon: "none", + title: '鏁呴殰绠�绉颁负绌�!', + duration: 2000 + }); + return false + } + // 璇锋眰寮�濮� 澧炲姞閬僵灞� + uni.showLoading({ + mask: true, + title: "鍔犺浇涓�....", + }) + this.$http.post(this.url.add, { + breakdownFlag: this.formData.breakdownFlag, + equipmentId: this.formData.num, + faultDescription: this.formData.faultDescription, + faultName: this.formData.faultName, + faultStartTime: this.formData.loadTime, + faultType: this.formData.faultType, + faultType_dictText: this.formData.faultType, + imageFilesResult: this.formData.avatar, // 鍖呭惈涓婁紶鍚庣殑鍥剧墖璺緞, + remark: this.formData.remark + }).then(res => { + uni.hideLoading(); + if (res.data.success) { + uni.showToast({ + icon: "success", + title: '鎻愪氦鎴愬姛', + duration: 2000 + }); + this.$Router.replaceAll({ + name: 'reportRepairList' + }) + + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: '鎻愪氦澶辫触', + duration: 2000 + }); + }); + }, + + + + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/reportRepair/reportRepairDeils/reportRepairDeils.vue b/pages/reportRepair/reportRepairDeils/reportRepairDeils.vue new file mode 100644 index 0000000..7ec29f4 --- /dev/null +++ b/pages/reportRepair/reportRepairDeils/reportRepairDeils.vue @@ -0,0 +1,321 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</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"> + <uni-forms-item required name="num" :label-width="80" label="璁惧缂栧彿:"> + <uni-data-select v-model="formData.num" :localdata="equipmentList" @change="changeEquipmentList" + placeholder="璇烽�夋嫨" :disabled="true" /> + </uni-forms-item> + + <uni-forms-item name="remark" :label-width="80" label="鏁呴殰绠�绉�:"> + <uni-easyinput v-model="formData.faultName" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="remark" :label-width="80" label="鏁呴殰寮�濮嬫椂闂�:"> + <uni-easyinput v-model="formData.faultStartTime" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="outNum" :label-width="80" label="鏄惁鍋滄満:"> + <uni-easyinput v-model="formData.breakdownFlag_dictText" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="outNum" :label-width="80" label="鏁呴殰鎻忚堪:"> + <uni-easyinput v-model="formData.faultDescription" :disabled="true" /> + </uni-forms-item> + <uni-forms-item name="remark" :label-width="80" label="澶囨敞:"> + <uni-easyinput v-model="formData.remark" :disabled="true" /> + </uni-forms-item> + <uni-forms-item 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-forms-item> + </uni-group> + </uni-forms> + + </view> + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + import configService from '@/common/service/config.service.js' + import { + http + } from '@/common/service/service.js' + + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + ipAndPort: configService.staticURL, + scrollLeft: 0, + searchValue: '', + imgList: [], + equipmentList: [], + uploadUrl: "/eam/sysFiles/batch_upload", + formData: { + num: '', + avatar: [] + }, + NavBarColor: this.NavBarColor, + url: { + stallList: "/eam/eamReportRepair/queryById", + getEquipmentList:'eam/equipment/list' + // getEquipmentList: "eam/equipment/asyncLoadEquipment" + }, + id: '', + serverBaseUrl: '', + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msg1Count: 0, + msg2Count: 0, + msg1Title: "" + } + }, + computed: { + top() { + return this.CustomBar * 2 + 160 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + onLoad(options) { + const annItem = JSON.parse(decodeURIComponent(options.item)); + this.id = annItem.id + }, + + created() { + this.getEquipment() + this.upCallback() + }, + methods: { + 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("鑱旂綉澶辫触") + }) + }, + changeEquipmentList(e) { + this.formData.num = e; + }, + 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].filePath; + 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('鍥剧墖涓婁紶澶辫触'); + }); + } + }); + }, + 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) + } + } + }) + }, + + 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.faultDescription = this.announcement1.faultDescription + this.formData.faultName = this.announcement1.faultName + this.formData.remark = this.announcement1.remark + this.formData.faultStartTime = this.announcement1.faultStartTime + this.formData.breakdownFlag_dictText = this.announcement1.breakdownFlag_dictText + 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}`; + }); + + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + }, + + + + /* 妫�绱� */ + getSera(res) { + this.msgList = []; + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + equipmentCode: res + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + } + }, + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/reportRepair/reportRepairList/reportRepairList.vue b/pages/reportRepair/reportRepairList/reportRepairList.vue new file mode 100644 index 0000000..ac4c155 --- /dev/null +++ b/pages/reportRepair/reportRepairList/reportRepairList.vue @@ -0,0 +1,373 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">鎶ヤ慨</block> + </cu-custom> + + <view style="width: 100%;"> + <uni-popup ref="popup" background-color="#fff" :type="type"> + <view class="popupView"> + <!-- 鍩虹琛ㄥ崟鏍¢獙 --> + <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> + <uni-group title="" top="0"> + <uni-forms-item name="numbers" label="棰嗘枡鐢宠鍗曞彿:"> + <uni-easyinput type="text" v-model="formData.num" placeholder="璇疯緭鍏ラ鏂欑敵璇峰崟鍙锋绱�" /> + </uni-forms-item> + <uni-forms-item name="name" label="棰嗘枡浜у搧:"> + <uni-easyinput v-model="formData.partNumNameModel" placeholder="璇疯緭鍏ラ鏂欎骇鍝�" /> + </uni-forms-item> + </uni-group> + </uni-forms> + <view class="flex"> + + <view + class="cuIcon-search flex-sub bg-blue padding-sm margin-xs margin-left-lg margin-right-lg text-sm text-center" + @click="getSera">鏌ヨ + </view> + <view + class="cuIcon-refresh flex-sub bg-white solids padding-sm margin-xs radius text-sm text-center margin-left-lg margin-right-lg" + @click="resetTask">閲嶇疆</view> + </view> + + </view> + </uni-popup> + </view> + <view class="flex"> + + <view + class="cuIcon-add flex-sub bg-blue padding-sm margin-xs margin-left-lg margin-right-lg text-sm text-center" + @click="getAdd()">鏂板 + </view> + </view> + <view class="container"> + <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback"> + <!-- 鍒楄〃淇℃伅寮�濮� --> + <view class="content"> + <uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index" + @click="onClickProductionTask(item)"> + <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 text-bold radius text-right"> + {{item.equipmentId_dictText}} + </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"> + {{item.faultName}} + </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 text-blue radius text-right"> + {{item.faultStartTime}} + </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 text-blue radius text-right"> + {{item.breakdownFlag_dictText}} + </view> + </view> + + <!-- <view class="flex"> + <view class="flex-sub text-light bg-white padding-xs margin-xs radius">鎿嶄綔:</view> + <view class="flex-sub bg-blue padding-xs margin-xs radius text-sm text-center" + @click.stop="handleStartWork(item)" hover-class="is-hover">棰嗗彇</view> + + </view> --> + </uni-card> + </view> + + </mescroll-uni> + </view> + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + type: 'top', + scrollLeft: 0, + formData: { + num: '', + partNumNameModel: '' + }, + NavBarColor: this.NavBarColor, + activeColor: '#5277A6', + url: { + stallList: "/eam/eamReportRepair/list" + }, + + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + msgList: [], //鍒楄〃鏁版嵁 + announcement1: [], + msg1Count: 0, + msg2Count: 0, + msg1Title: "" + } + }, + computed: { + top() { + return this.CustomBar * 2 + 100 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + + + onShow() { + if (this.mescroll) { + this.mescroll.resetUpScroll() + } + }, + + created() {}, + methods: { + getAdd() { + uni.redirectTo({ + url: '/pages/reportRepair/reportRepair' + }) + }, + /** + * @param {Object} item + * 璇︽儏椤甸潰 + */ + onClickProductionTask(item) { + + uni.navigateTo({ + url: '/pages/reportRepair/reportRepairDeils/reportRepairDeils?item=' + + encodeURIComponent(JSON.stringify(item)) + }) + + }, + + search() { + this.$refs.popup.open(); + }, + + + upCallback(page) { + this.$http.get(this.url.stallList, { + params: { + pageNo: page.num, + pageSize: page.size, + order: 'asc', + column: 'createTime' + + }, + + }).then(res => { + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + }, + + + resetTask() { + this.formData.num = '' + this.formData.partNumNameModel = '' + this.$refs.popup.close(); + this.mescroll.resetUpScroll() + + }, + /* 妫�绱� */ + getSera() { + this.$refs.popup.close(); + let keyword = this.TabCur + this.msgList = []; + + if (keyword == 0) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*', + status: 'published' + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } else if (keyword == 1) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + status: 'training', + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*' + + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg2Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } else if (keyword == 2) { + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 999, + order: "desc", + column: "createTime", + status: 'completed', + num: '*' + this.formData.num + '*', + partNumNameModel: '*' + this.formData.partNumNameModel + '*' + + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg3Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + } + + + + + + }, + + + mescrollInit(mescroll) { + console.log('mescrollInit') + this.mescroll = mescroll; + }, + }, + + } +</script> + +<style> + .is-hover { + color: rgba(255, 255, 255, 0.6); + background-color: #55aaff; + border-color: #55aaff; + } + + + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .popupView { + margin-top: 85px; + height: auto; + } +</style> \ No newline at end of file diff --git a/pages/searEquipment/searEquipment.vue b/pages/searEquipment/searEquipment.vue new file mode 100644 index 0000000..6a44901 --- /dev/null +++ b/pages/searEquipment/searEquipment.vue @@ -0,0 +1,309 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">閫夋嫨璁惧</block> + <block slot="right"> + <view @click="search"> + <image class="search" src="/static/icon/sear.png" style="width: 25px; height: 25px;" alt="" /> + </view> + </block> + </cu-custom> + + <view style="width: 100%;"> + <uni-popup ref="popup" background-color="#fff" :type="type"> + <view class="popupView" style="height: auto; margin-top: 85px;"> + <!-- 鍩虹琛ㄥ崟鏍¢獙 --> + <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> + <uni-group title="" top="0"> + <uni-forms-item name="name" label="濮撳悕:"> + <uni-easyinput placeholder="璇疯緭鍏ュ鍚嶆绱�" v-model="formData.name" /> + </uni-forms-item> + </uni-group> + </uni-forms> + + <view class="flex"> + + <view + class="cuIcon-search flex-sub bg-blue padding-sm margin-left-lg margin-right-lg margin-xs text-sm text-center" + @click="searBut">鏌ヨ + </view> + <view + class="cuIcon-refresh flex-sub bg-white solids padding-sm margin-left-lg margin-right-lg margin-xs radius text-sm text-center" + @click="resetTask">閲嶇疆</view> + </view> + </view> + </uni-popup> + + </view> + <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback"> + <!-- 鍒楄〃淇℃伅寮�濮� --> + <view class="content"> + + <uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index" + @click="onClickProductionTask(item)"> + <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">{{item.workNo}}</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-bold text-right margin-xs">{{item.realname}} + </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">{{item.phone}}</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"> + {{item.post_dictText}} + </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"> + {{item.orgCodeTxt}} + </view> + </view> + </uni-card> + + </view> + + </mescroll-uni> + + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + type: 'top', + formData: { + num: '', + name: '' + }, + url: { + stallList: "/sys/user/list" + }, + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + msgList: [], //鍒楄〃鏁版嵁 + announcement1: [], + msg1Count: "", + msg1Title: "", + } + }, + computed: { + top() { + return this.CustomBar * 2 + 10 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + + created() { + + + + }, + methods: { + search() { + this.$refs.popup.open(); + }, + upCallback(page) { + //鑱旂綉鍔犺浇鏁版嵁 + + this.$http.get(this.url.stallList, { + params: { + pageNo: page.num, + pageSize: page.size, + column: "createTime", + order: "desc" + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + }, + + + searBut() { + this.$refs.popup.close() + this.msgList = []; + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: this.upOption.page.size, + name: this.formData.realname, + column: "createTime", + order: "desc", + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + + + + }, + + resetTask() { + this.formData.realname = '', + this.mescroll.resetUpScroll() + this.$refs.popup.close() + }, + + onClickProductionTask(item) { + uni.$emit('choes', { + msg: JSON.stringify(item) + }) + + uni.navigateBack({ + delta: 1 + }) + + + }, + }, + + } +</script> + +<style> + .footer-box__item_content { + font-size: 12px; + color: #666; + } + + .footer-box__item_input { + text-align: right; + font-size: 13px; + color: #000; + } + + .footer-box { + padding: 10rpx; + display: flex; + justify-content: space-between; + flex-direction: row; + } + + .footer-box__item_title { + margin-left: 10rpx; + font-size: 24v; + font-size: 12px; + color: #999; + } + + .margin-bottom { + margin: 0 30px; + } + + .input { + text-align: right; + } + + .cu-form-group { + padding-left: 25px; + display: flex; + justify-content: space-between; + flex-direction: row; + } + + .text { + font-size: 10pt; + text-align: right; + } + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } + + .footer-box-btn { + padding: 10rpx; + display: flex; + justify-content: space-between; + flex-direction: row; + background: white; + } + + .button-rese { + height: 50rpx; + display: flex; + margin-top: 10rpx; + line-height: 50rpx; + justify-content: center; + border-radius: 5px; + color: #FFFFFF; + /* 杩欓噷鍙互鏀规垚娓愬彉锛� background:linear-gradient(to right, #FFDE28,#FF3228) */ + background-color: #1890FF; + font-size: 28rpx; + + } +</style> \ No newline at end of file diff --git a/pages/selectEquipment/selectEquipment.vue b/pages/selectEquipment/selectEquipment.vue new file mode 100644 index 0000000..ce39802 --- /dev/null +++ b/pages/selectEquipment/selectEquipment.vue @@ -0,0 +1,318 @@ +<template> + <view class="container"> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">閫夋嫨璁惧</block> + <block slot="right"> + <view @click="search"> + <image class="search" src="/static/icon/more.png" style="width: 25px; height: 25px;" alt="" /> + </view> + </block> + </cu-custom> + <view style="width: 100%;"> + <uni-popup ref="popup" background-color="#fff" :type="type"> + <view class="popupView"> + <!-- 鍩虹琛ㄥ崟鏍¢獙 --> + <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> + <uni-group title="" top="0"> + <uni-forms-item name="num" label="璁惧缂栧彿:"> + <uni-easyinput type="text" v-model="formData.num" placeholder="璇疯緭鍏ヨ澶囩紪鍙锋绱�" /> + </uni-forms-item> + <uni-forms-item name="name" label="璁惧鍚嶇О:"> + <uni-easyinput type="text" v-model="formData.name" placeholder="璇疯緭鍏ヨ澶囧悕绉版绱�" /> + </uni-forms-item> + + </uni-group> + </uni-forms> + <view class="flex"> + + <view class="cuIcon-search flex-sub bg-blue padding-sm margin-xs margin-left-lg margin-right-lg text-sm text-center" + @click="getSera">鏌ヨ + </view> + <view + class="cuIcon-refresh flex-sub bg-white solids padding-sm margin-left-lg margin-right-lg margin-xs radius text-sm text-center" + @click="resetTask">閲嶇疆</view> + </view> + + </view> + </uni-popup> + + </view> + + <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback"> + <!-- 鍒楄〃淇℃伅寮�濮� --> + <view class="content"> + + <uni-card margin="10px" spacing="1px" v-for="(item,index) in msgList" :key="index" + @click="onClickProductionTask(item)"> + + <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">{{item.equipmentCode}}</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 text-bold radius text-right">{{item.equipmentName}} + </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">{{item.equipmentModel}}</view> + </view> + </uni-card> + + </view> + + </mescroll-uni> + + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + type: 'top', + formData: { + + name: '', + num:'' + }, + url: { + part:'eam/equipment/list' + }, + upOption: { + page: { + num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + empty: { + tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず + + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' + }, + msgList: [], //鍒楄〃鏁版嵁 + announcement1: [], + msg1Count: "", + msg1Title: "", + } + }, + computed: { + top() { + return this.CustomBar * 2 + 15 + }, + style() { + var StatusBar = this.StatusBar; + var CustomBar = this.CustomBar; + var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`; + return style + }, + }, + onUnload() { + uni.$off() + + }, + created() { + + + + }, + methods: { + search() { + this.$refs.popup.open(); + }, + + upCallback(page) { + //鑱旂綉鍔犺浇鏁版嵁 + + this.$http.get(this.url.part, { + params: { + pageNo: page.num, + pageSize: page.size, + order: 'desc', + column: 'createTime' + + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + this.announcement1 = res.data.result.records + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + this.msg1Count = res.data.result.total + this.msg1Title = "閫氱煡(" + res.data.result.total + ")"; + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + }, + + + resetTask() { + this.formData.name='' + this.formData.num='' + this.$refs.popup.close() + this.mescroll.resetUpScroll() + + }, + // /* 宸ュ彿妫�绱� */ + // onInput(e) { + // console.log(e.detail.value) + // this.formData.name = e.detail.value + // this.getSera() + // }, + + /* 妫�绱� */ + getSera(page) { + this.$refs.popup.close(); + this.msgList = []; + //鑱旂綉鍔犺浇鏁版嵁 + this.$http.get(this.url.part, { + params: { + pageNo: this.upOption.page.num, + pageSize: this.upOption.page.size, + order: "desc", + column: "createTime", + equipmentCode: this.formData.num, + equipmentName:this.formData.name + } + }).then(res => { + //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + this.announcement1 = res.data.result.records + + this.mescroll.endSuccess(this.announcement1.length); + console.log("url", res) + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log("res", res.data) + + for (let annItem of this.announcement1) { + this.msgList.push(annItem) + } + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } + + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + + }, + onClickProductionTask(item) { + uni.$emit('selectPart', { + msg: JSON.stringify(item) + }) + + uni.navigateBack({ + delta: 1 + }) + + + }, + }, + + } +</script> + +<style> + .button-rese { + height: 50rpx; + display: flex; + margin-top: 10rpx; + line-height: 50rpx; + justify-content: center; + border-radius: 5px; + color: #FFFFFF; + /* 杩欓噷鍙互鏀规垚娓愬彉锛� background:linear-gradient(to right, #FFDE28,#FF3228) */ + background-color: #1890FF; + font-size: 28rpx; + + } + + .footer-box__item_content { + font-size: 12px; + color: #666; + } + + .footer-box__item_input { + text-align: right; + font-size: 13px; + color: #000; + } + + .footer-box-btn { + padding: 10rpx; + display: flex; + justify-content: space-between; + flex-direction: row; + background: white; + } + + .footer-box { + padding: 10rpx; + display: flex; + justify-content: space-between; + flex-direction: row; + } + + .footer-box__item_title { + margin-left: 10rpx; + font-size: 24v; + font-size: 12px; + color: #999; + } + + .margin-bottom { + margin: 0 30px; + } + + .input { + text-align: right; + } + .popupView { + + margin-top: 50px; + height: auto; + } + + .cu-form-group { + padding-left: 25px; + display: flex; + justify-content: space-between; + flex-direction: row; + } + + .text { + font-size: 10pt; + text-align: right; + } + + .content { + margin-top: 5px; + } + + .content scroll-view { + scrollIndicator: "none" + } +</style> diff --git a/pages/user/useredit.vue b/pages/user/useredit.vue index 8b259d4..f8c56a8 100644 --- a/pages/user/useredit.vue +++ b/pages/user/useredit.vue @@ -170,7 +170,7 @@ sizeType: ['original', 'compressed'], //鍙互鎸囧畾鏄師鍥捐繕鏄帇缂╁浘锛岄粯璁や簩鑰呴兘鏈� sourceType: ['album'], //浠庣浉鍐岄�夋嫨 success: (res) => { - that.$http.upload(that.$config.apiUrl+that.uploadUrl, { + that.$http.upload(that.uploadUrl, { filePath: res.tempFilePaths[0], name: 'file' }) @@ -180,6 +180,7 @@ .catch(err => { that.$tip.error(err.data.message) }); + console.log(res.tempFilePaths) this.imgList = res.tempFilePaths } }); diff --git a/static/icon/icon_home.png b/static/icon/icon_home.png new file mode 100644 index 0000000..b6c3b0a --- /dev/null +++ b/static/icon/icon_home.png Binary files differ -- Gitblit v1.9.3