|
|
@@ -14,7 +14,7 @@
|
|
|
></el-col> -->
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="出库物品类型" prop="extInfo.assetType">
|
|
|
- <DictSelection
|
|
|
+ <!-- <DictSelection
|
|
|
dictName="类型用途"
|
|
|
:disabled="
|
|
|
!!(warehousingMaterialList && warehousingMaterialList.length)
|
|
|
@@ -22,7 +22,22 @@
|
|
|
clearable
|
|
|
v-model="formData.extInfo.assetType"
|
|
|
@itemChange="handleChange"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
+ <el-select
|
|
|
+ :disabled="
|
|
|
+ !!(warehousingMaterialList && warehousingMaterialList.length)
|
|
|
+ "
|
|
|
+ clearable
|
|
|
+ v-model="formData.extInfo.assetType"
|
|
|
+ @change="handleChanges"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in codeList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictCode"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
@@ -243,8 +258,14 @@
|
|
|
>
|
|
|
<el-table-column label="序号" type="index" width="50">
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="物品编码" prop="code"></el-table-column>
|
|
|
- <el-table-column label="物品名称" prop="name"></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="物品编码"
|
|
|
+ prop="assetCode"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ label="物品名称"
|
|
|
+ prop="assetName"
|
|
|
+ ></el-table-column>
|
|
|
|
|
|
<el-table-column
|
|
|
v-for="(item, index) in tableHeader"
|
|
|
@@ -266,26 +287,31 @@
|
|
|
{{ row.materialId }}
|
|
|
</template>
|
|
|
</el-table-column> -->
|
|
|
- <el-table-column label="出库数量" prop="" align="center" width="350px">
|
|
|
+ <el-table-column
|
|
|
+ label="出库数量"
|
|
|
+ prop=""
|
|
|
+ align="center"
|
|
|
+ width="350px"
|
|
|
+ >
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
<el-row :gutter="4">
|
|
|
- <el-col :span="9">
|
|
|
+ <!-- <el-col :span="9">
|
|
|
<el-input type="text" :value="row.selfSum" disabled>
|
|
|
<template slot="append">
|
|
|
- {{ row.measuringUnit }}
|
|
|
+ {{ row.unit }}
|
|
|
</template>
|
|
|
</el-input></el-col
|
|
|
- >
|
|
|
+ > -->
|
|
|
<el-col :span="9" v-if="!row.isUnpack">
|
|
|
<el-input type="text" disabled :value="row.outInNum">
|
|
|
<template slot="append">
|
|
|
- {{ row.minUnit }}
|
|
|
+ {{ row.minPackUnit }}
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-button type="text" @click="handleSetting(row, $index)"
|
|
|
- >设置</el-button
|
|
|
+ >详情</el-button
|
|
|
></el-col
|
|
|
>
|
|
|
</el-row>
|
|
|
@@ -317,7 +343,7 @@
|
|
|
<el-table-column
|
|
|
:label="`${title}编码`"
|
|
|
min-width="100"
|
|
|
- prop="sourceBizNo"
|
|
|
+ prop="onlyCode"
|
|
|
></el-table-column>
|
|
|
<el-table-column
|
|
|
label="批次号"
|
|
|
@@ -326,14 +352,14 @@
|
|
|
<el-table-column label="生产日期" width="200">
|
|
|
<template slot-scope="{ row }">
|
|
|
<span v-if="row.dateType === 2">
|
|
|
- {{ row.dateValue }}
|
|
|
+ {{ row.manufactureTime }}
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="采购日期" width="200">
|
|
|
<template slot-scope="{ row }">
|
|
|
<span v-if="row.dateType === 1">
|
|
|
- {{ row.dateValue }}
|
|
|
+ {{ row.procurementtime }}
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -344,18 +370,14 @@
|
|
|
>
|
|
|
<template slot-scope="{ row, $index }">
|
|
|
<template v-if="!row.isUnpack">
|
|
|
- {{ row.minPackingCount }}{{ row.unit }}/{{
|
|
|
- row.minUnit
|
|
|
+ {{ row.measurementUnit }}{{ row.unit }}/{{
|
|
|
+ row.minPackUnit
|
|
|
}}</template
|
|
|
>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="包装编码" prop="num"></el-table-column>
|
|
|
- <el-table-column
|
|
|
- label="货位"
|
|
|
- prop="paths"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
+ <el-table-column label="货位" prop="num" show-overflow-tooltip>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="转消耗" prop="">
|
|
|
<template slot-scope="{ row }">
|
|
|
@@ -400,7 +422,7 @@
|
|
|
<script>
|
|
|
import outin from '@/api/warehouseManagement/outin';
|
|
|
import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
|
|
|
-
|
|
|
+ import { getTreeByPid } from '@/api/classifyManage';
|
|
|
import selectUpload from '@/components/selectUpload';
|
|
|
import upload from '@/components/uploadImg';
|
|
|
import {
|
|
|
@@ -433,6 +455,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ codeList: [],
|
|
|
materialType,
|
|
|
warehousingType,
|
|
|
outputSceneState,
|
|
|
@@ -489,7 +512,8 @@
|
|
|
}
|
|
|
},
|
|
|
options: [],
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ onSelectTableDataVal: []
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -498,6 +522,12 @@
|
|
|
},
|
|
|
// 条码信息
|
|
|
materialCodeReqList() {
|
|
|
+ console.log(
|
|
|
+ '===',
|
|
|
+ this.warehousingMaterialList
|
|
|
+ .map((i) => i.warehouseLedgerDetails || [])
|
|
|
+ .flat()
|
|
|
+ );
|
|
|
return this.warehousingMaterialList
|
|
|
.map((i) => i.warehouseLedgerDetails || [])
|
|
|
.flat();
|
|
|
@@ -653,7 +683,7 @@
|
|
|
if (row.isUnpack) {
|
|
|
return ++sum;
|
|
|
}
|
|
|
- return sum + pre.minPackingCount;
|
|
|
+ return sum + pre.measurementUnit;
|
|
|
}, 0)
|
|
|
);
|
|
|
});
|
|
|
@@ -747,7 +777,23 @@
|
|
|
|
|
|
this.saveLoading = true;
|
|
|
|
|
|
- const res = await outin.save(obj);
|
|
|
+ console.log('明细', this.warehousingMaterialList);
|
|
|
+ const categoryLevelId = this.$refs.assetsDialogRef.materialType;
|
|
|
+ let newObj = {
|
|
|
+ inOutAddPO: {
|
|
|
+ ...this.formData,
|
|
|
+ ...this.formData.extInfo,
|
|
|
+ bizStatus: 2
|
|
|
+ },
|
|
|
+ warehouseLedgerInfos: this.handelArr(
|
|
|
+ this.warehousingMaterialList,
|
|
|
+ categoryLevelId
|
|
|
+ )
|
|
|
+ };
|
|
|
+ delete newObj.inOutAddPO.extInfo;
|
|
|
+ console.log('2222', newObj);
|
|
|
+
|
|
|
+ const res = await outin.addInOut(newObj);
|
|
|
if (res.code == 0) {
|
|
|
this.$message.success('保存成功!');
|
|
|
}
|
|
|
@@ -755,15 +801,44 @@
|
|
|
this.saveLoading = false;
|
|
|
this.$router.push('/warehouseManagement/outgoingManagement');
|
|
|
|
|
|
- // if (res?.success) {
|
|
|
- // this.$message.success('保存成功!');
|
|
|
- // this.$router.go(-1);
|
|
|
- // }
|
|
|
+ if (res?.success) {
|
|
|
+ this.$message.success('保存成功!');
|
|
|
+ this.$router.go(-1);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ handelArr(arr, id) {
|
|
|
+ for (const key in arr) {
|
|
|
+ arr[key].inLedgerId = arr[key].id;
|
|
|
+ arr[key].categoryLevelId = id;
|
|
|
+ for (const k in arr[key].warehouseLedgerDetails) {
|
|
|
+ arr[key].warehouseLedgerDetails[k].ledgerDetailId =
|
|
|
+ arr[key].warehouseLedgerDetails[k].id;
|
|
|
+ arr[key].warehouseLedgerDetails[k].inDetailId = arr[key].inLedgerId;
|
|
|
+
|
|
|
+ arr[key].warehouseLedgerDetails[k].isTransferAsset = arr[key]
|
|
|
+ .warehouseLedgerDetails[k].isTransferAsset
|
|
|
+ ? 1
|
|
|
+ : 0;
|
|
|
+ arr[key].warehouseLedgerDetails[k].bizStatus = 2;
|
|
|
+ arr[key].warehouseLedgerDetails[k].categoryLevelId = id;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return arr;
|
|
|
+ // let newArr = arr.map((item) => {
|
|
|
+ // return { ...item, ledgerId: item.id };
|
|
|
+ // });
|
|
|
+ // newArr.map((item) => {
|
|
|
+ // item.warehouseLedgerDetails.map((ite) => {
|
|
|
+ // return { ...ite, ledgerDetailId: ite.id, ledgerId: item.id };
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // return newArr;
|
|
|
+ },
|
|
|
//添加明细
|
|
|
onSelectTableData(val) {
|
|
|
+ this.onSelectTableDataVal = val;
|
|
|
this.warehousingMaterialList = val.map((next) => {
|
|
|
delete next.updateTime;
|
|
|
delete next.createTime;
|
|
|
@@ -787,6 +862,10 @@
|
|
|
});
|
|
|
},
|
|
|
async initData() {
|
|
|
+ const { data } = await getTreeByPid(0);
|
|
|
+ this.codeList = data.map((item) => {
|
|
|
+ return { dictCode: item.id, dictValue: item.name };
|
|
|
+ });
|
|
|
const res = await warehouseDefinition.tree();
|
|
|
this.treeList = this.$util.toTreeData({
|
|
|
data: res,
|
|
|
@@ -801,8 +880,8 @@
|
|
|
this.fromUserList = res22.list;
|
|
|
|
|
|
// /
|
|
|
- const res111 = await warehouseDefinition.list();
|
|
|
- this.warehouseList = res111.list;
|
|
|
+ // const res111 = await warehouseDefinition.list();
|
|
|
+ // this.warehouseList = res111.list;
|
|
|
const info = JSON.parse(localStorage.getItem('info'));
|
|
|
let obj = res.find((item) => item.id === info.deptId);
|
|
|
this.formData.extInfo.deptName = obj.name;
|
|
|
@@ -827,6 +906,14 @@
|
|
|
this.formData.documentSource = '';
|
|
|
}
|
|
|
},
|
|
|
+ handleChanges(code) {
|
|
|
+ const data = this.codeList.find((item) => item.dictCode == code);
|
|
|
+ this.title = data?.dictValue;
|
|
|
+ this.selectEquiType = data?.dictCode;
|
|
|
+ if (this.formData.bizType == 4) {
|
|
|
+ this.formData.documentSource = '';
|
|
|
+ }
|
|
|
+ },
|
|
|
handleBizSceneChange() {
|
|
|
if (this.formData.extInfo.assetType == 7) {
|
|
|
this.formData.extInfo.documentSource = '';
|