From eacff2ef7312ff9ecfc098a508bac36329e96f14 Mon Sep 17 00:00:00 2001 From: Houjie <714924425@qq.com> Date: 星期三, 10 九月 2025 09:46:52 +0800 Subject: [PATCH] 线边库-入库 --- pages/eam/production/HeatTreatmentStorageList/HeatTreatmentStorageList.vue | 707 ++++++++ pages/eam/production/SmallInnerRingInboundValidatorList/SmallInnerRingInboundValidatorList.vue | 22 common/service/config.service.js | 6 static/home/128/icon_paichang.png | 0 pages.json | 42 pages/eam/production/ToDoList/ToDoList.vue | 39 pages/eam/production/record/record.vue | 1343 ++++++++-------- static/home/128/icon_host.png | 0 static/icon/add.png | 0 pages/eam/production/InternalTransfer/InternalTransfer.vue | 691 ++++++++ static/home/128/icon_caigou.png | 0 common/router/modules/routes.js | 54 pages/eam/production/report/report.vue | 336 ++-- common/service/service.js | 17 pages/eam/production/HeatTreatmentStorage/HeatTreatmentStorage.vue | 663 ++++++++ pages/eam/production/InternalTransferList/InternalTransferList.vue | 22 common/util/work.js | 84 pages/eam/production/SmallInnerRingInboundValidator/SmallInnerRingInboundValidator.vue | 666 ++++++++ static/home/128/icon_all_into.png | 0 static/home/128/icon_tioabo.png | 0 20 files changed, 3,806 insertions(+), 886 deletions(-) diff --git a/common/router/modules/routes.js b/common/router/modules/routes.js index aa98c2c..2d3ec51 100644 --- a/common/router/modules/routes.js +++ b/common/router/modules/routes.js @@ -548,7 +548,61 @@ } + }, + + { + path: '/pages/eam/production/HeatTreatmentStorage/HeatTreatmentStorage', + name: 'HeatTreatmentStorage', + meta: { + title: '鐑鐞嗗叆搴�', + } + + + },{ + path: '/pages/eam/production/SmallInnerRingInboundValidator/SmallInnerRingInboundValidator', + name: 'SmallInnerRingInboundValidator', + meta: { + title: '灏忓唴鍦堝叆搴�', + } + + + }, + { + path: '/pages/eam/production/InternalTransfer/InternalTransfer', + name: 'InternalTransfer', + meta: { + title: '鍐呴儴璋冩嫧', + } + + + }, + { + path: '/pages/eam/production/HeatTreatmentStorageList/HeatTreatmentStorageList', + name: 'HeatTreatmentStorageList', + meta: { + title: '鐑鐞嗗叆搴�', + } + + + },{ + path: '/pages/eam/production/SmallInnerRingInboundValidatorList/SmallInnerRingInboundValidatorList', + name: 'SmallInnerRingInboundValidatorList', + meta: { + title: '灏忓唴鍦堝叆搴�', + } + + + }, + { + path: '/pages/eam/production/InternalTransferList/InternalTransferList', + name: 'InternalTransferList', + meta: { + title: '鍐呴儴璋冩嫧', + } + + } + diff --git a/common/service/config.service.js b/common/service/config.service.js index ceb45f2..ffbdcd1 100644 --- a/common/service/config.service.js +++ b/common/service/config.service.js @@ -1,14 +1,14 @@ // let BASE_URL = 'http://192.168.1.14/jeecg-boot' // if (process.env.NODE_ENV == 'development') { -let BASE_URL = 'http://192.168.43.223:9989/' +let BASE_URL = 'http://192.168.3.55:9989/' if (process.env.NODE_ENV == 'development') { console.log(BASE_URL) - BASE_URL = uni.getStorageSync('base_url') ? uni.getStorageSync('base_url') : 'http://192.168.43.223:9989/' + BASE_URL = uni.getStorageSync('base_url') ? uni.getStorageSync('base_url') : 'http://192.168.3.55:9989/' } else { - BASE_URL = uni.getStorageSync('base_url') ? uni.getStorageSync('base_url') : 'http://192.168.43.223:9989/' + BASE_URL = uni.getStorageSync('base_url') ? uni.getStorageSync('base_url') : 'http://192.168.3.55:9989/' } let staticDomainURL = BASE_URL + '/sys/common/static'; diff --git a/common/service/service.js b/common/service/service.js index a067093..f81d7b5 100644 --- a/common/service/service.js +++ b/common/service/service.js @@ -105,27 +105,12 @@ success: (res) => { if (res.confirm) { uni.reLaunch({ - url: '/pages/login/loginOauth2' + url: '/pages/login/login' }); } } }); break; - - // case 401: - // uni.showModal({ - // title: '鎻愮ず', - // content: '鐧诲綍瓒呮椂锛岄渶瑕侀噸鏂扮櫥褰�!', - // showCancel: false, - // success: (res) => { - // if (res.confirm) { - // uni.reLaunch({ - // url: '/pages/login/login' - // }) - // } - // } - // }); - // break default: tip.error({ duration: 0, diff --git a/common/util/work.js b/common/util/work.js index afc643a..8a35366 100644 --- a/common/util/work.js +++ b/common/util/work.js @@ -6,33 +6,63 @@ export const ps = { data: [{ - title: "鎺掍骇宸ュ崟", - icon: icon_prefix + "todo.png", - description: "鎺掍骇宸ュ崟", - useCount: 1000, - page: 'ProductionManager' - }, - { - title: "鎶ュ伐", - icon: icon_prefix + "icon_report.png", - description: "鎶ュ伐", - useCount: 1000, - page: 'report' - }, - { - title: "涓婃枡", - icon: icon_prefix + "icon_into.png", - description: "涓婃枡", - useCount: 1000, - page: 'materialLoading' - }, - { - title: "涓嬫枡", - icon: icon_prefix + "icon_out.png", - description: "涓嬫枡", - useCount: 1000, - page: 'ProductionManager' - }] + title: "鎺掍骇宸ュ崟", + icon: icon_prefix + "icon_paichang.png", + description: "鎺掍骇宸ュ崟", + useCount: 1000, + page: 'ProductionManager' + }, + { + title: "鎶ュ伐", + icon: icon_prefix + "icon_report.png", + description: "鎶ュ伐", + useCount: 1000, + page: 'report' + }, + { + title: "涓婃枡", + icon: icon_prefix + "icon_into.png", + description: "涓婃枡", + useCount: 1000, + page: 'materialLoading' + }, + { + title: "涓嬫枡", + icon: icon_prefix + "icon_out.png", + description: "涓嬫枡", + useCount: 1000, + page: 'ProductionManager' + }, + { + title: "澶栧崗鐑鐞嗗叆搴�", + icon: icon_prefix + "icon_host.png", + description: "澶栧崗鐑鐞嗗叆搴�", + useCount: 1000, + page: 'HeatTreatmentStorage' + }, + { + title: "灏忓唴鍦堝叆搴�", + icon: icon_prefix + "icon_caigou.png", + description: "灏忓唴鍦堝叆搴�", + useCount: 1000, + page: 'SmallInnerRingInboundValidator' + }, + { + title: "鍐呴儴璋冩嫧", + icon: icon_prefix + "icon_tioabo.png", + description: "鍐呴儴璋冩嫧", + useCount: 1000, + page: 'InternalTransfer' + }, + { + title: "绾胯竟搴撳叆搴�", + icon: icon_prefix + "icon_all_into.png", + description: "鍏ュ簱", + useCount: 1000, + page: 'HeatTreatmentStorageList' + } + + ] } diff --git a/pages.json b/pages.json index 63b5daf..654880d 100644 --- a/pages.json +++ b/pages.json @@ -522,6 +522,48 @@ { "navigationBarTitleText" : "" } + }, + { + "path" : "pages/eam/production/HeatTreatmentStorage/HeatTreatmentStorage", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/eam/production/SmallInnerRingInboundValidator/SmallInnerRingInboundValidator", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/eam/production/InternalTransfer/InternalTransfer", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/eam/production/HeatTreatmentStorageList/HeatTreatmentStorageList", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/eam/production/SmallInnerRingInboundValidatorList/SmallInnerRingInboundValidatorList", + "style" : + { + "navigationBarTitleText" : "" + } + }, + { + "path" : "pages/eam/production/InternalTransferList/InternalTransferList", + "style" : + { + "navigationBarTitleText" : "" + } } diff --git a/pages/eam/production/HeatTreatmentStorage/HeatTreatmentStorage.vue b/pages/eam/production/HeatTreatmentStorage/HeatTreatmentStorage.vue new file mode 100644 index 0000000..93c37a6 --- /dev/null +++ b/pages/eam/production/HeatTreatmentStorage/HeatTreatmentStorage.vue @@ -0,0 +1,663 @@ +<template> + <view class="container"> + <!-- 椤堕儴瀵艰埅鏍� --> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">鐑鐞嗗叆搴�</block> + </cu-custom> + + <!-- 楠ㄦ灦灞忥紙鏁版嵁鍔犺浇鏃舵樉绀猴級 --> + <view v-if="loading" class="skeleton-container"> + <view class="skeleton-group"> + <view class="skeleton-divider"></view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + </view> + <view class="skeleton-button"></view> + </view> + + <!-- 瀹為檯琛ㄥ崟鍐呭锛堟暟鎹姞杞藉畬鎴愬悗鏄剧ず锛� --> + <view v-else class="form-container"> + <uni-forms ref="form" :modelValue="formData" :rules="formRules" validate-trigger="submit" + err-show-type="undertext"> + <uni-group top="1"> + <!-- 鏉ユ簮缂栫爜锛堝繀濉級 --> + <uni-forms-item :required="true" :label-width="100" name="originalCode" label="鏉ユ簮缂栫爜:"> + <uni-easyinput v-model="formData.originalCode" placeholder="璇疯緭鍏ユ潵婧愮紪鐮�" /> + </uni-forms-item> + + <!-- 鏉ユ簮鍚嶇О锛堝繀濉級 --> + <uni-forms-item :required="true" :label-width="100" name="originalName" label="鏉ユ簮鍚嶇О:"> + <uni-easyinput v-model="formData.originalName" placeholder="璇疯緭鍏ユ潵婧愬悕绉�" /> + </uni-forms-item> + + <!-- 绾胯竟搴擄紙蹇呭~锛� --> + <uni-forms-item :required="true" :label-width="100" name="warehouseId" label="绾胯竟搴�:"> + <uni-data-select v-model="warehouseId" :localdata="warehouseIdList" @change="changeWarehouseId" + placeholder="璇烽�夋嫨绾胯竟搴�"/> + </uni-forms-item> + + <!-- 鐗╂枡缂栫爜锛堝繀濉紝甯︽壂鐮佸姛鑳斤級 --> + <uni-forms-item :required="true" :label-width="100" name="materialNumber" label="鐗╂枡缂栫爜:"> + <view class="input-with-scan"> + <uni-easyinput v-model="formData.materialNumber" placeholder="璇疯緭鍏ユ垨鎵爜鐗╂枡缂栫爜" + @blur="handleMaterialCodeInput" @input="handleMaterialCodeInputDebounced" /> + <uni-icons type="scan" size="18" class="scan-icon" /> + </view> + </uni-forms-item> + + <!-- 鎵规鍙凤紙蹇呭~锛� --> + <uni-forms-item :required="true" :label-width="100" name="batchNumber" label="鎵规鍙�:"> + <uni-easyinput v-model="formData.batchNumber" placeholder="璇疯緭鍏ユ壒娆″彿" /> + </uni-forms-item> + + <!-- 鐗╂枡鍚嶇О锛堥潪蹇呭~锛屾壂鐮佸悗鑷姩濉厖锛� --> + <uni-forms-item :label-width="100" name="materialName" label="鐗╂枡鍚嶇О:"> + <uni-easyinput v-model="formData.materialName" placeholder="鑷姩濉厖鎴栨墜鍔ㄨ緭鍏�" readonly /> + </uni-forms-item> + + <!-- 鍏ュ簱鏁伴噺锛堥潪蹇呭~锛屽缓璁ぇ浜�0锛� --> + <uni-forms-item :label-width="100" name="quantity" label="鍏ュ簱鏁伴噺:"> + <uni-number-box v-model="formData.quantity" :min="1" :max="9999" placeholder="璇疯緭鍏ュ叆搴撴暟閲�" /> + </uni-forms-item> + + <!-- 鍏ュ簱绫诲瀷锛堢鐢紝鍥哄畾涓虹儹澶勭悊鍏ュ簱锛� --> + <uni-forms-item :label-width="100" name="inboundCategory" label="鍏ュ簱绫诲瀷:"> + <uni-data-select v-model="inboundCategory" :localdata="inboundCategoryList" placeholder="鐑鐞嗗叆搴�" + :disabled="true" /> + </uni-forms-item> + </uni-group> + </uni-forms> + + <!-- 鎻愪氦鎸夐挳 --> + <view class="submit-btn-container"> + <view class="submit-btn bg-blue padding-sm margin-xl radius text-sm text-center text-white" + @click.stop="submitInbound" hover-class="btn-hover"> + 纭畾鍏ュ簱 + </view> + </view> + </view> + + <!-- PDA鎵爜缁勪欢 --> + <pdaScanVue ref="scanRef"></pdaScanVue> + </view> +</template> + +<script> + // 寮曞叆鎵爜缁勪欢 + import pdaScanVue from "@/components/mes/pdaScan.vue"; + // 寮曞叆Vuex鑾峰彇鍏ㄥ眬鏁版嵁 + import { + mapGetters + } from "vuex"; + + export default { + components: { + pdaScanVue + }, + data() { + return { + debounceTimer: null, // 闃叉姈瀹氭椂鍣� + // 涓嬫媺鍒楄〃鏁版嵁 + warehouseIdList: [], // 绾胯竟搴撳垪琛� + inboundCategoryList: [], // 鍏ュ簱绫诲瀷鍒楄〃 + + // 涓嬫媺鍒楄〃缁戝畾鍊� + warehouseId: '', // 閫変腑鐨勭嚎杈瑰簱ID + inboundCategory: 'HEAT_TREATMENT_INBOUND', // 鍥哄畾鐑鐞嗗叆搴撶被鍨� + originalCodeDictOptions: [], + // 鍔犺浇鐘舵�侊紙鎺у埗楠ㄦ灦灞忔樉绀猴級 + loading: true, + // 闃查噸澶嶆彁浜ゆ爣璁� + isSubmitting: false, + // 瀵艰埅鏍忛鑹诧紙缁ф壙鍏ㄥ眬閰嶇疆锛� + NavBarColor: this.NavBarColor, + + // 琛ㄥ崟鏁版嵁 + formData: { + factoryId: '', + originalCode: '', // 鏉ユ簮缂栫爜 + originalName: '', // 鏉ユ簮鍚嶇О + materialNumber: '', // 鐗╂枡缂栫爜 + batchNumber: '', // 鎵规鍙� + materialName: '', // 鐗╂枡鍚嶇О + quantity: 1 // 鍏ュ簱鏁伴噺锛堥粯璁�1锛� + }, + + // 琛ㄥ崟鏍¢獙瑙勫垯锛堥潪绌烘牎楠岋級 + formRules: { + // 鏉ユ簮缂栫爜锛堝繀濉級 + originalCode: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ潵婧愮紪鐮�', + trigger: 'blur' + }, + { + required: true, + message: '鏉ユ簮缂栫爜涓嶈兘涓虹┖', + trigger: 'submit' + } + ] + }, + // 鏉ユ簮鍚嶇О锛堝繀濉級 + originalName: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ潵婧愬悕绉�', + trigger: 'blur' + }, + { + required: true, + message: '鏉ユ簮鍚嶇О涓嶈兘涓虹┖', + trigger: 'submit' + } + ] + }, + // 绾胯竟搴擄紙蹇呭~锛寁-model缁戝畾formData.warehouseId锛� + + // 鐗╂枡缂栫爜锛堝繀濉級 + materialNumber: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ垨鎵爜鐗╂枡缂栫爜', + trigger: 'blur' + }, + { + required: true, + message: '鐗╂枡缂栫爜涓嶈兘涓虹┖', + trigger: 'submit' + } + ] + }, + // 鎵规鍙凤紙蹇呭~锛� + batchNumber: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ壒娆″彿', + trigger: 'blur' + }, + { + required: true, + message: '鎵规鍙蜂笉鑳戒负绌�', + trigger: 'submit' + } + ] + }, + // 鍏ュ簱鏁伴噺锛堥渶澶т簬0锛� + quantity: { + rules: [{ + validator: (rule, value, callback) => { + if (value < 1) callback(new Error('鍏ュ簱鏁伴噺闇�澶т簬0')); + else callback(); + }, + trigger: 'blur' + }, + { + validator: (rule, value, callback) => { + if (value < 1) callback(new Error('鍏ュ簱鏁伴噺闇�澶т簬0')); + else callback(); + }, + trigger: 'submit' + } + ] + }, + }, + + // 鎺ュ彛鍦板潃閰嶇疆 + apiUrls: { + getInboundType: 'sys/dict/getDictItems/material_inbound_category', // 鑾峰彇鍏ュ簱绫诲瀷 + getWarehouse: 'base/lineSideWarehouse/queryByProductionType', // 鑾峰彇绾胯竟搴� + getMaterialInfo: 'lsw/lswMaterial/queryByMaterialNumber', // 閫氳繃鐗╂枡缂栫爜鏌ヤ俊鎭� + subInbound: 'lsw/materialInbound/add', // 鎻愪氦鍏ュ簱 + scan: 'lsw/lswMaterial/scan' + } + }; + }, + computed: { + // 浠嶸uex鑾峰彇鍏ㄥ眬鏁版嵁 + ...mapGetters(["currentLineName", "username", "currentLineId","currentLineType"]), + // 瀵艰埅鏍忔牱寮忥紙閫傞厤涓嶅悓璁惧鐘舵�佹爮锛� + navBarStyle() { + return `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;`; + } + }, + created() { + console.log(this.currentLineId) + console.log(this.currentLineType) + // 鍒濆鍖栵細鍔犺浇涓嬫媺鍒楄〃鏁版嵁 + this.initSelectData(); + this.handleMaterialCodeInputDebounced = this.debounce(this.handleMaterialCodeInput, 500); + }, + onShow() { + // 椤甸潰鏄剧ず鏃讹紝閲嶆柊鐩戝惉鎵爜浜嬩欢锛堥槻姝㈤噸澶嶇洃鍚級 + this.initScanListener(); + }, + methods: { + /** + * 1. 闃叉姈宸ュ叿鍑芥暟锛氶伩鍏嶈緭鍏ヨ繃绋嬩腑棰戠箒璋冪敤鎺ュ彛 + * @param {Function} fn - 瑕佹墽琛岀殑鐩爣鍑芥暟 + * @param {Number} delay - 寤惰繜鏃堕棿锛坢s锛� + */ + debounce(fn, delay) { + return (...args) => { + clearTimeout(this.debounceTimer); + this.debounceTimer = setTimeout(() => { + fn.apply(this, args); + }, delay); + }; + }, + /** + * 2. 鐗╂枡缂栫爜鎵嬪姩杈撳叆瀹屾垚鍚庤Е鍙戯細璋冪敤鎺ュ彛鏌ヨ鐗╂枡淇℃伅 + */ + handleMaterialCodeInput() { + const materialCode = this.formData.materialNumber.trim(); + // 鑻ヨ緭鍏ヤ负绌猴紝娓呯┖鍏宠仈瀛楁锛堜繚鎸佹暟鎹竴鑷存�э級 + if (!materialCode) { + this.formData.materialName = ''; + this.formData.batchNumber = ''; + this.formData.quantity = 1; + return; + } + + }, + + /** + * 鍒濆鍖栦笅鎷夊垪琛ㄦ暟鎹紙鍏ュ簱绫诲瀷銆佺嚎杈瑰簱锛� + */ + async initSelectData() { + try { + // 骞惰璇锋眰涓や釜鎺ュ彛锛屾彁鍗囧姞杞芥晥鐜� + const [typeRes, warehouseRes] = await Promise.all([ + // 鑾峰彇鍏ュ簱绫诲瀷瀛楀吀 + this.$http.get(this.apiUrls.getInboundType), + // 鑾峰彇绾胯竟搴擄紙绛涢�夋硶鍏扮被鐢熶骇绫诲瀷锛� + this.$http.get(this.apiUrls.getWarehouse, { + params: { + productionType: 'OUTERFLANGE,INNERFLANGE' + } + }) + ]); + + // 澶勭悊鍏ュ簱绫诲瀷鏁版嵁 + if (typeRes.data.success) { + this.inboundCategoryList = typeRes.data.result.map(item => ({ + value: item.value, + text: item.text + })); + } + + // 澶勭悊绾胯竟搴撴暟鎹� + if (warehouseRes.data.success) { + this.originalCodeDictOptions = warehouseRes.data.result || []; + + // 鎻愬彇褰撳墠浜х嚎ID + const currentLineId = this.currentLineId; + + // 绛涢�夌鍚堟潯浠剁殑浠撳簱鏁版嵁 + const filteredData = this.originalCodeDictOptions.filter(item => + item && item.factoryId !== undefined && item.factoryId === currentLineId + ); + + // 杞崲鏍煎紡 + this.warehouseIdList = filteredData.map(item => ({ + value: item.id ?? '', + text: `${item.warehouseName ?? ''}(${item.warehouseCode ?? ''})` + })); + + // 妫�鏌ユ槸鍚︽湁鍖归厤鐨勬暟鎹紝濡傛灉娌℃湁鍒欐彁绀� + if (this.warehouseIdList.length === 0) { + uni.showModal({ + title: '鎻愮ず', // 寮圭獥鏍囬锛堝彲閫夛紝澧炲己鍙鎬э級 + content: '褰撳墠浜х嚎鏃犳硶杩涜鐑鐞嗘搷浣滐紝璇烽噸鏂伴�夋嫨浜х嚎', + showCancel: false, + + confirmText: '鍘婚�夋嫨', + success: (res) => { + + if (res.confirm) { + uni.reLaunch({ + url: '/pages/index/index', + success: () => { + console.log('鐢ㄦ埛纭鍚庯紝宸茶烦杞嚦浜х嚎閫夋嫨椤甸潰'); + }, + fail: (err) => { + // 璺宠浆澶辫触鐨勫閿欏鐞� + console.error('椤甸潰璺宠浆澶辫触锛�', err); + uni.showToast({ + title: '璺宠浆澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 2000 + }); + } + }); + } + // 鑻howCancel: true锛屽彲娣诲姞else if (res.cancel) 澶勭悊鍙栨秷閫昏緫 + // else if (res.cancel) { console.log('鐢ㄦ埛鍙栨秷璺宠浆'); } + } + }); + } + + + console.log(`绛涢�夊嚭${this.warehouseIdList.length}涓尮閰嶅綋鍓嶄骇绾跨殑浠撳簱`); + } + + // 鏁版嵁鍔犺浇瀹屾垚锛岄殣钘忛鏋跺睆 + this.loading = false; + } catch (err) { + console.error('鍒濆鍖栦笅鎷夋暟鎹け璐ワ細', err); + uni.showToast({ + title: '鏁版嵁鍔犺浇澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 2000 + }); + // 澶辫触涔熼殣钘忛鏋跺睆锛岄伩鍏嶅崱浣� + this.loading = false; + } + }, + + /** + * 鍒濆鍖栨壂鐮佺洃鍚紙PDA鎵爜鍚庤Е鍙戯級 + */ + initScanListener() { + // 鍏堢Щ闄ゆ棫鐩戝惉锛岄槻姝㈤噸澶嶈Е鍙� + uni.$off('scancodedate'); + // 鐩戝惉鎵爜浜嬩欢 + uni.$on('scancodedate', (data) => { + if (data && data.code) { + const materialCode = data.code.trim(); + // 鎵爜鍚庡~鍏呯墿鏂欑紪鐮侊紝骞舵煡璇㈢墿鏂欎俊鎭� + console.log(materialCode) + this.getMaterialDetail(materialCode); + } else { + uni.showToast({ + title: '鎵爜鍐呭鏃犳晥', + icon: 'none', + duration: 1500 + }); + } + }); + }, + + /** + * 閫氳繃鐗╂枡缂栫爜鏌ヨ鐗╂枡璇︽儏锛堝悕绉扮瓑锛� + * @param {string} materialCode - 鐗╂枡缂栫爜 + */ + async getMaterialDetail(materialCode) { + if (!materialCode) return; + + try { + const res = await this.$http.get(this.apiUrls.scan, { + params: { + qrCode: materialCode + } + }); + + if (res.data.success && res.data.result) { + // 鑷姩濉厖鐗╂枡鍚嶇О + console.log(res.data.result) + + this.formData.materialNumber = res.data.result.materialNumber || ''; + this.formData.materialName = res.data.result.materialName || ''; + this.formData.batchNumber = res.data.result.batchNumber || ''; + this.formData.quantity = res.data.result.quantity || ''; + + } else { + this.formData.materialName = ''; + this.formData.materialNumber = ''; + this.formData.batchNumber = ''; + this.formData.quantity = 0; + uni.showToast({ + title: '鏈煡璇㈠埌鐗╂枡淇℃伅', + icon: 'none', + duration: 1500 + }); + } + } catch (err) { + console.error('鏌ヨ鐗╂枡淇℃伅澶辫触锛�', err); + this.formData.materialName = ''; + this.formData.batchNumber = ''; + this.formData.materialNumber = ''; + this.formData.quantity = 0; + uni.showToast({ + title: '鏌ヨ鐗╂枡澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 1500 + }); + } + }, + + /** + * 绾胯竟搴撻�夋嫨鍙樻洿浜嬩欢 + * @param {string} val - 閫変腑鐨勭嚎杈瑰簱ID + */ + changeWarehouseId(val) { + console.log(val) + this.warehouseId = val; + let warehouse = this.originalCodeDictOptions.find(option => option.id === val) + console.log(warehouse) + if (warehouse) { + this.formData.factoryId = warehouse.factoryId + console.log(this.formData.factoryId) + } else { + this.formData.factoryId = undefined + } + }, + + /** + * 鎻愪氦鍏ュ簱淇℃伅 + */ + async submitInbound() { + // 闃查噸澶嶆彁浜� + if (this.isSubmitting) { + uni.showToast({ + title: '姝e湪鎻愪氦涓紝璇峰嬁閲嶅鐐瑰嚮', + icon: 'none', + duration: 1500 + }); + return; + } + + // 1. 鍏堟墽琛岃〃鍗曟牎楠� + + const valid = await this.$refs.form.validate(); + if (!valid) { + // 鏍¢獙澶辫触锛屾彁绀虹敤鎴峰苟杩斿洖 + uni.showToast({ + icon: "none", + title: "琛ㄥ崟鏍¢獙澶辫触锛岃妫�鏌ュ繀濉」", + duration: 1500 + }); + return; + } + + // 2. 鏍¢獙閫氳繃锛屾墽琛屾彁浜ら�昏緫 + this.isSubmitting = true; + uni.showLoading({ + title: '鎻愪氦涓�...', + mask: true + }); + + try { + // 鏋勯�犳彁浜ゅ弬鏁� + const submitParams = { + batchNumber: this.formData.batchNumber, + factoryId: this.formData.factoryId, // 浠嶸uex鑾峰彇褰撳墠浜х嚎ID + inboundCategory: this.inboundCategory, + materialName: this.formData.materialName, + materialNumber: this.formData.materialNumber, + originalCode: this.formData.originalCode, + originalName: this.formData.originalName, + quantity: this.formData.quantity, + warehouseId: this.warehouseId + }; + + // 璋冪敤鍏ュ簱鎺ュ彛 + const res = await this.$http.post(this.apiUrls.subInbound, submitParams); + + if (res.data.success) { + // 鎻愪氦鎴愬姛锛屾彁绀哄苟璺宠浆 + uni.showToast({ + title: '鍏ュ簱鎴愬姛锛�', + icon: 'success', + duration: 2000 + }); + + // 寤惰繜2绉掕烦杞嚦璐ㄦ椤甸潰 + setTimeout(() => { + this.$Router.replaceAll({ + name: 'index' + }); + }, 2000); + } else { + // 鎻愪氦澶辫触锛屾樉绀哄叿浣撳師鍥� + uni.showModal({ + title: '鍏ュ簱澶辫触', + content: res.data.message || '鏈嶅姟鍣ㄥ鐞嗗け璐ワ紝璇风◢鍚庨噸璇�', + showCancel: false, + confirmText: '纭畾' + }); + } + } catch (err) { + // 缃戠粶鎴栨帴鍙e紓甯稿鐞� + console.error('鍏ュ簱璇锋眰澶辫触锛�', err); + const errorMsg = err.errMsg?.includes('timeout') ? + '璇锋眰瓒呮椂锛岃妫�鏌ョ綉缁�' : + '缃戠粶寮傚父锛岃閲嶈瘯'; + + uni.showToast({ + title: errorMsg, + icon: 'none', + duration: 2000 + }); + } finally { + // 鏃犺鎴愬姛澶辫触锛岄兘閲嶇疆鎻愪氦鐘舵�� + this.isSubmitting = false; + uni.hideLoading(); + } + } + } + }; +</script> + +<style scoped> + /* 琛ㄥ崟瀹瑰櫒鏍峰紡 */ + .form-container { + padding: 20rpx; + } + + /* 鎻愪氦鎸夐挳瀹瑰櫒 */ + .submit-btn-container { + margin-top: 40rpx; + display: flex; + justify-content: center; + } + + /* 鎻愪氦鎸夐挳鏍峰紡 */ + .submit-btn { + width: 80%; + padding: 15rpx 0 !important; + font-size: 32rpx !important; + } + + /* 鎸夐挳 hover 鏁堟灉 */ + .btn-hover { + background-color: #55aaff !important; + opacity: 0.9; + } + + /* 甯︽壂鐮佸浘鏍囩殑杈撳叆妗嗗鍣� */ + .input-with-scan { + position: relative; + width: 100%; + } + + /* 鎵爜鍥炬爣鏍峰紡 */ + .scan-icon { + position: absolute; + right: 15rpx; + top: 50%; + transform: translateY(-50%); + color: #666; + cursor: pointer; + } + + /* 楠ㄦ灦灞忔牱寮� */ + .skeleton-container { + padding: 20rpx; + } + + .skeleton-group { + margin-bottom: 40rpx; + } + + .skeleton-divider { + height: 40rpx; + width: 300rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 4rpx; + animation: skeleton-loading 1.4s ease infinite; + margin-bottom: 30rpx; + } + + .skeleton-item { + display: flex; + align-items: center; + margin-bottom: 30rpx; + } + + .skeleton-label { + width: 160rpx; + height: 40rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 4rpx; + animation: skeleton-loading 1.4s ease infinite; + margin-right: 20rpx; + } + + .skeleton-input { + flex: 1; + height: 60rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 8rpx; + animation: skeleton-loading 1.4s ease infinite; + } + + .skeleton-button { + width: 90%; + height: 80rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 10rpx; + animation: skeleton-loading 1.4s ease infinite; + margin: 40rpx auto; + } + + /* 楠ㄦ灦灞忓姩鐢� */ + @keyframes skeleton-loading { + 0% { + background-position: 100% 50%; + } + + 100% { + background-position: 0 50%; + } + } +</style> \ No newline at end of file diff --git a/pages/eam/production/HeatTreatmentStorageList/HeatTreatmentStorageList.vue b/pages/eam/production/HeatTreatmentStorageList/HeatTreatmentStorageList.vue new file mode 100644 index 0000000..3c36e4a --- /dev/null +++ b/pages/eam/production/HeatTreatmentStorageList/HeatTreatmentStorageList.vue @@ -0,0 +1,707 @@ +<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" class="nav-btn"> + <image 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"> + <!-- 鍩虹琛ㄥ崟鏍¢獙 --> + <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> + <uni-group title="" top="0"> + <uni-forms-item name="type" :labelWidth="80" label="鍏ュ簱绫诲瀷:"> + <uni-data-select v-model="formData.type" :localdata="typeList" @change="changetypeList" + placeholder="璇烽�夋嫨鍏ュ簱绫诲瀷" /> + </uni-forms-item> + <uni-forms-item name="materialNumber" :labelWidth="80" label="鐗╂枡缂栫爜:"> + <view class="input-with-scan"> + <uni-easyinput v-model="formData.materialNumber" placeholder="璇疯緭鍏ョ墿鏂欑紪鐮�" /> + </view> + </uni-forms-item> + </uni-group> + <uni-forms-item> + <view class="flex"> + <view + class="cuIcon-search flex-sub bg-blue radius 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> + </uni-forms-item> + </uni-forms> + </view> + </uni-popup> + </view> + + + + <!-- 鍒楄〃椤堕儴锛氭壒閲忔搷浣�+鐘舵�佺瓫閫� --> + <view class="industrial-list-header" style="margin-top: 10px;"> + <!-- 鎵归噺閫夋嫨 --> + <!-- 鐘舵�佸揩鎹风瓫閫� --> + <view class="status-filter"> + <view + class="filter-item" + :class="{active: currentFilterStatus === ''}" + @click="filterByStatus('')" + > + 鍏ㄩ儴 + </view> + <view + class="filter-item" + :class="{active: currentFilterStatus === 'MATERIAL_TRANSFER_REQUEST'}" + @click="filterByStatus('MATERIAL_TRANSFER_REQUEST')" + > + 鐗╂枡鎷夊姩 + </view> + <view + class="filter-item" + :class="{active: currentFilterStatus === 'PRODUCTION_INBOUND'}" + @click="filterByStatus('PRODUCTION_INBOUND')" + > + 鐢熶骇涓嬬嚎 + </view> + <view + class="filter-item" + :class="{active: currentFilterStatus === 'HEAT_TREATMENT_INBOUND'}" + @click="filterByStatus('HEAT_TREATMENT_INBOUND')" + > + 鐑鐞� + </view> + + <view + class="filter-item" + :class="{active: currentFilterStatus === 'SMALL_INNER_RING'}" + @click="filterByStatus('SMALL_INNER_RING')" + > + 灏忓唴鍦� + </view> + <view + class="filter-item" + :class="{active: currentFilterStatus === 'MATERIAL_INNER_TRANSFER'}" + @click="filterByStatus('MATERIAL_INNER_TRANSFER')" + > + 鍐呴儴璋冩嫧 + </view> + + <view + class="filter-item" + :class="{active: currentFilterStatus === 'PRODUCTION_UNLOADING'}" + @click="filterByStatus('PRODUCTION_UNLOADING')" + > + 涓嬫枡 + </view> + </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" + class="industrial-card" + @click="onClickProductionTask(item)" + > + <!-- 鏍稿績淇℃伅鍖猴紙榛樿灞曠ず锛� --> + <view class="core-info"> + <!-- 鐗╂枡缂栫爜+鍚嶇О --> + <view class="material-info"> + <text class="label">鐗╂枡锛�</text> + <text class="code">{{ item.materialNumber }}</text> + <text class="name">{{ item.materialName }}</text> + </view> + + <!-- 鎵规鍙�+鍏ュ簱鏁伴噺 --> + <view class="batch-qty"> + <text class="label">鎵规锛�</text> + <text class="batch">{{ item.batchNumber }}</text> + <text class="label qty-label">鏁伴噺锛�</text> + <text class="qty">{{ item.quantity }}</text> + </view> + </view> + + <!-- 娆¤淇℃伅鍖猴紙鎶樺彔灞曞紑锛� --> + <view class="expand-info" @click.stop="item.showExpand = !item.showExpand"> + <text class="expand-btn">{{ item.showExpand ? '鏀惰捣璇︽儏' : '灞曞紑璇︽儏' }}</text> + <uni-icons + :type="item.showExpand ? 'up' : 'down'" + size="14" + class="expand-icon" + /> + </view> + <view class="detail-info" v-if="item.showExpand"> + <view class="detail-row"> + <text class="detail-label">鏉ユ簮缂栫爜锛�</text> + <text class="detail-value">{{ item.originalCode }}</text> + </view> + <view class="detail-row"> + <text class="detail-label">鏉ユ簮鍚嶇О锛�</text> + <text class="detail-value">{{ item.originalName }}</text> + </view> + <view class="detail-row"> + <text class="detail-label">绾胯竟搴擄細</text> + <text class="detail-value">{{ item.warehouseId_dictText }}</text> + </view> + <view class="detail-row" > + <text class="detail-label">鍏ュ簱绫诲瀷锛�</text> + <text class="detail-value">{{ item.inboundCategory_dictText }}</text> + </view> + <view class="detail-row"> + <text class="detail-label">鍏ュ簱浜猴細</text> + <text class="detail-value">{{ item.receiver_dictText }}</text> + </view> + <view class="detail-row"> + <text class="detail-label">鍏ュ簱鏃堕棿锛�</text> + <text class="detail-value">{{ formatTime(item.receiveTime) }}</text> + </view> + </view> + </uni-card> + </view> + </mescroll-uni> + </view> + </view> +</template> + +<script> + import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; + import { mapGetters } from "vuex"; + + export default { + mixins: [MescrollMixin], // 浣跨敤mixin + data() { + return { + type: 'top', + showAddMenu: false, // 鏂板涓嬫媺鑿滃崟鏄剧ず鐘舵�� + selectAll: false, // 鍏ㄩ�夌姸鎬� + currentFilterStatus: '', // 褰撳墠绛涢�夌殑鐘舵�� + scrollLeft: 0, + formData: { + materialNumber: '', + type: '' + }, + NavBarColor: this.NavBarColor, + activeColor: '#5277A6', + url: { + inboundTypeDict: "/sys/dict/getDictItems/base_line_side_warehouse,warehouse_name,id,del_flag=0%20and%20warehouse_status='1'", + heatTreatmentInboundList: "/lsw/materialInbound/list", + exportInbound: "/lsw/materialInbound/export" + }, + + upOption: { + page: { + num: 1, // 褰撳墠椤电爜,浠�1寮�濮� + size: 10 // 姣忛〉鏁版嵁鐨勬暟閲� + }, + noMoreSize: 4, // 濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁 + empty: { + tip: '~ 鏆傛棤鐑鐞嗗叆搴撹褰� ~', // 鎻愮ず + }, + loading: '', + text: '鍏ㄩ儴', + isShowNoMore: false, + textNoMore: '宸插姞杞藉叏閮ㄦ暟鎹�' + }, + styles: { + color: '#2979FF', + borderColor: '#2979FF' + }, + typeList: [], + msgList: [], // 鍒楄〃鏁版嵁 + currentFilter: { // 褰撳墠绛涢�夋潯浠� + type: '', + materialNumber: '', + status: '' + }, + announcement1: [], + msg1Count: 0, + msg2Count: 0, + msg1Title: "" + } + }, + computed: { + ...mapGetters(["currentLineName", "username", "currentLineId"]), + top() { + return this.CustomBar * 2 + 180 + }, + 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() { + this.getTypeList() + }, + methods: { + /** + * 娴佺▼鍒嗙被鍒楄〃浜嬩欢 + */ + getTypeList() { + this.$http.get(this.url.inboundTypeDict).then(res => { + // 璁剧疆鍒楄〃鏁版嵁 + if (res.data.success) { + // 纭繚杩斿洖鏍煎紡涓篬{value: '缂栫爜', text: '鍚嶇О'}] + this.typeList = res.data.result.map(item => ({ + value: item.value, + text: item.text + })); + } + }).catch(err => { + console.error('鑾峰彇鍏ュ簱绫诲瀷澶辫触锛�', err); + uni.showToast({ + title: '鑾峰彇鍏ュ簱绫诲瀷澶辫触', + icon: 'none', + duration: 2000 + }); + }) + }, + + // 澶勭悊鍏ュ簱绫诲瀷閫夋嫨鍙樺寲 + changetypeList(e) { + this.formData.type = e; + }, + + + + /** + * 鏌ョ湅鍏ュ簱璇︽儏 + */ + onClickProductionTask(item) { + uni.navigateTo({ + url: `/pages/heatTreatmentInbound/detailInbound?id=${item.id}` + }); + }, + + // 鎵撳紑鎼滅储寮圭獥 + search() { + this.$refs.popup.open(); + }, + + // 涓婃媺鍔犺浇鍥炶皟 + upCallback(page) { + // 鎼哄甫褰撳墠绛涢�夋潯浠跺拰鍒嗛〉鍙傛暟 + const params = { + pageNo: page.num, + pageSize: page.size, + order: 'desc', + column: 'createTime', + warehouseId: this.formData.type, + materialNumber: this.currentFilter.materialNumber, + inboundCategory: this.currentFilter.status + }; + + this.$http.get(this.url.heatTreatmentInboundList, { params }) + .then(res => { + if (res.data.success) { + const newData = res.data.result.records || []; + // 涓烘瘡鏉℃暟鎹坊鍔犻�変腑鐘舵�佸拰灞曞紑鐘舵�� + const formattedData = newData.map(item => ({ + ...item, + selected: false, + showExpand: false + })); + + // 鍒嗛〉閫昏緫锛氱涓�椤佃鐩栨暟鎹紝鍚庣画椤佃拷鍔� + if (page.num === 1) { + this.msgList = formattedData; + } else { + this.msgList = this.msgList.concat(formattedData); + } + + // 鍛婅瘔mescroll鍔犺浇缁撴灉 + this.mescroll.endSuccess(formattedData.length, res.data.result.total); + // 鏇存柊缁熻淇℃伅 + this.msg1Count = res.data.result.total; + this.msg1Title = `閫氱煡(${this.msg1Count})`; + } else { + uni.showToast({ + title: res.data.message || '鑾峰彇鏁版嵁澶辫触', + icon: 'none', + duration: 2000 + }); + this.mescroll.endErr(); + } + }) + .catch(err => { + console.error('鍒嗛〉鍔犺浇澶辫触锛�', err); + uni.showToast({ + title: '鍔犺浇澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 2000 + }); + this.mescroll.endErr(); + }); + }, + + // 涓嬫媺鍒锋柊鍥炶皟 + downCallback() { + // 閲嶇疆椤电爜骞堕噸鏂板姞杞芥暟鎹� + this.mescroll.resetUpScroll(); + }, + + // 閲嶇疆绛涢�夋潯浠� + resetTask() { + this.formData = { + materialNumber: '', + type: '' + }; + this.currentFilter = { + type: '', + materialNumber: '', + inboundCategory: this.currentFilterStatus // 淇濈暀鐘舵�佺瓫閫� + }; + this.$refs.popup.close(); + this.mescroll.resetUpScroll(); + }, + + // 鎵ц绛涢�� + getSera() { + this.$refs.popup.close(); + // 淇濆瓨褰撳墠绛涢�夋潯浠� + this.currentFilter = { + ...this.currentFilter, + warehouseId: this.formData.type, + materialNumber: this.formData.materialNumber + }; + // 閲嶇疆鍒楄〃鍒扮涓�椤� + this.mescroll.resetUpScroll(); + }, + + // 鎸夌姸鎬佺瓫閫� + filterByStatus(status) { + this.currentFilterStatus = status; + // 鍚屾绛涢�夋潯浠� + this.currentFilter = { + ...this.currentFilter, + status: status + }; + // 閲嶇疆鍒楄〃骞跺姞杞芥暟鎹� + this.mescroll.resetUpScroll(); + }, + // 鍒濆鍖杕escroll + mescrollInit(mescroll) { + console.log('mescroll鍒濆鍖栧畬鎴�'); + this.mescroll = mescroll; + }, + + // 鏍煎紡鍖栨椂闂� + formatTime(timeStr) { + if (!timeStr) return ''; + // 绠�鍗曠殑鏃堕棿鏍煎紡鍖栫ず渚嬶紝鍙牴鎹疄闄呴渶姹傝皟鏁� + const date = new Date(timeStr); + return `${date.getFullYear()}-${(date.getMonth() + 1).toString().padStart(2, '0')}-${date.getDate().toString().padStart(2, '0')} ${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`; + }, + + // 鐘舵�佹牱寮忔槧灏勶紙宸ヤ笟鏍囧噯鑹诧級 + getStatusClass(status) { + const statusMap = { + 'HEAT_TREATMENT_INBOUND': 'status-completed', // 娣辩豢锛氭甯稿畬鎴� + 'SMALL_INNER_RING': 'status-pending', // 榛勮壊锛氬緟瀹℃牳 + 'MATERIAL_INNER_TRANSFER': 'status-rework', // 姗欒壊锛氳繑宸� + 'PRODUCTION_UNLOADING': 'status-abnormal' // 绾㈣壊锛氬紓甯� + }; + return statusMap[status] || 'status-default'; + } + }, + } +</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: 45px; + height: auto; + } + + /* 鏂板鎸夐挳涓嬫媺鑿滃崟鏍峰紡 */ + .industrial-add-menu { + background: #fff; + border-radius: 4px; + box-shadow: 0 2px 8px rgba(0,0,0,0.15); + padding: 8px 0; + } + .menu-item { + display: flex; + align-items: center; + padding: 10px 16px; + font-size: 14px; + color: #333; + } + .menu-item uni-icons { + margin-right: 8px; + } + .menu-item:active { + background: #f5f7fa; + } + + /* 鍒楄〃涓婃柟鎿嶄綔鏍� */ + .industrial-operation-bar { + display: flex; + align-items: center; + background: #fff; + border-radius: 4px; + padding: 8px 16px; + margin: 10px; + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + } + .operation-btn { + display: flex; + align-items: center; + margin-right: 20px; + color: #333; + font-size: 13px; + } + .operation-btn uni-icons { + margin-right: 4px; + } + .operation-btn:active { + color: #009688; /* 宸ヤ笟鍦烘櫙甯哥敤涓昏壊锛堟繁缁匡紝浠h〃鐢熶骇/鍚堟牸锛� */ + } + + /* 瀵艰埅鏍忔寜閽棿璺� */ + .nav-btn { + margin-left: 15px; + } + .add-icon-down { + margin-left: 3px; + } + + /* 鍒楄〃椤堕儴鏍峰紡 */ + .industrial-list-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 10px; + margin-bottom: 10px; + } + .batch-select { + display: flex; + align-items: center; + color: #333; + font-size: 13px; + } + .batch-text { + margin-left: 5px; + } + .status-filter { + display: flex; + align-items: center; + overflow-x: auto; + padding: 5px 0; + } + .filter-item { + padding: 4px 10px; + margin-left: 8px; + font-size: 10px; + border-radius: 12px; + background: #f5f5f5; + color: #666; + white-space: nowrap; + } + .filter-item:first-child { + margin-left: 0; + } + .filter-item.active { + background: #009688; + color: #fff; + } + .filter-item:active { + opacity: 0.8; + } + + /* 鍒楄〃鍗$墖鏍峰紡锛堝伐涓氶锛氱畝娲併�佺‖鏈楋級 */ + .industrial-card { + box-shadow: 0 1px 3px rgba(0,0,0,0.1); + border-radius: 4px; + border: none; + } + + /* 鐘舵�佹爣绛炬牱寮忥紙宸ヤ笟鏍囧噯鑹诧級 */ + .status-tag { + display: inline-block; + padding: 2px 8px; + border-radius: 2px; + font-size: 12px; + color: #fff; + margin-right: 10px; + } + .status-completed { + background: #009688; /* 宸ヤ笟鍚堟牸鑹诧細娣辩豢 */ + } + .status-pending { + background: #FFC107; /* 寰呭鐞嗚壊锛氶粍鑹� */ + color: #333; /* 榛勮壊鑳屾櫙閰嶆繁鑹叉枃瀛楋紝鎻愬崌鍙鎬� */ + } + .status-rework { + background: #FF9800; /* 杩斿伐鑹诧細姗欒壊 */ + } + .status-abnormal { + background: #F44336; /* 寮傚父鑹诧細绾㈣壊 */ + } + .status-default { + background: #9E9E9E; /* 榛樿鑹诧細鐏拌壊 */ + } + + /* 鏍稿績淇℃伅鍖哄竷灞� */ + .core-info { + display: flex; + flex-wrap: wrap; + align-items: center; + padding: 10px 0; + border-bottom: 1px solid #f5f5f5; + } + .item-checkbox { + margin-right: 10px; + } + .material-info { + flex: 1; + min-width: 200px; + margin: 5px 0; + } + .label { + font-size: 12px; + color: #666; + margin-right: 4px; + } + .code { + font-weight: bold; + color: #333; + margin-right: 8px; + } + .name { + font-size: 13px; + color: #333; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 150px; + } + .batch-qty { + flex: 1; + min-width: 200px; + margin: 5px 0; + display: flex; + align-items: center; + } + .batch { + font-size: 13px; + color: #333; + margin-right: 15px; + } + .qty-label { + margin-left: 10px; + } + .qty { + font-weight: bold; + color: #009688; /* 鏁伴噺鐢ㄤ富鑹茬獊鍑� */ + font-size: 14px; + } + + /* 蹇嵎鎿嶄綔鍖� */ + .quick-ops { + display: flex; + align-items: center; + margin-left: auto; + } + .op-btn { + display: flex; + flex-direction: column; + align-items: center; + margin-left: 15px; + font-size: 12px; + color: #666; + } + .op-btn uni-icons { + margin-bottom: 2px; + } + .op-btn:active { + color: #009688; + } + + /* 灞曞紑璇︽儏鍖� */ + .expand-info { + display: flex; + align-items: center; + justify-content: center; + padding: 8px 0; + color: #009688; + font-size: 12px; + cursor: pointer; + } + .expand-btn { + margin-right: 5px; + } + .detail-info { + padding: 10px 15px; + background: #fafafa; + border-radius: 4px; + margin-top: 8px; + } + .detail-row { + display: flex; + align-items: center; + margin-bottom: 6px; + font-size: 12px; + } + .detail-label { + width: 80px; + color: #666; + } + .detail-value { + color: #333; + flex: 1; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + + /* 甯︽壂鐮佸浘鏍囩殑杈撳叆妗� */ + .input-with-scan { + position: relative; + } + .scan-icon { + position: absolute; + right: 10px; + top: 50%; + transform: translateY(-50%); + color: #666; + } +</style> diff --git a/pages/eam/production/InternalTransfer/InternalTransfer.vue b/pages/eam/production/InternalTransfer/InternalTransfer.vue new file mode 100644 index 0000000..fbc6e2f --- /dev/null +++ b/pages/eam/production/InternalTransfer/InternalTransfer.vue @@ -0,0 +1,691 @@ +<template> + <view class="container"> + <!-- 椤堕儴瀵艰埅鏍� --> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">鍐呴儴璋冩嫧</block> + </cu-custom> + + <!-- 楠ㄦ灦灞忥紙鏁版嵁鍔犺浇鏃舵樉绀猴級 --> + <view v-if="loading" class="skeleton-container"> + <view class="skeleton-group"> + <view class="skeleton-divider"></view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + </view> + <view class="skeleton-button"></view> + </view> + + <!-- 瀹為檯琛ㄥ崟鍐呭锛堟暟鎹姞杞藉畬鎴愬悗鏄剧ず锛� --> + <view v-else class="form-container"> + <uni-forms ref="form" :modelValue="formData" :rules="formRules" validate-trigger="submit" + err-show-type="undertext"> + <uni-group top="1"> + <!-- 鏉ユ簮缂栫爜锛堝繀濉級 --> + <uni-forms-item :required="true" :label-width="100" name="originalCode" label="鏉ユ簮绾胯竟搴�:"> + <!-- <uni-easyinput v-model="formData.originalCode" placeholder="璇疯緭鍏ユ潵婧愮紪鐮�" /> --> + <uni-data-select v-model="formData.originalCode" :localdata="warehouseIdList" + @change="changeWarehouseId" placeholder="璇烽�夋嫨绾胯竟搴�" /> + </uni-forms-item> + + <!-- 鏉ユ簮鍚嶇О锛堝繀濉級 --> + <uni-forms-item :required="true" :label-width="100" name="originalName" label="鏉ユ簮鍚嶇О:"> + <uni-easyinput v-model="formData.originalName" placeholder="璇疯緭鍏ユ潵婧愬悕绉�" /> + </uni-forms-item> + + <!-- 绾胯竟搴擄紙蹇呭~锛� --> + <uni-forms-item :required="true" :label-width="100" name="warehouseId" label="绾胯竟搴�:"> + <uni-data-select v-model="warehouseId" :localdata="originalList" + @change="warehouseSelectChange" placeholder="璇烽�夋嫨绾胯竟搴�" /> + </uni-forms-item> + + <!-- 鐗╂枡缂栫爜锛堝繀濉紝甯︽壂鐮佸姛鑳斤級 --> + <uni-forms-item :required="true" :label-width="100" name="materialNumber" label="鐗╂枡缂栫爜:"> + <view class="input-with-scan"> + <uni-easyinput v-model="formData.materialNumber" placeholder="璇疯緭鍏ユ垨鎵爜鐗╂枡缂栫爜" + @blur="handleMaterialCodeInput" @input="handleMaterialCodeInputDebounced" /> + <uni-icons type="scan" size="18" class="scan-icon" /> + </view> + </uni-forms-item> + + <!-- 鎵规鍙凤紙蹇呭~锛� --> + <uni-forms-item :required="true" :label-width="100" name="batchNumber" label="鎵规鍙�:"> + <uni-easyinput v-model="formData.batchNumber" placeholder="璇疯緭鍏ユ壒娆″彿" /> + </uni-forms-item> + + <!-- 鐗╂枡鍚嶇О锛堥潪蹇呭~锛屾壂鐮佸悗鑷姩濉厖锛� --> + <uni-forms-item :label-width="100" name="materialName" label="鐗╂枡鍚嶇О:"> + <uni-easyinput v-model="formData.materialName" placeholder="鑷姩濉厖鎴栨墜鍔ㄨ緭鍏�" readonly /> + </uni-forms-item> + + <!-- 鍏ュ簱鏁伴噺锛堥潪蹇呭~锛屽缓璁ぇ浜�0锛� --> + <uni-forms-item :label-width="100" name="quantity" label="鍏ュ簱鏁伴噺:"> + <uni-number-box v-model="formData.quantity" :min="1" :max="9999" placeholder="璇疯緭鍏ュ叆搴撴暟閲�" /> + </uni-forms-item> + + <!-- 鍏ュ簱绫诲瀷锛堢鐢紝鍥哄畾涓虹儹澶勭悊鍏ュ簱锛� --> + <uni-forms-item :label-width="100" name="inboundCategory" label="鍏ュ簱绫诲瀷:"> + <uni-data-select v-model="inboundCategory" :localdata="inboundCategoryList" placeholder="鐑鐞嗗叆搴�" + :disabled="true" /> + </uni-forms-item> + </uni-group> + </uni-forms> + + <!-- 鎻愪氦鎸夐挳 --> + <view class="submit-btn-container"> + <view class="submit-btn bg-blue padding-sm margin-xl radius text-sm text-center text-white" + @click.stop="submitInbound" hover-class="btn-hover"> + 纭畾鍏ュ簱 + </view> + </view> + </view> + + <!-- PDA鎵爜缁勪欢 --> + <pdaScanVue ref="scanRef"></pdaScanVue> + </view> +</template> + +<script> + // 寮曞叆鎵爜缁勪欢 + import pdaScanVue from "@/components/mes/pdaScan.vue"; + // 寮曞叆Vuex鑾峰彇鍏ㄥ眬鏁版嵁 + import { + mapGetters + } from "vuex"; + + export default { + components: { + pdaScanVue + }, + data() { + return { + // 涓嬫媺鍒楄〃鏁版嵁 + debounceTimer: null, // 闃叉姈瀹氭椂鍣� + warehouseIdList: [], // 绾胯竟搴撳垪琛� + inboundCategoryList: [], // 鍏ュ簱绫诲瀷鍒楄〃 + originalList: [], + // 涓嬫媺鍒楄〃缁戝畾鍊� + warehouseId: '', // 閫変腑鐨勭嚎杈瑰簱ID + inboundCategory: 'MATERIAL_INNER_TRANSFER', // 鍥哄畾鐑鐞嗗叆搴撶被鍨� + + // 鍔犺浇鐘舵�侊紙鎺у埗楠ㄦ灦灞忔樉绀猴級 + loading: true, + // 闃查噸澶嶆彁浜ゆ爣璁� + isSubmitting: false, + // 瀵艰埅鏍忛鑹诧紙缁ф壙鍏ㄥ眬閰嶇疆锛� + NavBarColor: this.NavBarColor, + originalCodeDictOptions: [], + // 琛ㄥ崟鏁版嵁 + formData: { + factoryId: '', + originalCode: '', // 鏉ユ簮缂栫爜 + originalName: '', // 鏉ユ簮鍚嶇О + materialNumber: '', // 鐗╂枡缂栫爜 + batchNumber: '', // 鎵规鍙� + materialName: '', // 鐗╂枡鍚嶇О + quantity: 1 // 鍏ュ簱鏁伴噺锛堥粯璁�1锛� + }, + + // 琛ㄥ崟鏍¢獙瑙勫垯锛堥潪绌烘牎楠岋級 + formRules: { + // 鏉ユ簮缂栫爜锛堝繀濉級 + originalCode: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ潵婧愮紪鐮�', + trigger: 'blur' + }, + { + required: true, + message: '鏉ユ簮缂栫爜涓嶈兘涓虹┖', + trigger: 'submit' + } + ] + }, + // 鏉ユ簮鍚嶇О锛堝繀濉級 + originalName: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ潵婧愬悕绉�', + trigger: 'blur' + }, + { + required: true, + message: '鏉ユ簮鍚嶇О涓嶈兘涓虹┖', + trigger: 'submit' + } + ] + }, + + // 鐗╂枡缂栫爜锛堝繀濉級 + materialNumber: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ垨鎵爜鐗╂枡缂栫爜', + trigger: 'blur' + }, + { + required: true, + message: '鐗╂枡缂栫爜涓嶈兘涓虹┖', + trigger: 'submit' + } + ] + }, + // 鎵规鍙凤紙蹇呭~锛� + batchNumber: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ壒娆″彿', + trigger: 'blur' + }, + { + required: true, + message: '鎵规鍙蜂笉鑳戒负绌�', + trigger: 'submit' + } + ] + }, + // 鍏ュ簱鏁伴噺锛堥渶澶т簬0锛� + quantity: { + rules: [{ + validator: (rule, value, callback) => { + if (value < 1) callback(new Error('鍏ュ簱鏁伴噺闇�澶т簬0')); + else callback(); + }, + trigger: 'blur' + }, + { + validator: (rule, value, callback) => { + if (value < 1) callback(new Error('鍏ュ簱鏁伴噺闇�澶т簬0')); + else callback(); + }, + trigger: 'submit' + } + ] + }, + }, + + // 鎺ュ彛鍦板潃閰嶇疆 + apiUrls: { + getInboundType: 'sys/dict/getDictItems/material_inbound_category', // 鑾峰彇鍏ュ簱绫诲瀷 + getWarehouse: 'base/lineSideWarehouse/queryByProductionType', // 鑾峰彇绾胯竟搴� + getMaterialInfo: 'lsw/lswMaterial/queryByMaterialNumber', // 閫氳繃鐗╂枡缂栫爜鏌ヤ俊鎭� + subInbound: 'lsw/materialInbound/add', // 鎻愪氦鍏ュ簱 + scan: 'lsw/lswMaterial/scan' + } + }; + }, + computed: { + // 浠嶸uex鑾峰彇鍏ㄥ眬鏁版嵁 + ...mapGetters(["currentLineName", "username", "currentLineId"]), + // 瀵艰埅鏍忔牱寮忥紙閫傞厤涓嶅悓璁惧鐘舵�佹爮锛� + navBarStyle() { + return `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;`; + } + }, + created() { + // 鍒濆鍖栵細鍔犺浇涓嬫媺鍒楄〃鏁版嵁 + this.initSelectData(); + this.handleMaterialCodeInputDebounced = this.debounce(this.handleMaterialCodeInput, 500); + }, + onShow() { + // 椤甸潰鏄剧ず鏃讹紝閲嶆柊鐩戝惉鎵爜浜嬩欢锛堥槻姝㈤噸澶嶇洃鍚級 + this.initScanListener(); + }, + methods: { + /** + * 1. 闃叉姈宸ュ叿鍑芥暟锛氶伩鍏嶈緭鍏ヨ繃绋嬩腑棰戠箒璋冪敤鎺ュ彛 + * @param {Function} fn - 瑕佹墽琛岀殑鐩爣鍑芥暟 + * @param {Number} delay - 寤惰繜鏃堕棿锛坢s锛� + */ + debounce(fn, delay) { + return (...args) => { + clearTimeout(this.debounceTimer); + this.debounceTimer = setTimeout(() => { + fn.apply(this, args); + }, delay); + }; + }, + /** + * 2. 鐗╂枡缂栫爜鎵嬪姩杈撳叆瀹屾垚鍚庤Е鍙戯細璋冪敤鎺ュ彛鏌ヨ鐗╂枡淇℃伅 + */ + handleMaterialCodeInput() { + const materialCode = this.formData.materialNumber.trim(); + // 鑻ヨ緭鍏ヤ负绌猴紝娓呯┖鍏宠仈瀛楁锛堜繚鎸佹暟鎹竴鑷存�э級 + if (!materialCode) { + this.formData.materialName = ''; + this.formData.batchNumber = ''; + this.formData.quantity = 1; + return; + } + + }, + warehouseSelectChange(value) { + this.warehouseId = value; + console.log(value) + let warehouse = this.originalCodeDictOptions.find(option => option.id === value) + console.log(warehouse) + if (warehouse) { + this.formData.factoryId = warehouse.factoryId + console.log(this.formData.factoryId) + } else { + this.formData.factoryId = undefined + } + }, + /** + * 绾胯竟搴撻�夋嫨鍙樻洿浜嬩欢 + * @param {string} val - 閫変腑鐨勭嚎杈瑰簱ID + */ + changeWarehouseId(val) { + this.formData.originalCode = val; + console.log(this.originalCodeDictOptions) + + let warehouse = this.originalCodeDictOptions.find(option => option.warehouseCode === val) + + if (warehouse) { + this.formData.originalName = warehouse.warehouseName + } else { + this.formData.originalName = undefined + } + }, + /** + * 鍒濆鍖栦笅鎷夊垪琛ㄦ暟鎹紙鍏ュ簱绫诲瀷銆佺嚎杈瑰簱锛� + */ + async initSelectData() { + try { + // 骞惰璇锋眰涓や釜鎺ュ彛锛屾彁鍗囧姞杞芥晥鐜� + const [typeRes, warehouseRes] = await Promise.all([ + // 鑾峰彇鍏ュ簱绫诲瀷瀛楀吀 + this.$http.get(this.apiUrls.getInboundType), + // 鑾峰彇绾胯竟搴擄紙绛涢�夋硶鍏扮被鐢熶骇绫诲瀷锛� + this.$http.get(this.apiUrls.getWarehouse, { + params: { + productionType: 'ASSEMBLE' + } + }) + ]); + + // 澶勭悊鍏ュ簱绫诲瀷鏁版嵁 + if (typeRes.data.success) { + this.inboundCategoryList = typeRes.data.result.map(item => ({ + value: item.value, + text: item.text + })); + } + + // 澶勭悊绾胯竟搴撴暟鎹� + if (warehouseRes.data.success) { + this.originalCodeDictOptions = warehouseRes.data.result; + // this.originalList = warehouseRes.data.result.map(item => ({ + // value: item.id, + // text: `${item.warehouseName}(${item.warehouseCode})` + // })); + this.originalCodeDictOptions = warehouseRes.data.result || []; + + // 鎻愬彇褰撳墠浜х嚎ID + const currentLineId = this.currentLineId; + + // 绛涢�夌鍚堟潯浠剁殑浠撳簱鏁版嵁 + const filteredData = this.originalCodeDictOptions.filter(item => + item && item.factoryId !== undefined && item.factoryId === currentLineId + ); + + // 杞崲鏍煎紡 + this.originalList = filteredData.map(item => ({ + value: item.id ?? '', + text: `${item.warehouseName ?? ''}(${item.warehouseCode ?? ''})` + })); + + // 妫�鏌ユ槸鍚︽湁鍖归厤鐨勬暟鎹紝濡傛灉娌℃湁鍒欐彁绀� + if (this.originalList.length === 0) { + uni.showModal({ + title: '鎻愮ず', // 寮圭獥鏍囬锛堝彲閫夛紝澧炲己鍙鎬э級 + content: '褰撳墠浜х嚎鏃犳硶杩涜鍐呴儴璋冩嫧鎿嶄綔锛岃閲嶆柊閫夋嫨浜х嚎', + showCancel: false, + + confirmText: '鍘婚�夋嫨', + success: (res) => { + + if (res.confirm) { + uni.reLaunch({ + url: '/pages/index/index', + success: () => { + console.log('鐢ㄦ埛纭鍚庯紝宸茶烦杞嚦浜х嚎閫夋嫨椤甸潰'); + }, + fail: (err) => { + // 璺宠浆澶辫触鐨勫閿欏鐞� + console.error('椤甸潰璺宠浆澶辫触锛�', err); + uni.showToast({ + title: '璺宠浆澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 2000 + }); + } + }); + } + // 鑻howCancel: true锛屽彲娣诲姞else if (res.cancel) 澶勭悊鍙栨秷閫昏緫 + // else if (res.cancel) { console.log('鐢ㄦ埛鍙栨秷璺宠浆'); } + } + }); + } + + + console.log(`绛涢�夊嚭${this.warehouseIdList.length}涓尮閰嶅綋鍓嶄骇绾跨殑浠撳簱`); + + + + + + + + this.warehouseIdList = warehouseRes.data.result.map(item => ({ + value: item.warehouseCode, + text: `${item.warehouseName}(${item.warehouseCode})` + })); + } + + // 鏁版嵁鍔犺浇瀹屾垚锛岄殣钘忛鏋跺睆 + this.loading = false; + } catch (err) { + console.error('鍒濆鍖栦笅鎷夋暟鎹け璐ワ細', err); + uni.showToast({ + title: '鏁版嵁鍔犺浇澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 2000 + }); + // 澶辫触涔熼殣钘忛鏋跺睆锛岄伩鍏嶅崱浣� + this.loading = false; + } + }, + + /** + * 鍒濆鍖栨壂鐮佺洃鍚紙PDA鎵爜鍚庤Е鍙戯級 + */ + initScanListener() { + // 鍏堢Щ闄ゆ棫鐩戝惉锛岄槻姝㈤噸澶嶈Е鍙� + uni.$off('scancodedate'); + // 鐩戝惉鎵爜浜嬩欢 + uni.$on('scancodedate', (data) => { + if (data && data.code) { + const materialCode = data.code.trim(); + // 鎵爜鍚庡~鍏呯墿鏂欑紪鐮侊紝骞舵煡璇㈢墿鏂欎俊鎭� + this.formData.materialNumber = materialCode; + this.getMaterialDetail(materialCode); + } else { + uni.showToast({ + title: '鎵爜鍐呭鏃犳晥', + icon: 'none', + duration: 1500 + }); + } + }); + }, + + + /** + * 閫氳繃鐗╂枡缂栫爜鏌ヨ鐗╂枡璇︽儏锛堝悕绉扮瓑锛� + * @param {string} materialCode - 鐗╂枡缂栫爜 + */ + async getMaterialDetail(materialCode) { + if (!materialCode) return; + + try { + const res = await this.$http.get(this.apiUrls.scan, { + params: { + qrCode: materialCode + } + }); + + if (res.data.success && res.data.result) { + // 鑷姩濉厖鐗╂枡鍚嶇О + console.log(res.data.result) + + this.formData.materialNumber = res.data.result.materialNumber || ''; + this.formData.materialName = res.data.result.materialName || ''; + this.formData.batchNumber = res.data.result.batchNumber || ''; + this.formData.quantity = res.data.result.quantity || ''; + + } else { + this.formData.materialName = ''; + this.formData.materialNumber = ''; + this.formData.batchNumber = ''; + this.formData.quantity = 0; + uni.showToast({ + title: '鏈煡璇㈠埌鐗╂枡淇℃伅', + icon: 'none', + duration: 1500 + }); + } + } catch (err) { + console.error('鏌ヨ鐗╂枡淇℃伅澶辫触锛�', err); + this.formData.materialName = ''; + this.formData.batchNumber = ''; + this.formData.materialNumber = ''; + this.formData.quantity = 0; + uni.showToast({ + title: '鏌ヨ鐗╂枡澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 1500 + }); + } + }, + + + + /** + * 鎻愪氦鍏ュ簱淇℃伅 + */ + async submitInbound() { + // 闃查噸澶嶆彁浜� + if (this.isSubmitting) { + uni.showToast({ + title: '姝e湪鎻愪氦涓紝璇峰嬁閲嶅鐐瑰嚮', + icon: 'none', + duration: 1500 + }); + return; + } + + // 1. 鍏堟墽琛岃〃鍗曟牎楠� + + const valid = await this.$refs.form.validate(); + if (!valid) { + // 鏍¢獙澶辫触锛屾彁绀虹敤鎴峰苟杩斿洖 + uni.showToast({ + icon: "none", + title: "琛ㄥ崟鏍¢獙澶辫触锛岃妫�鏌ュ繀濉」", + duration: 1500 + }); + return; + } + + // 2. 鏍¢獙閫氳繃锛屾墽琛屾彁浜ら�昏緫 + this.isSubmitting = true; + uni.showLoading({ + title: '鎻愪氦涓�...', + mask: true + }); + + try { + // 鏋勯�犳彁浜ゅ弬鏁� + const submitParams = { + batchNumber: this.formData.batchNumber, + factoryId: this.formData.factoryId, + inboundCategory: this.inboundCategory, + materialName: this.formData.materialName, + materialNumber: this.formData.materialNumber, + originalCode: this.formData.originalCode, + originalName: this.formData.originalName, + quantity: this.formData.quantity, + warehouseId: this.warehouseId + }; + + // 璋冪敤鍏ュ簱鎺ュ彛 + const res = await this.$http.post(this.apiUrls.subInbound, submitParams); + + if (res.data.success) { + // 鎻愪氦鎴愬姛锛屾彁绀哄苟璺宠浆 + uni.showToast({ + title: '鍏ュ簱鎴愬姛锛�', + icon: 'success', + duration: 2000 + }); + + // 寤惰繜2绉掕烦杞嚦璐ㄦ椤甸潰 + setTimeout(() => { + this.$Router.replaceAll({ + name: 'index' + }); + }, 2000); + } else { + // 鎻愪氦澶辫触锛屾樉绀哄叿浣撳師鍥� + uni.showModal({ + title: '鍏ュ簱澶辫触', + content: res.data.message || '鏈嶅姟鍣ㄥ鐞嗗け璐ワ紝璇风◢鍚庨噸璇�', + showCancel: false, + confirmText: '纭畾' + }); + } + } catch (err) { + // 缃戠粶鎴栨帴鍙e紓甯稿鐞� + console.error('鍏ュ簱璇锋眰澶辫触锛�', err); + const errorMsg = err.errMsg?.includes('timeout') ? + '璇锋眰瓒呮椂锛岃妫�鏌ョ綉缁�' : + '缃戠粶寮傚父锛岃閲嶈瘯'; + + uni.showToast({ + title: errorMsg, + icon: 'none', + duration: 2000 + }); + } finally { + // 鏃犺鎴愬姛澶辫触锛岄兘閲嶇疆鎻愪氦鐘舵�� + this.isSubmitting = false; + uni.hideLoading(); + } + } + } + }; +</script> + +<style scoped> + /* 琛ㄥ崟瀹瑰櫒鏍峰紡 */ + .form-container { + padding: 20rpx; + } + + /* 鎻愪氦鎸夐挳瀹瑰櫒 */ + .submit-btn-container { + margin-top: 40rpx; + display: flex; + justify-content: center; + } + + /* 鎻愪氦鎸夐挳鏍峰紡 */ + .submit-btn { + width: 80%; + padding: 15rpx 0 !important; + font-size: 32rpx !important; + } + + /* 鎸夐挳 hover 鏁堟灉 */ + .btn-hover { + background-color: #55aaff !important; + opacity: 0.9; + } + + /* 甯︽壂鐮佸浘鏍囩殑杈撳叆妗嗗鍣� */ + .input-with-scan { + position: relative; + width: 100%; + } + + /* 鎵爜鍥炬爣鏍峰紡 */ + .scan-icon { + position: absolute; + right: 15rpx; + top: 50%; + transform: translateY(-50%); + color: #666; + cursor: pointer; + } + + /* 楠ㄦ灦灞忔牱寮� */ + .skeleton-container { + padding: 20rpx; + } + + .skeleton-group { + margin-bottom: 40rpx; + } + + .skeleton-divider { + height: 40rpx; + width: 300rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 4rpx; + animation: skeleton-loading 1.4s ease infinite; + margin-bottom: 30rpx; + } + + .skeleton-item { + display: flex; + align-items: center; + margin-bottom: 30rpx; + } + + .skeleton-label { + width: 160rpx; + height: 40rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 4rpx; + animation: skeleton-loading 1.4s ease infinite; + margin-right: 20rpx; + } + + .skeleton-input { + flex: 1; + height: 60rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 8rpx; + animation: skeleton-loading 1.4s ease infinite; + } + + .skeleton-button { + width: 90%; + height: 80rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 10rpx; + animation: skeleton-loading 1.4s ease infinite; + margin: 40rpx auto; + } + + /* 楠ㄦ灦灞忓姩鐢� */ + @keyframes skeleton-loading { + 0% { + background-position: 100% 50%; + } + + 100% { + background-position: 0 50%; + } + } +</style> \ No newline at end of file diff --git a/pages/eam/production/InternalTransferList/InternalTransferList.vue b/pages/eam/production/InternalTransferList/InternalTransferList.vue new file mode 100644 index 0000000..8183fd0 --- /dev/null +++ b/pages/eam/production/InternalTransferList/InternalTransferList.vue @@ -0,0 +1,22 @@ +<template> + <view> + + </view> +</template> + +<script> + export default { + data() { + return { + + } + }, + methods: { + + } + } +</script> + +<style> + +</style> diff --git a/pages/eam/production/SmallInnerRingInboundValidator/SmallInnerRingInboundValidator.vue b/pages/eam/production/SmallInnerRingInboundValidator/SmallInnerRingInboundValidator.vue new file mode 100644 index 0000000..f6b0c79 --- /dev/null +++ b/pages/eam/production/SmallInnerRingInboundValidator/SmallInnerRingInboundValidator.vue @@ -0,0 +1,666 @@ +<template> + <view class="container"> + <!-- 椤堕儴瀵艰埅鏍� --> + <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="productionTask"> + <block slot="backText">杩斿洖</block> + <block slot="content">灏忓唴鍦堝叆搴�</block> + </cu-custom> + + <!-- 楠ㄦ灦灞忥紙鏁版嵁鍔犺浇鏃舵樉绀猴級 --> + <view v-if="loading" class="skeleton-container"> + <view class="skeleton-group"> + <view class="skeleton-divider"></view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + <view class="skeleton-item"> + <view class="skeleton-label"></view> + <view class="skeleton-input"></view> + </view> + </view> + <view class="skeleton-button"></view> + </view> + + <!-- 瀹為檯琛ㄥ崟鍐呭锛堟暟鎹姞杞藉畬鎴愬悗鏄剧ず锛� --> + <view v-else class="form-container"> + <uni-forms ref="form" :modelValue="formData" :rules="formRules" validate-trigger="submit" + err-show-type="undertext"> + <uni-group top="1"> + <!-- 鏉ユ簮缂栫爜锛堝繀濉級 --> + <uni-forms-item :required="true" :label-width="100" name="originalCode" label="鏉ユ簮缂栫爜:"> + <uni-easyinput v-model="formData.originalCode" placeholder="璇疯緭鍏ユ潵婧愮紪鐮�" /> + </uni-forms-item> + + <!-- 鏉ユ簮鍚嶇О锛堝繀濉級 --> + <uni-forms-item :required="true" :label-width="100" name="originalName" label="鏉ユ簮鍚嶇О:"> + <uni-easyinput v-model="formData.originalName" placeholder="璇疯緭鍏ユ潵婧愬悕绉�" /> + </uni-forms-item> + + <!-- 绾胯竟搴擄紙蹇呭~锛� --> + <uni-forms-item :required="true" :label-width="100" name="warehouseId" label="绾胯竟搴�:"> + <uni-data-select v-model="warehouseId" :localdata="warehouseIdList" @change="changeWarehouseId" + placeholder="璇烽�夋嫨绾胯竟搴�" /> + </uni-forms-item> + + <!-- 鐗╂枡缂栫爜锛堝繀濉紝甯︽壂鐮佸姛鑳斤級 --> + <uni-forms-item :required="true" :label-width="100" name="materialNumber" label="鐗╂枡缂栫爜:"> + <view class="input-with-scan"> + <uni-easyinput v-model="formData.materialNumber" placeholder="璇疯緭鍏ユ垨鎵爜鐗╂枡缂栫爜" + @blur="handleMaterialCodeInput" @input="handleMaterialCodeInputDebounced" /> + <uni-icons type="scan" size="18" class="scan-icon" /> + </view> + </uni-forms-item> + + <!-- 鎵规鍙凤紙蹇呭~锛� --> + <uni-forms-item :required="true" :label-width="100" name="batchNumber" label="鎵规鍙�:"> + <uni-easyinput v-model="formData.batchNumber" placeholder="璇疯緭鍏ユ壒娆″彿" /> + </uni-forms-item> + + <!-- 鐗╂枡鍚嶇О锛堥潪蹇呭~锛屾壂鐮佸悗鑷姩濉厖锛� --> + <uni-forms-item :label-width="100" name="materialName" label="鐗╂枡鍚嶇О:"> + <uni-easyinput v-model="formData.materialName" placeholder="鑷姩濉厖鎴栨墜鍔ㄨ緭鍏�" readonly /> + </uni-forms-item> + + <!-- 鍏ュ簱鏁伴噺锛堥潪蹇呭~锛屽缓璁ぇ浜�0锛� --> + <uni-forms-item :label-width="100" name="quantity" label="鍏ュ簱鏁伴噺:"> + <uni-number-box v-model="formData.quantity" :min="1" :max="9999" placeholder="璇疯緭鍏ュ叆搴撴暟閲�" /> + </uni-forms-item> + + <!-- 鍏ュ簱绫诲瀷锛堢鐢紝鍥哄畾涓虹儹澶勭悊鍏ュ簱锛� --> + <uni-forms-item :label-width="100" name="inboundCategory" label="鍏ュ簱绫诲瀷:"> + <uni-data-select v-model="inboundCategory" :localdata="inboundCategoryList" placeholder="鐑鐞嗗叆搴�" + :disabled="true" /> + </uni-forms-item> + </uni-group> + </uni-forms> + + <!-- 鎻愪氦鎸夐挳 --> + <view class="submit-btn-container"> + <view class="submit-btn bg-blue padding-sm margin-xl radius text-sm text-center text-white" + @click.stop="submitInbound" hover-class="btn-hover"> + 纭畾鍏ュ簱 + </view> + </view> + </view> + + <!-- PDA鎵爜缁勪欢 --> + <pdaScanVue ref="scanRef"></pdaScanVue> + </view> +</template> + +<script> + // 寮曞叆鎵爜缁勪欢 + import pdaScanVue from "@/components/mes/pdaScan.vue"; + // 寮曞叆Vuex鑾峰彇鍏ㄥ眬鏁版嵁 + import { + mapGetters + } from "vuex"; + + export default { + components: { + pdaScanVue + }, + data() { + return { + debounceTimer: null, // 闃叉姈瀹氭椂鍣� + // 涓嬫媺鍒楄〃鏁版嵁 + warehouseIdList: [], // 绾胯竟搴撳垪琛� + inboundCategoryList: [], // 鍏ュ簱绫诲瀷鍒楄〃 + + // 涓嬫媺鍒楄〃缁戝畾鍊� + warehouseId: '', // 閫変腑鐨勭嚎杈瑰簱ID + inboundCategory: 'SMALL_INNER_RING', // 鍥哄畾鐑鐞嗗叆搴撶被鍨� + originalCodeDictOptions: [], + // 鍔犺浇鐘舵�侊紙鎺у埗楠ㄦ灦灞忔樉绀猴級 + loading: true, + // 闃查噸澶嶆彁浜ゆ爣璁� + isSubmitting: false, + // 瀵艰埅鏍忛鑹诧紙缁ф壙鍏ㄥ眬閰嶇疆锛� + NavBarColor: this.NavBarColor, + + // 琛ㄥ崟鏁版嵁 + formData: { + factoryId: '', + originalCode: '', // 鏉ユ簮缂栫爜 + originalName: '', // 鏉ユ簮鍚嶇О + materialNumber: '', // 鐗╂枡缂栫爜 + batchNumber: '', // 鎵规鍙� + materialName: '', // 鐗╂枡鍚嶇О + quantity: 1 // 鍏ュ簱鏁伴噺锛堥粯璁�1锛� + }, + + // 琛ㄥ崟鏍¢獙瑙勫垯锛堥潪绌烘牎楠岋級 + formRules: { + // 鏉ユ簮缂栫爜锛堝繀濉級 + originalCode: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ潵婧愮紪鐮�', + trigger: 'blur' + }, + { + required: true, + message: '鏉ユ簮缂栫爜涓嶈兘涓虹┖', + trigger: 'submit' + } + ] + }, + // 鏉ユ簮鍚嶇О锛堝繀濉級 + originalName: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ潵婧愬悕绉�', + trigger: 'blur' + }, + { + required: true, + message: '鏉ユ簮鍚嶇О涓嶈兘涓虹┖', + trigger: 'submit' + } + ] + }, + + // 鐗╂枡缂栫爜锛堝繀濉級 + materialNumber: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ垨鎵爜鐗╂枡缂栫爜', + trigger: 'blur' + }, + { + required: true, + message: '鐗╂枡缂栫爜涓嶈兘涓虹┖', + trigger: 'submit' + } + ] + }, + // 鎵规鍙凤紙蹇呭~锛� + batchNumber: { + rules: [{ + required: true, + message: '璇疯緭鍏ユ壒娆″彿', + trigger: 'blur' + }, + { + required: true, + message: '鎵规鍙蜂笉鑳戒负绌�', + trigger: 'submit' + } + ] + }, + // 鍏ュ簱鏁伴噺锛堥渶澶т簬0锛� + quantity: { + rules: [{ + validator: (rule, value, callback) => { + if (value < 1) callback(new Error('鍏ュ簱鏁伴噺闇�澶т簬0')); + else callback(); + }, + trigger: 'blur' + }, + { + validator: (rule, value, callback) => { + if (value < 1) callback(new Error('鍏ュ簱鏁伴噺闇�澶т簬0')); + else callback(); + }, + trigger: 'submit' + } + ] + }, + }, + + // 鎺ュ彛鍦板潃閰嶇疆 + apiUrls: { + getInboundType: 'sys/dict/getDictItems/material_inbound_category', // 鑾峰彇鍏ュ簱绫诲瀷 + getWarehouse: 'base/lineSideWarehouse/queryByProductionType', // 鑾峰彇绾胯竟搴� + getMaterialInfo: 'lsw/lswMaterial/queryByMaterialNumber', // 閫氳繃鐗╂枡缂栫爜鏌ヤ俊鎭� + subInbound: 'lsw/materialInbound/add', // 鎻愪氦鍏ュ簱 + scan: 'lsw/lswMaterial/scan' + } + }; + }, + computed: { + // 浠嶸uex鑾峰彇鍏ㄥ眬鏁版嵁 + ...mapGetters(["currentLineName", "username", "currentLineId"]), + // 瀵艰埅鏍忔牱寮忥紙閫傞厤涓嶅悓璁惧鐘舵�佹爮锛� + navBarStyle() { + return `height:${this.CustomBar}px;padding-top:${this.StatusBar}px;`; + } + }, + created() { + // 鍒濆鍖栵細鍔犺浇涓嬫媺鍒楄〃鏁版嵁 + this.initSelectData(); + this.handleMaterialCodeInputDebounced = this.debounce(this.handleMaterialCodeInput, 500); + }, + onShow() { + // 椤甸潰鏄剧ず鏃讹紝閲嶆柊鐩戝惉鎵爜浜嬩欢锛堥槻姝㈤噸澶嶇洃鍚級 + this.initScanListener(); + }, + methods: { + /** + * 1. 闃叉姈宸ュ叿鍑芥暟锛氶伩鍏嶈緭鍏ヨ繃绋嬩腑棰戠箒璋冪敤鎺ュ彛 + * @param {Function} fn - 瑕佹墽琛岀殑鐩爣鍑芥暟 + * @param {Number} delay - 寤惰繜鏃堕棿锛坢s锛� + */ + debounce(fn, delay) { + return (...args) => { + clearTimeout(this.debounceTimer); + this.debounceTimer = setTimeout(() => { + fn.apply(this, args); + }, delay); + }; + }, + /** + * 2. 鐗╂枡缂栫爜鎵嬪姩杈撳叆瀹屾垚鍚庤Е鍙戯細璋冪敤鎺ュ彛鏌ヨ鐗╂枡淇℃伅 + */ + handleMaterialCodeInput() { + const materialCode = this.formData.materialNumber.trim(); + // 鑻ヨ緭鍏ヤ负绌猴紝娓呯┖鍏宠仈瀛楁锛堜繚鎸佹暟鎹竴鑷存�э級 + if (!materialCode) { + this.formData.materialName = ''; + this.formData.batchNumber = ''; + this.formData.quantity = 1; + return; + } + + }, + /** + * 鍒濆鍖栦笅鎷夊垪琛ㄦ暟鎹紙鍏ュ簱绫诲瀷銆佺嚎杈瑰簱锛� + */ + async initSelectData() { + try { + // 骞惰璇锋眰涓や釜鎺ュ彛锛屾彁鍗囧姞杞芥晥鐜� + const [typeRes, warehouseRes] = await Promise.all([ + // 鑾峰彇鍏ュ簱绫诲瀷瀛楀吀 + this.$http.get(this.apiUrls.getInboundType), + // 鑾峰彇绾胯竟搴擄紙绛涢�夋硶鍏扮被鐢熶骇绫诲瀷锛� + this.$http.get(this.apiUrls.getWarehouse, { + params: { + productionType: 'ASSEMBLE' + } + }) + ]); + + // 澶勭悊鍏ュ簱绫诲瀷鏁版嵁 + if (typeRes.data.success) { + this.inboundCategoryList = typeRes.data.result.map(item => ({ + value: item.value, + text: item.text + })); + } + + // 澶勭悊绾胯竟搴撴暟鎹� + // if (warehouseRes.data.success) { + // this.originalCodeDictOptions = warehouseRes.data.result; + // this.warehouseIdList = warehouseRes.data.result.map(item => ({ + // value: item.id, + // text: `${item.warehouseName}(${item.warehouseCode})` + // })); + // } + if (warehouseRes.data.success) { + this.originalCodeDictOptions = warehouseRes.data.result || []; + + // 鎻愬彇褰撳墠浜х嚎ID + const currentLineId = this.currentLineId; + + // 绛涢�夌鍚堟潯浠剁殑浠撳簱鏁版嵁 + const filteredData = this.originalCodeDictOptions.filter(item => + item && item.factoryId !== undefined && item.factoryId === currentLineId + ); + + // 杞崲鏍煎紡 + this.warehouseIdList = filteredData.map(item => ({ + value: item.id ?? '', + text: `${item.warehouseName ?? ''}(${item.warehouseCode ?? ''})` + })); + + // 妫�鏌ユ槸鍚︽湁鍖归厤鐨勬暟鎹紝濡傛灉娌℃湁鍒欐彁绀� + if (this.warehouseIdList.length === 0) { + uni.showModal({ + title: '鎻愮ず', // 寮圭獥鏍囬锛堝彲閫夛紝澧炲己鍙鎬э級 + content: '褰撳墠浜х嚎鏃犳硶杩涜鐑皬鍐呭湀鎿嶄綔锛岃閲嶆柊閫夋嫨浜х嚎', + showCancel: false, + + confirmText: '鍘婚�夋嫨', + success: (res) => { + + if (res.confirm) { + uni.reLaunch({ + url: '/pages/index/index', + success: () => { + console.log('鐢ㄦ埛纭鍚庯紝宸茶烦杞嚦浜х嚎閫夋嫨椤甸潰'); + }, + fail: (err) => { + // 璺宠浆澶辫触鐨勫閿欏鐞� + console.error('椤甸潰璺宠浆澶辫触锛�', err); + uni.showToast({ + title: '璺宠浆澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 2000 + }); + } + }); + } + // 鑻howCancel: true锛屽彲娣诲姞else if (res.cancel) 澶勭悊鍙栨秷閫昏緫 + // else if (res.cancel) { console.log('鐢ㄦ埛鍙栨秷璺宠浆'); } + } + }); + } + console.log(`绛涢�夊嚭${this.warehouseIdList.length}涓尮閰嶅綋鍓嶄骇绾跨殑浠撳簱`); + } + // 鏁版嵁鍔犺浇瀹屾垚锛岄殣钘忛鏋跺睆 + this.loading = false; + } catch (err) { + console.error('鍒濆鍖栦笅鎷夋暟鎹け璐ワ細', err); + uni.showToast({ + title: '鏁版嵁鍔犺浇澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 2000 + }); + // 澶辫触涔熼殣钘忛鏋跺睆锛岄伩鍏嶅崱浣� + this.loading = false; + } + }, + + /** + * 鍒濆鍖栨壂鐮佺洃鍚紙PDA鎵爜鍚庤Е鍙戯級 + */ + initScanListener() { + // 鍏堢Щ闄ゆ棫鐩戝惉锛岄槻姝㈤噸澶嶈Е鍙� + uni.$off('scancodedate'); + // 鐩戝惉鎵爜浜嬩欢 + uni.$on('scancodedate', (data) => { + if (data && data.code) { + const materialCode = data.code.trim(); + // 鎵爜鍚庡~鍏呯墿鏂欑紪鐮侊紝骞舵煡璇㈢墿鏂欎俊鎭� + this.formData.materialNumber = materialCode; + this.getMaterialDetail(materialCode); + } else { + uni.showToast({ + title: '鎵爜鍐呭鏃犳晥', + icon: 'none', + duration: 1500 + }); + } + }); + }, + + + + /** + * 閫氳繃鐗╂枡缂栫爜鏌ヨ鐗╂枡璇︽儏锛堝悕绉扮瓑锛� + * @param {string} materialCode - 鐗╂枡缂栫爜 + */ + async getMaterialDetail(materialCode) { + if (!materialCode) return; + + try { + const res = await this.$http.get(this.apiUrls.scan, { + params: { + qrCode: materialCode + } + }); + + if (res.data.success && res.data.result) { + // 鑷姩濉厖鐗╂枡鍚嶇О + console.log(res.data.result) + + this.formData.materialNumber = res.data.result.materialNumber || ''; + this.formData.materialName = res.data.result.materialName || ''; + this.formData.batchNumber = res.data.result.batchNumber || ''; + this.formData.quantity = res.data.result.quantity || ''; + + } else { + this.formData.materialName = ''; + this.formData.materialNumber = ''; + this.formData.batchNumber = ''; + this.formData.quantity = 0; + uni.showToast({ + title: '鏈煡璇㈠埌鐗╂枡淇℃伅', + icon: 'none', + duration: 1500 + }); + } + } catch (err) { + console.error('鏌ヨ鐗╂枡淇℃伅澶辫触锛�', err); + this.formData.materialName = ''; + this.formData.batchNumber = ''; + this.formData.materialNumber = ''; + this.formData.quantity = 0; + uni.showToast({ + title: '鏌ヨ鐗╂枡澶辫触锛岃閲嶈瘯', + icon: 'none', + duration: 1500 + }); + } + }, + + + /** + * 绾胯竟搴撻�夋嫨鍙樻洿浜嬩欢 + * @param {string} val - 閫変腑鐨勭嚎杈瑰簱ID + */ + changeWarehouseId(val) { + this.warehouseId = val; + let warehouse = this.originalCodeDictOptions.find(option => option.id === val) + console.log(warehouse) + if (warehouse) { + this.formData.factoryId = warehouse.factoryId + console.log(this.formData.factoryId) + } else { + this.formData.factoryId = undefined + } + + }, + + /** + * 鎻愪氦鍏ュ簱淇℃伅 + */ + async submitInbound() { + // 闃查噸澶嶆彁浜� + if (this.isSubmitting) { + uni.showToast({ + title: '姝e湪鎻愪氦涓紝璇峰嬁閲嶅鐐瑰嚮', + icon: 'none', + duration: 1500 + }); + return; + } + + // 1. 鍏堟墽琛岃〃鍗曟牎楠� + + const valid = await this.$refs.form.validate(); + if (!valid) { + // 鏍¢獙澶辫触锛屾彁绀虹敤鎴峰苟杩斿洖 + uni.showToast({ + icon: "none", + title: "琛ㄥ崟鏍¢獙澶辫触锛岃妫�鏌ュ繀濉」", + duration: 1500 + }); + return; + } + + // 2. 鏍¢獙閫氳繃锛屾墽琛屾彁浜ら�昏緫 + this.isSubmitting = true; + uni.showLoading({ + title: '鎻愪氦涓�...', + mask: true + }); + + try { + // 鏋勯�犳彁浜ゅ弬鏁� + const submitParams = { + batchNumber: this.formData.batchNumber, + factoryId: this.formData.factoryId, + inboundCategory: this.inboundCategory, + materialName: this.formData.materialName, + materialNumber: this.formData.materialNumber, + originalCode: this.formData.originalCode, + originalName: this.formData.originalName, + quantity: this.formData.quantity, + warehouseId: this.warehouseId + }; + + // 璋冪敤鍏ュ簱鎺ュ彛 + const res = await this.$http.post(this.apiUrls.subInbound, submitParams); + + if (res.data.success) { + // 鎻愪氦鎴愬姛锛屾彁绀哄苟璺宠浆 + uni.showToast({ + title: '鍏ュ簱鎴愬姛锛�', + icon: 'success', + duration: 2000 + }); + + // 寤惰繜2绉掕烦杞嚦璐ㄦ椤甸潰 + setTimeout(() => { + this.$Router.replaceAll({ + name: 'index' + }); + }, 2000); + } else { + // 鎻愪氦澶辫触锛屾樉绀哄叿浣撳師鍥� + uni.showModal({ + title: '鍏ュ簱澶辫触', + content: res.data.message || '鏈嶅姟鍣ㄥ鐞嗗け璐ワ紝璇风◢鍚庨噸璇�', + showCancel: false, + confirmText: '纭畾' + }); + } + } catch (err) { + // 缃戠粶鎴栨帴鍙e紓甯稿鐞� + console.error('鍏ュ簱璇锋眰澶辫触锛�', err); + const errorMsg = err.errMsg?.includes('timeout') ? + '璇锋眰瓒呮椂锛岃妫�鏌ョ綉缁�' : + '缃戠粶寮傚父锛岃閲嶈瘯'; + + uni.showToast({ + title: errorMsg, + icon: 'none', + duration: 2000 + }); + } finally { + // 鏃犺鎴愬姛澶辫触锛岄兘閲嶇疆鎻愪氦鐘舵�� + this.isSubmitting = false; + uni.hideLoading(); + } + } + } + }; +</script> + +<style scoped> + /* 琛ㄥ崟瀹瑰櫒鏍峰紡 */ + .form-container { + padding: 20rpx; + } + + /* 鎻愪氦鎸夐挳瀹瑰櫒 */ + .submit-btn-container { + margin-top: 40rpx; + display: flex; + justify-content: center; + } + + /* 鎻愪氦鎸夐挳鏍峰紡 */ + .submit-btn { + width: 80%; + padding: 15rpx 0 !important; + font-size: 32rpx !important; + } + + /* 鎸夐挳 hover 鏁堟灉 */ + .btn-hover { + background-color: #55aaff !important; + opacity: 0.9; + } + + /* 甯︽壂鐮佸浘鏍囩殑杈撳叆妗嗗鍣� */ + .input-with-scan { + position: relative; + width: 100%; + } + + /* 鎵爜鍥炬爣鏍峰紡 */ + .scan-icon { + position: absolute; + right: 15rpx; + top: 50%; + transform: translateY(-50%); + color: #666; + cursor: pointer; + } + + /* 楠ㄦ灦灞忔牱寮� */ + .skeleton-container { + padding: 20rpx; + } + + .skeleton-group { + margin-bottom: 40rpx; + } + + .skeleton-divider { + height: 40rpx; + width: 300rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 4rpx; + animation: skeleton-loading 1.4s ease infinite; + margin-bottom: 30rpx; + } + + .skeleton-item { + display: flex; + align-items: center; + margin-bottom: 30rpx; + } + + .skeleton-label { + width: 160rpx; + height: 40rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 4rpx; + animation: skeleton-loading 1.4s ease infinite; + margin-right: 20rpx; + } + + .skeleton-input { + flex: 1; + height: 60rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 8rpx; + animation: skeleton-loading 1.4s ease infinite; + } + + .skeleton-button { + width: 90%; + height: 80rpx; + background: linear-gradient(90deg, #f2f2f2 25%, #e6e6e6 37%, #f2f2f2 63%); + background-size: 400% 100%; + border-radius: 10rpx; + animation: skeleton-loading 1.4s ease infinite; + margin: 40rpx auto; + } + + /* 楠ㄦ灦灞忓姩鐢� */ + @keyframes skeleton-loading { + 0% { + background-position: 100% 50%; + } + + 100% { + background-position: 0 50%; + } + } +</style> \ No newline at end of file diff --git a/pages/eam/production/SmallInnerRingInboundValidatorList/SmallInnerRingInboundValidatorList.vue b/pages/eam/production/SmallInnerRingInboundValidatorList/SmallInnerRingInboundValidatorList.vue new file mode 100644 index 0000000..8183fd0 --- /dev/null +++ b/pages/eam/production/SmallInnerRingInboundValidatorList/SmallInnerRingInboundValidatorList.vue @@ -0,0 +1,22 @@ +<template> + <view> + + </view> +</template> + +<script> + export default { + data() { + return { + + } + }, + methods: { + + } + } +</script> + +<style> + +</style> diff --git a/pages/eam/production/ToDoList/ToDoList.vue b/pages/eam/production/ToDoList/ToDoList.vue index 1cf7501..73a5cd7 100644 --- a/pages/eam/production/ToDoList/ToDoList.vue +++ b/pages/eam/production/ToDoList/ToDoList.vue @@ -27,35 +27,32 @@ <uni-easyinput v-model="formData.orderNum" :disabled="true" /> </uni-forms-item> - <uni-forms-item :label-width="80" name="num" label="璁惧缂栫爜:"> + <uni-forms-item :label-width="80" name="num" label="璁惧缂栧彿:"> <uni-easyinput v-model="formData.inspectionStatus_dictText" :disabled="true" /> </uni-forms-item> - <uni-forms-item :label-width="80" name="installationPosition_dictText" label="瀹夎浣嶇疆:"> + <uni-forms-item :label-width="80" name="installationPosition_dictText" label="鏍囧噯鍚嶇О:"> <uni-easyinput v-model="formData.installationPosition_dictText" :disabled="true" /> </uni-forms-item> - <uni-forms-item :label-width="80" name="remark" label="鐐规鏃ユ湡:"> + <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-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="formData.remark" label="澶囨敞:"> - <uni-easyinput v-model="formData.remark" :disabled="true" /> - </uni-forms-item> - <uni-forms-item :label-width="80" name="outNum" label="鐐规鍥剧墖:"> + + <!-- <uni-forms-item :label-width="80" name="outNum" label="鐐规鍥剧墖:"> <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" :sourceType="sourceType" @select="select" @progress="progress" @success="success" @fail="fail" @delete="deletea" :readonly="readonly" /> - </uni-forms-item> - <uni-forms-item name="outNum" :label-width="80" label="浣滀笟鎸囧:"> + </uni-forms-item> --> + <!-- <uni-forms-item name="outNum" :label-width="80" label="浣滀笟鎸囧:"> <button class="cu-btn bg-blue" @tap="showPreview = true">鏌ョ湅</button> - </uni-forms-item> + </uni-forms-item> --> </uni-group> </uni-forms> - <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 淇濆吇椤逛俊鎭� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> --> <view class="divider"><text>淇濆吇椤逛俊鎭�</text></view> <uni-collapse> <uni-collapse-item :show-animation="true" :accordion="true" title="鏌ョ湅淇濆吇椤�" :border="false" @@ -64,19 +61,31 @@ <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">{{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 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"> + {{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 margin-xs radius text-right"> + {{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 margin-xs radius text-right"> {{item.itemDemand}} </view> @@ -89,7 +98,7 @@ </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" @change="handleType($event, index)" v-model="item.reportFlag" :disabled="item.istrue"/> diff --git a/pages/eam/production/record/record.vue b/pages/eam/production/record/record.vue index 69f8cc4..1401da2 100644 --- a/pages/eam/production/record/record.vue +++ b/pages/eam/production/record/record.vue @@ -1,321 +1,261 @@ <template> <view class="container"> + <!-- 椤堕儴瀵艰埅鏍� --> <cu-custom :bgColor="NavBarColor" :isBack="true" backRouterName="index"> <block slot="backText">杩斿洖</block> <block slot="content">鎿嶄綔璁板綍</block> </cu-custom> - <view class="container"> - <view class="solid-bottom"> - <scroll-view scroll-x class="bg-white 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> - </scroll-view> - </view> - - - <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="upCallback"> - <view class="production-container"> - <teleport v-if="TabCur==0"> - <view class="list-item" v-for="(item, index) in mockBillList" :key="index"> - <!-- 榻愬妫�鏌� --> - <view class="item-details"> - <view class="detail-row"> - <text class="label">宸ュ崟鍙�:</text> - <text class="value">{{item.workOrderCode}}</text> - </view> - - <view class="detail-row"> - <text class="label">鐗╂枡缂栧彿:</text> - <text class="value">{{item.materialNumber}}</text> - </view> - - <view class="detail-row"> - <text class="label">鐗╂枡鍚嶇О:</text> - <text class="value">{{item.materialName}}</text> - </view> - - <view class="detail-row"> - <text class="label">闇�姹傛暟閲�:</text> - <text class="value" style="color: #00FF00;"> - {{item.requiredQuantity}}</text> - </view> - <view class="detail-row"> - <text class="label">瀹為檯鏁伴噺:</text> - <text class="value" style="color: #00FF00;">{{item.actualQuantity}}</text> - </view> - <view class="detail-row"> - <text class="label">鏄惁榻愬:</text> - <text class="value" v-if="item.checkFlag==='0'" style="color: red;">鍚�</text> - <text class="value" v-else style="color: red;">鏄�</text> - </view> - </view> - </view> - </teleport> - - - <teleport v-if="TabCur==1"> - <view class="list-item" v-for="(item, index) in checkList" :key="index"> - <!-- 榻愬妫�鏌� --> - <view class="item-details"> - <view class="detail-row"> - <text class="label">宸ヨ壓鍙傛暟缂栧彿:</text> - <text class="value">{{ item.paramCode}}</text> - </view> - - <view class="detail-row"> - <text class="label">宸ヨ壓鍙傛暟:</text> - <text class="value">{{ item.paramName}}</text> - </view> - - <view class="detail-row"> - <text class="label">鍚堟牸鑼冨洿:</text> - <text class="value">{{ item.availableQty}}</text> - </view> - - <view class="detail-row"> - <text class="label">鍙傛暟鍊�:</text> - <text class="value">{{ item.paramValue}}</text> - </view> - <view class="detail-row"> - <text class="label">鍒ゅ畾:</text> - <text class="value">{{ item.judgment}}</text> - </view> - </view> - </view> - </teleport> - - - - <teleport v-if="TabCur==2"> - <view class="container"> - <!-- 娴獥閬僵灞� --> - <view v-if="showPreview" class="overlay" @tap.stop="closePreview"> - <view class="modal"> - <!-- 鍏抽棴鎸夐挳 --> - <text class="close-btn" @tap.stop="showPreview = false">×</text> - <!-- 鍥剧墖灞曠ず --> - <image :src="previewImageSrc" mode="aspectFit" class="preview-image" - @error="handleImageError" :show-menu-by-longpress="false" /> - </view> - </view> - <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" - err-show-type="undertext"> - <uni-group top="1"> - <view class="divider"><text>鍩烘湰淇℃伅</text></view> - <!-- <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" name="num" label="璁惧缂栧彿:"> - <uni-easyinput v-model="formData.num" :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="formData.remark" label="澶囨敞:"> - <uni-easyinput v-model="formData.remark" :disabled="true" /> - </uni-forms-item> - <uni-forms-item :label-width="80" name="outNum" label="鐐规鍥剧墖:"> - <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" - :sourceType="sourceType" @select="select" @progress="progress" - @success="success" @fail="fail" @delete="deletea" :readonly="readonly" /> - </uni-forms-item> - <uni-forms-item name="outNum" :label-width="80" label="浣滀笟鎸囧:"> - <button class="cu-btn bg-blue" @tap="showPreview = true">鏌ョ湅</button> - </uni-forms-item> - </uni-group> - </uni-forms> - - <!-- <view class="text-gray margin-bottom-lg">鈥斺�斺�斺�斺�斺�斺�斺�斺�斺�� 淇濆吇椤逛俊鎭� 鈥斺�斺�斺�斺�斺�斺�斺�斺�斺��</view> --> - <view class="divider"><text>淇濆吇椤逛俊鎭�</text></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"> - {{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" - 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-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-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> - </teleport> - - - - - <teleport v-if="TabCur==3"> - <view class="container"> - <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" - err-show-type="undertext"> - <uni-group top="1"> - <uni-forms-item :label-width="100" name="remark" label="鏂囦欢鍚嶇О:"> - <uni-easyinput v-model="formData.equipmentName" /> - </uni-forms-item> - <uni-forms-item :label-width="100" name="outNum" label="璁惧鏂囨。:"> - <uni-file-picker v-model="fileLists" :extension="['.pdf']" @fail="uploadFail" - :list-styles="listStyles" :delIcon="del" :max-count="5" file-mediatype="all" - @downloadFile="downloadFile" @select="onFileSelect" @delete="onFileDelete"> - <button size="mini" type="primary">鐐瑰嚮涓婁紶</button> - </uni-file-picker> - </uni-forms-item> - <!-- 鏂板锛氭牎楠岀粨鏋滃崟閫夋 --> - <uni-forms-item name="result" :label-width="100" label="妫�楠岀粨鏋�:"> - <radio-group @change="radioChange"> - <label style="margin-right: 20rpx;"> - <radio :checked="formData.result=='qualified'" value="qualified" />鍚堟牸 - </label> - - <label style="margin-right: 20rpx;"> - <radio :checked="formData.result=='unqualified'" value="unqualified" /> - 涓嶅悎鏍� - </label> - </radio-group> - </uni-forms-item> - </uni-group> - </uni-forms> - - <view class="file-list margin-sm"> - <view class="file-item" v-for="(file, index) in this.selectedFiles" :key="index"> - <view class="file-icon"> - <!-- 鏂囦欢鍥炬爣 --> - <image src="/static/icon_file.png" - style="height: 25px; width: 25px; margin-right: 10px;" mode='aspectFit' - class="zai-logo "></image> - </view> - <view class="file-name"> - <!-- 鏂囦欢鍚� --> - {{ file.fileName }} - </view> - <view class="file-actions"> - <!-- 涓嬭浇鎸夐挳 --> - <image v-show="showBtn" src="/static/icon_down.png" @click="downloadFile(file)" - style="height: 25px; width: 25px; margin-right: 10px;"></image> - </view> - </view> - </view> - - <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> - </teleport> - - - - <teleport v-if="TabCur==4"> - <view class="list-item" v-for="(item, index) in checkList" :key="index"> - <!-- 榻愬妫�鏌� --> - <view class="item-details"> - <view class="detail-row"> - <text class="label">鎵规鍙�:</text> - <text class="value">{{ item.paramCode}}</text> - </view> - - <view class="detail-row"> - <text class="label">鐗╂枡缂栫爜:</text> - <text class="value">{{ item.paramName}}</text> - </view> - - <view class="detail-row"> - <text class="label">鐗╂枡鎻忚堪:</text> - <text class="value">{{ item.availableQty}}</text> - </view> - - <view class="detail-row"> - <text class="label">涓婃枡鏃堕棿:</text> - <text class="value">{{ item.paramValue}}</text> - </view> - <view class="detail-row"> - <text class="label">涓婃枡鏁伴噺:</text> - <text class="value">{{ item.judgment}}</text> - </view> - <view class="detail-row"> - <text class="label">涓婃枡浜哄憳:</text> - <text class="value">{{ item.judgment}}</text> - </view> - </view> - </view> - </teleport> - - - <!-- 琛ㄥご锛堝叡鐢ㄦ牱寮忥級 --> - - + + <!-- 鍚搁《鏍囩鏍� --> + <view class="solid-bottom" :style="{ top: navBarHeight + 'px' }"> + <scroll-view scroll-x class="bg-white nav text-center"> + <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> - </mescroll-uni> + </scroll-view> + </view> + + <!-- 鐙珛婊氬姩鐨勫垪琛ㄥ鍣� --> + <view class="production-container" :style="{ height: contentHeight + 'px' }"> + <!-- 榻愬妫�鏌� --> + <teleport v-if="TabCur==0"> + <view class="list-item" v-for="(item, index) in mockBillList" :key="index"> + <view class="item-details"> + <view class="detail-row"> + <text class="label">宸ュ崟鍙�:</text> + <text class="value">{{item.workOrderCode}}</text> + </view> + <view class="detail-row"> + <text class="label">鐗╂枡缂栧彿:</text> + <text class="value">{{item.materialNumber}}</text> + </view> + <view class="detail-row"> + <text class="label">鐗╂枡鍚嶇О:</text> + <text class="value">{{item.materialName}}</text> + </view> + <view class="detail-row"> + <text class="label">闇�姹傛暟閲�:</text> + <text class="value" style="color: #00FF00;">{{item.requiredQuantity}}</text> + </view> + <view class="detail-row"> + <text class="label">瀹為檯鏁伴噺:</text> + <text class="value" style="color: #00FF00;">{{item.actualQuantity}}</text> + </view> + <view class="detail-row"> + <text class="label">鏄惁榻愬:</text> + <text class="value" v-if="item.checkFlag==='0'" style="color: red;">鍚�</text> + <text class="value" v-else style="color: green;">鏄�</text> + </view> + </view> + </view> + </teleport> + + <!-- 宸ヨ壓鐐规 --> + <teleport v-if="TabCur==1"> + <view class="list-item" v-for="(item, index) in checkList" :key="index"> + <view class="item-details"> + <view class="detail-row"> + <text class="label">宸ヨ壓鍙傛暟缂栧彿:</text> + <text class="value">{{ item.paramCode}}</text> + </view> + <view class="detail-row"> + <text class="label">宸ヨ壓鍙傛暟:</text> + <text class="value">{{ item.paramName}}</text> + </view> + <view class="detail-row"> + <text class="label">鍚堟牸鑼冨洿:</text> + <text class="value">{{ item.validRange}}</text> + </view> + <view class="detail-row"> + <text class="label">鍙傛暟鍊�:</text> + <text class="value">{{ item.paramValue}}</text> + </view> + <view class="detail-row"> + <text class="label">鍒ゅ畾:</text> + <text class="value">{{ item.judgment}}</text> + </view> + </view> + </view> + </teleport> + + <!-- 璁惧鐐规 --> + <teleport v-if="TabCur==2"> + <view class="container-inner"> + <!-- 娴獥閬僵灞� --> + <view v-if="showPreview" class="overlay" @tap.stop="closePreview"> + <view class="modal"> + <text class="close-btn" @tap.stop="showPreview = false">×</text> + <image :src="previewImageSrc" mode="aspectFit" class="preview-image" + @error="handleImageError" :show-menu-by-longpress="false" /> + </view> + </view> + + <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" + err-show-type="undertext"> + <uni-group top="1"> + <view class="divider"><text>鍩烘湰淇℃伅</text></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" name="equipmentNum" label="璁惧缂栧彿:"> + <uni-easyinput v-model="formData.num" :disabled="true" /> + </uni-forms-item> + <uni-forms-item :label-width="80" name="inspectionDate" label="鐐规鏃ユ湡:"> + <uni-easyinput v-model="formData.inspectionDate" :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="checkImages" label="鐐规鍥剧墖:"> + <uni-file-picker limit="9" :value="fileLists" :image-styles="imageStyles" + :sourceType="sourceType" @select="select" @progress="progress" + @success="success" @fail="fail" @delete="deletea" :readonly="readonly" /> + </uni-forms-item> + <uni-forms-item name="guide" :label-width="80" label="浣滀笟鎸囧:"> + <button class="cu-btn bg-blue" @tap="showPreview = true">鏌ョ湅</button> + </uni-forms-item> + </uni-group> + </uni-forms> + + <view class="divider"><text>淇濆吇椤逛俊鎭�</text></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">{{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" + 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-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-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> + </teleport> + + <!-- 鏍蜂欢鏍¢獙 --> + <teleport v-if="TabCur==3"> + <view class="container-inner"> + <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" + err-show-type="undertext"> + <uni-group top="1"> + <uni-forms-item :label-width="100" name="equipmentName" label="鏂囦欢鍚嶇О:"> + <uni-easyinput v-model="formData.equipmentName" /> + </uni-forms-item> + <uni-forms-item :label-width="100" name="equipmentDoc" label="璁惧鏂囨。:"> + <uni-file-picker v-model="fileLists" :extension="['.pdf']" @fail="uploadFail" + :list-styles="listStyles" :delIcon="del" :max-count="5" file-mediatype="all" + @downloadFile="downloadFile" @select="onFileSelect" @delete="onFileDelete"> + <button size="mini" type="primary">鐐瑰嚮涓婁紶</button> + </uni-file-picker> + </uni-forms-item> + <uni-forms-item name="result" :label-width="100" label="妫�楠岀粨鏋�:"> + <radio-group @change="radioChange" v-model="formData.result"> + <label style="margin-right: 20rpx;"> + <radio :checked="formData.result=='qualified'" value="qualified" />鍚堟牸 + </label> + <label style="margin-right: 20rpx;"> + <radio :checked="formData.result=='unqualified'" value="unqualified" /> + 涓嶅悎鏍� + </label> + </radio-group> + </uni-forms-item> + </uni-group> + </uni-forms> + + <view class="file-list margin-sm"> + <view class="file-item" v-for="(file, index) in selectedFiles" :key="index"> + <view class="file-icon"> + <image src="/static/icon_file.png" + style="height: 50rpx; width: 50rpx; margin-right: 20rpx;" mode='aspectFit' + class="zai-logo "></image> + </view> + <view class="file-name">{{ file.fileName }}</view> + <view class="file-actions"> + <image v-show="showBtn" src="/static/icon_down.png" @click="downloadFile(file)" + style="height: 50rpx; width: 50rpx; margin-right: 20rpx;"></image> + </view> + </view> + </view> + + <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> + </teleport> + + <!-- 涓婃枡璁板綍 --> + <teleport v-if="TabCur==4"> + <view class="list-item" v-for="(item, index) in feedingList" :key="index"> + <view class="item-details"> + <view class="detail-row"> + <text class="label">鎵规鍙�:</text> + <text class="value">{{ item.batchCode}}</text> + </view> + <view class="detail-row"> + <text class="label">鐗╂枡缂栫爜:</text> + <text class="value">{{ item.materialCode}}</text> + </view> + <view class="detail-row"> + <text class="label">鐗╂枡鎻忚堪:</text> + <text class="value">{{ item.materialDesc}}</text> + </view> + <view class="detail-row"> + <text class="label">涓婃枡鏃堕棿:</text> + <text class="value">{{ item.feedingTime}}</text> + </view> + <view class="detail-row"> + <text class="label">涓婃枡鏁伴噺:</text> + <text class="value">{{ item.feedingQty}}</text> + </view> + <view class="detail-row"> + <text class="label">涓婃枡浜哄憳:</text> + <text class="value">{{ item.feeder}}</text> + </view> + </view> + </view> + </teleport> </view> </view> </template> @@ -342,91 +282,66 @@ } ]; import configService from "@/common/service/config.service.js"; - import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js"; export default { - mixins: [MescrollMixin], // 浣跨敤mixin data() { return { - mockBillList:[], + // 鍚搁《鍜屾粴鍔ㄧ浉鍏� + navBarHeight: 0, + contentHeight: 0, + + // 鏁版嵁鍒楄〃 + mockBillList: [], + checkList: [], + partTakeAdviceDetailList: [], + feedingList: [], + + // 鍥剧墖棰勮 previewImageSrc: '', ipAndPort: configService.staticURL, fileLists: [], - // 涓婁紶鍥剧墖鐨勬牱寮� + + // 涓婁紶鍥剧墖鏍峰紡 imageStyles: { width: 90, height: 90, }, sourceType: ['album', 'camera'], - ScanData: { - typeName: '', - handlingType: [{ - text: "閫氳繃", - value: "1" - }, - { - text: "椹冲洖", - value: "2" - } - ], - handlingSuggestion: '' - }, + + // 琛ㄥ崟鏁版嵁 formData: { num: '', avatar: [], orderNum: '', operator: '', - inspectionDate: '' - + inspectionDate: '', + remark: '', + equipmentName: '', + result: 'qualified' }, - checkList: [{ - paramCode: '001', - paramName: '杞��', - validRange: '', - paramValue: '', - judgment: '鍚堟牸' - }, - { - paramCode: '002', - paramName: '杩涚粰', - validRange: '', - paramValue: '', - judgment: '鍚堟牸' - }, - { - paramCode: '003', - paramName: '鍚冨垁閲�', - validRange: '', - paramValue: '', - judgment: '鍚堟牸' - }, - { - paramCode: '004', - paramName: '鍊嶇巼', - validRange: '', - paramValue: '', - judgment: '鍚堟牸' - } - ], + + // 鏍囩鐩稿叧 tabs, TabCur: 0, scrollLeft: 0, NavBarColor: this.NavBarColor, + + // 鍒嗛〉閰嶇疆 upOption: { page: { - num: 0, // 褰撳墠椤电爜,榛樿0,鍥炶皟涔嬪墠浼氬姞1,鍗砪allback(page)浼氫粠1寮�濮� - size: 10, // 姣忛〉鏁版嵁鐨勬暟閲� - + num: 0, + size: 10, }, - noMoreSize: 4, //濡傛灉鍒楄〃宸叉棤鏁版嵁,鍙缃垪琛ㄧ殑鎬绘暟閲忚澶т簬鍗婇〉鎵嶆樉绀烘棤鏇村鏁版嵁;閬垮厤鍒楄〃鏁版嵁杩囧皯(姣斿鍙湁涓�鏉℃暟鎹�),鏄剧ず鏃犳洿澶氭暟鎹細涓嶅ソ鐪�; 榛樿5 + noMoreSize: 4, empty: { - tip: '~ 鏆傛棤鏁版嵁 ~', // 鎻愮ず - + tip: '~ 鏆傛棤鏁版嵁 ~', }, loading: '', text: '鍏ㄩ儴', isShowNoMore: false, textNoMore: '鎴戞槸鏈夊簳绾跨殑 >_<' }, + + // 鍏朵粬閰嶇疆 styles: { color: '#2979FF', borderColor: '#2979FF' @@ -442,14 +357,22 @@ current: 0, colorIndex: 0, activeColor: '#5277A6', - msgList: [], //鍒楄〃鏁版嵁 + msgList: [], announcementList: [], + workOrderId:'', + // 鏂囦欢鐩稿叧 + readonly: false, + del: true, + showBtn: true, + listStyles: { height: '100rpx' }, + selectedFiles: [], + showPreview: false } }, computed: { top() { - return this.CustomBar * 2 + 100 + return this.CustomBar * 2 + 120 }, style() { var StatusBar = this.StatusBar; @@ -458,22 +381,182 @@ return style }, }, + onLoad(options) { + this.calculateHeights(); + if (options.id) { + this.workOrderId = options.id; + console.log('鎺ユ敹鐨勫伐鍗昳d:', this.workOrderId); + + // 鍙湪姝ゅ璋冪敤鎺ュ彛锛屾牴鎹甶d鑾峰彇宸ュ崟璇︽儏 + this.upCallback(this.workOrderId); + } + // 璁$畻瀵艰埅鏍忓拰鍐呭鍖哄煙楂樺害 + + }, + onLoad() { + + }, methods: { + // 璁$畻瀵艰埅鏍忓拰鍐呭鍖哄煙楂樺害 + calculateHeights() { + uni.getSystemInfo({ + success: (res) => { + // 瀵艰埅鏍忛珮搴� = 鐘舵�佹爮楂樺害 + 鑷畾涔夊鑸爮楂樺害(44px) + this.navBarHeight = res.statusBarHeight + 44; + + // 鏍囩鏍忛珮搴︾害50px锛岃绠楀唴瀹瑰尯鍩熼珮搴� + const tabBarHeight = 50; + const safeAreaBottom = res.safeArea?.bottom || 0; + this.contentHeight = res.windowHeight - this.navBarHeight - tabBarHeight - (res.windowHeight - safeAreaBottom); + } + }); + }, + + // 鍒濆鍖栨ā鎷熸暟鎹� + initData() { + // 榻愬妫�鏌ユā鎷熸暟鎹� + this.mockBillList = [ + { + workOrderCode: 'WO2023001', + materialNumber: 'MAT001', + materialName: '杞存壙', + requiredQuantity: '100', + actualQuantity: '100', + checkFlag: '1' + }, + { + workOrderCode: 'WO2023001', + materialNumber: 'MAT002', + materialName: '榻胯疆', + requiredQuantity: '50', + actualQuantity: '45', + checkFlag: '0' + }, + { + workOrderCode: 'WO2023002', + materialNumber: 'MAT003', + materialName: '铻烘爴', + requiredQuantity: '200', + actualQuantity: '200', + checkFlag: '1' + } + ]; + + // 宸ヨ壓鐐规妯℃嫙鏁版嵁 + this.checkList = [ + { + paramCode: '001', + paramName: '杞��', + validRange: '1000-1500r/min', + paramValue: '1200r/min', + judgment: '鍚堟牸' + }, + { + paramCode: '002', + paramName: '杩涚粰', + validRange: '0.1-0.3mm/r', + paramValue: '0.2mm/r', + judgment: '鍚堟牸' + }, + { + paramCode: '003', + paramName: '鍚冨垁閲�', + validRange: '2-5mm', + paramValue: '3mm', + judgment: '鍚堟牸' + }, + { + paramCode: '004', + paramName: '鍊嶇巼', + validRange: '80%-120%', + paramValue: '100%', + judgment: '鍚堟牸' + } + ]; + + // 涓婃枡璁板綍妯℃嫙鏁版嵁 + this.feedingList = [ + { + batchCode: 'B20230501', + materialCode: 'MAT001', + materialDesc: '杞存壙', + feedingTime: '2023-05-01 08:30', + feedingQty: '100', + feeder: '寮犱笁' + }, + { + batchCode: 'B20230501', + materialCode: 'MAT002', + materialDesc: '榻胯疆', + feedingTime: '2023-05-01 09:15', + feedingQty: '50', + feeder: '鏉庡洓' + } + ]; + + // 璁惧鐐规淇濆吇椤规ā鎷熸暟鎹� + this.partTakeAdviceDetailList = [ + { + itemName: '娑︽粦娌规鏌�', + itemDemand: '娌归噺鍦ㄥ埢搴︾嚎涔嬮棿锛屾棤鍙樿川', + restle: [ + { text: "姝e父", value: '1' }, + { text: "寮傚父", value: '2' } + ], + type: [ + { text: "鍚�", value: "0" }, + { text: "鏄�", value: "1" } + ], + istrue: false, + inspectionResult: '', + reportFlag: '0', + exceptionDescription: '' + }, + { + itemName: '铻轰笣绱у浐', + itemDemand: '鎵�鏈夎灪涓濇棤鏉惧姩', + restle: [ + { text: "姝e父", value: '1' }, + { text: "寮傚父", value: '2' } + ], + type: [ + { text: "鍚�", value: "0" }, + { text: "鏄�", value: "1" } + ], + istrue: false, + inspectionResult: '', + reportFlag: '0', + exceptionDescription: '' + } + ]; + + // 琛ㄥ崟鍒濆鏁版嵁 + this.formData = { + num: 'EQ2023001', + orderNum: 'WO2023001', + operator: '寮犱笁', + inspectionDate: '2023-05-01', + remark: '璁惧杩愯姝e父', + equipmentName: '璁惧鏍¢獙鎶ュ憡', + result: 'qualified' + }; + }, + mescrollInit(mescroll) { console.log('mescrollInit') this.mescroll = mescroll; }, upCallback() { - //鑱旂綉鍔犺浇鏁版嵁 - console.log("tabindex", this.TabCur) + // 鑱旂綉鍔犺浇鏁版嵁鐨勯�昏緫 + console.log("褰撳墠鏍囩椤�:", this.TabCur) let keyword = this.TabCur if (keyword == 0) { this.$http.get(this.url.sub1, { params: { - workOrderId:"1960585092127371266" + workOrderId:this.workOrderId } }).then(res => { @@ -490,102 +573,40 @@ icon: 'none' }); }) + + + } else if (keyword == 1) { - this.$http.get(this.url.list, { - params: { - pageSize: page.size, - order: "desc", - column: "createTime", - type: 2, - status: 1 - } - }).then(res => { - //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; - this.announcement2 = res.data.result.records - this.mescroll.endSuccess(this.announcement2.length, this.msgCount); - - //璁剧疆鍒楄〃鏁版嵁 - if (res.data.success) { - console.log("res sys", res.data) - this.msg2Count = res.data.result.total - this.msg2Title = "閫氱煡(" + res.data.result.total + ")"; - - for (let item of this.announcement2) { - this.msgList.push(item) - } - } - if (page.num == 1) { - this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 - this.msgList = this.msgList.concat(this.announcement2); //杩藉姞鏂版暟鎹� - } - }).catch(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - this.mescroll.endErr(); - uni.showToast({ - title: '缃戠粶寮傚父锛岃绋嶅悗鍐嶈瘯', - icon: 'none' - }); - }) + console.log("鍔犺浇宸ヨ壓鐐规鏁版嵁"); } else if (keyword == 2) { - - this.$http.get(this.url.list, { - params: { - pageSize: page.size, - order: "desc", - column: "createTime", - type: 2, - status: 2 - } - }).then(res => { - //鑱旂綉鎴愬姛鐨勫洖璋�,闅愯棌涓嬫媺鍒锋柊鍜屼笂鎷夊姞杞界殑鐘舵��; - this.announcement2 = res.data.result.records - this.mescroll.endSuccess(this.announcement2.length, this.msgCount); - - //璁剧疆鍒楄〃鏁版嵁 - if (res.data.success) { - console.log("res sys", res.data) - this.msg2Count = res.data.result.total - this.msg2Title = "閫氱煡(" + res.data.result.total + ")"; - - for (let item of this.announcement2) { - this.msgList.push(item) - } - } - if (page.num == 1) { - this.msgList = []; //濡傛灉鏄涓�椤甸渶鎵嬪姩鍒剁┖鍒楄〃 - this.msgList = this.msgList.concat(this.announcement2); //杩藉姞鏂版暟鎹� - } - }).catch(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - this.mescroll.endErr(); - uni.showToast({ - title: '缃戠粶寮傚父锛岃绋嶅悗鍐嶈瘯', - icon: 'none' - }); - }) - + console.log("鍔犺浇璁惧鐐规鏁版嵁"); } - }, + + // 鏍囩閫夋嫨 tabSelect(e) { - this.TabCur = e.currentTarget.dataset.id; - this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60; - this.msgList = [] // 鍏堢疆绌哄垪琛�,鏄剧ず鍔犺浇杩涘害 - this.mescroll.resetUpScroll() // 鍐嶅埛鏂板垪琛ㄦ暟鎹� + const tabIndex = e.currentTarget.dataset.id; + this.TabCur = tabIndex; + + // 鍔ㄦ�佽绠楁粴鍔ㄤ綅缃� + const query = uni.createSelectorQuery().in(this); + query.selectAll('.cu-item').boundingClientRect(rects => { + let scrollLeft = 0; + for (let i = 0; i < tabIndex - 1; i++) { + scrollLeft += rects[i]?.width || 0; + } + this.scrollLeft = scrollLeft; + }).exec(); }, - - 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 @@ -596,281 +617,297 @@ }, /** - * 淇濆吇椤� + * 淇濆吇椤圭浉鍏虫柟娉� */ 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(() => { - //鑱旂綉澶辫触, 缁撴潫鍔犺浇 - }) + // 瀹為檯椤圭洰涓皟鐢ˋPI鑾峰彇淇濆吇椤规暟鎹� + console.log("鑾峰彇淇濆吇椤规暟鎹�"); }, + + handleCode(e, index) { + console.log("鐐规缁撴灉鍙樻洿:", e, "绱㈠紩:", index); + }, + + handleType(e, index) { + console.log("鎶ヤ慨鐘舵�佸彉鏇�:", e, "绱㈠紩:", index); + }, + + // 鍥剧墖閿欒澶勭悊 handleImageError(e) { const icon_prefix = "/static/"; this.previewImageSrc = icon_prefix + "icn_erro.png" }, + + // 鍏抽棴棰勮 + closePreview() { + this.showPreview = false; + }, + /** * 浣滀笟鎸囧涔� */ getStandardFile() { - this.$http.get(this.url.getStandardFile, { - params: { - id: this.standardId - } - }).then(res => { - if (res.data.success) { - console.log("res", res.data.result); - const referenceFileStr = res.data.result.referenceFile; - - // 鍒ゆ柇鏄惁瀛樺湪 referenceFile 骞惰繘琛岃В鏋� - if (referenceFileStr) { - try { - const referenceFileObj = JSON.parse(referenceFileStr); - const filePath = `${this.ipAndPort}${referenceFileObj.filePath}`; - this.previewImageSrc = filePath; - console.log('previewImageSrc:', this.previewImageSrc); - } catch (e) { - console.error("referenceFile 瑙f瀽澶辫触", e); - this.previewImageSrc = ''; - } - } else { - console.warn("referenceFile 涓嶅瓨鍦�"); - this.previewImageSrc = ''; - } - } - }).catch(err => { - console.error("缃戠粶璇锋眰澶辫触", err); - // 鑱旂綉澶辫触, 缁撴潫鍔犺浇 - }); + // 瀹為檯椤圭洰涓皟鐢ˋPI鑾峰彇浣滀笟鎸囧涔� + console.log("鑾峰彇浣滀笟鎸囧涔�"); }, + // 鍥剧墖閫夋嫨 select(e) { const tempFilePaths = e.tempFilePaths; uni.showLoading({ title: '涓婁紶涓�...' }); - const uploadPromises = tempFilePaths.map((filePath, index) => { - return new Promise((resolve, reject) => { - this.$http.upload(this.url.upload, { - filePath: filePath, - name: 'file' - }) - .then(uploadRes => { - // 鍋囪鏈嶅姟鍣ㄨ繑鍥炵殑缁撴灉涓寘鍚枃浠惰矾寰� - const serverFilePath = uploadRes.data.result[0]; - this.formData.avatar.push(serverFilePath); - resolve(uploadRes); // 杩斿洖缁撴灉缁� Promise.all - }) - .catch(err => { - console.error(`鍥剧墖 ${index + 1} 涓婁紶澶辫触:`, err); - reject(err); - }); - }); - }); - - Promise.all(uploadPromises) - .then(() => { - uni.hideLoading(); - uni.showToast({ - title: '鍏ㄩ儴涓婁紶鎴愬姛' - }); - }) - .catch(err => { - uni.hideLoading(); - uni.showToast({ - title: '閮ㄥ垎涓婁紶澶辫触', - icon: 'none' - }); - console.error('涓婁紶寮傚父:', err); - }); + + // 妯℃嫙涓婁紶鎴愬姛 + setTimeout(() => { + uni.hideLoading(); + uni.showToast({ title: '涓婁紶鎴愬姛' }); + }, 1000); }, - // 鍒犻櫎 + + // 鍒犻櫎鍥剧墖 deletea(e) { console.log('鍒犻櫎鍥剧墖', e); + }, + + // 鏂囦欢閫夋嫨 + onFileSelect(e) { + const newFiles = e.tempFiles.map(file => ({ + fileName: file.name, + filePath: file.path, + size: file.size + })); + this.selectedFiles = [...this.selectedFiles, ...newFiles]; + }, + + // 鍒犻櫎鏂囦欢 + onFileDelete(e) { + this.selectedFiles.splice(e.index, 1); + }, + + // 涓嬭浇鏂囦欢 + downloadFile(file) { + uni.showToast({ title: `姝e湪涓嬭浇 ${file.fileName}`, icon: 'none' }); + // 瀹為檯椤圭洰涓皟鐢ㄤ笅杞紸PI + }, + + // 妫�楠岀粨鏋滃彉鏇� + radioChange(e) { + this.formData.result = e.detail.value; + }, + + // 涓婁紶澶辫触 + uploadFail(e) { + console.log('涓婁紶澶辫触', e); + uni.showToast({ title: '涓婁紶澶辫触', icon: 'none' }); + }, + + // 杩涘害鍥炶皟 + progress(e) { + console.log('涓婁紶杩涘害', e); + }, + + // 鎴愬姛鍥炶皟 + success(e) { + console.log('涓婁紶鎴愬姛', e); + }, + + // 澶辫触鍥炶皟 + fail(e) { + console.log('鎿嶄綔澶辫触', e); + }, + + // 纭畾鎸夐挳 + ProductionTask() { + uni.showToast({ title: '鎿嶄綔鎴愬姛' }); } } } </script> -<style> - <style scoped> - - /* 鍒楄〃瀹瑰櫒鏍峰紡 */ - .check-list-container { - margin-bottom: 120rpx; - /* 涓哄簳閮ㄦ搷浣滄爮鐣欏嚭绌洪棿 */ +<style scoped> + .container { + background-color: #f5f7fa; + min-height: 100vh; } - + + /* 鍚搁《鏍囩鏍忔牱寮� */ + .solid-bottom { + position: sticky; + z-index: 99; + border-bottom: 1px solid #eee; + } + + .nav { + white-space: nowrap; + padding: 12rpx 0; + } + + .cu-item { + display: inline-block; + padding: 10rpx 30rpx; + margin: 0 10rpx; + font-size: 28rpx; + color: #666; + position: relative; + } + + .cu-item.text-blue.cur { + color: #007AFF; + font-weight: bold; + } + + .cu-item.cur::after { + content: ''; + position: absolute; + bottom: 0; + left: 50%; + transform: translateX(-50%); + width: 40rpx; + height: 4rpx; + background-color: #007AFF; + border-radius: 2rpx; + } + + /* 鍒楄〃瀹瑰櫒鏍峰紡 */ + .production-container { + overflow-y: auto; + background-color: #f5f7fa; + padding: 10rpx; + } + + /* 闅愯棌婊氬姩鏉� */ + .production-container::-webkit-scrollbar { + display: none; + } + + .container-inner { + padding: 16rpx; + } + /* 鍒楄〃椤规牱寮� */ .list-item { background-color: #fff; border-radius: 16rpx; padding: 20rpx; - margin: 10px; margin-bottom: 20rpx; - box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1); + box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); + transition: background-color 0.2s; } - - /* 椤瑰ご閮ㄦ牱寮� */ - .item-header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 20rpx; - padding-bottom: 15rpx; - border-bottom: 1rpx solid #eee; + + .list-item:active { + background-color: #f5f7fa; } - - .part-code { - font-size: 32rpx; - font-weight: bold; - color: #333; - } - - .warehouse-tag { - font-size: 24rpx; - color: #007AFF; - background-color: #e8f4ff; - padding: 6rpx 12rpx; - border-radius: 8rpx; - } - + /* 璇︾粏淇℃伅鏍峰紡 */ .item-details { margin-bottom: 20rpx; } - + .detail-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15rpx; } - + .detail-row:last-child { margin-bottom: 0; } - + .label { font-size: 28rpx; color: #666; flex: 1; } - + .value { font-size: 28rpx; color: #333; flex: 1; text-align: right; } - - .warning-text { - color: #ff6347; - font-weight: bold; - } - - /* 鍙紪杈戞牱寮� */ - .editable { - display: flex; - align-items: center; - justify-content: flex-end; - } - - .edit-input { - border: 1rpx solid #007AFF; - border-radius: 8rpx; - padding: 10rpx; - width: 120rpx; - text-align: right; - font-size: 28rpx; - } - - .edit-icon { - margin-left: 10rpx; - color: #007AFF; - font-size: 24rpx; - } - - /* 鎿嶄綔鎸夐挳鏍峰紡 */ - .item-actions { - display: flex; - justify-content: flex-end; - gap: 20rpx; - } - - .action-btn { - padding: 12rpx 24rpx; - font-size: 13rpx; - border-radius: 8rpx; - border: none; - min-width: 60rpx; - } - - .edit-btn { - background-color: #007AFF; - color: #fff; - } - - .delete-btn { - background-color: #ff6347; - color: #fff; - } - + + /* 鍒嗗壊绾挎牱寮� */ .divider { display: flex; align-items: center; text-align: center; color: gray; - /* 鏂囧瓧棰滆壊 */ margin: 20px 0; - /* 涓婁笅闂磋窛 */ } - + .divider::before, .divider::after { content: ''; flex: 1; border-bottom: 1px solid gray; - /* 妯嚎棰滆壊 */ margin: 0 16px; - /* 妯嚎涓庢枃瀛椾箣闂寸殑闂磋窛 */ } - + .divider text { white-space: nowrap; - /* 闃叉鏂囧瓧鎹㈣ */ } -</style> \ No newline at end of file + + /* 鏂囦欢鍒楄〃鏍峰紡 */ + .file-list { + margin-top: 20rpx; + } + + .file-item { + display: flex; + align-items: center; + padding: 16rpx; + background-color: #fff; + border-radius: 8rpx; + margin-bottom: 10rpx; + } + + .file-name { + flex: 1; + font-size: 28rpx; + color: #333; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + /* 鍥剧墖棰勮鏍峰紡 */ + .overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.8); + z-index: 999; + display: flex; + align-items: center; + justify-content: center; + } + + .modal { + position: relative; + width: 90%; + height: 80%; + } + + .close-btn { + position: absolute; + top: -40rpx; + right: 0; + font-size: 48rpx; + color: #fff; + } + + .preview-image { + width: 100%; + height: 100%; + border-radius: 16rpx; + } + + /* 鎸夐挳鏍峰紡 */ + .is-hover { + opacity: 0.8; + } +</style> diff --git a/pages/eam/production/report/report.vue b/pages/eam/production/report/report.vue index c603703..9e44610 100644 --- a/pages/eam/production/report/report.vue +++ b/pages/eam/production/report/report.vue @@ -4,12 +4,12 @@ <block slot="backText">杩斿洖</block> <block slot="content">鎶ュ伐</block> <block slot="right"> - <view @click="printHandel"> + <view v-show="isShow" @click="printHandel"> <image class="search" src="/static/icon_dayin.png" style="width: 25px; height: 25px;" alt="鎵撳嵃鎸夐挳" /> </view> </block> </cu-custom> - + <!-- 楠ㄦ灦灞� --> <view v-if="loading" class="skeleton-container"> <view class="skeleton-group"> @@ -31,7 +31,7 @@ <view class="skeleton-input"></view> </view> </view> - + <view class="skeleton-group"> <view class="skeleton-divider"></view> <view class="skeleton-item"> @@ -59,53 +59,29 @@ <view class="skeleton-datetime"></view> </view> </view> - + <view class="skeleton-button"></view> </view> - + <!-- 瀹為檯鍐呭 --> <view v-else class="container"> - <uni-forms - ref="form" - :modelValue="formData" - :rules="rules" - validate-trigger="bind" - err-show-type="undertext"> + <uni-forms ref="form" :modelValue="formData" validate-trigger="bind" err-show-type="undertext"> <uni-group top="1"> <view class="divider"><text>宸ュ崟淇℃伅</text></view> - <uni-forms-item :label-width="100" name="workOrderNumber" label="鍗曟嵁缂栧彿:"> - <uni-easyinput v-model="formData.workOrderNumber" :disabled="true" /> + <uni-forms-item :label-width="100" name="workOrderNumber" label="鎶ュ伐宸ュ崟:"> + <uni-data-select v-model="workOrderNumber" :localdata="productionOrderList" + @change="changeProductionOrder" placeholder="璇烽�夋嫨" /> </uni-forms-item> - <uni-forms-item :label-width="100" name="materialCode" label="鐗╂枡缂栫爜:"> - <uni-easyinput v-model="formData.materialCode" :disabled="true" /> - </uni-forms-item> - - <uni-forms-item :label-width="100" name="materialDescription" label="鐗╂枡鎻忚堪:"> - <uni-easyinput v-model="formData.materialDescription" :disabled="true" /> - </uni-forms-item> - <uni-forms-item :label-width="100" name="plannedQuantity" label="璁″垝鏁伴噺:"> - <uni-easyinput v-model="formData.plannedQuantity" :disabled="true" /> - </uni-forms-item> - - <view class="divider"><text>鎶ュ伐淇℃伅</text></view> - - <uni-forms-item :label-width="140" required name="inspectionOrderNumber" - label="鎶ュ伐鍗曞彿:"> - <uni-easyinput v-model="formData.inspectionOrderNumber" placeholder="绯荤粺鐢熸垚" :disabled="true" /> - </uni-forms-item> - <uni-forms-item :label-width="140" required name="process" label="浠撳簱"> - <uni-data-select v-model="formData.process" :localdata="SpareList" @change="changeisSpareList" + <uni-forms-item :label-width="100" name="reportCode" label="鐢熶骇 璁㈠崟:"> + <uni-data-select v-model="reportCode" :localdata="reportCodeList" @change="changeReportCodeList" placeholder="璇烽�夋嫨" /> </uni-forms-item> - <uni-forms-item :label-width="140" required name="inspectionQuantity" label="鎶ュ伐鏁伴噺:"> - <uni-number-box v-model="formData.inspectionQuantity" /> + + <uni-forms-item :label-width="100" name="materialDescription" label="浜х嚎:"> + <uni-easyinput v-model="formData.materialDescription" :disabled="true" /> </uni-forms-item> - <uni-forms-item :label-width="140" required name="inspectionPlan" label="妫�楠屼汉鍛�"> - <uni-data-select v-model="formData.inspectionPlan" :localdata="SpareList" - @change="changeisSpareList" placeholder="璇烽�夋嫨" /> - </uni-forms-item> - <uni-forms-item :label-width="140" required name="inspectionTime" label="鎶ュ伐鏃堕棿"> - <uni-datetime-picker type="datetime" v-model="formData.inspectionTime" /> + <uni-forms-item :label-width="100" name="plannedQuantity" label="鎶ュ伐鏁伴噺:"> + <uni-number-box :min="0" :max="9999" v-model="formData.plannedQuantity" /> </uni-forms-item> </uni-group> </uni-forms> @@ -115,7 +91,7 @@ @click.stop="ProductionTask()" hover-class="is-hover">纭畾</view> </view> </view> - + <pdaScanVue></pdaScanVue> </view> </template> @@ -123,7 +99,9 @@ <script> import pdaScanVue from "@/components/mes/pdaScan.vue"; import QRCode from 'qrcode'; - + import { + mapGetters + } from "vuex"; export default { components: { pdaScanVue @@ -132,16 +110,12 @@ return { loading: true, isShow: false, + materialNumber: '', isSubmitting: false, // 闃查噸澶嶆彁浜� - SpareList: [{ - text: "鏄�", - value: 1 - }, - { - text: "鍚�", - value: 0 - } - ], + productionOrderList: [], + reportCodeList: [], + reportCode: '', + workOrderNumber: '', scrollLeft: 0, formData: { workOrderNumber: '1111111', @@ -160,48 +134,12 @@ produceDate: '', workshop: '瑁呴厤杞﹂棿3鍙风嚎' }, - // 琛ㄥ崟楠岃瘉瑙勫垯 - rules: { - process: { - rules: [{ - required: true, - errorMessage: '璇烽�夋嫨宸ュ簭' - }] - }, - inspectionType: { - rules: [{ - required: true, - errorMessage: '璇烽�夋嫨妫�楠岀被鍨�' - }] - }, - inspectionPlan: { - rules: [{ - required: true, - errorMessage: '璇烽�夋嫨妫�楠屾柟妗�' - }] - }, - inspectionTime: { - rules: [{ - required: true, - errorMessage: '璇烽�夋嫨妫�楠屾椂闂�' - }] - }, - inspectionQuantity: { - rules: [{ - required: true, - errorMessage: '璇疯緭鍏ラ�佹鏁伴噺' - }, { - format: 'number', - errorMessage: '閫佹鏁伴噺蹇呴』涓烘暟瀛�' - }] - } - }, + NavBarColor: this.NavBarColor, url: { - upload: "/eam/sysFiles/batch_upload", - stallList: "/eam/eamRepairOrder/queryById", - getEquipmentList: 'eam/equipment/list', - approval: '/eam/eamRepairOrder/perform' + getEquipmentList: 'mes/mesProductionWorkOrder/list', + approval: '/mes/productionOrder/selectReportWorkOrderList', + add: 'mes/mesWorkReporting/add' }, styles: { color: '#2979FF', @@ -211,6 +149,7 @@ } }, computed: { + ...mapGetters(["currentLineName", "username", "currentLineId"]), top() { return this.CustomBar * 2 + 160 }, @@ -221,37 +160,100 @@ return style }, }, - mounted() { - /** - * 涓婃枡涓嬫枡鏍规嵁鐗╂枡绫诲瀷鍒ゆ柇锛堥澶栦俊鎭�)---鎵爜/鎵嬪姩杈撳叆 ---锛堟墜鍔ㄨ緭鍏ヨ皟鐢ㄦ帴鍙h繑鍥炲簱瀛樹俊鎭級 鎵爜淇℃伅鎻愪氦鍚庣锛屽湪閲嶆柊璧嬪�� 鍒ゆ柇鐗╂枡绫诲瀷- 鏄剧ず鐗规畩灞炴�у�硷紝 搴撳瓨淇℃伅涔熻淇濆瓨 - */ - const currentLineType = this.$store.getters.currentLineType; - console.log('褰撳墠浜х嚎绫诲瀷锛�', currentLineType); - /** - * 瑁呴厤 ASSEMBLE - * 鍐呮硶鍏癐NNERFLANGE - * 澶栨硶鍏癘UTERFLANGE - * 鐑鐞咹EATTREATMENT - */ - }, created() { - // 鍒濆鍖栫敓浜ф棩鏈熶负褰撳墠鏃ユ湡 - this.formData.produceDate = this.formatDate(new Date()); - - // 妯℃嫙鏁版嵁鍔犺浇 - setTimeout(() => { - this.loading = false; - }, 1000); + this.formData.materialDescription = this.currentLineName; + this.getRelatedProdOrder(); + }, methods: { - // 鏍煎紡鍖栨棩鏈� - formatDate(date) { - const year = date.getFullYear(); - const month = String(date.getMonth() + 1).padStart(2, '0'); - const day = String(date.getDate()).padStart(2, '0'); - return `${year}-${month}-${day}`; + changeReportCodeList(e) { + this.reportCode = e; }, - + changeProductionOrder(e) { + this.workOrderNumber = e; + // 閫氳繃 selectedValue 鍖归厤 productionOrderList 涓殑椤� + const selectedItem = this.productionOrderList.find( + item => item.value === this.workOrderNumber + ); + if (selectedItem) { + // 鑾峰彇 materialNumber + this.materialNumber = selectedItem.materialNumber; + console.log('閫変腑椤圭殑 materialNumber:', this.materialNumber); + + // 鑾峰彇绱㈠紩锛堝彲閫夛紝鑻ラ渶瑕佺储寮曪級 + const index = this.productionOrderList.findIndex( + item => item.value === this.workOrderNumber + ); + console.log('閫変腑椤圭殑绱㈠紩:', index); + } + + this.getReportCodeList(this.materialNumber); + }, + getReportCodeList(code) { + this.$http.get(this.url.approval, { + params: { + materialNumber: code, + } + }).then(res => { + if (res.data.success) { + this.loading = false; + this.reportCodeList = res.data.result + } else { + uni.showModal({ + title: "鎻愮ず", + content: res.data.message, + confirmText: '纭畾', + showCancel: false, + }) + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: res.data.message, + duration: 2000 + }); + }); + + + }, + getRelatedProdOrder() { + this.$http.get(this.url.getEquipmentList, { + params: { + workOrderStatus: "EXECUTING", + factoryId: this.currentLineId + + } + }).then(res => { + if (res.data.success) { + this.loading = false; + this.productionOrderList = (res.data.result.records || []).map(line => ({ + value: line.value, + text: line.text, + materialNumber: line.materialNumber // 纭繚鏄犲皠type瀛楁 + })); + console.log(this.productionOrderList) + + } else { + uni.showModal({ + title: "鎻愮ず", + content: res.data.message, + confirmText: '纭畾', + showCancel: false, + }) + } + }).catch(() => { + this.$tip.loaded(); + uni.showToast({ + icon: "error", + title: res.data.message, + duration: 2000 + }); + }); + + + }, + // 鐐瑰嚮鎵撳嵃鎸夐挳锛氱敓鎴怘TML棰勮骞惰烦杞� async printHandel() { // 1. 楠岃瘉琛ㄥ崟淇℃伅 @@ -263,48 +265,47 @@ }); return; } - + try { - uni.showLoading({ title: '鐢熸垚棰勮涓�...' }); - + uni.showLoading({ + title: '鐢熸垚棰勮涓�...' + }); + // 2. 鏀堕泦鎵撳嵃鏁版嵁 const tagData = this.getReportPrintData(); - + // 3. 璺宠浆鑷抽瑙堥〉锛屽苟鎼哄甫鎵撳嵃鏁版嵁 await uni.navigateTo({ url: `/pages/finished-product-preview/finished-product-preview?tagData=${encodeURIComponent(JSON.stringify(tagData))}` }); - + uni.hideLoading(); } catch (error) { uni.hideLoading(); console.error('鐢熸垚棰勮澶辫触:', error); - uni.showToast({ title: '棰勮鐢熸垚澶辫触', icon: 'none' }); + uni.showToast({ + title: '棰勮鐢熸垚澶辫触', + icon: 'none' + }); } }, // 鐢熸垚鎴愬搧鎵樻爣绛炬暟鎹紙浼樺寲鍚庯級 - getReportPrintData() { - const { formData } = this; - return { - - material: '120034535', - batch: '25098814', - model: 'G3-2B259', - quantity: 216, - inspectDate: '20250408', - inspector: '鐜嬬京/鍚堟牸', - date: '2025.08.22' - - // batchNo: "25158878", - // productModel: "涓変唬杞瘋杞存壙鍗曞厓\\G3-639", - // palletNo: "11236979", - // quantity: "107", - // workshop: "3003", - // code: "1200143912506070086", - // planNum:"10016456466565" - }; - }, + getReportPrintData() { + const { + formData + } = this; + return { + + material: '120034535', + batch: '25098814', + model: 'G3-2B259', + quantity: 216, + inspectDate: '20250408', + inspector: '鐜嬬京/鍚堟牸', + date: '2025.08.22' + }; + }, changeisSpareList(e) { this.formData.isSpare = e; @@ -325,28 +326,18 @@ mask: true, title: "鎻愪氦涓�..." }); - try { - // 琛ㄥ崟楠岃瘉 - await this.$refs.form.validate(); - this.isSubmitting = true; - // 鍙戦�佹姤宸ヨ姹� - const response = await this.$http.post(this.url.approval, { - workOrderNumber: this.formData.workOrderNumber, - materialCode: this.formData.materialCode, - materialDescription: this.formData.materialDescription, - plannedQuantity: this.formData.plannedQuantity, - inspectionOrderNumber: this.formData.inspectionOrderNumber, - process: this.formData.process, - inspectionType: this.formData.inspectionType, - inspectionQuantity: this.formData.inspectionQuantity, - inspectionPlan: this.formData.inspectionPlan, - inspectionTime: this.formData.inspectionTime + const response = await this.$http.post(this.url.add, { + factoryId: this.currentLineId, + orderId: this.reportCode, + quantity: this.formData.plannedQuantity, + workOrderId: this.workOrderNumber }); if (response.data.success) { + this.isShow = true; uni.showToast({ icon: "success", title: '鎻愪氦鎴愬姛', @@ -442,16 +433,16 @@ margin-top: 45px; height: auto; } - + /* 楠ㄦ灦灞忔牱寮� */ .skeleton-container { padding: 20rpx; } - + .skeleton-group { margin-bottom: 40rpx; } - + .skeleton-divider { height: 40rpx; width: 300rpx; @@ -461,13 +452,13 @@ animation: skeleton-loading 1.4s ease infinite; margin-bottom: 30rpx; } - + .skeleton-item { display: flex; align-items: center; margin-bottom: 30rpx; } - + .skeleton-label { width: 160rpx; height: 40rpx; @@ -477,7 +468,7 @@ animation: skeleton-loading 1.4s ease infinite; margin-right: 20rpx; } - + .skeleton-input { flex: 1; height: 60rpx; @@ -486,7 +477,7 @@ border-radius: 8rpx; animation: skeleton-loading 1.4s ease infinite; } - + .skeleton-select { flex: 1; height: 60rpx; @@ -495,7 +486,7 @@ border-radius: 8rpx; animation: skeleton-loading 1.4s ease infinite; } - + .skeleton-datetime { flex: 1; height: 60rpx; @@ -504,7 +495,7 @@ border-radius: 8rpx; animation: skeleton-loading 1.4s ease infinite; } - + .skeleton-button { width: 90%; height: 80rpx; @@ -514,13 +505,14 @@ animation: skeleton-loading 1.4s ease infinite; margin: 40rpx auto; } - + @keyframes skeleton-loading { 0% { background-position: 100% 50%; } + 100% { background-position: 0 50%; } } -</style> +</style> \ No newline at end of file diff --git a/static/home/128/icon_all_into.png b/static/home/128/icon_all_into.png new file mode 100644 index 0000000..52e76c8 --- /dev/null +++ b/static/home/128/icon_all_into.png Binary files differ diff --git a/static/home/128/icon_caigou.png b/static/home/128/icon_caigou.png new file mode 100644 index 0000000..c60e665 --- /dev/null +++ b/static/home/128/icon_caigou.png Binary files differ diff --git a/static/home/128/icon_host.png b/static/home/128/icon_host.png new file mode 100644 index 0000000..4f52de9 --- /dev/null +++ b/static/home/128/icon_host.png Binary files differ diff --git a/static/home/128/icon_paichang.png b/static/home/128/icon_paichang.png new file mode 100644 index 0000000..fcb30da --- /dev/null +++ b/static/home/128/icon_paichang.png Binary files differ diff --git a/static/home/128/icon_tioabo.png b/static/home/128/icon_tioabo.png new file mode 100644 index 0000000..84c4eee --- /dev/null +++ b/static/home/128/icon_tioabo.png Binary files differ diff --git a/static/icon/add.png b/static/icon/add.png index 917480a..8678843 100644 --- a/static/icon/add.png +++ b/static/icon/add.png Binary files differ -- Gitblit v1.9.3