From a2444e26e2995edf96cf08a272daed21861c3fbe Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期一, 11 十一月 2024 14:41:44 +0800
Subject: [PATCH] 1.生产入库T+ 手动写表暂时完成
---
src/views/produce/stepReport2.vue | 136 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 131 insertions(+), 5 deletions(-)
diff --git a/src/views/produce/stepReport2.vue b/src/views/produce/stepReport2.vue
index 507bf08..6f624a2 100644
--- a/src/views/produce/stepReport2.vue
+++ b/src/views/produce/stepReport2.vue
@@ -472,6 +472,28 @@
<el-input v-model="dialogForm.startqty" oninput="value=value.replace(/[^\d]/g,'')" style="width: 200px" />
</el-form-item>
+ <el-form-item
+ v-if="(activeName==='鐢熶骇鍒楄〃'||activeName==='澶栧崗鏀舵枡')&&rowData.isend === 'Y'"
+ prop="stockcode"
+ label="鍏ュ簱浠撳簱"
+ class="dialogFormItem"
+ >
+ <el-select
+ v-model="dialogForm.stockcode"
+ style="width:200px"
+ placeholder="璇烽�夋嫨"
+ filterable
+ :popper-append-to-body="false"
+ >
+ <el-option
+ v-for="item in WareHouseArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+
<el-form-item v-if="activeName==='澶栧崗鍙戞枡'||activeName==='澶栧崗鏀舵枡'" prop="wxcode" label="澶栧崗渚涙柟" class="dialogFormItem">
<el-select
v-model="dialogForm.wxcode"
@@ -883,8 +905,14 @@
EditOrderNgStepSeave,
MesOrderNgStepSearch,
MesOrderNgSubStepSearch,
- MesOrderStepSearch, MesOrderStepStart,
- MesOrderWxStepSearch, SavaMesOrderStepIn, SavaMesOrderStepOut, SavaMesOrderStepReport
+ MesOrderStepSearch,
+ MesOrderStepStart,
+ MesOrderWxStepSearch,
+ ProductInHouseOrderCodeSearch,
+ SavaMesOrderStepIn,
+ SavaMesOrderStepOut,
+ SavaMesOrderStepReport,
+ TProductInHouseOrderSpSeave
} from '@/api/WorkOrder'
import {
CustomerPermissions,
@@ -892,12 +920,12 @@
EqpPermissions,
GroupsPermissions,
GroupsPersonPermissions,
- PersonPermissions, PrentOrganizationNoCompany
+ PersonPermissions, PrentOrganizationNoCompany, WareHouse
} from '@/api/GeneralBasicData'
import { nanoid } from 'nanoid'
import { LabelBarCode } from '@/api/systemSetting'
import { getCookie } from '@/utils/auth'
-import { handleDatetime2 } from '@/utils/global'
+import { handleDatetime, handleDatetime2 } from '@/utils/global'
import QRCode from 'qrcodejs2'
export default {
name: 'StepReport2',
@@ -959,6 +987,8 @@
'eqpcode': '',
'eqpname': '',
+ stockcode: '',
+
remarks: '', // 澶囨敞
inbarcode: '', // 鍏ュ簱鏉$爜
defectlist: '', // 涓嶈壇姹囨��
@@ -983,6 +1013,9 @@
],
reportuser: [
{ required: true, message: '璇烽�夋嫨鎶ュ伐浜哄憳', trigger: ['blur', 'change'] }
+ ],
+ stockcode: [
+ { required: true, message: '璇烽�夋嫨鍏ュ簱浠撳簱', trigger: ['blur', 'change'] }
],
startqty: [
{ required: true, message: '璇疯緭鍏ュ悎鏍兼暟閲�', trigger: ['blur', 'change'] }
@@ -1050,7 +1083,8 @@
console.log('鎵ц浜嗘墦鍗�')
}
},
- xx: ''
+ rowData: {},
+ WareHouseArr: []
}
},
activated() {
@@ -1067,8 +1101,14 @@
this.tabClick()
this.getAllSelectArr()
+
+ this.getWareHouse()
},
methods: {
+ async getWareHouse() {
+ const { data: res } = await WareHouse()
+ this.WareHouseArr = res
+ },
async getAllSelectArr() {
const { data: res1 } = await GroupsPermissions()// 鐝粍
@@ -1173,9 +1213,13 @@
// 鎶ュ伐
report(row) {
if (row) {
+ this.rowData = row
+ this.dialogForm.stockcode = this.rowData.stockcode
this.getMesOrderStepStart('ZZ', '', row.wo_code, row.stepcode)
} else {
const temp = this.tableData.find(i => i.id === this.radioSelected)
+ this.rowData = temp
+ this.dialogForm.stockcode = this.rowData.stockcode
this.getMesOrderStepStart('ZZ', '', temp.wo_code, temp.stepcode)
}
},
@@ -1191,9 +1235,13 @@
// 鏀舵枡
takeIn(row) {
if (row) {
+ this.rowData = row
+ this.dialogForm.stockcode = this.rowData.stockcode
this.getMesOrderStepStart('WX', 'IN', row.wo_code, row.stepcode)
} else {
const temp = this.tableData.find(i => i.id === this.radioSelected)
+ this.rowData = temp
+ this.dialogForm.stockcode = this.rowData.stockcode
this.getMesOrderStepStart('WX', 'IN', temp.wo_code, temp.stepcode)
}
},
@@ -1309,6 +1357,8 @@
'eqpcode': '',
'eqpname': '',
+ stockcode: '',
+
wxcode: '',
outuser: '',
fqty: '',
@@ -1399,6 +1449,11 @@
if (res.code === '200') {
this.$notify.success('鎶ュ伐鎴愬姛锛�')
// await this.search()
+
+ if (this.rowData.isend === 'Y') {
+ await this.handleProductInHouseOrderSeave('B', inbarcode)
+ }
+
await this.tabClick()
this.$store.state.app.buttonIsDisabled = false
this.dialogVisible = false
@@ -1507,6 +1562,11 @@
const res = await SavaMesOrderStepIn(data)
if (res.code === '200') {
this.$notify.success('鏀舵枡鎴愬姛锛�')
+
+ if (this.rowData.isend === 'Y') {
+ await this.handleProductInHouseOrderSeave('S', inbarcode)
+ }
+
// await this.search()
await this.tabClick()
this.$store.state.app.buttonIsDisabled = false
@@ -1557,6 +1617,72 @@
// this.$refs.qrCodeDiv2 = ''
},
+ async handleProductInHouseOrderSeave(type, inbarcode) {
+ const { data: res2 } = await ProductInHouseOrderCodeSearch({ rightcode: '0605' })
+ const TableDetailData = []
+
+ TableDetailData.push({
+ hbillno: res2[0], // --鍏ュ簱鍗曞彿
+ wocode: this.rowData.wo_code, // --宸ュ崟鍙�
+ rownumber: this.rowData.sbid.toString(), // --琛屽彿
+ sourceVoucherId: this.rowData.mpoid.toString(), // --鏉ユ簮鍗曟嵁id
+ sourceVoucherCode: this.rowData.m_po.toString(), // --鏉ユ簮鍗曟嵁缂栧彿
+ SourceVoucherDetailId: this.rowData.sbid.toString(), // --鏉ユ簮鍗曟嵁鏄庣粏id
+
+ inbarcode: inbarcode, // --鍏ュ簱鏉$爜
+ idinventory: this.rowData.materiel_id.toString(), // --瀛樿揣id
+ inventorycode: this.rowData.partcode, // --瀛樿揣缂栫爜
+ idunit: this.rowData.unitid.toString(), // --璁¢噺鍗曚綅id
+ unitcode: this.rowData.unitcode, // --璁¢噺鍗曚綅缂栫爜
+ idwarehouse: this.WareHouseArr.find(i => i.code === this.dialogForm.stockcode).noid.toString(), // --浠撳簱id
+ warehousecode: this.dialogForm.stockcode, // --浠撳簱缂栫爜
+
+ saleOrderId: this.rowData.saleOrderid.toString(), // --閿�鍞崟id
+ saleOrderCode: this.rowData.saleOrderCode, // --閿�鍞崟鍙�
+ saleOrderDetailId: this.rowData.saleOrderDetailId.toString(), // --閿�鍞崟鏄庣粏id
+
+ qty: type === 'B' ? this.dialogForm.startqty.toString() : this.dialogForm.sqty.toString(), // 鍏ュ簱鏁伴噺
+ stepcode: this.rowData.stepcode, // --宸ュ簭缂栫爜
+ style: type, // --鎶ュ伐绫诲瀷
+ status: '0' // --鍗曟嵁鐘舵��
+ })
+
+ const data = {
+ 'rightcode': '0605', // 鍔熻兘缂栧彿
+ 'incbit': res2[1], // 娴佹按鍙�
+ 'TableData': [
+ [
+ {
+ 'hbillno': res2[0], // 鍏ュ簱鍗曞彿
+ 'madedate': handleDatetime(new Date()) + ' 00:00:00', // 鍒跺崟鏃ユ湡锛堝勾鏈堟棩 00:00:00锛�
+ 'hbdate': this.rowData.voucherdate,
+
+ sourceVoucherId: this.rowData.mpoid.toString(),
+ sourceVoucherCode: this.rowData.m_po.toString(),
+ saleOrderCode: this.rowData.saleOrderCode.toString(),
+
+ 'iddepartment': this.rowData.dept_id.toString(), // 閮ㄩ棬id
+ 'departmentcode': this.rowData.wkshp_code, // 閮ㄩ棬缂栫爜
+
+ 'idwarehouse': this.WareHouseArr.find(i => i.code === this.dialogForm.stockcode).noid.toString(), // 浠撳簱id
+ 'warehousecode': this.dialogForm.stockcode, // 浠撳簱缂栫爜
+ 'status': '0', // 鍏ュ簱鍗曠姸鎬侊細0(鏈鏍�) 1(宸插鏍�)
+ PurchaseOrderCode: '', // 閲囪喘璁㈠崟鍙�
+ 'remark': '', // 澶囨敞
+ 'create_user': localStorage.getItem('username'), // 鍒涘缓浜哄憳
+ 'create_date': handleDatetime2(new Date()),
+ 'check_user': '', // 瀹℃牳浜哄憳
+ 'check_date': ''// 瀹℃牳鏃堕棿
+ }
+ ],
+ TableDetailData// 琛ㄤ綋
+ ]
+ }
+
+ // console.log(JSON.parse(JSON.stringify(data)))
+ await TProductInHouseOrderSpSeave(data)
+ },
+
ZZprint2(username) {
if (this.dialogForm.nextstepcode !== '') {
this.qrForm.qrvalue = this.dialogForm.wo_code + ';' + this.dialogForm.nextstepcode
--
Gitblit v1.9.3