Merge branch 'htq20251215' of http://115.159.85.185:8098/r/ZhongRui/ALDbanyunxiangmu into htq20251215
| | |
| | | type: 'primary', |
| | | onClick: function () { |
| | | } |
| | | } |
| | | },{ |
| | | name: "é å® åº å ç ç¹", |
| | | icon: '', |
| | | class: '', |
| | | value: 'SelectStockTake', |
| | | type: 'warning', |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | ,{ |
| | | name: "å æ® ç ç¹ æ ä½", |
| | | icon: '', |
| | | class: '', |
| | | value: 'OrderStockTake', |
| | | type: 'warning', |
| | | onClick: function () { |
| | | } |
| | | }, |
| | | ] |
| | | |
| | | export default buttons |
| | |
| | | "dev": true, |
| | | "optional": true |
| | | }, |
| | | "@popperjs/core": { |
| | | "version": "npm:@sxzz/popperjs-es@2.11.7", |
| | | "resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", |
| | | "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==" |
| | | }, |
| | | "@soda/friendly-errors-webpack-plugin": { |
| | | "version": "1.8.0", |
| | | "resolved": "https://registry.npm.taobao.org/@soda/friendly-errors-webpack-plugin/download/@soda/friendly-errors-webpack-plugin-1.8.0.tgz?cache=0&sync_timestamp=1607927406873&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40soda%2Ffriendly-errors-webpack-plugin%2Fdownload%2F%40soda%2Ffriendly-errors-webpack-plugin-1.8.0.tgz", |
| | |
| | | "webpack-chain": "^6.4.0", |
| | | "webpack-dev-server": "^3.11.0", |
| | | "webpack-merge": "^4.2.2" |
| | | }, |
| | | "dependencies": { |
| | | "ansi-styles": { |
| | | "version": "4.3.0", |
| | | "resolved": "https://mirrors.huaweicloud.com/repository/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", |
| | | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "color-convert": "^2.0.1" |
| | | } |
| | | }, |
| | | "chalk": { |
| | | "version": "4.1.2", |
| | | "resolved": "https://mirrors.huaweicloud.com/repository/npm/chalk/-/chalk-4.1.2.tgz", |
| | | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "ansi-styles": "^4.1.0", |
| | | "supports-color": "^7.1.0" |
| | | } |
| | | }, |
| | | "color-convert": { |
| | | "version": "2.0.1", |
| | | "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-convert/-/color-convert-2.0.1.tgz", |
| | | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "color-name": "~1.1.4" |
| | | } |
| | | }, |
| | | "color-name": { |
| | | "version": "1.1.4", |
| | | "resolved": "https://mirrors.huaweicloud.com/repository/npm/color-name/-/color-name-1.1.4.tgz", |
| | | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", |
| | | "dev": true, |
| | | "optional": true |
| | | }, |
| | | "has-flag": { |
| | | "version": "4.0.0", |
| | | "resolved": "https://mirrors.huaweicloud.com/repository/npm/has-flag/-/has-flag-4.0.0.tgz", |
| | | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", |
| | | "dev": true, |
| | | "optional": true |
| | | }, |
| | | "loader-utils": { |
| | | "version": "2.0.4", |
| | | "resolved": "https://mirrors.huaweicloud.com/repository/npm/loader-utils/-/loader-utils-2.0.4.tgz", |
| | | "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "big.js": "^5.2.2", |
| | | "emojis-list": "^3.0.0", |
| | | "json5": "^2.1.2" |
| | | } |
| | | }, |
| | | "supports-color": { |
| | | "version": "7.2.0", |
| | | "resolved": "https://mirrors.huaweicloud.com/repository/npm/supports-color/-/supports-color-7.2.0.tgz", |
| | | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "has-flag": "^4.0.0" |
| | | } |
| | | }, |
| | | "vue-loader-v16": { |
| | | "version": "npm:vue-loader@16.8.3", |
| | | "resolved": "https://mirrors.huaweicloud.com/repository/npm/vue-loader/-/vue-loader-16.8.3.tgz", |
| | | "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "chalk": "^4.1.0", |
| | | "hash-sum": "^2.0.0", |
| | | "loader-utils": "^2.0.0" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "@vue/cli-shared-utils": { |
| | |
| | | "lodash-unified": "^1.0.2", |
| | | "memoize-one": "^6.0.0", |
| | | "normalize-wheel-es": "^1.2.0" |
| | | }, |
| | | "dependencies": { |
| | | "@popperjs/core": { |
| | | "version": "npm:@sxzz/popperjs-es@2.11.7", |
| | | "resolved": "https://mirrors.huaweicloud.com/repository/npm/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz", |
| | | "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==" |
| | | } |
| | | } |
| | | }, |
| | | "element-ui": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "vue-loader-v16": { |
| | | "version": "npm:vue-loader@16.8.3", |
| | | "resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz", |
| | | "integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "chalk": "^4.1.0", |
| | | "hash-sum": "^2.0.0", |
| | | "loader-utils": "^2.0.0" |
| | | }, |
| | | "dependencies": { |
| | | "ansi-styles": { |
| | | "version": "4.3.0", |
| | | "resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz", |
| | | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "color-convert": "^2.0.1" |
| | | } |
| | | }, |
| | | "chalk": { |
| | | "version": "4.1.2", |
| | | "resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz", |
| | | "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "ansi-styles": "^4.1.0", |
| | | "supports-color": "^7.1.0" |
| | | } |
| | | }, |
| | | "color-convert": { |
| | | "version": "2.0.1", |
| | | "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", |
| | | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "color-name": "~1.1.4" |
| | | } |
| | | }, |
| | | "color-name": { |
| | | "version": "1.1.4", |
| | | "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", |
| | | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", |
| | | "dev": true, |
| | | "optional": true |
| | | }, |
| | | "has-flag": { |
| | | "version": "4.0.0", |
| | | "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz", |
| | | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", |
| | | "dev": true, |
| | | "optional": true |
| | | }, |
| | | "loader-utils": { |
| | | "version": "2.0.4", |
| | | "resolved": "https://registry.npmmirror.com/loader-utils/-/loader-utils-2.0.4.tgz", |
| | | "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "big.js": "^5.2.2", |
| | | "emojis-list": "^3.0.0", |
| | | "json5": "^2.1.2" |
| | | } |
| | | }, |
| | | "supports-color": { |
| | | "version": "7.2.0", |
| | | "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz", |
| | | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", |
| | | "dev": true, |
| | | "optional": true, |
| | | "requires": { |
| | | "has-flag": "^4.0.0" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "vue-qrcode": { |
| | | "version": "2.2.2", |
| | | "resolved": "https://registry.npmmirror.com/vue-qrcode/-/vue-qrcode-2.2.2.tgz", |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | window.webConfig = { |
| | | "webApiBaseUrl": "http://localhost:9291/", |
| | | "webApiProduction":"http://localhost:9291/" |
| | | |
| | | // "webApiBaseUrl": "http://172.19.69.152:9291/", |
| | | // "webApiProduction":"http://172.19.69.152:9291/" |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <vol-box |
| | | v-model="showStockTakeBox" |
| | | :lazy="true" |
| | | :width="isMobile ? '95%' : '70%'" |
| | | :padding="24" |
| | | title="åºåçç¹æä½" |
| | | class="custom-vol-box" |
| | | > |
| | | <div class="stock-take-container"> |
| | | <div class="receipt-info"> |
| | | <el-tag type="primary" size="small" class="receipt-tag"> |
| | | å½åçç¹åæ®å·ï¼<span class="receipt-no">{{ orderNo }}</span> |
| | | </el-tag> |
| | | </div> |
| | | |
| | | <!-- æ ¸å¿è¾å
¥è¡¨å --> |
| | | <el-form |
| | | :model="formData" |
| | | ref="formRef" |
| | | label-width="100px" |
| | | class="stock-take-form" |
| | | @submit.prevent |
| | | > |
| | | <!-- æç®±å·è¾å
¥æ¡ --> |
| | | <el-form-item |
| | | label="æç®±å·ï¼" |
| | | name="boxNo" |
| | | :rules="[ |
| | | { |
| | | required: true, |
| | | message: 'è¯·æ«ææè¾å
¥æç®±å·', |
| | | trigger: 'blur', |
| | | }, |
| | | { validator: validateBoxNo, trigger: 'blur' }, |
| | | ]" |
| | | class="form-item" |
| | | > |
| | | <el-input |
| | | ref="boxNoInputRef" |
| | | v-model="formData.boxNo" |
| | | placeholder="è¯·ä½¿ç¨æ«ç æªæ«ææç®±å·ï¼ææå¨è¾å
¥" |
| | | clearable |
| | | @keydown.enter="debouncedHandleBoxNoScan" |
| | | @blur="handleBoxNoBlur" |
| | | :disabled="loading" |
| | | class="custom-input" |
| | | :class="{ 'has-value': formData.boxNo.trim() }" |
| | | > |
| | | <template #append> |
| | | <el-button |
| | | icon="Search" |
| | | type="primary" |
| | | size="small" |
| | | @click="handleBoxNoScan" |
| | | :disabled="!formData.boxNo.trim() || loading" |
| | | class="input-btn" |
| | | ></el-button> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | |
| | | <!-- æ¡ç è¾å
¥æ¡ --> |
| | | <el-form-item |
| | | label="çç¹æ¡ç ï¼" |
| | | name="barcode" |
| | | :rules="[ |
| | | { required: true, message: 'è¯·æ«ææè¾å
¥æ¡ç ', trigger: 'blur' }, |
| | | { validator: validateBarcode, trigger: 'blur' }, |
| | | ]" |
| | | class="form-item" |
| | | > |
| | | <el-input |
| | | ref="barcodeInputRef" |
| | | v-model="formData.barcode" |
| | | placeholder="è¯·ä½¿ç¨æ«ç æªæ«ææ¡ç ï¼ææå¨è¾å
¥" |
| | | clearable |
| | | @keydown.enter="debouncedHandleBarcodeScan" |
| | | :disabled="!formData.boxNo.trim() || loading" |
| | | class="custom-input" |
| | | :class="{ 'has-value': formData.barcode.trim() }" |
| | | > |
| | | <template #append> |
| | | <el-button |
| | | icon="Search" |
| | | type="primary" |
| | | size="small" |
| | | @click="handleBarcodeScan" |
| | | :disabled=" |
| | | !formData.boxNo.trim() || |
| | | !formData.barcode.trim() || |
| | | loading |
| | | " |
| | | class="input-btn" |
| | | ></el-button> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | |
| | | <!-- åºåæ°éæ¡ï¼åªè¯»ï¼ --> |
| | | <el-form-item |
| | | label="åºåæ°éï¼" |
| | | name="stockQuantity" |
| | | class="form-item" |
| | | > |
| | | <el-input |
| | | v-model="formData.stockQuantity" |
| | | placeholder="æ«ææ¡ç åèªå¨å¡«å
" |
| | | readonly |
| | | class="custom-input custom-readonly-input" |
| | | :class="{ 'has-value': formData.stockQuantity }" |
| | | ></el-input> |
| | | </el-form-item> |
| | | |
| | | <!-- å®é
çç¹æ°é --> |
| | | <el-form-item |
| | | label="å®é
çç¹æ°éï¼" |
| | | name="actualQuantity" |
| | | :rules="[ |
| | | { |
| | | required: true, |
| | | message: '请è¾å
¥å®é
çç¹æ°é', |
| | | trigger: 'blur', |
| | | }, |
| | | { type: 'number', message: '请è¾å
¥ææçæ°å', trigger: 'blur' }, |
| | | { validator: validateActualQuantity, trigger: 'blur' }, |
| | | ]" |
| | | class="form-item" |
| | | > |
| | | <el-input |
| | | v-model.number="formData.actualQuantity" |
| | | placeholder="请è¾å
¥å®é
çç¹æ°éï¼å¤§äº0ï¼" |
| | | type="number" |
| | | clearable |
| | | @keydown.enter="handleStockTakeComplete" |
| | | :disabled="!formData.stockQuantity || loading" |
| | | class="custom-input" |
| | | :class="{ 'has-value': formData.actualQuantity }" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="action-buttons"> |
| | | <el-button |
| | | type="info" |
| | | size="small" |
| | | @click="handleBoxReturn" |
| | | :disabled="!formData.boxNo.trim() || loading" |
| | | class="return-btn" |
| | | > |
| | | <Return /> æç®±ååº |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | @click="handleStockTakeComplete" |
| | | :disabled=" |
| | | loading || |
| | | !formData.boxNo.trim() || |
| | | !formData.barcode.trim() || |
| | | !formData.stockQuantity || |
| | | !formData.actualQuantity |
| | | " |
| | | class="complete-btn" |
| | | > |
| | | <Check /> çç¹å®æ |
| | | </el-button> |
| | | <el-button |
| | | type="text" |
| | | size="small" |
| | | @click="handleCancel" |
| | | :disabled="loading" |
| | | class="cancel-btn" |
| | | > |
| | | åæ¶ |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | </vol-box> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted, nextTick, watch, defineEmits, computed } from "vue"; |
| | | import { ElMessage, ElTag, ElMessageBox } from "element-plus"; |
| | | import { Search, Check, Return } from "@element-plus/icons-vue"; |
| | | |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import http from "@/api/http"; |
| | | |
| | | // ååºå¼åé - åæ®å· |
| | | const orderNo = ref(""); |
| | | |
| | | // æ´é²äºä»¶ |
| | | const emit = defineEmits(["close", "refresh", "box-returned"]); |
| | | |
| | | // ååºå¼æ°æ® |
| | | const showStockTakeBox = ref(false); |
| | | const formData = reactive({ |
| | | boxNo: "", // æç®±å· |
| | | barcode: "", // çç¹æ¡ç |
| | | stockQuantity: "", // åºåæ°éï¼åªè¯»ï¼ |
| | | actualQuantity: "", // å®é
çç¹æ°é |
| | | }); |
| | | const loading = ref(false); |
| | | const formRef = ref(null); |
| | | |
| | | // 模æ¿å¼ç¨ |
| | | const boxNoInputRef = ref(null); |
| | | const barcodeInputRef = ref(null); |
| | | |
| | | // æ£æµæ¯å¦ä¸ºç§»å¨ç«¯ |
| | | const isMobile = computed(() => { |
| | | return window.innerWidth < 768; |
| | | }); |
| | | |
| | | // ç»ä»¶æè½½æ¶èç¦å°æç®±å·è¾å
¥æ¡ |
| | | onMounted(() => { |
| | | nextTick(() => { |
| | | boxNoInputRef.value?.focus(); |
| | | }); |
| | | // çå¬çªå£å¤§å°åå |
| | | window.addEventListener("resize", () => {}); |
| | | }); |
| | | |
| | | // çå¬æç®±å·ååï¼æ¸
空åç»ç¸å
³å段 |
| | | watch( |
| | | () => formData.boxNo, |
| | | (newVal) => { |
| | | if (!newVal.trim()) { |
| | | formData.barcode = ""; |
| | | formData.stockQuantity = ""; |
| | | formData.actualQuantity = ""; |
| | | } |
| | | }, |
| | | { immediate: true } |
| | | ); |
| | | |
| | | // 鲿彿° |
| | | const debounce = (fn, delay = 100) => { |
| | | let timer = null; |
| | | return (...args) => { |
| | | if (timer) clearTimeout(timer); |
| | | timer = setTimeout(() => { |
| | | fn.apply(this, args); |
| | | }, delay); |
| | | }; |
| | | }; |
| | | |
| | | // æå¼å¼¹çªå¹¶æ¥æ¶åæ®å· |
| | | const open = (receiptNo) => { |
| | | showStockTakeBox.value = true; |
| | | orderNo.value = receiptNo; |
| | | // é置表å |
| | | formData.boxNo = ""; |
| | | formData.barcode = ""; |
| | | formData.stockQuantity = ""; |
| | | formData.actualQuantity = ""; |
| | | nextTick(() => { |
| | | boxNoInputRef.value?.focus(); |
| | | }); |
| | | }; |
| | | |
| | | // å
³éå¼¹çª |
| | | const handleCancel = (e) => { |
| | | e.stopPropagation(); |
| | | e.preventDefault(); |
| | | showStockTakeBox.value = false; |
| | | emit("close"); |
| | | orderNo.value = ""; |
| | | }; |
| | | |
| | | // æç®±å·éªè¯ï¼ä¼åï¼æå¼æ¶ä»
éªè¯é¿åº¦ï¼æ 弿¶è§¦åå¿
å¡«ï¼ |
| | | const validateBoxNo = (rule, value, callback) => { |
| | | // æå¼æ¶éªè¯é¿åº¦ |
| | | if (value && value.trim().length < 3) { |
| | | callback(new Error("æç®±å·é¿åº¦ä¸è½å°äº3ä½")); |
| | | } |
| | | // æ 弿¶ç±requiredè§åå¤çï¼è¿éä¸éå¤æç¤º |
| | | else { |
| | | callback(); |
| | | } |
| | | }; |
| | | |
| | | // æ¡ç éªè¯ï¼ä¼åï¼æå¼æ¶ä»
éªè¯é¿åº¦ï¼ |
| | | const validateBarcode = (rule, value, callback) => { |
| | | if (value && value.trim().length < 6) { |
| | | callback(new Error("æ¡ç é¿åº¦ä¸è½å°äº6ä½")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | |
| | | // å®é
çç¹æ°ééªè¯ï¼ä¼åï¼æå¼æ¶éªè¯åæ³æ§ï¼ |
| | | const validateActualQuantity = (rule, value, callback) => { |
| | | if (value === null || value === undefined) { |
| | | callback(new Error("请è¾å
¥å®é
çç¹æ°é")); |
| | | } else if (value <= 0) { |
| | | callback(new Error("å®é
çç¹æ°éå¿
须大äº0")); |
| | | } else if (!Number.isInteger(value)) { |
| | | callback(new Error("å®é
çç¹æ°éå¿
é¡»æ¯æ´æ°")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | |
| | | // æç®±å·å¤±ç¦å¤ç |
| | | const handleBoxNoBlur = () => { |
| | | if (formData.boxNo.trim() && boxNoInputRef.value?.input) { |
| | | boxNoInputRef.value.input.select(); |
| | | } |
| | | }; |
| | | |
| | | // æç®±å·æ«æéªè¯ï¼å端æ¥å£ï¼ |
| | | const validateBoxNoApi = async (boxNo) => { |
| | | try { |
| | | const res = await http.post( |
| | | `/api/TakeStockOrder/ValidateBoxNo?orderNo=${encodeURIComponent( |
| | | orderNo.value |
| | | )}&boxNo=${encodeURIComponent(boxNo)}`, |
| | | "éªè¯æç®±å·ä¸..." |
| | | ); |
| | | |
| | | if (!res.status) { |
| | | throw new Error(res.message || "æç®±å·éªè¯å¤±è´¥"); |
| | | } |
| | | return res.data; |
| | | } catch (error) { |
| | | throw error; |
| | | } |
| | | }; |
| | | |
| | | // æç®±å·æ«æå¤ç |
| | | const handleBoxNoScan = async () => { |
| | | if (!formRef.value) return; |
| | | // æå¨è§¦åéªè¯ï¼ä»
éªè¯å½ååæ®µï¼ |
| | | const valid = await formRef.value.validateField("boxNo"); |
| | | if (valid !== true) return; |
| | | |
| | | const boxNo = formData.boxNo.trim(); |
| | | if (!boxNo) return; |
| | | |
| | | try { |
| | | loading.value = true; |
| | | await validateBoxNoApi(boxNo); |
| | | ElMessage.success(`æç®±å· ${boxNo} éªè¯éè¿`); |
| | | nextTick(() => { |
| | | barcodeInputRef.value?.focus(); |
| | | }); |
| | | } catch (error) { |
| | | ElMessage.error(error.message); |
| | | nextTick(() => { |
| | | if (boxNoInputRef.value?.input) { |
| | | boxNoInputRef.value.input.select(); |
| | | } |
| | | }); |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | | }; |
| | | |
| | | // æ¡ç æ«æéªè¯ï¼å端æ¥å£ï¼ |
| | | const validateBarcodeApi = async (boxNo, barcode) => { |
| | | try { |
| | | const res = await http.post( |
| | | `/api/TakeStockOrder/ValidateBarcode?boxNo=${encodeURIComponent( |
| | | boxNo |
| | | )}&barcode=${encodeURIComponent(barcode)}`, |
| | | "éªè¯æ¡ç ä¸..." |
| | | ); |
| | | |
| | | if (!res.status) { |
| | | throw new Error(res.message || "æ¡ç éªè¯å¤±è´¥"); |
| | | } |
| | | |
| | | if ( |
| | | res.data?.stockQuantity === undefined || |
| | | res.data?.stockQuantity === null |
| | | ) { |
| | | throw new Error("æªæ¥è¯¢å°è¯¥æ¡ç çåºåæ°é"); |
| | | } |
| | | |
| | | return res.data; |
| | | } catch (error) { |
| | | throw error; |
| | | } |
| | | }; |
| | | |
| | | // æ¡ç æ«æå¤ç |
| | | const handleBarcodeScan = async () => { |
| | | if (!formRef.value) return; |
| | | const valid = await formRef.value.validateField("barcode"); |
| | | if (valid !== true) return; |
| | | |
| | | const boxNo = formData.boxNo.trim(); |
| | | const barcode = formData.barcode.trim(); |
| | | if (!boxNo || !barcode) return; |
| | | |
| | | try { |
| | | loading.value = true; |
| | | const result = await validateBarcodeApi(boxNo, barcode); |
| | | formData.stockQuantity = result.stockQuantity; |
| | | ElMessage.success( |
| | | `æ¡ç ${barcode} éªè¯éè¿ï¼åºåæ°éï¼${result.stockQuantity}` |
| | | ); |
| | | nextTick(() => { |
| | | const actualQuantityInput = document.querySelector( |
| | | ".form-item:last-child .el-input__inner" |
| | | ); |
| | | actualQuantityInput?.focus(); |
| | | }); |
| | | } catch (error) { |
| | | ElMessage.error(error.message); |
| | | nextTick(() => { |
| | | if (barcodeInputRef.value?.input) { |
| | | barcodeInputRef.value.input.select(); |
| | | } |
| | | }); |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | | }; |
| | | |
| | | // çç¹å®ææäº¤ |
| | | const handleStockTakeComplete = async () => { |
| | | if (!formRef.value) return; |
| | | // å
¨è¡¨åéªè¯ |
| | | const valid = await formRef.value.validate(); |
| | | if (!valid) return; |
| | | |
| | | const { boxNo, barcode, actualQuantity, stockQuantity } = formData; |
| | | const receiptNo = orderNo.value; |
| | | |
| | | try { |
| | | loading.value = true; |
| | | |
| | | const res = await http.post( |
| | | "/api/TakeStockOrder/CompleteStockTake", |
| | | { |
| | | orderNo: receiptNo, |
| | | boxNo, |
| | | barcode, |
| | | actualQuantity, |
| | | stockQuantity, |
| | | }, |
| | | { |
| | | loadingText: "æäº¤çç¹æ°æ®ä¸...", |
| | | } |
| | | ); |
| | | |
| | | if (res.status) { |
| | | ElMessage.success("çç¹å®æï¼æäº¤æåï¼"); |
| | | formData.barcode = ""; |
| | | formData.stockQuantity = ""; |
| | | formData.actualQuantity = ""; |
| | | nextTick(() => { |
| | | barcodeInputRef.value?.focus(); |
| | | }); |
| | | emit("refresh"); |
| | | } else { |
| | | throw new Error(res.message || "çç¹æäº¤å¤±è´¥"); |
| | | } |
| | | } catch (error) { |
| | | ElMessage.error(error.message || "ç½ç»å¼å¸¸ï¼æäº¤å¤±è´¥"); |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | | }; |
| | | |
| | | // æç®±ååºåè½ |
| | | const handleBoxReturn = async () => { |
| | | const boxNo = formData.boxNo.trim(); |
| | | if (!boxNo) { |
| | | ElMessage.warning("请å
è¾å
¥ææ«ææç®±å·"); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | await ElMessageBox.confirm(`ç¡®å®å°æç®±ã${boxNo}ãååºåï¼`, "ååºç¡®è®¤", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "info", |
| | | center: true, |
| | | confirmButtonClass: "el-button--primary", |
| | | cancelButtonClass: "el-button--text", |
| | | }); |
| | | |
| | | loading.value = true; |
| | | |
| | | const res = await http.post( |
| | | `/api/TakeStockOrder/ReturnBox?boxNo=${encodeURIComponent(boxNo)}&orderNo=${encodeURIComponent( |
| | | orderNo.value |
| | | )}`, |
| | | "æç®±ååºä¸..." |
| | | ); |
| | | |
| | | if (res.status) { |
| | | ElMessage.success(`æç®±ã${boxNo}ãååºæåï¼`); |
| | | formData.boxNo = ""; |
| | | formData.barcode = ""; |
| | | formData.stockQuantity = ""; |
| | | formData.actualQuantity = ""; |
| | | nextTick(() => { |
| | | boxNoInputRef.value?.focus(); |
| | | }); |
| | | emit("box-returned", boxNo); |
| | | } else { |
| | | throw new Error(res.message || "æç®±ååºå¤±è´¥"); |
| | | } |
| | | } catch (error) { |
| | | if (error.name !== "Cancel") { |
| | | ElMessage.error(error.message); |
| | | } |
| | | } finally { |
| | | loading.value = false; |
| | | } |
| | | }; |
| | | |
| | | // å¸¦é²æçæ«æå¤ç |
| | | const debouncedHandleBoxNoScan = debounce(async (e) => { |
| | | e.stopPropagation(); |
| | | e.preventDefault(); |
| | | await handleBoxNoScan(); |
| | | }, 100); |
| | | |
| | | const debouncedHandleBarcodeScan = debounce(async (e) => { |
| | | e.stopPropagation(); |
| | | e.preventDefault(); |
| | | await handleBarcodeScan(); |
| | | }, 100); |
| | | |
| | | // æ´é²æ¹æ³ |
| | | defineExpose({ |
| | | open, |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /* 䏻容卿 ·å¼ - ä¼åé´è·åååºå¼ */ |
| | | .stock-take-container { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 16px; |
| | | padding: 8px 0; |
| | | } |
| | | |
| | | /* åæ®ä¿¡æ¯æ ·å¼ - ä¼åè§è§å±çº§ */ |
| | | .receipt-info { |
| | | margin-bottom: 4px; |
| | | } |
| | | |
| | | .receipt-tag { |
| | | padding: 8px 16px; |
| | | font-size: 14px; |
| | | background-color: #e8f4f8 !important; |
| | | border-color: #409eff !important; |
| | | color: #1989fa !important; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 8px rgba(64, 158, 255, 0.1); |
| | | } |
| | | |
| | | .receipt-no { |
| | | font-weight: 600; |
| | | color: #1989fa; |
| | | margin-left: 6px; |
| | | } |
| | | |
| | | /* è¡¨åæ ·å¼ - ä¼åé´å½±åå
è¾¹è· */ |
| | | .stock-take-form { |
| | | width: 100%; |
| | | background-color: #ffffff; |
| | | padding: 20px; |
| | | border-radius: 12px; |
| | | box-shadow: 0 2px 12px rgba(64, 158, 255, 0.06); |
| | | border: 1px solid #f0f8fb; |
| | | } |
| | | |
| | | .form-item { |
| | | margin-bottom: 16px; |
| | | } |
| | | |
| | | /* è¾å
¥æ¡æ ¸å¿æ ·å¼ - ä¼åç¶ææ¾ç¤º */ |
| | | .custom-input { |
| | | width: 100%; |
| | | position: relative; |
| | | } |
| | | |
| | | /* æå¼æ¶éèå ä½ç¬¦ + ä¼åè¾¹æ¡ */ |
| | | .custom-input.has-value :deep(.el-input__inner) { |
| | | --el-input-placeholder-color: transparent; /* éèå ä½ç¬¦ */ |
| | | border-color: #8cc5ff; /* æµ
èè¾¹æ¡ï¼åºåæ å¼ç¶æ */ |
| | | background-color: #ffffff; |
| | | } |
| | | |
| | | .custom-input :deep(.el-input__inner) { |
| | | border-radius: 8px; |
| | | border-color: #e5f0fa; |
| | | transition: all 0.2s ease; |
| | | height: 42px; |
| | | line-height: 42px; |
| | | font-size: 14px; |
| | | background-color: #f8fbff; |
| | | padding: 0 12px; |
| | | } |
| | | |
| | | /* èç¦æ ·å¼ä¼å */ |
| | | .custom-input :deep(.el-input__inner:focus) { |
| | | border-color: #409eff; |
| | | box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1); |
| | | background-color: #ffffff; |
| | | outline: none; |
| | | } |
| | | |
| | | /* æ¸
餿鮿 ·å¼ä¼å */ |
| | | .custom-input :deep(.el-input__clear) { |
| | | color: #91c9f7; |
| | | width: 18px; |
| | | height: 18px; |
| | | } |
| | | |
| | | .custom-input :deep(.el-input__clear:hover) { |
| | | color: #409eff; |
| | | } |
| | | |
| | | /* åªè¯»è¾å
¥æ¡æ ·å¼ - å¢å¼ºåºå度 */ |
| | | .custom-readonly-input :deep(.el-input__inner) { |
| | | background-color: #f0f8fb; |
| | | color: #1989fa; |
| | | font-weight: 500; |
| | | cursor: default; |
| | | border-color: #d1e7fd; |
| | | padding-right: 12px; |
| | | } |
| | | |
| | | /* è¾å
¥æ¡æé®æ ·å¼ - ä¼å尺寸åhoverææ */ |
| | | .input-btn { |
| | | border-radius: 0 8px 8px 0 !important; |
| | | height: 42px; |
| | | width: 48px; |
| | | background-color: #409eff; |
| | | border-color: #409eff; |
| | | transition: all 0.2s ease; |
| | | } |
| | | |
| | | .input-btn:hover { |
| | | background-color: #1989fa !important; |
| | | border-color: #1989fa !important; |
| | | box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2); |
| | | transform: translateY(-1px); |
| | | } |
| | | |
| | | /* 表åéªè¯éè¯¯æ ·å¼ - å
³é®ï¼æå¼æ¶ä¸æ¾ç¤ºéè¯¯è¾¹æ¡ */ |
| | | .form-item :deep(.el-form-item__error) { |
| | | font-size: 12px; |
| | | color: #f56c6c; |
| | | margin-top: 4px; |
| | | /* ä»
å¨è¾å
¥æ¡ä¸ºç©ºä¸éªè¯å¤±è´¥æ¶æ¾ç¤º */ |
| | | display: none; |
| | | } |
| | | |
| | | /* åªæè¾å
¥æ¡ä¸ºç©º + éªè¯å¤±è´¥æ¶æ¾ç¤ºé误æç¤º */ |
| | | .form-item:deep(.el-form-item--error) .custom-input:not(.has-value) + .el-form-item__error { |
| | | display: block; |
| | | } |
| | | |
| | | /* æå¼æ¶å³ä½¿éªè¯å¤±è´¥ï¼ä¹ä¸æ¾ç¤ºéè¯¯è¾¹æ¡ */ |
| | | .custom-input.has-value :deep(.el-input__inner.el-input__inner--error) { |
| | | border-color: #8cc5ff; |
| | | box-shadow: none; |
| | | } |
| | | |
| | | /* æä½æé®åºå - ä¼åé´è·åååºå¼ */ |
| | | .action-buttons { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | gap: 10px; |
| | | margin-top: 20px; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | | /* ååºæé®æ ·å¼ - ä¼åäº¤äº */ |
| | | .return-btn { |
| | | border-radius: 8px; |
| | | padding: 9px 20px; |
| | | font-size: 14px; |
| | | font-weight: 500; |
| | | background-color: #e8f4f8; |
| | | border-color: #409eff; |
| | | color: #1989fa; |
| | | transition: all 0.2s ease; |
| | | } |
| | | |
| | | .return-btn:hover { |
| | | background-color: #d1e7fd !important; |
| | | border-color: #1989fa !important; |
| | | color: #1989fa !important; |
| | | transform: translateY(-1px); |
| | | box-shadow: 0 2px 8px rgba(64, 158, 255, 0.15); |
| | | } |
| | | |
| | | .return-btn:disabled { |
| | | background-color: #f0f8fb !important; |
| | | border-color: #b3d8ff !important; |
| | | color: #91c9f7 !important; |
| | | cursor: not-allowed; |
| | | transform: none; |
| | | box-shadow: none; |
| | | } |
| | | |
| | | /* çç¹å®ææé®æ ·å¼ - ä¼åäº¤äº */ |
| | | .complete-btn { |
| | | border-radius: 8px; |
| | | padding: 9px 20px; |
| | | font-size: 14px; |
| | | font-weight: 500; |
| | | background-color: #409eff; |
| | | border-color: #409eff; |
| | | transition: all 0.2s ease; |
| | | } |
| | | |
| | | .complete-btn:hover { |
| | | background-color: #1989fa !important; |
| | | border-color: #1989fa !important; |
| | | transform: translateY(-1px); |
| | | box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2); |
| | | } |
| | | |
| | | .complete-btn:disabled { |
| | | background-color: #a0cfff !important; |
| | | border-color: #a0cfff !important; |
| | | color: #ffffff !important; |
| | | cursor: not-allowed; |
| | | transform: none; |
| | | box-shadow: none; |
| | | } |
| | | |
| | | /* åæ¶æé®æ ·å¼ - ä¼åç¹å»åºå */ |
| | | .cancel-btn { |
| | | color: #666666; |
| | | font-size: 14px; |
| | | transition: all 0.2s ease; |
| | | padding: 9px 20px; |
| | | border-radius: 8px; |
| | | min-width: 80px; |
| | | } |
| | | |
| | | .cancel-btn:hover { |
| | | color: #1989fa !important; |
| | | background-color: #f0f8fb !important; |
| | | } |
| | | |
| | | /* å¼¹çªæ´ä½æ ·å¼ - ä¼ååè§åé´å½± */ |
| | | .custom-vol-box { |
| | | border-radius: 16px !important; |
| | | overflow: hidden; |
| | | box-shadow: 0 8px 24px rgba(64, 158, 255, 0.12); |
| | | } |
| | | |
| | | .custom-vol-box :deep(.el-dialog__header) { |
| | | background-color: #e8f4f8; |
| | | border-bottom: 1px solid #d1e7fd; |
| | | padding: 16px 24px; |
| | | } |
| | | |
| | | .custom-vol-box :deep(.el-dialog__title) { |
| | | color: #1989fa; |
| | | font-size: 18px; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .custom-vol-box :deep(.el-dialog__body) { |
| | | padding: 16px 24px; |
| | | } |
| | | |
| | | /* ååºå¼éé
- å°å±å¹ä¼å */ |
| | | @media (max-width: 768px) { |
| | | .stock-take-form { |
| | | padding: 16px; |
| | | } |
| | | |
| | | .form-item { |
| | | margin-bottom: 12px; |
| | | } |
| | | |
| | | .action-buttons { |
| | | justify-content: center; |
| | | } |
| | | |
| | | .custom-vol-box :deep(.el-dialog__header) { |
| | | padding: 12px 16px; |
| | | } |
| | | |
| | | .custom-vol-box :deep(.el-dialog__body) { |
| | | padding: 12px 16px; |
| | | } |
| | | } |
| | | </style> |
| | | |
| | | <style> |
| | | /* å
¨å±è¡¥å
æ ·å¼ - ç»ä¸ä¸»é¢ */ |
| | | .el-tag--primary { |
| | | --el-tag-bg-color: #e8f4f8; |
| | | --el-tag-border-color: #409eff; |
| | | --el-tag-text-color: #1989fa; |
| | | } |
| | | |
| | | /* å ä½ç¬¦æ ·å¼ - ç»ä¸é¢è² */ |
| | | .el-input__inner::-webkit-input-placeholder { |
| | | color: #b3d8ff; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .el-input__inner::-moz-placeholder { |
| | | color: #b3d8ff; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .el-input__inner:-ms-input-placeholder { |
| | | color: #b3d8ff; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | .el-input__inner::placeholder { |
| | | color: #b3d8ff; |
| | | font-size: 13px; |
| | | } |
| | | |
| | | /* ä¿¡æ¯æé®å
¨å±æ ·å¼ */ |
| | | .el-button--info { |
| | | --el-button-bg-color: #e8f4f8; |
| | | --el-button-border-color: #409eff; |
| | | --el-button-text-color: #1989fa; |
| | | --el-button-hover-bg-color: #d1e7fd; |
| | | --el-button-hover-border-color: #1989fa; |
| | | --el-button-hover-text-color: #1989fa; |
| | | } |
| | | |
| | | /* ç¡®è®¤å¼¹çªæ ·å¼ä¼å */ |
| | | .el-message-box { |
| | | border-radius: 12px !important; |
| | | box-shadow: 0 4px 20px rgba(64, 158, 255, 0.15); |
| | | } |
| | | |
| | | .el-message-box__header { |
| | | border-bottom: 1px solid #f0f8fb; |
| | | padding: 12px 20px; |
| | | } |
| | | |
| | | .el-message-box__title { |
| | | color: #1989fa; |
| | | font-size: 16px; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .el-message-box__content { |
| | | color: #666666; |
| | | font-size: 14px; |
| | | padding: 16px 20px; |
| | | } |
| | | |
| | | .el-message-box__btns { |
| | | padding: 12px 20px; |
| | | border-top: 1px solid #f0f8fb; |
| | | } |
| | | </style> |
| | |
| | | }); |
| | | }, |
| | | outbound() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | const platformOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | ]; |
| | | const mountNode = document.createElement("div"); |
| | | document.body.appendChild(mountNode); |
| | | // if (this.selection.length === 0) { |
| | | // return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | // } |
| | | // const platformOptions = [ |
| | | // { label: "ç«å°2", value: "2-1" }, |
| | | // { label: "ç«å°3", value: "3-1" }, |
| | | // ]; |
| | | // const mountNode = document.createElement("div"); |
| | | // document.body.appendChild(mountNode); |
| | | |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, |
| | | }); |
| | | // const formData = reactive({ |
| | | // selectedPlatform: platformOptions[0].value, |
| | | // }); |
| | | |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | | title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | width: "500px", |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | "onUpdate:modelValue": (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: "20px 0", |
| | | borderRadius: "8px", |
| | | }, |
| | | }, |
| | | { |
| | | default: () => |
| | | h( |
| | | ElForm, |
| | | { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | ], |
| | | }, |
| | | ref: "outboundForm", |
| | | labelWidth: "100px", |
| | | style: { |
| | | padding: "0 30px", |
| | | }, |
| | | }, |
| | | [ |
| | | h(ElFormItem, { |
| | | label: "åºåºç«å°", |
| | | prop: "selectedPlatform", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: "è¯·éæ©åºåºç«å°ï¼3-12ï¼", |
| | | modelValue: formData.selectedPlatform, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | }, platformOptions.map((platform) => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )), |
| | | ]), |
| | | h("div", { |
| | | style: { |
| | | textAlign: "right", |
| | | marginTop: "8px", |
| | | paddingRight: "4px", |
| | | }, |
| | | }, [ |
| | | h(ElButton, { |
| | | type: "text", |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info("åæ¶åºåºæä½"); |
| | | }, |
| | | style: { |
| | | marginRight: "8px", |
| | | color: "#606266", |
| | | }, |
| | | }, "åæ¶"), |
| | | h(ElButton, { |
| | | type: "primary", |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | // const vnode = createVNode( |
| | | // ElDialog, |
| | | // { |
| | | // title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | // width: "500px", |
| | | // modelValue: true, |
| | | // appendToBody: true, |
| | | // "onUpdate:modelValue": (isVisible) => { |
| | | // if (!isVisible) { |
| | | // render(null, mountNode); |
| | | // document.body.removeChild(mountNode); |
| | | // } |
| | | // }, |
| | | // style: { |
| | | // padding: "20px 0", |
| | | // borderRadius: "8px", |
| | | // }, |
| | | // }, |
| | | // { |
| | | // default: () => |
| | | // h( |
| | | // ElForm, |
| | | // { |
| | | // model: formData, |
| | | // rules: { |
| | | // selectedPlatform: [ |
| | | // { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | // ], |
| | | // }, |
| | | // ref: "outboundForm", |
| | | // labelWidth: "100px", |
| | | // style: { |
| | | // padding: "0 30px", |
| | | // }, |
| | | // }, |
| | | // [ |
| | | // h(ElFormItem, { |
| | | // label: "åºåºç«å°", |
| | | // prop: "selectedPlatform", |
| | | // style: { |
| | | // marginBottom: "24px", |
| | | // }, |
| | | // }, [ |
| | | // h(ElSelect, { |
| | | // placeholder: "è¯·éæ©åºåºç«å°ï¼3-12ï¼", |
| | | // modelValue: formData.selectedPlatform, |
| | | // "onUpdate:modelValue": (val) => { |
| | | // formData.selectedPlatform = val; |
| | | // }, |
| | | // style: { |
| | | // width: "100%", |
| | | // height: "40px", |
| | | // borderRadius: "4px", |
| | | // borderColor: "#dcdfe6", |
| | | // }, |
| | | // }, platformOptions.map((platform) => |
| | | // h(ElOption, { label: platform.label, value: platform.value }) |
| | | // )), |
| | | // ]), |
| | | // h("div", { |
| | | // style: { |
| | | // textAlign: "right", |
| | | // marginTop: "8px", |
| | | // paddingRight: "4px", |
| | | // }, |
| | | // }, [ |
| | | // h(ElButton, { |
| | | // type: "text", |
| | | // onClick: () => { |
| | | // render(null, mountNode); |
| | | // document.body.removeChild(mountNode); |
| | | // ElMessage.info("åæ¶åºåºæä½"); |
| | | // }, |
| | | // style: { |
| | | // marginRight: "8px", |
| | | // color: "#606266", |
| | | // }, |
| | | // }, "åæ¶"), |
| | | // h(ElButton, { |
| | | // type: "primary", |
| | | // onClick: async () => { |
| | | // const formRef = vnode.component.refs.outboundForm; |
| | | // try { |
| | | // await formRef.validate(); |
| | | // } catch (err) { |
| | | // return; |
| | | // } |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundTargetLocation: formData.selectedPlatform, |
| | | outboundQuantity: 1, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | }; |
| | | // const keys = this.selection.map((item) => item.id); |
| | | // const requestParams = { |
| | | // detailIds: keys, |
| | | // outboundTargetLocation: formData.selectedPlatform, |
| | | // outboundQuantity: 1, |
| | | // operator: "", |
| | | // orderNo: this.row.orderNo, |
| | | // }; |
| | | |
| | | this.http |
| | | .post( |
| | | "api/Outbound/ProcessPickingOutbound", |
| | | requestParams, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | // .catch(() => { |
| | | // ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | // }); |
| | | }, |
| | | style: { |
| | | borderRadius: "4px", |
| | | padding: "8px 20px", |
| | | }, |
| | | }, "ç¡®å®åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | // this.http |
| | | // .post( |
| | | // "api/Outbound/ProcessPickingOutbound", |
| | | // requestParams, |
| | | // "æ°æ®å¤çä¸" |
| | | // ) |
| | | // .then((x) => { |
| | | // if (!x.status) return ElMessage.error(x.message); |
| | | // ElMessage.success("æä½æå"); |
| | | // this.showDetialBox = false; |
| | | // this.$emit("parentCall", ($vue) => { |
| | | // $vue.getData(); |
| | | // }); |
| | | // render(null, mountNode); |
| | | // document.body.removeChild(mountNode); |
| | | // }) |
| | | // // .catch(() => { |
| | | // // ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | // // }); |
| | | // }, |
| | | // style: { |
| | | // borderRadius: "4px", |
| | | // padding: "8px 20px", |
| | | // }, |
| | | // }, "ç¡®å®åºåº"), |
| | | // ]), |
| | | // ]), |
| | | // } |
| | | // ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | // vnode.appContext = this.$.appContext; |
| | | // render(vnode, mountNode); |
| | | }, |
| | | outboundbatch() { |
| | | if (this.selection.length === 0) { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | // èªå®ä¹æ©å±ä¸å¡ä»£ç |
| | | import gridBody from "./extend/OrderStockTake.vue"; |
| | | |
| | | let extension = { |
| | | components: { |
| | | // æ¥è¯¢ç颿©å±ç»ä»¶ï¼å°èªå®ä¹å¼¹çªæ³¨å为 gridBody ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: gridBody, // 对åºä½ ççç¹å¼¹çªç»ä»¶ |
| | | gridFooter: '', |
| | | // æ°å»º/ç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ï¼æ¤å¤ä¸ç¨ï¼çç©ºï¼ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', // æ éæå®è¡¨åï¼é»è®¤éç¨å½å页é¢è¡¨æ ¼ï¼ |
| | | buttons: { view: [], box: [], detail: [] }, // æ©å±æé®ï¼å¦éé¢å¤æ·»å å¯å¨æ¤é
ç½®ï¼ |
| | | methods: { |
| | | onInit() { |
| | | // æ¾å° value 为 "OrderStockTake" çæé®ï¼é卿¡æ¶ä¸æåé
置该æé®ï¼ |
| | | let OrderStockTakeBtn = this.buttons.find(x => x.value === 'OrderStockTake'); |
| | | if (OrderStockTakeBtn) { |
| | | // éåæé®ç¹å»äºä»¶ |
| | | OrderStockTakeBtn.onClick = function () { |
| | | // 1. è·åè¡¨æ ¼éä¸è¡æ°æ® |
| | | let rows = this.$refs.table.getSelected(); |
| | | if (rows.length === 0) return this.$error("è¯·éæ©ä¸æ¡çç¹åæ®æ°æ®ï¼"); |
| | | if (rows.length > 1) return this.$error("åªè½éæ©ä¸æ¡çç¹åæ®æ°æ®ï¼"); |
| | | |
| | | const selectedReceiptNo = rows[0].orderNo; |
| | | if (!selectedReceiptNo) return this.$error("éä¸çåæ®ç¼ºå°ææçåæ®å·ï¼"); |
| | | |
| | | // 3. è°ç¨èªå®ä¹å¼¹çªç open æ¹æ³ï¼å¹¶ä¼ éåæ®å·ï¼æ ¸å¿ï¼ç»å¼¹çªä¼ åï¼ |
| | | this.$refs.gridBody.open(selectedReceiptNo); |
| | | }; |
| | | } |
| | | |
| | | // 4. çå¬èªå®ä¹å¼¹çªçäºä»¶ï¼åæ¥ä¸»é¡µé¢æ°æ®ï¼ |
| | | this.$nextTick(() => { |
| | | const stockTakeComp = this.$refs.gridBody; |
| | | if (stockTakeComp) { |
| | | // çå¬å¼¹çªç "refresh" äºä»¶ï¼çç¹å®æåå·æ°ä¸»é¡µé¢ï¼ |
| | | stockTakeComp.$on('refresh', () => { |
| | | this.$refs.table.reload(); // å·æ°è¡¨æ ¼æ°æ® |
| | | }); |
| | | |
| | | // çå¬å¼¹çªç "box-returned" äºä»¶ï¼æç®±ååºå坿éå¤çï¼ |
| | | stockTakeComp.$on('box-returned', (boxNo) => { |
| | | this.$success(`æç®±ã${boxNo}ãååºæåï¼è¡¨æ ¼å°å·æ°ï¼`); |
| | | this.$refs.table.reload(); // ååºåä¹å·æ°è¡¨æ ¼ï¼å¯éï¼æ ¹æ®ä¸å¡éæ±ï¼ |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | onInited() { |
| | | // æ¡æ¶åå§å宿忧è¡ï¼å¦éé
ç½®æç»è¡¨å¯å¨æ¤æä½ï¼ |
| | | }, |
| | | searchBefore(param) { |
| | | // æ¥è¯¢åæ¦æªï¼å¯æ·»å é¢å¤æ¥è¯¢æ¡ä»¶ï¼å¦æéè¿æ»¤ï¼ |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | // æ¥è¯¢åæ°æ®å¤çï¼å¦æ ¼å¼åæ¥æãç¶ææ¾ç¤ºï¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | | // æ°å»ºä¿ååå¤çï¼æ¤å¤ä¸ç¨ï¼ |
| | | return true; |
| | | }, |
| | | updateBefore(formData) { |
| | | // ç¼è¾ä¿ååå¤çï¼æ¤å¤ä¸ç¨ï¼ |
| | | return true; |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | // åå»è¡éä¸å½åè¡ï¼ä¼åç¨æ·ä½éªï¼ |
| | | this.$refs.table.$refs.table.toggleRowSelection(row); |
| | | }, |
| | | modelOpenAfter(row) { |
| | | // æ°å»º/ç¼è¾å¼¹çªæå¼åå¤çï¼æ¤å¤ä¸ç¨ï¼ |
| | | } |
| | | } |
| | | }; |
| | | |
| | | export default extension; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | }, |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤çè¡¨æ ¼çå¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | | //æ°å»ºä¿ååformData为对象ï¼å
æ¬æç»è¡¨ï¼å¯ä»¥ç»ç»è¡¨å设置å¼ï¼èªå·±è¾åºçformDataçå¼ |
| | | return true; |
| | | }, |
| | | updateBefore(formData) { |
| | | //ç¼è¾ä¿ååformData为对象ï¼å
æ¬æç»è¡¨ãå é¤è¡çId |
| | | return true; |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| | | |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import http from '@/api/http.js' |
| | | import { h,createVNode, render,reactive ,ref } from 'vue'; |
| | | import { ElDialog , ElForm, ElFormItem, ElInput, ElButton, ElMessage ,ElSelect, ElOption} from 'element-plus'; |
| | | |
| | | import gridBody from './extend/newAllocateOrderDetail.vue' |
| | | let extension = { |
| | | components: { |
| | |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [ |
| | | /* { |
| | | name: 'åºåº', |
| | | type: 'primary', |
| | | value: 'åºåº', |
| | | onClick: function () { // ä¿®å¤ï¼ç¨ElMessageæ¿ä»£this.$message |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | if (selectedRows.length === 0) { |
| | | ElMessage.warning('请å
éæ©è¦çæä»»å¡çè¡'); |
| | | return; |
| | | } |
| | | if (selectedRows.length > 1) { |
| | | ElMessage.warning('åªè½éæ©ä¸è¡'); |
| | | return; |
| | | } |
| | | |
| | | |
| | | // æææ ¡éªéè¿ï¼è§¦å主ç»ä»¶æå¼åºåºå¼¹çª |
| | | console.log('æææ ¡éªéè¿ï¼è§¦åopenOutboundDialogäºä»¶ï¼åæ®æ°æ®ï¼', selectedRows[0]); |
| | | |
| | | this.$emit('openOutboundDialog', { |
| | | transNo: selectedRows[0].transNo, // åºåºåç¼å· |
| | | createDate: selectedRows[0].createDate || new Date().toLocaleDateString() // åºåºæ¥æ |
| | | }); |
| | | } |
| | | }, */ |
| | | { |
| | | name: '空æçåºåº', |
| | | type: 'primary', |
| | | value: '空æçåºåº', |
| | | onClick: function () { |
| | | |
| | | |
| | | const platformOptions = Array.from({ length: 1 }, (_, i) => { |
| | | const num = 1; |
| | | return { label: `ç«å°${num}`, value: `1-2` }; |
| | | }); |
| | | |
| | | const quantityOptions = Array.from({ length: 6 }, (_, i) => ({ |
| | | label: (i + 1).toString(), |
| | | value: i + 1 |
| | | })); |
| | | |
| | | const warehouseOptions = ref([]); |
| | | const isLoadingWarehouses = ref(false); |
| | | |
| | | const getWarehouseList = async () => { |
| | | isLoadingWarehouses.value = true; |
| | | try { |
| | | const { data, status } = await http.post('/api/LocationInfo/GetLocationTypes'); |
| | | if (status && Array.isArray(data)) { |
| | | // æ ¼å¼åä»åºé项ï¼éé
ElSelectçlabel-valueæ ¼å¼ |
| | | warehouseOptions.value = data.map(item => ({ |
| | | label: item.locationTypeDesc, |
| | | value: item.locationType |
| | | })); |
| | | } else { |
| | | ElMessage.error('è·ååºåå表失败'); |
| | | warehouseOptions.value = []; |
| | | } |
| | | } catch (err) { |
| | | ElMessage.error('åºåæ°æ®è¯·æ±å¼å¸¸ï¼è¯·ç¨åéè¯'); |
| | | warehouseOptions.value = []; |
| | | } finally { |
| | | isLoadingWarehouses.value = false; |
| | | } |
| | | }; |
| | | |
| | | const mountNode = document.createElement('div'); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | |
| | | const formData = reactive({ |
| | | warehouseCode:'', |
| | | palletCode: '', |
| | | selectedPlatform: platformOptions[0].value, |
| | | quantity:1 |
| | | }); |
| | | |
| | | const vnode = createVNode(ElDialog, { |
| | | title: '空æçåºåº', |
| | | width: '500px', |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | onOpened: async () => { |
| | | await getWarehouseList(); |
| | | const inputRef = vnode.component.refs.boxCodeInput; |
| | | inputRef?.focus(); |
| | | }, |
| | | 'onUpdate:modelValue': (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: '20px 0', |
| | | borderRadius: '8px' |
| | | } |
| | | }, { |
| | | default: () => h(ElForm, { |
| | | model: formData, |
| | | rules: { |
| | | warehouseCode:[ |
| | | { required: true, message: 'è¯·éæ©åºå', trigger: ['change', 'blur'] } |
| | | ], |
| | | palletCode: [ |
| | | { type: 'string', message: 'æç®±å·å¿
须为å符串', trigger: 'blur' } |
| | | ], |
| | | selectedPlatform: [ |
| | | { required: true, message: 'è¯·éæ©åºåºç«å°', trigger: 'change' } |
| | | ], |
| | | quantity:[ |
| | | { required: true, message: 'è¯·éæ©ç©ºç®±æ°é', trigger: 'change'} |
| | | ] |
| | | }, |
| | | ref: 'batchOutForm', |
| | | labelWidth: '100px', |
| | | style: { |
| | | padding: '0 30px', |
| | | } |
| | | }, |
| | | [ |
| | | // h(ElFormItem, { |
| | | // label: 'ä»åºåºå', |
| | | // prop: 'warehouseCode', |
| | | // style: { |
| | | // marginBottom: '24px' |
| | | // } |
| | | // }, [ |
| | | // h(ElSelect, { |
| | | // placeholder: 'è¯·éæ©ä»åºåºå', |
| | | // modelValue: formData.warehouseCode, |
| | | // 'onUpdate:modelValue': (val) => { |
| | | // formData.warehouseCode = val; |
| | | // }, |
| | | // style: { |
| | | // width: '100%', |
| | | // height: '40px', |
| | | // borderRadius: '4px', |
| | | // borderColor: '#dcdfe6' |
| | | // } |
| | | // }, warehouseOptions.value.map(platform => |
| | | // h(ElOption, { label: platform.label, value: platform.value }) |
| | | // )) |
| | | // ]), |
| | | h(ElFormItem, { |
| | | label: 'åºåºç«å°', |
| | | prop: 'selectedPlatform', |
| | | style: { |
| | | marginBottom: '24px' |
| | | } |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: 'è¯·éæ©åºåºç«å°', |
| | | modelValue: formData.selectedPlatform, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: '100%', |
| | | height: '40px', |
| | | borderRadius: '4px', |
| | | borderColor: '#dcdfe6' |
| | | } |
| | | }, platformOptions.map(platform => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )) |
| | | ]), |
| | | // h(ElFormItem,{ |
| | | // label:'åºåºæ°é', |
| | | // prop:'quantity', |
| | | // style:{ |
| | | // marginBottom:'24px' |
| | | // } |
| | | // },[h(ElSelect,{ |
| | | // placeholder:'è¯·éæ©ç©ºç®±æ°é', |
| | | // modelValue:formData.quantity, |
| | | // 'onUpdate:modelValue':(val)=>{ |
| | | // formData.quantity=val; |
| | | // }, |
| | | // style:{ |
| | | // width:'100%', |
| | | // height:'40px', |
| | | // borderRadius:'4px', |
| | | // borderColor:'#dcdfe6' |
| | | // }, |
| | | // filterable:false |
| | | // }, |
| | | // quantityOptions.map(option=> |
| | | // h(ElOption,{ |
| | | // label:option.label, |
| | | // value:option.value |
| | | // }) |
| | | // ) |
| | | // )]), |
| | | h(ElFormItem, { |
| | | label: 'æç®±å·', |
| | | prop: 'palletCode', |
| | | style: { |
| | | marginBottom: '16px' |
| | | } |
| | | }, [ |
| | | h(ElInput, { |
| | | type: 'text', |
| | | placeholder: 'å¯éè¾å
¥æç®±å·ï¼ä¸å¡«åèªå¨åé
空æç®±', |
| | | modelValue: formData.palletCode, |
| | | 'onUpdate:modelValue': (val) => { |
| | | formData.palletCode = val; |
| | | }, |
| | | style: { |
| | | width: '100%', |
| | | height: '40px', |
| | | borderRadius: '4px', |
| | | borderColor: '#dcdfe6' |
| | | }, |
| | | attrs: { |
| | | placeholderStyle: 'color: #909399;' |
| | | } |
| | | }) |
| | | ]), |
| | | |
| | | h('div', { |
| | | style: { |
| | | textAlign: 'right', |
| | | marginTop: '8px', |
| | | paddingRight: '4px' |
| | | } |
| | | }, [ |
| | | h(ElButton, { |
| | | type: 'text', |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info('åæ¶åºåºæä½'); |
| | | }, |
| | | style: { |
| | | marginRight: '8px', |
| | | color: '#606266' |
| | | } |
| | | }, 'åæ¶'), |
| | | h(ElButton, { |
| | | type: 'primary', |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.batchOutForm; |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | |
| | | http.post('/api/Task/PalletOutboundTask?palletCode='+formData.palletCode+'&endStation='+formData.selectedPlatform, { |
| | | |
| | | }).then(({ data, status, message }) => { |
| | | if (status) { |
| | | |
| | | ElMessage.success(`åºåºæå`); |
| | | this.refresh(); |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } else { |
| | | ElMessage.error(message || data?.message || 'åºåºå¤±è´¥'); |
| | | } |
| | | }).catch(() => { |
| | | ElMessage.error('请æ±å¤±è´¥ï¼è¯·ç¨åéè¯'); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: '4px', |
| | | padding: '8px 20px' |
| | | } |
| | | }, 'ç¡®å®') |
| | | ]) |
| | | ]) |
| | | }); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | } |
| | | } |
| | | ], box: [], detail: [] }, //æ©å±çæé® |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | |
| | | <stock-select ref="child" @parentCall="parentCall"></stock-select> |
| | | <selected-stock ref="selectedStock" @parentCall="parentCall"></selected-stock> |
| | | <NoStockOut ref="NoStockOut" @parentCall="parentCall"></NoStockOut> |
| | | <DirectOutbound ref="DirectOutbound" @parentCall="parentCall"></DirectOutbound> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import StockSelect from "./StockSelect.vue"; |
| | | import SelectedStock from "./SelectedStock.vue"; |
| | | import NoStockOut from "./NoStockOut.vue"; |
| | | import { h, createVNode, render, reactive } from "vue"; |
| | | import { |
| | | ElDialog, |
| | | ElForm, |
| | | ElFormItem, |
| | | ElSelect, |
| | | ElOption, |
| | | ElButton, |
| | | ElInput, |
| | | ElMessage, |
| | | } from "element-plus"; |
| | | import DirectOutbound from "./DirectOutbound.vue"; |
| | | |
| | | export default { |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock, NoStockOut }, |
| | | components: { VolBox, VolForm, StockSelect, SelectedStock, NoStockOut, DirectOutbound }, |
| | | data() { |
| | | return { |
| | | row: null, |
| | |
| | | }); |
| | | }, |
| | | outbound() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | const platformOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | ]; |
| | | const mountNode = document.createElement("div"); |
| | | document.body.appendChild(mountNode); |
| | | // if (this.selection.length === 0) { |
| | | // return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | // } |
| | | // const platformOptions = [ |
| | | // { label: "ç«å°2", value: "2-1" }, |
| | | // { label: "ç«å°3", value: "3-1" }, |
| | | // ]; |
| | | // const mountNode = document.createElement("div"); |
| | | // document.body.appendChild(mountNode); |
| | | |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, |
| | | }); |
| | | // const formData = reactive({ |
| | | // selectedPlatform: platformOptions[0].value, |
| | | // }); |
| | | |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | | title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | width: "500px", |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | "onUpdate:modelValue": (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: "20px 0", |
| | | borderRadius: "8px", |
| | | }, |
| | | }, |
| | | { |
| | | default: () => |
| | | h( |
| | | ElForm, |
| | | { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | ], |
| | | }, |
| | | ref: "outboundForm", |
| | | labelWidth: "100px", |
| | | style: { |
| | | padding: "0 30px", |
| | | }, |
| | | }, |
| | | [ |
| | | h(ElFormItem, { |
| | | label: "åºåºç«å°", |
| | | prop: "selectedPlatform", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: "è¯·éæ©åºåºç«å°ï¼3-12ï¼", |
| | | modelValue: formData.selectedPlatform, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | }, platformOptions.map((platform) => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )), |
| | | ]), |
| | | h("div", { |
| | | style: { |
| | | textAlign: "right", |
| | | marginTop: "8px", |
| | | paddingRight: "4px", |
| | | }, |
| | | }, [ |
| | | h(ElButton, { |
| | | type: "text", |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info("åæ¶åºåºæä½"); |
| | | }, |
| | | style: { |
| | | marginRight: "8px", |
| | | color: "#606266", |
| | | }, |
| | | }, "åæ¶"), |
| | | h(ElButton, { |
| | | type: "primary", |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | // const vnode = createVNode( |
| | | // ElDialog, |
| | | // { |
| | | // title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | // width: "500px", |
| | | // modelValue: true, |
| | | // appendToBody: true, |
| | | // "onUpdate:modelValue": (isVisible) => { |
| | | // if (!isVisible) { |
| | | // render(null, mountNode); |
| | | // document.body.removeChild(mountNode); |
| | | // } |
| | | // }, |
| | | // style: { |
| | | // padding: "20px 0", |
| | | // borderRadius: "8px", |
| | | // }, |
| | | // }, |
| | | // { |
| | | // default: () => |
| | | // h( |
| | | // ElForm, |
| | | // { |
| | | // model: formData, |
| | | // rules: { |
| | | // selectedPlatform: [ |
| | | // { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | // ], |
| | | // }, |
| | | // ref: "outboundForm", |
| | | // labelWidth: "100px", |
| | | // style: { |
| | | // padding: "0 30px", |
| | | // }, |
| | | // }, |
| | | // [ |
| | | // h(ElFormItem, { |
| | | // label: "åºåºç«å°", |
| | | // prop: "selectedPlatform", |
| | | // style: { |
| | | // marginBottom: "24px", |
| | | // }, |
| | | // }, [ |
| | | // h(ElSelect, { |
| | | // placeholder: "è¯·éæ©åºåºç«å°ï¼3-12ï¼", |
| | | // modelValue: formData.selectedPlatform, |
| | | // "onUpdate:modelValue": (val) => { |
| | | // formData.selectedPlatform = val; |
| | | // }, |
| | | // style: { |
| | | // width: "100%", |
| | | // height: "40px", |
| | | // borderRadius: "4px", |
| | | // borderColor: "#dcdfe6", |
| | | // }, |
| | | // }, platformOptions.map((platform) => |
| | | // h(ElOption, { label: platform.label, value: platform.value }) |
| | | // )), |
| | | // ]), |
| | | // h("div", { |
| | | // style: { |
| | | // textAlign: "right", |
| | | // marginTop: "8px", |
| | | // paddingRight: "4px", |
| | | // }, |
| | | // }, [ |
| | | // h(ElButton, { |
| | | // type: "text", |
| | | // onClick: () => { |
| | | // render(null, mountNode); |
| | | // document.body.removeChild(mountNode); |
| | | // ElMessage.info("åæ¶åºåºæä½"); |
| | | // }, |
| | | // style: { |
| | | // marginRight: "8px", |
| | | // color: "#606266", |
| | | // }, |
| | | // }, "åæ¶"), |
| | | // h(ElButton, { |
| | | // type: "primary", |
| | | // onClick: async () => { |
| | | // const formRef = vnode.component.refs.outboundForm; |
| | | // try { |
| | | // await formRef.validate(); |
| | | // } catch (err) { |
| | | // return; |
| | | // } |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundTargetLocation: formData.selectedPlatform, |
| | | outboundQuantity: 1, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | }; |
| | | // const keys = this.selection.map((item) => item.id); |
| | | // const requestParams = { |
| | | // detailIds: keys, |
| | | // outboundTargetLocation: formData.selectedPlatform, |
| | | // outboundQuantity: 1, |
| | | // operator: "", |
| | | // orderNo: this.row.orderNo, |
| | | // }; |
| | | |
| | | this.http |
| | | .post( |
| | | "api/Outbound/ProcessPickingOutbound", |
| | | requestParams, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | // .catch(() => { |
| | | // ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | // }); |
| | | }, |
| | | style: { |
| | | borderRadius: "4px", |
| | | padding: "8px 20px", |
| | | }, |
| | | }, "ç¡®å®åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | // this.http |
| | | // .post( |
| | | // "api/Outbound/ProcessPickingOutbound", |
| | | // requestParams, |
| | | // "æ°æ®å¤çä¸" |
| | | // ) |
| | | // .then((x) => { |
| | | // if (!x.status) return ElMessage.error(x.message); |
| | | // ElMessage.success("æä½æå"); |
| | | // this.showDetialBox = false; |
| | | // this.$emit("parentCall", ($vue) => { |
| | | // $vue.getData(); |
| | | // }); |
| | | // render(null, mountNode); |
| | | // document.body.removeChild(mountNode); |
| | | // }) |
| | | // // .catch(() => { |
| | | // // ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | // // }); |
| | | // }, |
| | | // style: { |
| | | // borderRadius: "4px", |
| | | // padding: "8px 20px", |
| | | // }, |
| | | // }, "ç¡®å®åºåº"), |
| | | // ]), |
| | | // ]), |
| | | // } |
| | | // ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | // vnode.appContext = this.$.appContext; |
| | | // render(vnode, mountNode); |
| | | }, |
| | | outboundbatch() { |
| | | if (this.selection.length === 0) { |
| | | return this.$message.error("è¯·éæ©åæ®æç»"); |
| | | } |
| | | if (this.selection.length > 1) { |
| | | return this.$message.error("åªè½éæ©ä¸æ¡åæ®æç»è¿è¡åæ¹åºåº"); |
| | | } |
| | | const platformOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | ]; |
| | | const mountNode = document.createElement("div"); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | const formData = reactive({ |
| | | selectedPlatform: platformOptions[0].value, |
| | | outboundDecimal: "", |
| | | }); |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundQuantity: this.selection[0].orderQuantity - this.selection[0].lockQuantity, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | isBatch: this.isBatch |
| | | }; |
| | | console.log(requestParams); |
| | | this.$refs.DirectOutbound.open(requestParams); |
| | | |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | | title: "åºåºæä½ - éæ©åºåºç«å°", |
| | | width: "500px", |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | "onUpdate:modelValue": (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: "20px 0", |
| | | borderRadius: "8px", |
| | | }, |
| | | }, |
| | | { |
| | | default: () => |
| | | h( |
| | | ElForm, |
| | | { |
| | | model: formData, |
| | | rules: { |
| | | selectedPlatform: [ |
| | | { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | ], |
| | | outboundDecimal: [ |
| | | { required: true, message: "请è¾å
¥å°æ°æ°å¼", trigger: "blur" }, |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | const decimalReg = /^(([1-9]\d*)|0)(\.\d{1,2})?$/; |
| | | if (value && !decimalReg.test(value)) { |
| | | callback(new Error("请è¾å
¥ææçå°æ°ï¼æ£æ°ï¼æå¤2ä½å°æ°ï¼")); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | ref: "outboundForm", |
| | | labelWidth: "100px", |
| | | style: { |
| | | padding: "0 30px", |
| | | }, |
| | | }, |
| | | [ |
| | | h(ElFormItem, { |
| | | label: "åºåºç«å°", |
| | | prop: "selectedPlatform", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: "è¯·éæ©åºåºç«å°ï¼3-12ï¼", |
| | | modelValue: formData.selectedPlatform, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.selectedPlatform = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | }, platformOptions.map((platform) => |
| | | h(ElOption, { label: platform.label, value: platform.value }) |
| | | )), |
| | | ]), |
| | | h(ElFormItem, { |
| | | label: "åºåºæ°", |
| | | prop: "outboundDecimal", |
| | | style: { |
| | | marginBottom: "24px", |
| | | }, |
| | | }, [ |
| | | h(ElInput, { |
| | | type: "number", |
| | | placeholder: "请è¾å
¥å°æ°æ°å¼ï¼æå¤2ä½å°æ°ï¼", |
| | | modelValue: formData.outboundDecimal, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.outboundDecimal = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | step: "0.01", |
| | | precision: 2, |
| | | min: 0.01, |
| | | }), |
| | | ]), |
| | | h("div", { |
| | | style: { |
| | | textAlign: "right", |
| | | marginTop: "8px", |
| | | paddingRight: "4px", |
| | | }, |
| | | }, [ |
| | | h(ElButton, { |
| | | type: "text", |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info("åæ¶åæ¹åºåºæä½"); |
| | | }, |
| | | style: { |
| | | marginRight: "8px", |
| | | color: "#606266", |
| | | }, |
| | | }, "åæ¶"), |
| | | h(ElButton, { |
| | | type: "primary", |
| | | onClick: async () => { |
| | | const formRef = vnode.component.refs.outboundForm; |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | |
| | | const keys = this.selection.map((item) => item.id); |
| | | const requestParams = { |
| | | detailIds: keys, |
| | | outboundTargetLocation: formData.selectedPlatform, |
| | | outboundQuantity: formData.outboundDecimal, |
| | | operator: "", |
| | | orderNo: this.row.orderNo, |
| | | }; |
| | | |
| | | this.http |
| | | .post( |
| | | "api/Outbound/ProcessPickingOutbound", |
| | | requestParams, |
| | | "æ°æ®å¤çä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return ElMessage.error(x.message); |
| | | ElMessage.success("æä½æå"); |
| | | this.showDetialBox = false; |
| | | this.$emit("parentCall", ($vue) => { |
| | | $vue.getData(); |
| | | }); |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | }) |
| | | .catch(() => { |
| | | ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | }); |
| | | }, |
| | | style: { |
| | | borderRadius: "4px", |
| | | padding: "8px 20px", |
| | | }, |
| | | }, "ç¡®å®åæ¹åºåº"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }, |
| | | setCurrent(row) { |
| | | this.$refs.singleTable.setCurrentRow(row); |
| | |
| | | if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | if (rows.length > 1) return this.$error("è¯·éæ©ä¸æ¡æ°æ®!"); |
| | | |
| | | |
| | | // ç¡®ä¿éä¸è¡æidï¼æ ¹æ®å®é
è¡¨æ ¼æ°æ®åæ®µè°æ´ï¼æ¯å¦rows[0].detailIdçï¼ |
| | | const selectedId = rows[0].id || rows[0].detailId; |
| | | if (!selectedId) return this.$error("é䏿°æ®ç¼ºå°å¿
è¦IDåæ®µ!"); |
| | | |
| | | if(rows[0].orderStatus!=0&&rows[0].orderStatus!=1)return this.$error("è¯¥åæ®å·²ç»å®æ"); |
| | | |
| | | const platformOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | |
| | | |
| | | import { createVNode, render, h, reactive } from 'vue'; |
| | | import { ElDialog, ElForm, ElFormItem, ElSelect, ElOption, ElButton, ElMessage, ElLoading } from 'element-plus'; |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | |
| | | } |
| | | } |
| | | }) |
| | | |
| | | let SelectTake = this.buttons.find(x => x.value == 'SelectStockTake'); |
| | | if (SelectTake) { |
| | | // æ¹ä¸ºç®å¤´å½æ°ç¡®ä¿thisæåVueç»ä»¶å®ä¾ |
| | | SelectTake.onClick = async () => { |
| | | // è·åé䏿°æ®ï¼ä¸åé»è¾ä¸è´ï¼ç¡®ä¿æ¯æ°ç»æ ¼å¼ï¼ |
| | | let stockViews = this.$refs.table.getSelected(); |
| | | |
| | | // æ°æ®æ ¡éªï¼è³å°éæ©ä¸æ¡æ°æ® |
| | | if (stockViews.length === 0) return ElMessage.error("è¯·éæ©éè¦æä½çæ°æ®!"); |
| | | |
| | | // ç«å°é项ï¼å¯æ ¹æ®å®é
ä¸å¡è°æ´é项å¼ï¼ |
| | | const stationOptions = [ |
| | | { label: "ç«å°2", value: "2-1" }, |
| | | { label: "ç«å°3", value: "3-1" }, |
| | | { label: "ç«å°4", value: "4-1" }, |
| | | ]; |
| | | |
| | | // åå»ºå¼¹çªæè½½èç¹ |
| | | const mountNode = document.createElement("div"); |
| | | document.body.appendChild(mountNode); |
| | | |
| | | // è¡¨åæ°æ®ï¼ç»å®éä¸çç«å°ï¼ |
| | | const formData = reactive({ |
| | | outStation: stationOptions[0].value, // é»è®¤éä¸ç¬¬ä¸ä¸ªç«å° |
| | | }); |
| | | |
| | | // å建弹çªVNode |
| | | const vnode = createVNode( |
| | | ElDialog, |
| | | { |
| | | title: "åºåæä½ - éæ©åºåºç«å°", |
| | | width: "500px", |
| | | modelValue: true, |
| | | appendToBody: true, |
| | | "onUpdate:modelValue": (isVisible) => { |
| | | if (!isVisible) { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { |
| | | padding: "20px 0", |
| | | borderRadius: "8px", |
| | | }, |
| | | }, |
| | | { |
| | | default: () => |
| | | h( |
| | | ElForm, |
| | | { |
| | | model: formData, |
| | | rules: { |
| | | outStation: [ |
| | | { required: true, message: "è¯·éæ©åºåºç«å°", trigger: "change" }, |
| | | ], |
| | | }, |
| | | ref: "stockTakeForm", // 表årefæ è¯ |
| | | labelWidth: "100px", |
| | | style: { |
| | | padding: "0 30px", |
| | | }, |
| | | }, |
| | | [ |
| | | // ç«å°éæ©ä¸ææ¡ |
| | | h(ElFormItem, { |
| | | label: "åºåºç«å°", |
| | | prop: "outStation", |
| | | style: { marginBottom: "24px" }, |
| | | }, [ |
| | | h(ElSelect, { |
| | | placeholder: "è¯·éæ©åºåºç«å°", |
| | | modelValue: formData.outStation, |
| | | "onUpdate:modelValue": (val) => { |
| | | formData.outStation = val; |
| | | }, |
| | | style: { |
| | | width: "100%", |
| | | height: "40px", |
| | | borderRadius: "4px", |
| | | borderColor: "#dcdfe6", |
| | | }, |
| | | }, stationOptions.map((station) => |
| | | h(ElOption, { label: station.label, value: station.value }) |
| | | )), |
| | | ]), |
| | | // åºé¨æé®åºå |
| | | h("div", { |
| | | style: { |
| | | textAlign: "right", |
| | | marginTop: "8px", |
| | | paddingRight: "4px", |
| | | }, |
| | | }, [ |
| | | // åæ¶æé® |
| | | h(ElButton, { |
| | | type: "text", |
| | | onClick: () => { |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | ElMessage.info("åæ¶åºåæä½"); |
| | | }, |
| | | style: { marginRight: "8px", color: "#606266" }, |
| | | }, "åæ¶"), |
| | | // ç¡®å®æé® |
| | | h(ElButton, { |
| | | type: "primary", |
| | | onClick: async () => { |
| | | // ç¡®ä¿è¡¨årefå·²æè½½ |
| | | await this.$nextTick(); |
| | | const formRef = vnode.component.refs.stockTakeForm; |
| | | |
| | | if (!formRef) { |
| | | ElMessage.error("表ååå§å失败ï¼è¯·éè¯"); |
| | | return; |
| | | } |
| | | |
| | | // 表åéªè¯ |
| | | try { |
| | | await formRef.validate(); |
| | | } catch (err) { |
| | | return; |
| | | } |
| | | |
| | | // æé 请æ±åæ°ï¼ |
| | | // 1. 请æ±ä½ï¼ç´æ¥ä¼ éstockViewsæ°ç»ï¼å¯¹åºå端List<StockViewDTO>ï¼ |
| | | // 2. outStationï¼éè¿æ¥è¯¢åæ°ä¼ éï¼å åç«¯æªæå®[FromBody]æ¥æ¶è¯¥åæ°ï¼ |
| | | const requestBody = stockViews; // ç´æ¥ä¼ éé䏿°ç»ï¼ç¡®ä¿æ°ç»å
å¯¹è±¡ç»æä¸StockViewDTOä¸è´ï¼ |
| | | const outStation = formData.outStation; |
| | | |
| | | // æ¥å£è¯·æ±ï¼Postæ¹å¼ï¼è¯·æ±ä½ä¼ stockViewsæ°ç»ï¼outStationæ¼å°URLæ¥è¯¢åæ° |
| | | try { |
| | | // æ¼æ¥æ¥è¯¢åæ°ï¼å¦æoutStationæç¹æ®å符ï¼å¯ä½¿ç¨encodeURIComponentå¤çï¼ |
| | | const url = `api/Task/TakeOutbound?outStation=${encodeURIComponent(outStation)}`; |
| | | |
| | | const x = await this.http.post( |
| | | url, // 带æ¥è¯¢åæ°çURL |
| | | requestBody, // 请æ±ä½ï¼stockViewsæ°ç» |
| | | "æ°æ®å¤çä¸" |
| | | ); |
| | | |
| | | if (!x.status) { |
| | | ElMessage.error(x.message || "åºåæä½å¤±è´¥"); |
| | | return; |
| | | } |
| | | |
| | | ElMessage.success("æä½æå"); |
| | | this.refresh(); // åå·æ°é»è¾ä¿ç |
| | | } catch (error) { |
| | | console.error("åºåæ¥å£è¯·æ±å¤±è´¥ï¼", error); |
| | | ElMessage.error("请æ±å¤±è´¥ï¼è¯·ç¨åéè¯"); |
| | | } finally { |
| | | // æ 论æå失败ï¼å
³éå¼¹çª |
| | | render(null, mountNode); |
| | | document.body.removeChild(mountNode); |
| | | } |
| | | }, |
| | | style: { borderRadius: "4px", padding: "8px 20px" }, |
| | | }, "ç¡®å®æä½"), |
| | | ]), |
| | | ]), |
| | | } |
| | | ); |
| | | |
| | | // ç»å®appä¸ä¸æï¼ç¡®ä¿å¼¹çªå
ç»ä»¶æ£å¸¸å·¥ä½ï¼ |
| | | vnode.appContext = this.$.appContext; |
| | | render(vnode, mountNode); |
| | | }; |
| | | } |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [ |
| | | { |
| | | name: 'éä¸ä»»å¡', |
| | | type: 'primary', |
| | | value: 'éä¸ä»»å¡', |
| | | onClick: async function () { |
| | | const selectRows = this.$refs.table.getSelected(); |
| | | if (selectRows.length == 0) return ElMessage.warning('è¯·éæ©ä¸æ¡ä»»å¡'); |
| | | if (selectRows.length > 1) return ElMessage.warning('åªè½éæ©ä¸æ¡ä»»å¡'); |
| | | const taskNum = selectRows[0].taskId; |
| | | try{ |
| | | const response = await http.post('api/Task/RecreateTasks?taskNums='+taskNum, 'ä»»å¡éä¸ä¸...'); |
| | | const { status, message ,data} = response; |
| | | if (status) { |
| | | ElMessage.success(`éä¸ä»»å¡æå`); |
| | | this.refresh(); |
| | | }else{ |
| | | ElMessage.error(`éä¸ä»»å¡å¤±è´¥ï¼${message}`); |
| | | } |
| | | }catch(err){ |
| | | ElMessage.error(`éä¸ä»»å¡å¼å¸¸ï¼${err.message}`); |
| | | } |
| | | } |
| | | } |
| | | ], box: [], detail: [] }, //æ©å±çæé® |
| | | buttons: { view: [ ], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | |
| | | component: () => import('@/views/system/Log.vue'), |
| | | meta: { |
| | | } |
| | | }, { |
| | | path: '/takeStockOrder', |
| | | name: 'takeStockOrder', |
| | | component: () => import('@/views/inbound/takeStockOrder.vue') |
| | | }, { |
| | | path: '/takeStockOrderDetail', |
| | | name: 'takeStockOrderDetail', |
| | | component: () => import('@/views/inbound/takeStockOrderDetail.vue') |
| | | }, { |
| | | path: '/dashboard', |
| | | name: 'dashboard', |
| | | component: () => import('@/views/charts/wms-dashboard.vue') |
| | | } |
| | | ] |
| | | |
| | |
| | | const codeImgSrc = ref(""); |
| | | const value = ref(""); |
| | | const userInfo = reactive({ |
| | | userName: "admin", |
| | | password: "123456", |
| | | userName: "", |
| | | password: "", |
| | | verificationCode: "1234", |
| | | UUID: undefined, |
| | | }); |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="wms-dashboard"> |
| | | <!-- 顶鍿 颿 --> |
| | | <div class="header"> |
| | | <h1>WMSä»å¨å¯è§åå¾è¡¨çæ¿</h1> |
| | | <div class="header-right"> |
| | | <span>2025-12-24 16:11:44</span> |
| | | <el-select v-model="month" placeholder="æ¬æ" style="margin-left: 10px; width: 80px;"> |
| | | <el-option label="æ¬æ" value="month"></el-option> |
| | | <el-option label="䏿" value="lastMonth"></el-option> |
| | | </el-select> |
| | | <el-button type="primary" style="margin-left: 10px;" @click="refreshCharts">å·æ°</el-button> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- ç»è®¡å¡çåºå --> |
| | | <el-row :gutter="20" class="stats-card-row"> |
| | | <el-col :span="6"> |
| | | <el-card class="stats-card"> |
| | | <div class="card-title">æ»åºåï¼ä»¶ï¼</div> |
| | | <div class="card-value">269,225</div> |
| | | <div class="card-change"><el-tag type="success">â 2.1% è¾æ¨æ¥</el-tag></div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-card class="stats-card"> |
| | | <div class="card-title">å¾
åºåºè®¢å</div> |
| | | <div class="card-value">425</div> |
| | | <div class="card-change"><el-tag type="warning">â 5.3% è¾1å°æ¶å</el-tag></div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-card class="stats-card"> |
| | | <div class="card-title">仿¥ä½ä¸å®æç</div> |
| | | <div class="card-value">93.9%</div> |
| | | <div class="card-change"><el-tag type="success">â 1.8% è¾æ¨æ¥</el-tag></div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-card class="stats-card"> |
| | | <div class="card-title">æªå¤çå¼å¸¸</div> |
| | | <div class="card-value">7</div> |
| | | <div class="card-change"><el-tag type="danger">â 1 è¾30åéå</el-tag></div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- å¾è¡¨åºåï¼ç¬¬ä¸è¡ï¼ --> |
| | | <el-row :gutter="20" class="chart-row"> |
| | | <el-col :span="12"> |
| | | <el-card class="chart-card"> |
| | | <div class="chart-title">åºååºä½åå¸ï¼å¾ååå æ¯ï¼<el-button type="text" class="view-btn">忢è§å¾</el-button></div> |
| | | <div ref="inventoryPieRef" class="chart-container"></div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-card class="chart-card"> |
| | | <div class="chart-title">è¿7æ¥åºå
¥åºè¶å¿ï¼å¾ååèµ°å¿ï¼ |
| | | <el-button-group class="btn-group"> |
| | | <el-button type="primary" size="small">å
¨é¨</el-button> |
| | | <el-button type="default" size="small">å
¥åº</el-button> |
| | | <el-button type="default" size="small">åºåº</el-button> |
| | | </el-button-group> |
| | | </div> |
| | | <div ref="stockTrendRef" class="chart-container"></div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- å¾è¡¨åºåï¼ç¬¬äºè¡ï¼ --> |
| | | <el-row :gutter="20" class="chart-row"> |
| | | <el-col :span="8"> |
| | | <el-card class="chart-card"> |
| | | <div class="chart-title">åºä½å©ç¨ç</div> |
| | | <div ref="locationRateRef" class="chart-container"></div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-card class="chart-card"> |
| | | <div class="chart-title">ä½ä¸ç±»ååå¸<el-button type="text" class="view-btn">æ¥ç详æ
</el-button></div> |
| | | <div ref="operationRadarRef" class="chart-container"></div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-card class="chart-card"> |
| | | <div class="chart-title">å¼å¸¸ç±»åç»è®¡è¶å¿<el-button type="text" class="view-btn">çé</el-button></div> |
| | | <div ref="exceptionTrendRef" class="chart-container"></div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- è¡¨æ ¼åºå --> |
| | | <el-row :gutter="20" class="table-row"> |
| | | <el-col :span="12"> |
| | | <el-card class="table-card"> |
| | | <div class="table-title">订åå¤çè¿åº¦<el-select v-model="orderType" placeholder="éè´§å
¥åº" |
| | | style="width: 100px; margin-left: 10px;"> |
| | | <el-option label="éè´§å
¥åº" value="return"></el-option> |
| | | <el-option label="æ®éåºåº" value="normal"></el-option> |
| | | </el-select></div> |
| | | <el-table :data="orderList" border style="width: 100%;"> |
| | | <el-table-column prop="orderNo" label="订åå·" /> |
| | | <el-table-column prop="type" label="ç±»å" /> |
| | | <el-table-column prop="priority" label="ä¼å
级"> |
| | | <template #default="scope"> |
| | | <el-tag |
| | | :type="scope.row.priority === 'ç´§æ¥' ? 'danger' : scope.row.priority === 'å æ¥' ? 'warning' : 'success'"> |
| | | {{ scope.row.priority }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="progress" label="è¿åº¦"> |
| | | <template #default="scope"> |
| | | <el-progress :percentage="scope.row.progress" :color="scope.row.progressColor" /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <div class="table-pagination"> |
| | | <el-button type="text">å è½½æ´å¤è®¢å</el-button> |
| | | <el-pagination layout="prev, pager, next, jumper" :current-page="1" :total="50" /> |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-card class="table-card"> |
| | | <div class="table-title">宿¶ä½ä¸çæ§ |
| | | <el-button-group class="btn-group"> |
| | | <el-button type="primary" size="small">å
¨é¨ä½ä¸</el-button> |
| | | <el-button type="default" size="small">å
¥åº</el-button> |
| | | <el-button type="default" size="small">åºåº</el-button> |
| | | <el-button type="default" size="small">çç¹</el-button> |
| | | </el-button-group> |
| | | </div> |
| | | <el-table :data="operationList" border style="width: 100%;"> |
| | | <el-table-column prop="opNo" label="ä½ä¸åå·" /> |
| | | <el-table-column prop="opType" label="ä½ä¸ç±»å" /> |
| | | <el-table-column prop="operator" label="æä½äººå" /> |
| | | <el-table-column prop="startTime" label="å¼å§æ¶é´" /> |
| | | <el-table-column prop="status" label="å½åç¶æ"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.status === 'å¤çä¸' ? 'info' : scope.row.status === '已宿' ? 'success' : 'danger'"> |
| | | {{ scope.row.status }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="æä½"><el-button type="text">详æ
</el-button></el-table-column> |
| | | </el-table> |
| | | <div class="table-pagination"> |
| | | <el-pagination layout="prev, pager, next, jumper" :current-page="1" :total="50" /> |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted, onUnmounted, nextTick } from 'vue'; |
| | | import * as echarts from 'echarts'; |
| | | |
| | | // ååºå¼æ°æ® |
| | | const month = ref('month'); |
| | | const orderType = ref('return'); |
| | | |
| | | // æ¨¡ææ°æ® |
| | | const orderList = ref([ |
| | | { orderNo: 'OD20251224001', type: 'æ®éåºåº', priority: 'ç´§æ¥', progress: 60, progressColor: '#ff4d4f' }, |
| | | { orderNo: 'OD20251224002', type: 'éè´§å
¥åº', priority: 'æ®é', progress: 80, progressColor: '#1890ff' }, |
| | | { orderNo: 'OD20251224003', type: 'è°æ¨è®¢å', priority: 'å æ¥', progress: 40, progressColor: '#faad14' }, |
| | | { orderNo: 'OD20251224004', type: 'æ®éåºåº', priority: '常è§', progress: 100, progressColor: '#52c41a' } |
| | | ]); |
| | | const operationList = ref([ |
| | | { opNo: 'JW251224001', opType: 'å
¥åº', operator: 'å¼ ä¸', startTime: '15:30:22', status: 'å¤çä¸' }, |
| | | { opNo: 'CK251224002', opType: 'åºåº', operator: 'æå', startTime: '15:25:10', status: '已宿' }, |
| | | { opNo: 'PD251224003', opType: 'çç¹', operator: 'çäº', startTime: '15:20:05', status: 'å¾
确认' }, |
| | | { opNo: 'SC251224005', opType: '䏿¶', operator: 'åä¸', startTime: '15:10:18', status: 'å¼å¸¸' } |
| | | ]); |
| | | |
| | | // å¾è¡¨å®¹å¨ |
| | | const inventoryPieRef = ref(null); |
| | | const stockTrendRef = ref(null); |
| | | const locationRateRef = ref(null); |
| | | const operationRadarRef = ref(null); |
| | | const exceptionTrendRef = ref(null); |
| | | |
| | | // å¾è¡¨å®ä¾ |
| | | let inventoryPieChart = null; |
| | | let stockTrendChart = null; |
| | | let locationRateChart = null; |
| | | let operationRadarChart = null; |
| | | let exceptionTrendChart = null; |
| | | |
| | | // åå§ååºååºä½åå¸é¥¼å¾ |
| | | const initInventoryPie = () => { |
| | | if (!inventoryPieRef.value) return; |
| | | |
| | | if (inventoryPieChart) { |
| | | inventoryPieChart.dispose(); |
| | | } |
| | | |
| | | inventoryPieChart = echarts.init(inventoryPieRef.value); |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'item', |
| | | formatter: '{a} <br/>{b}: {c}%' |
| | | }, |
| | | legend: { |
| | | bottom: 0, |
| | | left: 'center', |
| | | data: ['常温åºAåº', 'å·èåºBåº', 'ä¿ç¨åºCåº', 'æ®æ¬¡ååºDåº'] |
| | | }, |
| | | series: [{ |
| | | name: 'åºååºä½åå¸', |
| | | type: 'pie', |
| | | radius: ['40%', '70%'], |
| | | center: ['50%', '40%'], |
| | | avoidLabelOverlap: false, |
| | | itemStyle: { |
| | | borderRadius: 10, |
| | | borderColor: '#fff', |
| | | borderWidth: 2 |
| | | }, |
| | | label: { |
| | | show: false, |
| | | position: 'center' |
| | | }, |
| | | emphasis: { |
| | | label: { |
| | | show: true, |
| | | fontSize: 20, |
| | | fontWeight: 'bold' |
| | | } |
| | | }, |
| | | labelLine: { |
| | | show: false |
| | | }, |
| | | data: [ |
| | | { value: 48.7, name: '常温åºAåº', itemStyle: { color: '#5470c6' } }, |
| | | { value: 29.2, name: 'å·èåºBåº', itemStyle: { color: '#91cc75' } }, |
| | | { value: 21.9, name: 'ä¿ç¨åºCåº', itemStyle: { color: '#fac858' } }, |
| | | { value: 2.2, name: 'æ®æ¬¡ååºDåº', itemStyle: { color: '#ee6666' } } |
| | | ] |
| | | }] |
| | | }; |
| | | |
| | | inventoryPieChart.setOption(option); |
| | | return inventoryPieChart; |
| | | }; |
| | | |
| | | // åå§åè¿7æ¥åºå
¥åºè¶å¿å¾ |
| | | const initStockTrend = () => { |
| | | if (!stockTrendRef.value) return; |
| | | |
| | | if (stockTrendChart) { |
| | | stockTrendChart.dispose(); |
| | | } |
| | | |
| | | stockTrendChart = echarts.init(stockTrendRef.value); |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'cross' |
| | | } |
| | | }, |
| | | legend: { |
| | | data: ['å
¥åºé', 'åºåºé'], |
| | | top: 10 |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | top: '15%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: true, |
| | | data: ['12-18', '12-19', '12-20', '12-21', '12-22', '12-23', '12-24'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | name: 'æ°éï¼åä»¶ï¼', |
| | | max: 25 |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'å
¥åºé', |
| | | type: 'bar', |
| | | barWidth: '30%', |
| | | data: [10, 12, 10, 12, 10, 12, 12], |
| | | itemStyle: { color: '#52c41a' } |
| | | }, |
| | | { |
| | | name: 'åºåºé', |
| | | type: 'bar', |
| | | barWidth: '30%', |
| | | data: [16, 18, 14, 18, 16, 18, 20], |
| | | itemStyle: { color: '#1890ff' } |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | stockTrendChart.setOption(option); |
| | | return stockTrendChart; |
| | | }; |
| | | |
| | | // åå§ååºä½å©ç¨çç¯å½¢å¾ |
| | | const initLocationRate = () => { |
| | | if (!locationRateRef.value) return; |
| | | |
| | | if (locationRateChart) { |
| | | locationRateChart.dispose(); |
| | | } |
| | | |
| | | locationRateChart = echarts.init(locationRateRef.value); |
| | | const option = { |
| | | tooltip: { |
| | | formatter: '{a} <br/>{b} : {c}%' |
| | | }, |
| | | series: [{ |
| | | name: 'åºä½å©ç¨ç', |
| | | type: 'gauge', |
| | | min: 0, |
| | | max: 100, |
| | | splitNumber: 10, |
| | | radius: '90%', |
| | | center: ['50%', '55%'], |
| | | startAngle: 180, |
| | | endAngle: 0, |
| | | progress: { |
| | | show: true, |
| | | width: 20, |
| | | itemStyle: { |
| | | color: '#1890ff' |
| | | } |
| | | }, |
| | | axisLine: { |
| | | lineStyle: { |
| | | width: 20, |
| | | color: [[1, 'rgba(200,200,200,0.3)']] |
| | | } |
| | | }, |
| | | axisTick: { |
| | | distance: -30, |
| | | splitNumber: 5, |
| | | lineStyle: { |
| | | width: 2, |
| | | color: '#999' |
| | | } |
| | | }, |
| | | splitLine: { |
| | | distance: -30, |
| | | length: 14, |
| | | lineStyle: { |
| | | width: 3, |
| | | color: '#999' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | distance: -20, |
| | | color: '#999', |
| | | fontSize: 12 |
| | | }, |
| | | anchor: { |
| | | show: false |
| | | }, |
| | | title: { |
| | | show: true, |
| | | offsetCenter: [0, '30%'], |
| | | fontSize: 16, |
| | | fontWeight: 'bold' |
| | | }, |
| | | detail: { |
| | | valueAnimation: true, |
| | | formatter: '{value}%', |
| | | fontSize: 20, |
| | | fontWeight: 'bold', |
| | | offsetCenter: [0, '70%'] |
| | | }, |
| | | data: [{ |
| | | value: 86.2, |
| | | name: 'åºä½å©ç¨ç' |
| | | }] |
| | | }] |
| | | }; |
| | | |
| | | locationRateChart.setOption(option); |
| | | return locationRateChart; |
| | | }; |
| | | |
| | | // åå§åä½ä¸ç±»åé·è¾¾å¾ |
| | | const initOperationRadar = () => { |
| | | if (!operationRadarRef.value) return; |
| | | |
| | | if (operationRadarChart) { |
| | | operationRadarChart.dispose(); |
| | | } |
| | | |
| | | operationRadarChart = echarts.init(operationRadarRef.value); |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | legend: { |
| | | show: false |
| | | }, |
| | | radar: { |
| | | indicator: [ |
| | | { name: 'åºåºä½ä¸', max: 100 }, |
| | | { name: 'å
¥åºä½ä¸', max: 100 }, |
| | | { name: 'è°æ¨ä½ä¸', max: 100 }, |
| | | { name: 'çç¹ä½ä¸', max: 100 } |
| | | ], |
| | | shape: 'circle', |
| | | splitNumber: 5, |
| | | axisName: { |
| | | color: '#666' |
| | | }, |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: 'rgba(0,0,0,0.1)' |
| | | } |
| | | }, |
| | | splitArea: { |
| | | show: true, |
| | | areaStyle: { |
| | | color: ['rgba(255,255,255,0.8)', 'rgba(200,200,200,0.2)'] |
| | | } |
| | | } |
| | | }, |
| | | series: [{ |
| | | name: 'ä½ä¸ç±»ååå¸', |
| | | type: 'radar', |
| | | symbolSize: 8, |
| | | areaStyle: { |
| | | color: 'rgba(24,144,255,0.3)' |
| | | }, |
| | | lineStyle: { |
| | | width: 2 |
| | | }, |
| | | itemStyle: { |
| | | color: '#1890ff' |
| | | }, |
| | | data: [{ |
| | | value: [45, 30, 15, 10], |
| | | name: 'ä½ä¸å æ¯', |
| | | label: { |
| | | show: true, |
| | | formatter: function (params) { |
| | | return params.value + '%'; |
| | | } |
| | | } |
| | | }] |
| | | }] |
| | | }; |
| | | |
| | | operationRadarChart.setOption(option); |
| | | return operationRadarChart; |
| | | }; |
| | | |
| | | // åå§åå¼å¸¸è¶å¿æçº¿å¾ |
| | | const initExceptionTrend = () => { |
| | | if (!exceptionTrendRef.value) return; |
| | | |
| | | if (exceptionTrendChart) { |
| | | exceptionTrendChart.dispose(); |
| | | } |
| | | |
| | | exceptionTrendChart = echarts.init(exceptionTrendRef.value); |
| | | const option = { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | | axisPointer: { |
| | | type: 'cross' |
| | | } |
| | | }, |
| | | legend: { |
| | | data: ['åºåä¸è¶³', '订åè¶
æ¶', 'åºä½å¼å¸¸', 'çç¹å·®å¼'], |
| | | top: 10 |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | top: '15%', |
| | | containLabel: true |
| | | }, |
| | | xAxis: { |
| | | type: 'category', |
| | | boundaryGap: false, |
| | | data: ['12-18', '12-19', '12-20', '12-21', '12-22', '12-23', '12-24'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value', |
| | | name: 'å¼å¸¸æ°é' |
| | | }, |
| | | series: [ |
| | | { |
| | | name: 'åºåä¸è¶³', |
| | | type: 'line', |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: [10, 11, 9, 12, 10, 13, 12], |
| | | itemStyle: { color: '#ff4d4f' }, |
| | | lineStyle: { |
| | | width: 3 |
| | | } |
| | | }, |
| | | { |
| | | name: '订åè¶
æ¶', |
| | | type: 'line', |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: [8, 9, 7, 8, 7, 9, 8], |
| | | itemStyle: { color: '#faad14' }, |
| | | lineStyle: { |
| | | width: 3 |
| | | } |
| | | }, |
| | | { |
| | | name: 'åºä½å¼å¸¸', |
| | | type: 'line', |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: [4, 5, 2, 4, 3, 5, 4], |
| | | itemStyle: { color: '#722ed1' }, |
| | | lineStyle: { |
| | | width: 3 |
| | | } |
| | | }, |
| | | { |
| | | name: 'çç¹å·®å¼', |
| | | type: 'line', |
| | | smooth: true, |
| | | symbol: 'circle', |
| | | symbolSize: 8, |
| | | data: [2, 3, 1, 2, 1, 3, 2], |
| | | itemStyle: { color: '#13c2c2' }, |
| | | lineStyle: { |
| | | width: 3 |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | exceptionTrendChart.setOption(option); |
| | | return exceptionTrendChart; |
| | | }; |
| | | |
| | | // å·æ°ææå¾è¡¨ |
| | | const refreshCharts = () => { |
| | | const charts = [ |
| | | initInventoryPie, |
| | | initStockTrend, |
| | | initLocationRate, |
| | | initOperationRadar, |
| | | initExceptionTrend |
| | | ]; |
| | | |
| | | charts.forEach(initFunc => { |
| | | const chart = initFunc(); |
| | | if (chart) { |
| | | chart.resize(); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // çå¬çªå£å¤§å°åå |
| | | const handleResize = () => { |
| | | const charts = [ |
| | | inventoryPieChart, |
| | | stockTrendChart, |
| | | locationRateChart, |
| | | operationRadarChart, |
| | | exceptionTrendChart |
| | | ]; |
| | | |
| | | charts.forEach(chart => { |
| | | if (chart) { |
| | | chart.resize(); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // æè½½ååå§åå¾è¡¨ |
| | | onMounted(() => { |
| | | nextTick(() => { |
| | | initInventoryPie(); |
| | | initStockTrend(); |
| | | initLocationRate(); |
| | | initOperationRadar(); |
| | | initExceptionTrend(); |
| | | |
| | | window.addEventListener('resize', handleResize); |
| | | }); |
| | | }); |
| | | |
| | | // ç»ä»¶å¸è½½æ¶æ¸
ç |
| | | onUnmounted(() => { |
| | | const charts = [ |
| | | inventoryPieChart, |
| | | stockTrendChart, |
| | | locationRateChart, |
| | | operationRadarChart, |
| | | exceptionTrendChart |
| | | ]; |
| | | |
| | | charts.forEach(chart => { |
| | | if (chart) { |
| | | chart.dispose(); |
| | | } |
| | | }); |
| | | |
| | | window.removeEventListener('resize', handleResize); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .wms-dashboard { |
| | | padding: 20px; |
| | | background: #f5f7fa; |
| | | min-height: 100vh; |
| | | box-sizing: border-box; |
| | | } |
| | | |
| | | .header { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 20px; |
| | | background: white; |
| | | padding: 15px 20px; |
| | | border-radius: 8px; |
| | | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | .stats-card-row, |
| | | .chart-row, |
| | | .table-row { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | .stats-card { |
| | | height: 120px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: center; |
| | | padding: 0 20px; |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .stats-card:hover { |
| | | transform: translateY(-2px); |
| | | box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); |
| | | } |
| | | |
| | | .card-title { |
| | | font-size: 14px; |
| | | color: #666; |
| | | margin-bottom: 8px; |
| | | } |
| | | |
| | | .card-value { |
| | | font-size: 28px; |
| | | font-weight: bold; |
| | | margin: 8px 0 4px; |
| | | color: #333; |
| | | } |
| | | |
| | | .card-change { |
| | | margin-top: 8px; |
| | | } |
| | | |
| | | .chart-card { |
| | | height: 320px; |
| | | padding: 15px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .chart-container { |
| | | width: 100%; |
| | | height: 100%; |
| | | min-height: 250px; |
| | | flex: 1; |
| | | } |
| | | |
| | | .chart-title, |
| | | .table-title { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-bottom: 15px; |
| | | font-size: 16px; |
| | | font-weight: bold; |
| | | color: #333; |
| | | } |
| | | |
| | | .view-btn { |
| | | font-size: 12px; |
| | | } |
| | | |
| | | .table-pagination { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-top: 15px; |
| | | } |
| | | |
| | | .btn-group { |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | /* ç¡®ä¿å¾è¡¨å®¹å¨ææç¡®å°ºå¯¸ */ |
| | | :deep(.el-card__body) { |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | <template> |
| | | <!-- <div> |
| | | <assemble-dist></assemble-dist> |
| | | </div> --> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/inbound/takeStockOrder.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | // import AssembleDistVue from '../charts/AssembleDist.vue'; |
| | | export default defineComponent({ |
| | | // components: { |
| | | // 'assemble-dist': AssembleDistVue, |
| | | // }, |
| | | setup() { |
| | | //使ç¨ç»ä»¶AssembleDist |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "çç¹å", |
| | | name: "takeStockOrder", |
| | | url: "/TakeStockOrder/", |
| | | sortName: "id", |
| | | }); |
| | | |
| | | const searchFormFields = ref({ |
| | | orderNo:"" |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "åæ®ç¼å·", field: "orderNo", type: "like" }, |
| | | ] |
| | | ]); |
| | | |
| | | const editFormFields = ref({ |
| | | orderNo:"", |
| | | warehouseId: "", |
| | | remark:"" |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | readonly: "true", |
| | | }, |
| | | { |
| | | title: "ä»åº", |
| | | field: "warehouseId", |
| | | type: "select", |
| | | dataKey: "warehouses", |
| | | data: [], |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | } |
| | | ] |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderNo", |
| | | title: "çç¹åå·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "takeStockStatus", |
| | | title: "çç¹ç¶æ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "takeStockStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "allPalletCode", |
| | | title: "åæ®çç¹æç", |
| | | type: "string", |
| | | width: 600, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "åºåºç«å°", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "çç¹æç»", |
| | | table: "Dt_TakeStockOrderDetail", |
| | | columns: [ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "takeStockId", |
| | | title: "çç¹å主é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "takePalletCode", |
| | | title: "çç¹æç", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "takeDetalStatus", |
| | | title: "çç¹æç»ç¶æ", |
| | | type: "int", |
| | | width: 130, |
| | | align: "left", |
| | | bind: { key: "takeStockDetailStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼ç ", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 130, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "materielSpec", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "sysQty", |
| | | title: "è´¦é¢æ°é", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | required: true, |
| | | edit: { type: "decimal" } |
| | | }, |
| | | { |
| | | field: "qty", |
| | | title: "å®çæ°é", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | required: true, |
| | | edit: { type: "decimal" } |
| | | }, |
| | | { |
| | | field: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ], |
| | | sortName: "id", |
| | | key: "id", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | <template> |
| | | <!-- <div> |
| | | <assemble-dist></assemble-dist> |
| | | </div> --> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/inbound/takeStockOrderDetail.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | // import AssembleDistVue from '../charts/AssembleDist.vue'; |
| | | export default defineComponent({ |
| | | // components: { |
| | | // 'assemble-dist': AssembleDistVue, |
| | | // }, |
| | | setup() { |
| | | //使ç¨ç»ä»¶AssembleDist |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "çç¹å", |
| | | name: "TakeStockOrderDetail", |
| | | url: "/TakeStockOrderDetail/", |
| | | sortName: "id", |
| | | }); |
| | | |
| | | const searchFormFields = ref({ |
| | | orderNo:"" |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "çç¹åæ®", field: "takeStockNo", type: "like" }, |
| | | { title: "çç¹æç®±", field: "takePalletCode", type: "like" }, |
| | | { title: "ç©æç¼å·", field: "materielCode", type: "like" }, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo", type: "like" }, |
| | | |
| | | ], |
| | | [ |
| | | { title: "æ¡ç ", field: "barcode", type: "like" }, |
| | | { title: "ä»åº", field: "warehouseCode", type: "like" }, |
| | | { title: "ååº", field: "factoryArea", type: "like" }, |
| | | { title: "ä¾åºåç¼å·", field: "supplyCode", type: "like" }, |
| | | ], |
| | | [ |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ] |
| | | ]); |
| | | |
| | | const editFormFields = ref({ |
| | | orderNo:"", |
| | | warehouseId: "", |
| | | remark:"" |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | readonly: "true", |
| | | }, |
| | | { |
| | | title: "ä»åº", |
| | | field: "warehouseId", |
| | | type: "select", |
| | | dataKey: "warehouses", |
| | | data: [], |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | } |
| | | ] |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "takeStockId", |
| | | title: "çç¹å主é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "takeStockNo", |
| | | title: "çç¹åæ®", |
| | | type: "string", |
| | | width: 145, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "takePalletCode", |
| | | title: "çç¹æç®±", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼ç ", |
| | | type: "string", |
| | | width: 130, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 130, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "barcode", |
| | | title: "æ¡ç ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "sysQty", |
| | | title: "è´¦é¢æ°é", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | required: true, |
| | | edit: { type: "decimal" } |
| | | }, |
| | | { |
| | | field: "qty", |
| | | title: "å®çæ°é", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | required: true, |
| | | edit: { type: "decimal" } |
| | | }, |
| | | { |
| | | field: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "takeDetalStatus", |
| | | title: "çç¹æç»ç¶æ", |
| | | type: "int", |
| | | width: 130, |
| | | align: "left", |
| | | bind: { key: "takeStockDetailStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "warehouseCode", |
| | | title: "ä»åºç¼å·", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "factoryArea", |
| | | title: "ååº", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "supplyCode", |
| | | title: "ä¾åºåç¼å·", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "çç¹æç»", |
| | | table: "Dt_TakeStockOrderDetail", |
| | | columns: [ |
| | | |
| | | ], |
| | | sortName: "id", |
| | | key: "id", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | @openOutboundDialog="handleOpenOutboundDialog" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | <view-grid ref="grid" @openOutboundDialog="handleOpenOutboundDialog" :columns="columns" :detail="detail" |
| | | :editFormFields="editFormFields" :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" :table="table" :extend="extend"> |
| | | </view-grid> |
| | | <!-- åºåºæä½å¼¹çª --> |
| | | <OutboundDialog |
| | | v-model:visible="outboundVisible" |
| | | :selected-document="selectedOutboundDocument" |
| | | @outbound-success="handleOutboundSuccess" |
| | | ></OutboundDialog> |
| | | </template> |
| | | <script> |
| | | <script> |
| | | import extend from "@/extension/outbound/allocateoutboundOrder.js"; |
| | | import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue'; |
| | | import { ref, defineComponent } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import OutboundDialog from "@/extension/outbound/extend/OutBound.vue"; // å¼å
¥åºåºå¼¹çªç»ä»¶ |
| | | |
| | | |
| | | export default defineComponent({ |
| | | components: { |
| | | // å
³é®ä¿®å¤2ï¼ç»ä»¶æ³¨åå䏿¨¡æ¿æ ç¾åéé
ï¼kebab-case对åºview-gridï¼ |
| | | viewGrid: ViewGrid, // 注å为kebab-caseï¼æ¨¡æ¿ç¨<view-grid> |
| | | OutboundDialog // 注ååºåºå¼¹çªç»ä»¶ |
| | | }, |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | |
| | | }); |
| | | const editFormFields = ref({ |
| | | orderType: "", |
| | | orderNo:"", |
| | | orderNo: "", |
| | | upperOrderNo: "", |
| | | orderStatus: "", |
| | | remark: "", |
| | | warehouseId:"" |
| | | warehouseId: "" |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | |
| | | data: [], |
| | | }, |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | readonly:true |
| | | }, |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | readonly: true |
| | | }, |
| | | { |
| | | title: "䏿¸¸åæ®ç¼å·", |
| | | field: "upperOrderNo", |
| | |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | hidden:true |
| | | hidden: true |
| | | }, |
| | | { |
| | | field: "departmentName", |
| | |
| | | sortName: "id", |
| | | key: "id", |
| | | }); |
| | | // è°æ¨å¼¹çªç¸å
³ |
| | | const outboundVisible = ref(false); |
| | | const selectedOutboundDocument = ref({}); // åå¨éä¸çè°æ¨åæ°æ® |
| | | // è°æ¨å¼¹çªç¸å
³ |
| | | // const outboundVisible = ref(false); |
| | | // const selectedOutboundDocument = ref({}); // åå¨éä¸çè°æ¨åæ°æ® |
| | | |
| | | // æå¼è°æ¨å¼¹çªï¼ä»æ©å±é
ç½®çæé®äºä»¶è§¦åï¼ |
| | | const handleOpenOutboundDialog = (docData) => { |
| | | selectedOutboundDocument.value = docData; // ä¿åéä¸çåæ®æ°æ® |
| | | outboundVisible.value = true; // æ¾ç¤ºå¼¹çª |
| | | }; |
| | | // // æå¼è°æ¨å¼¹çªï¼ä»æ©å±é
ç½®çæé®äºä»¶è§¦åï¼ |
| | | // const handleOpenOutboundDialog = (docData) => { |
| | | // selectedOutboundDocument.value = docData; // ä¿åéä¸çåæ®æ°æ® |
| | | // outboundVisible.value = true; // æ¾ç¤ºå¼¹çª |
| | | // }; |
| | | |
| | | // è°æ¨æååçåè° |
| | | const handleOutboundSuccess = (docNo) => { |
| | | ElMessage.success(`åæ® ${docNo} è°æ¨æå`); |
| | | gridRef.value?.refresh(); // å·æ°è¡¨æ ¼æ°æ® |
| | | }; |
| | | // // è°æ¨æååçåè° |
| | | // const handleOutboundSuccess = (docNo) => { |
| | | // ElMessage.success(`åæ® ${docNo} è°æ¨æå`); |
| | | // gridRef.value?.refresh(); // å·æ°è¡¨æ ¼æ°æ® |
| | | // }; |
| | | |
| | | // åå§åæ©å±é
ç½®ï¼ä¸ºè°æ¨æé®æ·»å äºä»¶è§¦åé»è¾ |
| | | const initExtension = () => { |
| | | // æ¾å°"è°æ¨"æé®å¹¶ç»å®æå¼å¼¹çªçé»è¾ |
| | | const outboundBtn = extend.buttons.view.find(btn => btn.name === 'åºåº'); |
| | | if (outboundBtn) { |
| | | const originalOnClick = outboundBtn.onClick; |
| | | outboundBtn.onClick = function() { |
| | | // å
æ§è¡åææ ¡éªé»è¾ |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | if (selectedRows.length === 1) { |
| | | // æ ¡éªéè¿åï¼è§¦å主ç»ä»¶çåºåºå¼¹çªäºä»¶ |
| | | this.$emit('openOutboundDialog', selectedRows[0]); |
| | | } else { |
| | | // åæé»è¾å·²å¤çæç¤ºï¼æ ééå¤ |
| | | originalOnClick.call(this); |
| | | } |
| | | }; |
| | | } |
| | | }; |
| | | // // åå§åæ©å±é
ç½®ï¼ä¸ºè°æ¨æé®æ·»å äºä»¶è§¦åé»è¾ |
| | | // const initExtension = () => { |
| | | // // æ¾å°"è°æ¨"æé®å¹¶ç»å®æå¼å¼¹çªçé»è¾ |
| | | // const outboundBtn = extend.buttons.view.find(btn => btn.name === 'åºåº'); |
| | | // if (outboundBtn) { |
| | | // const originalOnClick = outboundBtn.onClick; |
| | | // outboundBtn.onClick = function () { |
| | | // // å
æ§è¡åææ ¡éªé»è¾ |
| | | // const selectedRows = this.$refs.table.getSelected(); |
| | | // if (selectedRows.length === 1) { |
| | | // // æ ¡éªéè¿åï¼è§¦å主ç»ä»¶çåºåºå¼¹çªäºä»¶ |
| | | // this.$emit('openOutboundDialog', selectedRows[0]); |
| | | // } else { |
| | | // // åæé»è¾å·²å¤çæç¤ºï¼æ ééå¤ |
| | | // originalOnClick.call(this); |
| | | // } |
| | | // }; |
| | | // } |
| | | // }; |
| | | return { |
| | | table, |
| | | extend, |
| | |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | // åºåºç¸å
³ |
| | | outboundVisible, |
| | | selectedOutboundDocument, |
| | | handleOpenOutboundDialog, |
| | | handleOutboundSuccess |
| | | // åºåºç¸å
³ |
| | | // outboundVisible, |
| | | // selectedOutboundDocument, |
| | | // handleOpenOutboundDialog, |
| | | // handleOutboundSuccess |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | @openOutboundDialog="handleOpenOutboundDialog" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | <view-grid ref="grid" @openOutboundDialog="handleOpenOutboundDialog" :columns="columns" :detail="detail" |
| | | :editFormFields="editFormFields" :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" :table="table" :extend="extend"> |
| | | </view-grid> |
| | | <!-- åºåºæä½å¼¹çª --> |
| | | <OutboundDialog |
| | | v-model:visible="outboundVisible" |
| | | :selected-document="selectedOutboundDocument" |
| | | @outbound-success="handleOutboundSuccess" |
| | | ></OutboundDialog> |
| | | </template> |
| | | <script> |
| | | <script> |
| | | import extend from "@/extension/outbound/outboundOrder.js"; |
| | | import ViewGrid from '@/components/basic/ViewGrid/ViewGrid.vue'; |
| | | import { ref, defineComponent } from "vue"; |
| | | import { ElMessage } from "element-plus"; |
| | | import OutboundDialog from "@/extension/outbound/extend/OutBound.vue"; // å¼å
¥åºåºå¼¹çªç»ä»¶ |
| | | |
| | | |
| | | export default defineComponent({ |
| | | components: { |
| | | // å
³é®ä¿®å¤2ï¼ç»ä»¶æ³¨åå䏿¨¡æ¿æ ç¾åéé
ï¼kebab-case对åºview-gridï¼ |
| | | viewGrid: ViewGrid, // 注å为kebab-caseï¼æ¨¡æ¿ç¨<view-grid> |
| | | OutboundDialog // 注ååºåºå¼¹çªç»ä»¶ |
| | | }, |
| | | |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | |
| | | }); |
| | | const editFormFields = ref({ |
| | | orderType: "", |
| | | orderNo:"", |
| | | orderNo: "", |
| | | upperOrderNo: "", |
| | | orderStatus: "", |
| | | remark: "", |
| | | warehouseId:"" |
| | | warehouseId: "" |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | readonly:true |
| | | }, |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | readonly: true |
| | | }, |
| | | { |
| | | title: "䏿¸¸åæ®ç¼å·", |
| | | field: "upperOrderNo", |
| | |
| | | title: "æä½è
", |
| | | field: "operator", |
| | | type: "string", |
| | | hidden:true, |
| | | hidden: true, |
| | | readonly: true, |
| | | |
| | | |
| | | }, |
| | | ], |
| | | ]); |
| | |
| | | width: 150, |
| | | align: "left", |
| | | bind: { key: "outOrderType", data: [] }, |
| | | hidden:true |
| | | hidden: true |
| | | }, |
| | | { |
| | | field: "businessType", |
| | |
| | | field: "returnToMESStatus", |
| | | title: "åä¼ MESç¶æ", |
| | | width: 120, |
| | | bind: { key: "createType", data:[{key:0, value:"æªåä¼ "},{key:1, value:"å·²åä¼ æå"},{key:2, value:"åä¼ å¤±è´¥"}]}, |
| | | bind: { key: "createType", data: [{ key: 0, value: "æªåä¼ " }, { key: 1, value: "å·²åä¼ æå" }, { key: 2, value: "åä¼ å¤±è´¥" }] }, |
| | | }, |
| | | { |
| | | field: "factoryArea", |
| | |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | hidden:true |
| | | hidden: true |
| | | }, |
| | | { |
| | | field: "departmentName", |
| | |
| | | width: 90, |
| | | align: "left", |
| | | edit: { type: "number" }, |
| | | readonly:true |
| | | readonly: true |
| | | }, |
| | | { |
| | | field: "rowNo", |
| | |
| | | width: 90, |
| | | align: "left", |
| | | edit: { type: "number" }, |
| | | readonly:true |
| | | readonly: true |
| | | }, |
| | | { |
| | | field: "lockQuantity", |
| | |
| | | align: "left", |
| | | edit: { type: "select" }, |
| | | bind: { key: "orderDetailStatusEnum", data: [] }, |
| | | readonly:true |
| | | readonly: true |
| | | }, |
| | | { |
| | | field: "creater", |
| | |
| | | sortName: "id", |
| | | key: "id", |
| | | }); |
| | | // åºåºå¼¹çªç¸å
³ |
| | | const outboundVisible = ref(false); |
| | | const selectedOutboundDocument = ref({}); // åå¨éä¸çåºåºåæ°æ® |
| | | |
| | | // æå¼åºåºå¼¹çªï¼ä»æ©å±é
ç½®çæé®äºä»¶è§¦åï¼ |
| | | const handleOpenOutboundDialog = (docData) => { |
| | | selectedOutboundDocument.value = docData; // ä¿åéä¸çåæ®æ°æ® |
| | | outboundVisible.value = true; // æ¾ç¤ºå¼¹çª |
| | | }; |
| | | |
| | | // åºåºæååçåè° |
| | | const handleOutboundSuccess = (docNo) => { |
| | | ElMessage.success(`åæ® ${docNo} åºåºæå`); |
| | | gridRef.value?.refresh(); // å·æ°è¡¨æ ¼æ°æ® |
| | | }; |
| | | |
| | | // åå§åæ©å±é
ç½®ï¼ä¸ºåºåºæé®æ·»å äºä»¶è§¦åé»è¾ |
| | | const initExtension = () => { |
| | | // æ¾å°"åºåº"æé®å¹¶ç»å®æå¼å¼¹çªçé»è¾ |
| | | const outboundBtn = extend.buttons.view.find(btn => btn.name === 'åºåº'); |
| | | if (outboundBtn) { |
| | | const originalOnClick = outboundBtn.onClick; |
| | | outboundBtn.onClick = function() { |
| | | // å
æ§è¡åææ ¡éªé»è¾ |
| | | const selectedRows = this.$refs.table.getSelected(); |
| | | if (selectedRows.length === 1) { |
| | | // æ ¡éªéè¿åï¼è§¦å主ç»ä»¶çåºåºå¼¹çªäºä»¶ |
| | | this.$emit('openOutboundDialog', selectedRows[0]); |
| | | } else { |
| | | // åæé»è¾å·²å¤çæç¤ºï¼æ ééå¤ |
| | | originalOnClick.call(this); |
| | | } |
| | | }; |
| | | } |
| | | }; |
| | | return { |
| | | table, |
| | | extend, |
| | |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | // åºåºç¸å
³ |
| | | outboundVisible, |
| | | selectedOutboundDocument, |
| | | handleOpenOutboundDialog, |
| | | handleOutboundSuccess |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/record/stockQuantityChangeRecord.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "åºååå¨ä¿¡æ¯è®°å½", |
| | | name: "stockQuantityChangeRecord", |
| | | url: "/StockQuantityChangeRecord/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | | |
| | | }); |
| | | const editFormOptions = ref([ |
| | | |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | palleCode: "", |
| | | materielCode: "", |
| | | orderNo: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "æçå·", field: "palleCode" ,type:"like"}, |
| | | { title: "ç©æç¼å·", field: "materielCode",type:"like" }, |
| | | { title: "åæ®ç¼å·", field: "orderNo" ,type:"like"}, |
| | | { title: "åå¨ç±»å", field: "changeType" ,type: "selectList",dataKey: "stockChangeType",data: [],}, |
| | | ], |
| | | [ |
| | | { title: "æ¹æ¬¡å·", field: "batchNo" ,type:"like"}, |
| | | { title: "ä»»å¡å·", field: "taskNum" ,type:"like"}, |
| | | { title: "åºåå·", field: "serilNumber" ,type:"like"}, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stockDetailId", |
| | | title: "åºåæç»ID", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "palleCode", |
| | | title: "æçç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "barcode", |
| | | title: "æ¡ç ", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "serilNumber", |
| | | title: "åºåå·", |
| | | type: "int", |
| | | width: 280, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "taskNum", |
| | | title: "ä»»å¡å·", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "changeType", |
| | | title: "åå¨ç±»å", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "stockChangeType", data: [] }, |
| | | }, |
| | | { |
| | | field: "changeQuantity", |
| | | title: "å卿°é", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "beforeQuantity", |
| | | title: "åå¨ååºåé", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "afterQuantity", |
| | | title: "åå¨ååºåé", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderId", |
| | | title: "忮䏻é®", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderDetailId", |
| | | title: "åæ®æç»ä¸»é®", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "", |
| | | columns: [], |
| | | sortName: "", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | | :table="table" :extend="extend"> |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/record/stockQuantityChangeRecord.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "åºååå¨ä¿¡æ¯è®°å½", |
| | | name: "stockQuantityChangeRecord", |
| | | url: "/StockQuantityChangeRecord/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | | |
| | | }); |
| | | const editFormOptions = ref([ |
| | | |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | palleCode: "", |
| | | materielCode: "", |
| | | orderNo: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "æçå·", field: "palleCode", type: "like" }, |
| | | { title: "ç©æç¼å·", field: "materielCode", type: "like" }, |
| | | { title: "åæ®ç¼å·", field: "orderNo", type: "like" }, |
| | | // { title: "åå¨ç±»å", field: "changeType", type: "selectList", dataKey: "stockChangeType", data: [], }, |
| | | ], |
| | | [ |
| | | { title: "åæ¡ç ", field: "originalSerilNumber", type: "like" }, |
| | | { title: "ä»»å¡å·", field: "taskNum", type: "like" }, |
| | | { title: "æ¹æ¬¡å·", field: "batchNo", type: "like" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stockDetailId", |
| | | title: "åºåæç»ID", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, { |
| | | field: "taskNum", |
| | | title: "ä»»å¡å·", |
| | | type: "string", |
| | | width: 70, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "palleCode", |
| | | title: "æçç¼å·", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | // { |
| | | // field: "materielName", |
| | | // title: "ç©æåç§°", |
| | | // type: "decimal", |
| | | // width: 90, |
| | | // align: "left", |
| | | // }, |
| | | { |
| | | field: "originalSerilNumber", |
| | | title: "åæ¡ç ", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "newSerilNumber", |
| | | title: "æ°æ¡ç ", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | |
| | | // { |
| | | // field: "serilNumber", |
| | | // title: "åºåå·", |
| | | // type: "int", |
| | | // width: 280, |
| | | // align: "left", |
| | | // }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 280, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | |
| | | // { |
| | | // field: "changeType", |
| | | // title: "åå¨ç±»å", |
| | | // type: "int", |
| | | // width: 120, |
| | | // align: "left", |
| | | // bind: { key: "stockChangeType", data: [] }, |
| | | // }, |
| | | { |
| | | field: "changeQuantity", |
| | | title: "å卿°é", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "beforeQuantity", |
| | | title: "åå¨ååºåé", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "afterQuantity", |
| | | title: "åå¨ååºåé", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "orderId", |
| | | title: "忮䏻é®", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "orderDetailId", |
| | | title: "åæ®æç»ä¸»é®", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "#detailCnName", |
| | | table: "", |
| | | columns: [], |
| | | sortName: "", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "decimal", |
| | | width: 90, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 90, |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "supplyCode", |
| | |
| | | field: "outboundQuantity", |
| | | title: "åºåºæ°é", |
| | | type: "string", |
| | | width: 180, |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | | :table="table" :extend="extend"> |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | <script> |
| | | import extend from "@/extension/taskinfo/task.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | |
| | | [ |
| | | { title: "ä»»å¡å·", field: "taskNum", type: "int" }, |
| | | { title: "æçç¼å·", field: "palletCode", type: "like" }, |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | // { title: "å建人", field: "creater", type: "like" }, |
| | | ], |
| | | [ |
| | | //{ title: "ä»»å¡ç±»å",field: "taskType",type: "selectList",dataKey: "taskType",data: [],}, |
| | | { title: "ä»»å¡ç¶æ",field: "taskStatus",type: "selectList",dataKey: "taskStatusEnum",data: [],}, |
| | | { title: "å··éå·", field: "roadway", type: "like" }, |
| | | { title: "ä»»å¡ç±»å", field: "taskType", type: "selectList", dataKey: "taskType", data: [], }, |
| | | { title: "ä»»å¡ç¶æ", field: "taskStatus", type: "selectList", dataKey: "taskStatusEnum", data: [], }, |
| | | ], |
| | | [ |
| | | { title: "èµ·å§å°å", field: "sourceAddress", type: "like" }, |
| | | { title: "ç®æ å°å", field: "targetAddress", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | // { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "taskType", |
| | |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | hidden:true, |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "wMSId", |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions" |
| | | :table="table" :extend="extend"> |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | <script> |
| | | import extend from "@/extension/taskinfo/task_hty.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | |
| | | createDate: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | [ |
| | | { title: "ä»»å¡å·", field: "taskNum", type: "int" }, |
| | | { title: "æçç¼å·", field: "palletCode", type: "like" }, |
| | | { title: "å建人", field: "creater", type: "like" }, |
| | | // { title: "å建人", field: "creater", type: "like" }, |
| | | ], |
| | | [ |
| | | //{ title: "ä»»å¡ç±»å",field: "taskType",type: "selectList",dataKey: "taskType",data: [],}, |
| | | { title: "ä»»å¡ç¶æ",field: "taskStatus",type: "selectList",dataKey: "taskStatusEnum",data: [],}, |
| | | { title: "å··éå·", field: "roadway", type: "like" }, |
| | | { title: "ä»»å¡ç±»å", field: "taskType", type: "selectList", dataKey: "taskType", data: [], }, |
| | | { title: "ä»»å¡ç¶æ", field: "taskStatus", type: "selectList", dataKey: "taskStatusEnum", data: [], }, |
| | | // { title: "å··éå·", field: "roadway", type: "like" }, |
| | | ], |
| | | [ |
| | | { title: "èµ·å§å°å", field: "sourceAddress", type: "like" }, |
| | | { title: "ç®æ å°å", field: "targetAddress", type: "like" }, |
| | | { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | // { title: "å建æ¶é´", field: "createDate", type: "datetime" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | // { |
| | | // field: "taskType", |
| | | // title: "ä»»å¡ç±»å", |
| | | // type: "int", |
| | | // width: 120, |
| | | // align: "left", |
| | | // bind: { key: "taskType", data: [] }, |
| | | // }, |
| | | { |
| | | field: "taskType", |
| | | title: "ä»»å¡ç±»å", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "taskType", data: [] }, |
| | | }, |
| | | { |
| | | field: "taskStatus", |
| | | title: "ä»»å¡ç¶æ", |
| | |
| | | using System.Text.Json; |
| | | using System.Threading; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.LogHelper; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_IBasicService; |
| | | |
| | |
| | | var result = await PostAsync<TaskModel, ApiResponse<TasksData>>(url, request); |
| | | if (result != null && result.Code == 0) |
| | | { |
| | | _logger.LogInformation(result.Serialize()); |
| | | |
| | | return true; |
| | | } |
| | | return false; |
| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | private async Task<TResponse> PostAsync<TRequest, TResponse>(string url, TRequest request) |
| | | { |
| | | |
| | | string json = JsonConvert.SerializeObject(request, new JsonSerializerSettings |
| | | TResponse response1 = (TResponse)Activator.CreateInstance(typeof(TResponse)); |
| | | try |
| | | { |
| | | ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() |
| | | }); |
| | | var content = new StringContent(json, Encoding.UTF8, "application/json"); |
| | | var _client = _httpClientFactory.CreateClient("ESSUrl"); |
| | | _client.DefaultRequestHeaders.Clear(); |
| | | string json = JsonConvert.SerializeObject(request, new JsonSerializerSettings |
| | | { |
| | | ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() |
| | | }); |
| | | var content = new StringContent(json, Encoding.UTF8, "application/json"); |
| | | var _client = _httpClientFactory.CreateClient("ESSUrl"); |
| | | _client.DefaultRequestHeaders.Clear(); |
| | | |
| | | _client.DefaultRequestHeaders.Add("Accept", "application/json"); |
| | | _client.DefaultRequestHeaders.Add("Accept", "application/json"); |
| | | |
| | | using var response = await _client.PostAsync(url, content); |
| | | string body = await response.Content.ReadAsStringAsync(); |
| | | _logger.LogInformation($"ESSAPI post : {_client.BaseAddress} {url} {body}"); |
| | | if (!response.IsSuccessStatusCode) |
| | | { |
| | | throw new HttpRequestException(body); |
| | | using var response = await _client.PostAsync(url, content); |
| | | string body = await response.Content.ReadAsStringAsync(); |
| | | _logger.LogInformation($"ESSAPI post : {_client.BaseAddress} {url} {body}"); |
| | | if (!response.IsSuccessStatusCode) |
| | | { |
| | | throw new HttpRequestException(body); |
| | | } |
| | | |
| | | response1 = JsonConvert.DeserializeObject<TResponse>(body); |
| | | |
| | | return response1; |
| | | } |
| | | |
| | | return JsonConvert.DeserializeObject<TResponse>(body); |
| | | catch (Exception ex) |
| | | { |
| | | Logger.Add(request == null ? "" : JsonConvert.SerializeObject(request), response1 == null ? ex.ToString() : JsonConvert.SerializeObject(response1)); |
| | | throw new Exception(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | Logger.Add(request == null ? "" : JsonConvert.SerializeObject(request), response1 == null ? "" : JsonConvert.SerializeObject(response1)); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.HttpContextUser; |
| | | using WIDESEA_Core.LogHelper; |
| | | using WIDESEA_Core.Util; |
| | | using WIDESEA_DTO.Base; |
| | | using WIDESEA_DTO.ReturnMES; |
| | |
| | | |
| | | public WebResponseContent OutboundFeedback(string orderNo) |
| | | { |
| | | WebResponseContent webResponse = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_OutboundOrder outboundOrder = _outboundOrderRepository.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == orderNo).Includes(x => x.Details).First(); |
| | | if (outboundOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçåºåºåä¿¡æ¯"); |
| | | return webResponse = WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçåºåºåä¿¡æ¯"); |
| | | } |
| | | |
| | | List<Dt_MesReturnRecord> returnRecords = BaseDal.QueryData(x => x.OrderNo == orderNo && x.OrderId == outboundOrder.Id && x.ReturnStatus == 2); |
| | |
| | | MaterialOutboundReturnDTO? returnDTO = BuildOutboundFeedbackData(outboundOrder); |
| | | if (returnDTO == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æå»ºåè°å¯¹è±¡å¤±è´¥"); |
| | | return webResponse = WebResponseContent.Instance.Error($"æå»ºåè°å¯¹è±¡å¤±è´¥"); |
| | | } |
| | | |
| | | if (returnDTO.Details.Count <= 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è¯¥åæ®æ æç»å¯åä¼ "); |
| | | return webResponse = WebResponseContent.Instance.Error($"è¯¥åæ®æ æç»å¯åä¼ "); |
| | | } |
| | | |
| | | string apiUrl = AppSettings.GetValue("MaterialOutboundFeedbackUrl"); |
| | |
| | | Dt_AllocateOrder allocateOrder = _allocateRepository.QueryFirst(x => x.OrderNo == outboundOrder.OrderNo); |
| | | if (allocateOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçè°æ¨å"); |
| | | return webResponse = WebResponseContent.Instance.Error($"æªæ¾å°å¯¹åºçè°æ¨å"); |
| | | } |
| | | |
| | | AllocationReturnDTO? returnDTO = BuildAllocationFeedbackData(outboundOrder, allocateOrder.FromWarehouse, allocateOrder.ToWarehouse); |
| | | if (returnDTO == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æå»ºåè°å¯¹è±¡å¤±è´¥"); |
| | | return webResponse = WebResponseContent.Instance.Error($"æå»ºåè°å¯¹è±¡å¤±è´¥"); |
| | | } |
| | | |
| | | if (returnDTO.Details.Count <= 0) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è¯¥åæ®æ æç»å¯åä¼ "); |
| | | return webResponse = WebResponseContent.Instance.Error($"è¯¥åæ®æ æç»å¯åä¼ "); |
| | | } |
| | | |
| | | string apiUrl = AppSettings.GetValue("AllocationFeedbackUrl"); ; |
| | |
| | | lineNos = returnDTO.Details.Select(x => x.LineNo).ToList(); |
| | | httpResponseResult = _httpClientHelper.Post<MesResponseDTO>(apiUrl, requestData); |
| | | httpResponseResult.ApiUrl = apiUrl; |
| | | |
| | | Logger.Add(requestData, httpResponseResult.Serialize()); |
| | | } |
| | | |
| | | bool isSuccess = httpResponseResult.IsSuccess && httpResponseResult.Data.Code == "200"; |
| | |
| | | _unitOfWorkManage.CommitTran(); |
| | | int successCount = returnRecords.Where(x => x.ReturnStatus == 1).Count() + (isSuccess ? 1 : 0); |
| | | int failCount = returnRecords.Where(x => x.ReturnStatus == 2).Count() + (isSuccess ? 1 : 0); |
| | | WebResponseContent responseContent = new WebResponseContent(); |
| | | responseContent.Status = true; |
| | | responseContent.Message = $"åè°æåæ¡æ°ï¼{successCount}ï¼åè°å¤±è´¥æ¡æ°ï¼{failCount}"; |
| | | return responseContent; |
| | | |
| | | webResponse.Status = true; |
| | | webResponse.Message = $"åè°æåæ¡æ°ï¼{successCount}ï¼åè°å¤±è´¥æ¡æ°ï¼{failCount}"; |
| | | |
| | | return webResponse; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | return webResponse = WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | Logger.Add(orderNo, webResponse.Serialize()); |
| | | } |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | |
| | | namespace WIDESEA_DTO.Inbound |
| | | { |
| | | public class CompleteStockTakeDTO |
| | | { |
| | | |
| | | public string orderNo { get; set; } |
| | | |
| | | public string boxNo { get; set; } |
| | | |
| | | public string barcode { get; set; } |
| | | |
| | | public decimal actualQuantity { get; set; } |
| | | |
| | | public decimal stockQuantity { get; set; } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IInboundService |
| | | { |
| | | public interface ITakeStockOrderDetailService:IService<Dt_TakeStockOrderDetail> |
| | | { |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IInboundService |
| | | { |
| | | public interface ITakeStockOrderService : IService<Dt_TakeStockOrder> |
| | | { |
| | | WebResponseContent ValidateBoxNo(string orderNo, string boxNo); |
| | | |
| | | WebResponseContent ValidateBarcode(string boxNo, string barcode); |
| | | |
| | | WebResponseContent CompleteStockTake([FromBody] CompleteStockTakeDTO completeStockTakeDTO); |
| | | |
| | | WebResponseContent ReturnBox(string orderNo, string boxNo); |
| | | } |
| | | } |
| | |
| | | StockId = stockInfo == null ? 0 : stockInfo.Id, |
| | | Barcode = item.Barcode, |
| | | MaterielCode = item.MaterielCode, |
| | | MaterielName = item.MaterielName, |
| | | BatchNo = item.BatchNo, |
| | | Unit = item.Unit, |
| | | InboundOrderRowNo = item.lineNo, |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_InboundService |
| | | { |
| | | public class TakeStockOrderDetailService : ServiceBase<Dt_TakeStockOrderDetail, IRepository<Dt_TakeStockOrderDetail>>, ITakeStockOrderDetailService |
| | | |
| | | { |
| | | public IRepository<Dt_TakeStockOrderDetail> Repository => BaseDal; |
| | | public TakeStockOrderDetailService(IRepository<Dt_TakeStockOrderDetail> BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Core.Helper; |
| | | using Microsoft.AspNetCore.Mvc.RazorPages; |
| | | using WIDESEA_Core.Enums; |
| | | using SqlSugar; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Common.StockEnum; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_DTO.ReturnMES; |
| | | using MailKit.Search; |
| | | using static System.Collections.Specialized.BitVector32; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.TaskEnum; |
| | | using WIDESEA_IBasicService; |
| | | |
| | | namespace WIDESEA_InboundService |
| | | { |
| | | public class TakeStockOrderService : ServiceBase<Dt_TakeStockOrder, IRepository<Dt_TakeStockOrder>>, ITakeStockOrderService |
| | | { |
| | | public IRepository<Dt_TakeStockOrder> Repository => BaseDal; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly IRepository<Dt_TakeStockOrder> _takeStockOrder; |
| | | private readonly IRepository<Dt_StockInfo> _stockInfoRepository; |
| | | private readonly IRepository<Dt_TakeStockOrderDetail> _takeStockOrderDetail; |
| | | private readonly IRepository<Dt_Task> _taskRepository; |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | public TakeStockOrderService(IRepository<Dt_TakeStockOrder> BaseDal, IUnitOfWorkManage unitOfWorkManage,IRepository<Dt_TakeStockOrder> takeStockOrder,IRepository<Dt_StockInfo> stockInfoRepository,IRepository<Dt_TakeStockOrderDetail> takeStockOrderDetail,IRepository<Dt_Task> taskRepository,ILocationInfoService locationInfoService) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _takeStockOrder = takeStockOrder; |
| | | _stockInfoRepository = stockInfoRepository; |
| | | _takeStockOrderDetail = takeStockOrderDetail; |
| | | _taskRepository = taskRepository; |
| | | _locationInfoService = locationInfoService; |
| | | } |
| | | |
| | | public WebResponseContent ValidateBoxNo(string orderNo, string boxNo) |
| | | { |
| | | try |
| | | { |
| | | Dt_StockInfo stockInfo = _stockInfoRepository.QueryFirst(x => x.PalletCode == boxNo); |
| | | if (stockInfo == null) { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥æçåºå"); |
| | | } |
| | | if(stockInfo.StockStatus != StockStatusEmun.çç¹åºåºå®æ.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error("该æçå¤äºéçç¹ç¶æï¼è¯·æ£æ¥çç¹ä»»å¡"); |
| | | } |
| | | Dt_TakeStockOrder takeStockOrder = _takeStockOrder.QueryFirst(x=>x.OrderNo == orderNo); |
| | | if (takeStockOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥çç¹åæ®"); |
| | | } |
| | | if (takeStockOrder.AllPalletCode.Contains(",")) |
| | | { |
| | | var remarkValues = takeStockOrder.AllPalletCode |
| | | .Split(',') |
| | | .Select(s => s.Trim()) |
| | | .Where(s => !string.IsNullOrWhiteSpace(s)) |
| | | .ToList(); |
| | | if (remarkValues.Count == 0) |
| | | { |
| | | return WebResponseContent.Instance.Error("çç¹åç®±å·ä»
å
å«éå·ï¼æ ææç®±å·æ°æ®"); |
| | | } |
| | | |
| | | bool isMatch = remarkValues.Any(val => val.Equals(boxNo, StringComparison.OrdinalIgnoreCase)); |
| | | if (!isMatch) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ç®±å·ã{boxNo}ãæªå¨çç¹åç®±å·ã{takeStockOrder.Remark}ã䏿¾å°å¹é
项"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | bool isMatch = takeStockOrder.Remark.Trim().Equals(boxNo, StringComparison.OrdinalIgnoreCase); |
| | | if (!isMatch) |
| | | { |
| | | return WebResponseContent.Instance.Error($"ç®±å·ã{boxNo}ãä¸çç¹åç®±å·ã{takeStockOrder.Remark}ãä¸å¹é
"); |
| | | } |
| | | } |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent ValidateBarcode(string boxNo, string barcode) |
| | | { |
| | | try |
| | | { |
| | | Dt_StockInfo stockInfo = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == boxNo).Includes(x => x.Details).First(); |
| | | if(stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥æç®±åºåä¿¡æ¯"); |
| | | } |
| | | if(stockInfo.Details == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥æç®±åºå"); |
| | | } |
| | | List<string> barcodes = stockInfo.Details.Select(x => x.Barcode).ToList(); |
| | | |
| | | bool isMatch = barcodes.Any(val => val.Equals(barcode, StringComparison.OrdinalIgnoreCase)); |
| | | if (!isMatch) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æ¡ç ã{barcode}ãæªå¨ã{boxNo}ãæç®±æ¡ç 䏿¾å°å¹é
项"); |
| | | } |
| | | var stockDetail = stockInfo.Details.FirstOrDefault(x=>x.Barcode == barcode); |
| | | |
| | | var resultData = new { stockQuantity = stockDetail.StockQuantity }; |
| | | |
| | | return WebResponseContent.Instance.OK(data:resultData); |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent CompleteStockTake([FromBody] CompleteStockTakeDTO completeStockTakeDTO) |
| | | { |
| | | try |
| | | { |
| | | Dt_TakeStockOrder takeStockOrder = _takeStockOrder.QueryFirst(x=>x.OrderNo == completeStockTakeDTO.orderNo); |
| | | if (takeStockOrder == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥çç¹åæ®"); |
| | | } |
| | | Dt_StockInfo stockInfo = _stockInfoRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == completeStockTakeDTO.boxNo).Includes(x=>x.Details).First(); |
| | | if(stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°è¯¥æçåºå"); |
| | | } |
| | | Dt_StockInfoDetail stockInfoDetail = stockInfo.Details.FirstOrDefault(x => x.Barcode == completeStockTakeDTO.barcode); |
| | | if(stockInfoDetail == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æ¡ç åºåæ°æ®æªæ¾å°å¹é
æ°æ®"); |
| | | } |
| | | Dt_TakeStockOrderDetail takeStockOrderDetail = new Dt_TakeStockOrderDetail() |
| | | { |
| | | TakeStockId = takeStockOrder.Id, |
| | | MaterielCode = stockInfoDetail.MaterielCode, |
| | | MaterielName = stockInfoDetail.MaterielName??"", |
| | | BatchNo = stockInfoDetail.BatchNo, |
| | | TakePalletCode = completeStockTakeDTO.boxNo, |
| | | TakeDetalStatus = TakeStockDetailStatusEnum.çç¹å®æ.ObjToInt(), |
| | | Unit = stockInfoDetail.Unit, |
| | | SysQty = completeStockTakeDTO.stockQuantity, |
| | | Qty =completeStockTakeDTO.actualQuantity, |
| | | Remark = completeStockTakeDTO.stockQuantity-completeStockTakeDTO.actualQuantity>=0 ?"çäº":"çç", |
| | | barcode = completeStockTakeDTO.barcode, |
| | | WarehouseCode = stockInfoDetail.WarehouseCode??"", |
| | | FactoryArea = stockInfoDetail.FactoryArea, |
| | | SupplyCode = stockInfoDetail.SupplyCode??"", |
| | | TakeStockNo = takeStockOrder.OrderNo, |
| | | |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _takeStockOrderDetail.AddData(takeStockOrderDetail); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent ReturnBox(string orderNo, string boxNo) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_TakeStockOrder takeStockOrder = _takeStockOrder.QueryFirst(x=>x.OrderNo == orderNo); |
| | | if(takeStockOrder == null) |
| | | { |
| | | return content.Error("æªæ¾å°è¯¥çç¹åæ®"); |
| | | } |
| | | var stock = _stockInfoRepository.QueryFirst(x => x.PalletCode == boxNo); |
| | | |
| | | if (stock == null) |
| | | { |
| | | return content.Error($"æªæ¾å°æç{boxNo}åºåä¿¡æ¯ä¸å
许ååº"); |
| | | } |
| | | |
| | | var task = _taskRepository.QueryFirst(x => x.PalletCode == boxNo); |
| | | |
| | | |
| | | if (task != null) |
| | | { |
| | | return content.Error($"æç{boxNo}åå¨ä»»å¡ååºå¤±è´¥!"); |
| | | } |
| | | if(stock.StockStatus != StockStatusEmun.çç¹åºåºå®æ.ObjToInt()) |
| | | { |
| | | return content.Error("该æçç¶æä¸å¯¹,ä¸å
许çç¹å
¥åº"); |
| | | } |
| | | stock.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | |
| | | takeStockOrder.TakeStockStatus = TakeStockStatusEnum.çç¹å®æ.ObjToInt(); |
| | | // åé
æ°è´§ä½ |
| | | var newLocation = _locationInfoService.AssignLocation(stock.LocationType); |
| | | |
| | | var newTask = new Dt_Task() |
| | | { |
| | | CurrentAddress = takeStockOrder.Remark, |
| | | Grade = 0, |
| | | PalletCode = boxNo, |
| | | NextAddress = "", |
| | | OrderNo = takeStockOrder.OrderNo, |
| | | Roadway = newLocation.RoadwayNo, |
| | | SourceAddress = takeStockOrder.Remark, |
| | | TargetAddress = newLocation.LocationCode, |
| | | TaskStatus = (int)TaskStatusEnum.New, |
| | | TaskType = TaskTypeEnum.InInventory.ObjToInt(), |
| | | PalletType = stock.PalletType, |
| | | WarehouseId = stock.WarehouseId |
| | | }; |
| | | _unitOfWorkManage.BeginTran(); |
| | | _stockInfoRepository.UpdateData(stock); |
| | | _takeStockOrder.UpdateData(takeStockOrder); |
| | | _taskRepository.AddData(newTask); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | //var moveResult = await _eSSApiService.MoveContainerAsync(new MoveContainerRequest |
| | | //{ |
| | | // slotCode = movestations[station], |
| | | // containerCode = palletCode |
| | | //}); |
| | | return content.OK(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | using SqlSugar; |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | [ExporterHeader(DisplayName = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çç¹åä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "çç¹å主é®")] |
| | | [ExporterHeader(DisplayName = "çç¹å主é®")] |
| | | public int TakeStockId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æç¼ç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç©æç¼ç ")] |
| | | [ExporterHeader(DisplayName = "ç©æç¼ç ")] |
| | | public string MaterielCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æåç§° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 200, ColumnDescription = "ç©æåç§°")] |
| | | [ExporterHeader(DisplayName = "ç©æåç§°")] |
| | | public string MaterielName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¹æ¬¡å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¹æ¬¡å·")] |
| | | [ExporterHeader(DisplayName = "æ¹æ¬¡å·")] |
| | | public string BatchNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æè§æ ¼ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "ç©æè§æ ¼")] |
| | | [ExporterHeader(DisplayName = "ç©æè§æ ¼")] |
| | | public string MaterielSpec { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä»ä½ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "åä»ä½")] |
| | | [ExporterHeader(DisplayName = "åä»ä½")] |
| | | public string LocationCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çç¹æç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "çç¹æç")] |
| | | [ExporterHeader(DisplayName = "çç¹æç")] |
| | | public string TakePalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çç¹æç»ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "çç¹æç»ç¶æ")] |
| | | [ExporterHeader(DisplayName = "çç¹æç»ç¶æ")] |
| | | public int TakeDetalStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åä½ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "åä½")] |
| | | [ExporterHeader(DisplayName = "åä½")] |
| | | public string Unit { get; set; } |
| | | |
| | | /// <summary> |
| | | /// è´¦é¢æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "è´¦é¢æ°é")] |
| | | [ExporterHeader(DisplayName = "è´¦é¢æ°é")] |
| | | public decimal SysQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å®çæ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "å®çæ°é")] |
| | | [ExporterHeader(DisplayName = "å®çæ°é")] |
| | | public decimal Qty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "夿³¨")] |
| | | [ExporterHeader(DisplayName = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¡ç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "æ¡ç ")] |
| | | [ExporterHeader(DisplayName = "æ¡ç ")] |
| | | public string barcode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç©æä»åº |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "ç©æä»åº")] |
| | | [ExporterHeader(DisplayName = "ç©æä»åº")] |
| | | public string WarehouseCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ååº |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 10, ColumnDescription = "ååº")] |
| | | [ExporterHeader(DisplayName = "ååº")] |
| | | public string FactoryArea { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¾åºåç¼å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 20, ColumnDescription = "ä¾åºåç¼å·")] |
| | | [ExporterHeader(DisplayName = "ä¾åºåç¼å·")] |
| | | public string SupplyCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// çç¹ååæ® |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "çç¹ååæ®")] |
| | | [ExporterHeader(DisplayName = "çç¹ååæ®")] |
| | | public string TakeStockNo { get; set; } |
| | | } |
| | | } |
| | |
| | | List<Barcodes> barcodesList = new List<Barcodes>(); |
| | | Barcodes barcodes = new Barcodes |
| | | { |
| | | Barcode = newBarcode, |
| | | Barcode = isUnpacked ? newBarcode : stockDetail?.Barcode, |
| | | Qty = barcodeQuantity, |
| | | SupplyCode = stockDetail?.SupplyCode ?? "", |
| | | BatchNo = stockDetail?.BatchNo ?? "", |
| | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "takeStockStatusEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(TakeStockStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(TakeStockStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(TakeStockStatusEnum).GetField(((TakeStockStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "takeStockDetailStatusEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | Type type = typeof(TakeStockDetailStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(TakeStockDetailStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(TakeStockDetailStatusEnum).GetField(((TakeStockDetailStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | } |
| | | return result; |
| | | } |
| | |
| | | private readonly IRepository<Dt_AllocateMaterialInfo_Hty> _allocateMaterialInfo_Hty; |
| | | private readonly HttpClientHelper _httpClientHelper; |
| | | private readonly IBasicService _basicService; |
| | | private readonly IRepository<Dt_TakeStockOrder> _takeStockOrder; |
| | | public IRepository<Dt_Task> Repository => BaseDal; |
| | | |
| | | private Dictionary<string, SqlSugar.OrderByType> _taskOrderBy = new() |
| | |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, IRepository<Dt_ReCheckOrder> reCheckOrderRepository, IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository, IMaterialUnitService materialUnitService, ITask_HtyService task_HtyService, IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, IRepository<Dt_AllocateMaterialInfo_Hty> allocateMaterialInfo_Hty, HttpClientHelper httpClientHelper, IBasicService basicService) : base(BaseDal) |
| | | public TaskService(IRepository<Dt_Task> BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IRepository<Dt_StockInfo> stockRepository, ILocationInfoService locationInfoService, IInboundOrderService inboundOrderService, ILocationStatusChangeRecordService locationStatusChangeRecordService, IESSApiService eSSApiService, ILogger<TaskService> logger, IStockService stockService, IRecordService recordService, IInboundOrderDetailService inboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutboundOrderDetailService outboundOrderDetailService, IInvokeMESService invokeMESService, IOutStockLockInfoService outStockLockInfoService, IAllocateService allocateService, IRepository<Dt_OutboundBatch> outboundBatchRepository, IRepository<Dt_ReCheckOrder> reCheckOrderRepository, IRepository<Dt_AllocateOrderDetail> allocateOrderDetailRepository, IRepository<Dt_AllocateOrder> allocateOrderRepository, IMaterialUnitService materialUnitService, ITask_HtyService task_HtyService, IRepository<Dt_AllocateMaterialInfo> allocateMaterialInfo, IRepository<Dt_AllocateMaterialInfo_Hty> allocateMaterialInfo_Hty, HttpClientHelper httpClientHelper, IBasicService basicService,IRepository<Dt_TakeStockOrder> takeStockOrder) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _allocateMaterialInfo_Hty = allocateMaterialInfo_Hty; |
| | | _httpClientHelper = httpClientHelper; |
| | | _basicService = basicService; |
| | | _takeStockOrder = takeStockOrder; |
| | | } |
| | | |
| | | public async Task TaskStatusChange(string taskNum, TaskStatusEnum taskStatusEnum) |
| | |
| | | |
| | | _stockService.StockInfoService.Db.UpdateNav(stock).IncludesAllFirstLayer().ExecuteCommand(); |
| | | |
| | | task.TaskStatus = (int)TaskStatusEnum.Finish; |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.èªå¨å®æ); |
| | | if (!result) |
| | | { |
| | |
| | | return TaskCompleted(TaskNum); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çç¹åºåºå®æ |
| | | /// </summary> |
| | | public WebResponseContent OutInventoryTaskCompleted(Dt_Task task) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | task = BaseDal.QueryFirst(x => x.TaskNum == task.TaskNum); |
| | | if (task == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | var SourceAddress = task.SourceAddress; |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.QueryFirst(x=>x.PalletCode == task.PalletCode); |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == SourceAddress); |
| | | if (stockInfo == null) return WebResponseContent.Instance.Error("æªæ¾å°åºåä¿¡æ¯"); |
| | | if (locationInfo == null) return WebResponseContent.Instance.Error("æªæ¾å°è´§ä½ä¿¡æ¯"); |
| | | //è·å对åºçç¹å |
| | | Dt_TakeStockOrder takeStockOrder = _takeStockOrder.Db.Queryable<Dt_TakeStockOrder>().Where(x => x.OrderNo == task.OrderNo).Includes(x => x.Details).First(); |
| | | if (takeStockOrder == null) |
| | | { |
| | | return content.Error($"çç¹å{task.OrderNo}ä¸åå¨"); |
| | | } |
| | | if (takeStockOrder.TakeStockStatus != TakeStockStatusEnum.çç¹ä¸.ObjToInt()) |
| | | { |
| | | return content.Error($"çç¹å{task.OrderNo}çç¹å·²å®æææªå¼å§"); |
| | | } |
| | | if (stockInfo.StockStatus != StockStatusEmun.åºåºéå®.ObjToInt()) |
| | | { |
| | | return content.Error($"{stockInfo.PalletCode}åºåç¶æä¸æ£ç¡®"); |
| | | } |
| | | if (locationInfo.LocationStatus != LocationStatusEnum.Lock.ObjToInt()) |
| | | { |
| | | return content.Error($"{locationInfo.LocationCode}è´§ä½ç¶æä¸æ£ç¡®"); |
| | | } |
| | | |
| | | stockInfo.StockStatus = StockStatusEmun.çç¹åºåºå®æ.ObjToInt(); |
| | | stockInfo.LocationCode = ""; |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _unitOfWorkManage.BeginTran(); |
| | | //è´§ä½åå¨è®°å½ |
| | | _basicService.LocationInfoService.UpdateData(locationInfo); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, LocationStatusEnum.Free.ObjToInt(), takeStockOrder?.OrderNo ?? "", task.TaskNum); |
| | | _stockRepository.UpdateData(stockInfo); |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | _unitOfWorkManage.CommitTran(); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | content.Error(ex.Message); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çç¹å
¥åºå®æ |
| | | /// </summary> |
| | | /// <param name="task"></param> |
| | | /// <returns></returns> |
| | | public async Task<WebResponseContent> InInventoryTaskCompleted(Dt_Task task) |
| | | { |
| | | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | |
| | | Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | if (locationInfo == null) |
| | | { |
| | | return content.Error($"æªæ¾å°å¯¹åºçç»ç¹è´§ä½ä¿¡æ¯"); |
| | | } |
| | | Dt_StockInfo stockInfo = _stockRepository.Db.Queryable<Dt_StockInfo>().Where(x => x.PalletCode == task.PalletCode && x.WarehouseId == task.WarehouseId).First(); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°æç对åºçç»çä¿¡æ¯"); |
| | | } |
| | | |
| | | if (!string.IsNullOrEmpty(stockInfo.LocationCode)) |
| | | { |
| | | return WebResponseContent.Instance.Error($"该æçå·²ç»å®è´§ä½"); |
| | | } |
| | | if (locationInfo.LocationStatus == LocationStatusEnum.InStock.ObjToInt()) |
| | | { |
| | | return WebResponseContent.Instance.Error($"è´§ä½ç¶æä¸æ£ç¡®"); |
| | | } |
| | | |
| | | |
| | | var beforelocationStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | |
| | | |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | stockInfo.PalletCode = task.PalletCode; |
| | | stockInfo.LocationCode = task.TargetAddress; |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºå®æ.ObjToInt(); |
| | | task.TaskStatus = TaskStatusEnum.Finish.ObjToInt(); |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | _locationInfoService.Repository.UpdateData(locationInfo); |
| | | _stockRepository.UpdateData(stockInfo); |
| | | var result = _task_HtyService.DeleteAndMoveIntoHty(task, OperateTypeEnum.人工å é¤); |
| | | _unitOfWorkManage.CommitTran(); |
| | | |
| | | if (!result) |
| | | { |
| | | await Db.Deleteable(task).ExecuteCommandAsync(); |
| | | } |
| | | try |
| | | { |
| | | _locationStatusChangeRecordService.AddLocationStatusChangeRecord(locationInfo, beforelocationStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _logger.LogInformation($"InEmptyTaskCompleted AddLocationStatusChangeRecord : {ex.Message} "); |
| | | } |
| | | return content; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return await Task.FromResult(WebResponseContent.Instance.Error(ex.Message)); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | TargetAddress = outStation, |
| | | TaskStatus = TaskStatusEnum.New.ObjToInt(), |
| | | TaskType = taskType.ObjToInt(), |
| | | // TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | //TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | PalletType = stockInfo.PalletType, |
| | | WarehouseId = stockInfo.WarehouseId, |
| | | }; |
| | |
| | | } |
| | | //è·åè´§ä½ |
| | | List<string> locStrs = stockInfos.Select(x => x.LocationCode).ToList(); |
| | | List<Dt_LocationInfo> locationInfos = (List<Dt_LocationInfo>)_locationInfoService.Db.Queryable<Dt_LocationInfo>().Where(x => locStrs.Contains(x.LocationCode)); |
| | | List<Dt_LocationInfo> locationInfos =_locationInfoService.Db.Queryable<Dt_LocationInfo>().Where(x => locStrs.Contains(x.LocationCode)).ToList(); |
| | | if (stockInfos.Count != locationInfos.Count) |
| | | { |
| | | string? locStr = locStrs.FirstOrDefault(x => !locationInfos.Select(x => x.LocationCode).ToList().Contains(x)); |
| | |
| | | WarehouseId = stockInfos.FirstOrDefault().WarehouseId, |
| | | TakeStockStatus = TakeStockStatusEnum.çç¹ä¸.ObjToInt(), |
| | | OrderNo = CreateCodeByRule(nameof(RuleCodeEnum.PDCodeRule)), |
| | | Details = new List<Dt_TakeStockOrderDetail>() |
| | | AllPalletCode = string.Join(",", stockInfos.Select(item => item.PalletCode).Where(palletCode => !string.IsNullOrEmpty(palletCode))), |
| | | Remark = outStation |
| | | |
| | | }; |
| | | foreach (var item in stockInfos) |
| | | { |
| | |
| | | _unitOfWorkManage.BeginTran(); |
| | | //æ´æ°åºåç¶æ |
| | | _stockRepository.UpdateData(stockInfos); |
| | | BaseDal.Db.InsertNav(takeStockOrder); |
| | | _takeStockOrder.AddData(takeStockOrder); |
| | | //æ°å»ºä»»å¡ |
| | | BaseDal.AddData(tasks); |
| | | _locationInfoService.UpdateData(locationInfos); |
| | |
| | | { |
| | | return WebResponseContent.Instance.Error($"æ¡ç ä¸è½ä¸ºç©º"); |
| | | } |
| | | var materialName = _materialInfoRepository.QueryFirst(x => x.MaterielCode == detailDto.materialCode).MaterielName; |
| | | var materialName = _materialInfoRepository.QueryFirst(x => x.MaterielCode == detailDto.MaterialCode).MaterielName; |
| | | if (detailDto.Barcodes != null && detailDto.Barcodes.Any()) |
| | | { |
| | | foreach (var barcodeDto in detailDto.Barcodes) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | /// <summary> |
| | | /// çç¹å |
| | | /// </summary> |
| | | [Route("api/TakeStockOrder")] |
| | | [ApiController] |
| | | public class TakeStockOrderController : ApiBaseController<ITakeStockOrderService, Dt_TakeStockOrder> |
| | | { |
| | | public TakeStockOrderController(ITakeStockOrderService service) : base(service) |
| | | { |
| | | } |
| | | /// <summary> |
| | | /// æç®±éªè¯ |
| | | /// </summary> |
| | | [HttpPost,HttpGet, Route("ValidateBoxNo"), AllowAnonymous] |
| | | public WebResponseContent ValidateBoxNo(string orderNo , string boxNo) |
| | | { |
| | | return Service.ValidateBoxNo(orderNo,boxNo); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¡ç éªè¯ |
| | | /// </summary> |
| | | [HttpPost, HttpGet, Route("ValidateBarcode"), AllowAnonymous] |
| | | public WebResponseContent ValidateBarcode( string boxNo,string barcode) |
| | | { |
| | | return Service.ValidateBarcode(boxNo, barcode); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çç¹å®æè®°å½ |
| | | /// </summary> |
| | | [HttpPost, HttpGet, Route("CompleteStockTake"), AllowAnonymous] |
| | | public WebResponseContent CompleteStockTake([FromBody] CompleteStockTakeDTO completeStockTakeDTO) |
| | | { |
| | | return Service.CompleteStockTake(completeStockTakeDTO); |
| | | } |
| | | /// <summary> |
| | | /// çç¹æç®±ååº |
| | | /// </summary> |
| | | [HttpPost, HttpGet, Route("ReturnBox"), AllowAnonymous] |
| | | public WebResponseContent ReturnBox(string orderNo, string boxNo) |
| | | { |
| | | return Service.ReturnBox(orderNo, boxNo); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Inbound |
| | | { |
| | | [Route("api/TakeStockOrderDetail")] |
| | | [ApiController] |
| | | public class TakeStockOrderDetailController : ApiBaseController<ITakeStockOrderDetailService, Dt_TakeStockOrderDetail> |
| | | { |
| | | public TakeStockOrderDetailController(ITakeStockOrderDetailService service) : base(service) |
| | | { |
| | | } |
| | | } |
| | | } |
| | |
| | | [HttpPost, Route("save")] |
| | | public ActionResult Save([FromBody] Sys_Menu menu) |
| | | { |
| | | if (App.User.UserId == 1) |
| | | //è¶
级管çåä¹è½ä¿®æ¹èå |
| | | if (App.User.RoleId == 1) |
| | | { |
| | | return Json(Service.Save(menu)); |
| | | } |
| | |
| | | { |
| | | |
| | | // ç¬¬ä¸æ¥ï¼æ´æ°ValidDateçåçSQLï¼SQL Serverï¼ |
| | | string updateSql = @" |
| | | UPDATE s |
| | | SET s.ValidDate = DATEADD(DAY, m.ValidityDays, s.CreateDate) |
| | | FROM Dt_StockInfoDetail s |
| | | INNER JOIN Dt_MaterialExpirationDate m ON SUBSTRING(s.MaterielCode, 1, 6) = m.MaterialCode |
| | | WHERE s.ValidDate IS NULL"; |
| | | int updateValidDateResult = _db.Ado.ExecuteCommand(updateSql); |
| | | // string updateSql = @" |
| | | //UPDATE s |
| | | //SET s.ValidDate = DATEADD(DAY, m.ValidityDays, s.CreateDate) |
| | | //FROM Dt_StockInfoDetail s |
| | | //INNER JOIN Dt_MaterialExpirationDate m ON SUBSTRING(s.MaterielCode, 1, 6) = m.MaterialCode |
| | | //WHERE s.ValidDate IS NULL"; |
| | | // int updateValidDateResult = _db.Ado.ExecuteCommand(updateSql); |
| | | |
| | | // ç¬¬äºæ¥ï¼æ´æ°è¿æç¶æçåçSQL |
| | | string updateStatusSql = @" |
| | |
| | | { |
| | | var allQzServices = new List<TasksQz>() |
| | | { |
| | | //new TasksQz() |
| | | //{ |
| | | // Id = 1, |
| | | // AssemblyName = "WIDESEA_WMSServer", |
| | | // ClassName = "AgvTaskJob", |
| | | // CreateTime = DateTime.Now, |
| | | // IntervalSecond = 3, |
| | | // IsDeleted = false, |
| | | // IsStart = false, |
| | | // JobGroup = "WIDESEA_WMSServer", |
| | | // Name = "AgvTaskJob", |
| | | // TriggerType = 0 |
| | | //}, |
| | | |
| | | new TasksQz() |
| | | { |
| | | Id = 1, |
| | | AssemblyName = "WIDESEA_WMSServer", |
| | | ClassName = "AgvTaskJob", |
| | | CreateTime = DateTime.Now, |
| | | IntervalSecond = 3, |
| | | IsDeleted = false, |
| | | IsStart = false, |
| | | JobGroup = "WIDESEA_WMSServer", |
| | | Name = "AgvTaskJob", |
| | | TriggerType = 0 |
| | | }, |
| | | |
| | | }; |
| | | foreach (var item in allQzServices) |
| | | { |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <!-- https://go.microsoft.com/fwlink/?LinkID=208121. --> |
| | | <Project> |
| | | <PropertyGroup> |
| | | <DeleteExistingFiles>false</DeleteExistingFiles> |
| | | <ExcludeApp_Data>false</ExcludeApp_Data> |
| | | <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish> |
| | | <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> |
| | | <LastUsedPlatform>Any CPU</LastUsedPlatform> |
| | | <PublishProvider>FileSystem</PublishProvider> |
| | | <PublishUrl>bin\Release\net6.0\publish\</PublishUrl> |
| | | <WebPublishMethod>FileSystem</WebPublishMethod> |
| | | <_TargetId>Folder</_TargetId> |
| | | </PropertyGroup> |
| | | </Project> |