Prechádzať zdrojové kódy

feat(字典): 添加流程实例结果字典项并更新结果显示逻辑

liujt 6 mesiacov pred
rodič
commit
78bd3999c5
2 zmenil súbory, kde vykonal 26 pridanie a 1 odobranie
  1. 1 0
      enum/dict.js
  2. 25 1
      pages/home/wt/done/done.vue

+ 1 - 0
enum/dict.js

@@ -6,6 +6,7 @@ export default {
   产地: 'purchase_origin',
   物品机型: 'product_model_key',
   物品颜色: 'product_color_key',
+  流程实例的结果: 'bpm_process_instance_result',
 }
 
 //发货审核状态

+ 25 - 1
pages/home/wt/done/done.vue

@@ -16,7 +16,7 @@
 						<view class="card-title">
 							<text>{{ item.name }}</text>
 							<text
-								:class="item.result == 0 ? 'text-danger' : 'text-primary'">{{ handleResult[item.result] }}</text>
+								:class="item.result == 0 ? 'text-danger' : 'text-primary'">{{ getResult(item.result) }}</text>
 						</view>
 						<view>
 							<view class="card-body">
@@ -51,12 +51,16 @@
 		getDoneTaskPage,
 		getDoneTaskList
 	} from '@/api/wt/index.js'
+	import {
+		getByCode
+	} from '@/api/pda/common.js'
 
 	// let [page, isEnd] = [1, false]
 	export default {
 		components: {},
 		data() {
 			return {
+				bpm_process_instance_result: [],
 				page:1,
 				size:10,
 				isEnd:false,
@@ -123,8 +127,28 @@
 		onShow() {
 			this.page = 1
 			this.getList()
+			this.getByCode()
 		},
 		methods: {
+			getByCode() {
+				const codeS = ['bpm_process_instance_result']
+				codeS.forEach(async (code) => {
+					const codeValue = await getByCode(code);
+					this[code] = codeValue.map(item => {
+						const key = Object.keys(item)[0]
+						return {
+							value: key,
+							text: item[key]
+						}
+					})
+					console.log(code, this[code])
+				})
+				console.log('1111~~~~~~~~~', this.purchase_origin)
+			},
+			getResult(result) {
+				const item = this.bpm_process_instance_result.find(item => item.value == result)
+				return item?.text || ''
+			},
 			handleDetail(item) {
 				console.log(item)
 				uni.navigateTo({