From 642ae743bc6009e4ae95e6e47831396ba54bcde7 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期二, 29 十月 2024 16:58:52 +0800
Subject: [PATCH] 1.生产入库实现18%
---
src/views/produce/productWarehouse.vue | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 112 insertions(+), 8 deletions(-)
diff --git a/src/views/produce/productWarehouse.vue b/src/views/produce/productWarehouse.vue
index 174b187..36dcab9 100644
--- a/src/views/produce/productWarehouse.vue
+++ b/src/views/produce/productWarehouse.vue
@@ -120,7 +120,7 @@
<div class="elForm" style="justify-content: flex-start">
<el-form-item label="鍗曟嵁鏃ユ湡" style=" display: flex;">
<el-date-picker
- v-model="form.lm_date"
+ v-model="form.hbdate"
style="width: 200px"
readonly
type="date"
@@ -130,10 +130,11 @@
<el-form-item label="鍗曟嵁缂栧彿" style=" display: flex;">
<el-input
v-model="form.hbillno"
- readonly
+
placeholder="璇疯緭鍏�"
style="width: 200px"
/>
+ <!-- readonly-->
</el-form-item>
<el-form-item label="鍏ュ簱浠撳簱" required style=" display: flex;">
@@ -147,6 +148,23 @@
>
<el-option
v-for="item in stockcodeArr"
+ :key="item.code"
+ :label="item.name"
+ :value="item.code"
+ />
+ </el-select>
+ </el-form-item>
+
+ <el-form-item label="鍏ュ簱閮ㄩ棬" required style=" display: flex;">
+ <el-select
+ v-model="form.deptno"
+ :popper-append-to-body="false"
+ filterable
+ style="width: 200px"
+ placeholder="璇烽�夋嫨"
+ >
+ <el-option
+ v-for="item in departmentArr"
:key="item.code"
:label="item.name"
:value="item.code"
@@ -549,8 +567,14 @@
<script>
import { PrentOrganizationNoCompany } from '@/api/GeneralBasicData'
-import { ProductInHouseOrderSearch } from '@/api/WorkOrder'
+import {
+ DeptSelectData,
+ ProductInHouseOrderCodeSearch,
+ ProductInHouseOrderSearch,
+ ProductInHouseOrderSeave
+} from '@/api/WorkOrder'
import { TSecLocaTree } from '@/api/basicSettings'
+import { handleDatetime, handleDatetime2 } from '@/utils/global'
export default {
name: 'ProductWarehouse',
@@ -561,8 +585,8 @@
tableHeight: 0,
form: {
hbillno: '', // 鍏ュ簱鍗曞彿
- // incbit: '', // 娴佹按鍙�
- documentType: 'Y', // 鍗曟嵁绫诲瀷
+ incbit: '', // 娴佹按鍙�
+ hbdate: new Date(), // 鍏ュ簱鍗曟棩鏈�
saleordercode: '', // 閿�鍞崟鍙�
wkshopcode: '', // 鐢熶骇杞﹂棿
@@ -572,6 +596,7 @@
partname: '', // 浜у搧鍚嶇О
partspec: '', // 瑙勬牸鍨嬪彿
+ deptno: '', // 鍏ュ簱閮ㄩ棬
saleOrderCode: '', // 閿�鍞鍗�
stockcode: '' // 鍏ュ簱浠撳簱
@@ -581,6 +606,7 @@
multipleSelection: [],
stockcodeArr: [], // 鍏ュ簱浠撳簱鏁扮粍
WorkShopArr: [], // 鐢熶骇杞﹂棿鏁扮粍
+ departmentArr: [], // 鍏ュ簱閮ㄩ棬
tabClickIndex: null, // 鐐瑰嚮鐨勫崟鍏冩牸
tabClickLabel: '', // 褰撳墠鐐瑰嚮鐨勫垪鍚�
@@ -598,10 +624,23 @@
this.getPrentOrganizationNoCompany()
this.getTSecLocaTree()
+ this.getProductInHouseOrderCodeSearch()
+ this.getDeptSelectData()
this.getProductInHouseOrderSearch()
},
methods: {
+ // 鑾峰彇鍏ュ簱閮ㄩ棬
+ async getDeptSelectData() {
+ const { data: res } = await DeptSelectData()
+ this.departmentArr = res
+ },
+ // 鑾峰彇鍗曟嵁缂栧彿(鍏ュ簱鍗曞彿)銆佹祦姘村彿
+ async getProductInHouseOrderCodeSearch() {
+ const { data: res } = await ProductInHouseOrderCodeSearch({ rightcode: '0604' })
+ this.form.hbillno = res[0]
+ this.form.incbit = res[1]
+ },
// 鑾峰彇浠撳簱淇℃伅
async getTSecLocaTree() {
const { data: res } = await TSecLocaTree()
@@ -637,12 +676,77 @@
},
// 澶嶉�夋鍒囨崲
- handleSelectionChange() {
-
+ handleSelectionChange(val) {
+ this.multipleSelection = val
},
// 閫掍氦
- submit() {
+ async submit() {
+ // usercode
+ // console.log(localStorage.getItem('username'))
+ if (this.multipleSelection.length === 0) {
+ return this.$message.info('璇峰厛鍕鹃�夊崟鎹紒')
+ }
+ if (this.form.stockcode === '') {
+ return this.$message.info('鍏ュ簱浠撳簱涓嶈兘涓虹┖锛�')
+ }
+ if (this.form.deptno === '') {
+ return this.$message.info('鍏ュ簱閮ㄩ棬涓嶈兘涓虹┖锛�')
+ }
+
+ const TableDetailData = []
+ this.multipleSelection.forEach((i, index) => {
+ TableDetailData.push({
+ 'hbillno': this.form.hbillno, // 鍏ュ簱鍗曞彿
+ 'rownumber': (index + 1).toString(), // 琛屽彿
+ 'inbarcode': i.inbarcode, // 鍏ュ簱鏉$爜
+ 'mo_id': i.sbid.toString(), // 璁㈠崟id(琛屽彿)
+ 'mo_no': i.m_po, // 璁㈠崟鍙�
+ 'wocode': i.wo_code, // 宸ュ崟鍙�
+ 'partcode': i.partcode, // 浜у搧缂栫爜
+ 'unitcode': i.unitcode, // 鍗曚綅缂栫爜
+ 'unit_rate': '1', // 鍗曚綅鎹㈢畻鐜�
+ 'stockcode': i.stockcode, // 浠撳簱缂栫爜
+ // 'qty': i.qty.toString(), // 鍏ュ簱鏁伴噺
+ 'qty': i.good_qty.toString(), // 鍏ュ簱鏁伴噺
+ 'price': '0', // 鍏ュ簱鍗曚环
+ 'saleid': i.saleOrderDetailId.toString(), // 閿�鍞崟id(琛屽彿)
+ 'salecode': i.saleOrderCode, // 閿�鍞崟鍙�
+ 'status': '0', // 鍏ュ簱鍗曠姸鎬侊細0(鏈鏍�) 1(宸插鏍�)
+ 'stepcode': i.step_code, // 宸ュ簭缂栫爜
+ 'style': i.style// 鎶ュ伐绫诲瀷锛欱(鑷埗) S(澶栧崗)
+ })
+ })
+ const data = {
+ 'rightcode': '0604', // 鍔熻兘缂栧彿
+ 'incbit': this.form.incbit, // 娴佹按鍙�
+ 'TableData': [
+ [
+ {
+ 'hbillno': this.form.hbillno, // 鍏ュ簱鍗曞彿
+ 'hbdate': handleDatetime(this.form.hbdate),
+ 'deptno': this.form.deptno, // 鍏ュ簱閮ㄩ棬
+ 'storehouse_code': this.form.stockcode, // 浠撳簱缂栫爜
+ 'status': '0', // 鍏ュ簱鍗曠姸鎬侊細0(鏈鏍�) 1(宸插鏍�)
+ 'remark': '', // 澶囨敞
+ 'create_user': localStorage.getItem('username'), // 鍒涘缓浜哄憳
+ 'create_date': handleDatetime2(new Date()),
+ 'check_user': '', // 瀹℃牳浜哄憳
+ 'check_date': ''// 瀹℃牳鏃堕棿
+ }
+ ],
+ TableDetailData// 琛ㄤ綋
+ ]
+ }
+
+ const res = await ProductInHouseOrderSeave(data)
+ if (res.code === '200') {
+ this.multipleSelection = []
+ this.form.deptno = ''
+ this.form.stockcode = ''
+ await this.getProductInHouseOrderSearch()
+ await this.getProductInHouseOrderCodeSearch()
+ }
},
// 閲嶇疆
reset() {
--
Gitblit v1.9.3