From 964faa1077a89713910063c39ebe08fac4e4c56e Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期四, 24 七月 2025 17:44:18 +0800 Subject: [PATCH] 企业维修适配修改 --- pages/TaskManager/TaskManagerList.vue | 499 ++++++++++++++++++++---------------------------------- 1 files changed, 187 insertions(+), 312 deletions(-) diff --git a/pages/TaskManager/TaskManagerList.vue b/pages/TaskManager/TaskManagerList.vue index 33d6b69..b4a3e42 100644 --- a/pages/TaskManager/TaskManagerList.vue +++ b/pages/TaskManager/TaskManagerList.vue @@ -2,7 +2,12 @@ <view class="container"> <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> <block slot="backText">杩斿洖</block> - <block slot="content">浠诲姟绠$悊</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%;"> @@ -11,11 +16,12 @@ <!-- 鍩虹琛ㄥ崟鏍¢獙 --> <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 name="type" :labelWidth="80" label="娴佺▼鍒嗙被:"> + <uni-data-select v-model="formData.type" :localdata="storageTypeList" + @change="changeSelectType" /> </uni-forms-item> - <uni-forms-item name="name" label="棰嗘枡浜у搧:"> - <uni-easyinput v-model="formData.partNumNameModel" placeholder="璇疯緭鍏ラ鏂欎骇鍝�" /> + <uni-forms-item name="num" :labelWidth="80" label="璁惧缂栧彿:"> + <uni-easyinput v-model="formData.num" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" /> </uni-forms-item> </uni-group> </uni-forms> @@ -36,114 +42,71 @@ <view class="container"> - <uni-badge absolute="rightTop" :offset="[-30, 15]" :text="msg1Count" type="error" /> - - <uni-badge absolute="rightTop" :offset="[-270, 15]" :text="msg2Count" type="error" /> - - <view class="solid-bottom"> - <scroll-view scroll-x class="nav text-center "> - <view class="flex text-center justify-around"> - <view class="cu-item" :class="item.value==TabCur?'text-blue cur':''" - v-for="(item,index) in tabs" :key="index" @tap="tabSelect" :data-id="item.value"> - {{item.title}} - </view> - </view> - </scroll-view> - - </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 text-light bg-white padding-xs margin-xs radius">娴佺▼鍒嗙被:</view> + <view + class="flex-sub bg-white padding-xs margin-xs text-bold text-blue radius text-right"> + {{item.category_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.partName}} + {{item.procDefName}} + </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.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 radius text-right"> - {{item.taskType}} - </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 text-blue radius text-right"> - {{item.priority}} + {{item.startUserName}} </view> </view> + <view class="flex"> - <view class="flex-sub text-light bg-white padding-xs margin-xs radius">璐d换浜�:</view> - <view class="flex-sub bg-white padding-xs margin-xs text-blue radius text-right"> - {{item.ssignee}} - </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.taskDesc}} + {{item.description}} </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.dueaDate}} - </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 text-green radius text-right" - v-if="item.status == '1'"> - 寰呭鐞� - </view> - <view - class="flex-sub bg-white padding-xs margin-xs text-bold text-green radius text-right" - v-if="item.status == '3'"> - 宸插畬鎴� - </view> - </view> + </uni-card> </view> - </mescroll-uni> </view> </view> </template> <script> - const tabs = [{ - title: '寰呭姙', - value: 0 - }, { - title: '宸插姙', - value: 1 - }]; import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; export default { mixins: [MescrollMixin], // 浣跨敤mixin data() { return { - TabCur: 0, type: 'top', - scrollLeft:0, + scrollLeft: 0, formData: { - num: '', - partNumNameModel: '' + type: '', + num: '' }, + storageTypeList: [], NavBarColor: this.NavBarColor, - tabs, - current: 0, colorIndex: 0, activeColor: '#5277A6', url: { - - stallList: "/mom/partTakeRollingDetail/list" + stallList: "assign/flow/finishedList", + storageType: 'sys/dict/getDictItems/flow_type' }, upOption: { @@ -164,15 +127,7 @@ color: '#2979FF', borderColor: '#2979FF' }, - msgList: [{ - partName: "璁惧A", - taskType: "缁存姢", - taskDesc: "瀹氭湡妫�鏌�", - priority: "楂�", - dueaDate: "2023-10-10", - ssignee: "寮犱笁", - status: 1 - }], //鍒楄〃鏁版嵁 + msgList: [], //鍒楄〃鏁版嵁 announcement1: [], msg1Count: 0, msg2Count: 0, @@ -181,7 +136,7 @@ }, computed: { top() { - return this.CustomBar * 2 + 130 + return this.CustomBar * 2 + 50 }, style() { var StatusBar = this.StatusBar; @@ -198,260 +153,181 @@ } }, - created() {}, + created() { + this.storageType(); + }, methods: { - + + changeSelectType(e) { + + this.formData.type = e + }, /** - * @param {Object} item - * 璇︽儏椤甸潰 + * 娴佺▼绫诲瀷 */ - // onClickProductionTask(item) { - // let keyword = this.TabCur - // uni.navigateTo({ - // url: '/pages/mes/om/workSheetOpToolingBorrowDeils/workSheetOpToolingBorrowDeils?keyword=' + keyword - // }) - - // }, - tabSelect(e) { - this.TabCur = e.currentTarget.dataset.id; - this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60; - this.msgList = [] // 鍏堢疆绌哄垪琛�,鏄剧ず鍔犺浇杩涘害 - this.mescroll.resetUpScroll() // 鍐嶅埛鏂板垪琛ㄦ暟鎹� + storageType() { + this.$http.get(this.url.storageType).then(res => { + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + this.storageTypeList = res.data.result + } + }).catch(() => { + //鑱旂綉澶辫触, + }) }, + onClickProductionTask(item, flag = 'task') { + const name = item.taskName; + const type = item.category_dictText; + let url = ''; - - ListTouchStart(e) { - this.listTouchStart = e.touches[0].pageX - }, - - // ListTouch璁$畻鏂瑰悜 - ListTouchMove(e) { - this.listTouchDirection = e.touches[0].pageX - this.listTouchStart > 0 ? 'right' : 'left' - }, - - // ListTouch璁$畻婊氬姩 - ListTouchEnd(e) { - if (this.listTouchDirection == 'left') { - this.modalName = e.currentTarget.dataset.target - } else { - this.modalName = null + 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/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/ToDoSpareParts/ToDoSpareParts'; + break; + case (name === '鐐规宸ュ崟' && type === '璁惧鐐规'): + url = '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure'; + break; + case (name === '鐐规寮�濮�' && type === '璁惧鐐规'): + url = '/pages/ToDoList/ToDoListCheckSure/ToDoListCheckSure'; + break; + default: + console.warn(`No URL found for name: ${name} and type: ${type}`); + return; } - this.listTouchDirection = null - }, + if (url) { + uni.navigateTo({ + + url: `${url}?item=${encodeURIComponent(JSON.stringify(item))}&flag=${flag}` + }); + // uni.redirectTo({ + + // url: `${url}?item=${encodeURIComponent(JSON.stringify(item))}&flag=${flag}` + // }); + } + }, search() { this.$refs.popup.open(); }, - - // upCallback(page) { - // let keyword = this.TabCur - // if (keyword == 0) { - // this.$http.get(this.url.stallList, { - // params: { - // pageNo: page.num, - // pageSize: page.size, - // order: 'asc', - // column: 'createTime', - // status: 1 - // }, + 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); //杩藉姞鏂版暟鎹� - // } + }).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: page.num, - // pageSize: page.size, - // order: 'desc', - // status: 3, - // 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.msg2Count = 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(); - // }) - - // } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) + }, - // }, + /* 閲嶇疆鏌ヨ鏉′欢 */ resetTask() { - this.formData.num = '' - this.formData.partNumNameModel = '' - this.$refs.popup.close(); + this.formData.type = '', + this.formData.num = '', + this.$refs.popup.close(); this.mescroll.resetUpScroll() }, - /* 妫�绱� */ + + getSera() { this.$refs.popup.close(); - let keyword = this.TabCur this.msgList = []; + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 9999, + column: 'createTime', + order: 'desc', + category: this.formData.type, + title: this.formData.num + }, - 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) } - }).then(res => { - //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; + } + if (page.num == 1) { + this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 + this.msgList = this.msgList.concat(this.announcement1); //杩藉姞鏂版暟鎹� + } - 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(); - }) - - } - - - - - + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + this.mescroll.endErr(); + }) }, - mescrollInit(mescroll) { console.log('mescrollInit') @@ -463,7 +339,6 @@ </script> <style> - .is-hover { color: rgba(255, 255, 255, 0.6); background-color: #55aaff; @@ -471,7 +346,7 @@ } - + .content { margin-top: 5px; } @@ -481,7 +356,7 @@ } .popupView { - margin-top: 85px; + margin-top: 55px; height: auto; } </style> \ No newline at end of file -- Gitblit v1.9.3