From 0a48655d2162b709ecb80d249a4085971add6140 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期一, 07 七月 2025 17:26:30 +0800 Subject: [PATCH] 企业微信 --- pages/ToDoList/ToDoList.vue | 360 +++++++++++++++++++++++++++++------------------------------ 1 files changed, 176 insertions(+), 184 deletions(-) diff --git a/pages/ToDoList/ToDoList.vue b/pages/ToDoList/ToDoList.vue index 1989d82..7ab14d5 100644 --- a/pages/ToDoList/ToDoList.vue +++ b/pages/ToDoList/ToDoList.vue @@ -3,6 +3,11 @@ <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%;"> @@ -11,11 +16,14 @@ <!-- 鍩虹琛ㄥ崟鏍¢獙 --> <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="num" :labelWidth="80" label="娴佺▼鍒嗙被:"> + + + <uni-data-select v-model="formData.type" :localdata="typeList" @change="changetypeList" + placeholder="璇烽�夋嫨娴佺▼" /> </uni-forms-item> - <uni-forms-item name="name" label="棰嗘枡浜у搧:"> - <uni-easyinput v-model="formData.partNumNameModel" placeholder="璇疯緭鍏ラ鏂欎骇鍝�" /> + <uni-forms-item name="name" :labelWidth="80" label="璁惧缂栧彿:"> + <uni-easyinput v-model="formData.num" placeholder="璇疯緭鍏ヨ澶囩紪鍙�" /> </uni-forms-item> </uni-group> </uni-forms> @@ -35,16 +43,42 @@ </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 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.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.preNodeAssignee_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-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 text-olive radius text-right"> + {{item.name}} </view> </view> <view class="flex"> @@ -53,25 +87,6 @@ {{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"> - {{item.preNodeAssignee_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-blue 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"> - {{item.name}} - </view> - </view> </uni-card> </view> @@ -87,15 +102,15 @@ data() { return { type: 'top', - scrollLeft:0, + scrollLeft: 0, formData: { num: '', - partNumNameModel: '' + type: '' }, NavBarColor: this.NavBarColor, activeColor: '#5277A6', url: { - + flowType: "/sys/dict/getDictItems/flow_type", stallList: "/assign/flow/toTaskBySelf" }, @@ -117,6 +132,7 @@ color: '#2979FF', borderColor: '#2979FF' }, + typeList: [], msgList: [], //鍒楄〃鏁版嵁 announcement1: [], msg1Count: 0, @@ -126,7 +142,7 @@ }, computed: { top() { - return this.CustomBar * 2 + 130 + return this.CustomBar * 2 + 50 }, style() { var StatusBar = this.StatusBar; @@ -143,66 +159,127 @@ } }, - created() {}, + created() { + this.getTypeList() + }, methods: { - + /** + * 娴佺▼鍒嗙被鍒楄〃浜嬩欢 + */ + getTypeList() { + this.$http.get(this.url.flowType).then(res => { + //璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + console.log(res) + this.typeList = res.data.result + } + }).catch(() => { + //鑱旂綉澶辫触, 缁撴潫鍔犺浇 + }) + + }, + changetypeList(e) { + this.formData.type = e; + }, /** * @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'; + + break; + default:ToDoCheckDetils + console.warn(`No URL found for name: ${name} and type: ${type}`); + return; + } + + if (url) { + uni.redirectTo({ + url: `${url}?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: '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) - } + }).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(); + }) + }, resetTask() { this.formData.num = '' - this.formData.partNumNameModel = '' + this.formData.type = '' this.$refs.popup.close(); this.mescroll.resetUpScroll() @@ -210,125 +287,41 @@ /* 妫�绱� */ getSera() { this.$refs.popup.close(); - let keyword = this.TabCur this.msgList = []; + this.$http.get(this.url.stallList, { + params: { + pageNo: 1, + pageSize: 9999, + order: "desc", + column: "createTime", + title: this.formData.num, + category: this.formData.type - 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(); + }) }, @@ -342,7 +335,6 @@ </script> <style> - .is-hover { color: rgba(255, 255, 255, 0.6); background-color: #55aaff; @@ -350,7 +342,7 @@ } - + .content { margin-top: 5px; } -- Gitblit v1.9.3