|
@@ -4,9 +4,9 @@
|
|
label-width="120px" inline class="change-form">
|
|
label-width="120px" inline class="change-form">
|
|
<h3 style="width: 100%;">库存报损</h3>
|
|
<h3 style="width: 100%;">库存报损</h3>
|
|
<el-form-item label="报损时间" prop="report_time" class="change-form-item">
|
|
<el-form-item label="报损时间" prop="report_time" class="change-form-item">
|
|
- <span v-if="id">{{ goodsInventoryAddForm.report_time }}</span>
|
|
|
|
- <el-date-picker v-else v-model="goodsInventoryAddForm.report_time" value-format="yyyy-MM-dd HH:mm:ss" type="datetime"
|
|
|
|
- :disabled="type === 'detail' || type === 'audit'" placeholder="选择日期时间">
|
|
|
|
|
|
+ <span v-if="type == 'detail'">{{ goodsInventoryAddForm.report_time }}</span>
|
|
|
|
+ <el-date-picker v-else v-model="goodsInventoryAddForm.report_time" value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
+ type="datetime" :disabled="type === 'detail' || type === 'audit'" placeholder="选择日期时间">
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="所属部门" prop="dept_id" class="change-form-item">
|
|
<!-- <el-form-item label="所属部门" prop="dept_id" class="change-form-item">
|
|
@@ -19,35 +19,36 @@
|
|
}" clearable @change="changewarehouseList"></el-cascader>
|
|
}" clearable @change="changewarehouseList"></el-cascader>
|
|
</el-form-item> -->
|
|
</el-form-item> -->
|
|
<el-form-item label="仓库" prop="warehouse_id" class="change-form-item">
|
|
<el-form-item label="仓库" prop="warehouse_id" class="change-form-item">
|
|
- <span v-if="id">{{ getWarehouse(goodsInventoryAddForm.warehouse_id) }}</span>
|
|
|
|
|
|
+ <span v-if="type == 'detail'">{{ getWarehouse(goodsInventoryAddForm.warehouse_id) }}</span>
|
|
<el-select v-else v-model="goodsInventoryAddForm.warehouse_id" @change="cleanGoodsList"
|
|
<el-select v-else v-model="goodsInventoryAddForm.warehouse_id" @change="cleanGoodsList"
|
|
:disabled="type === 'detail' || type === 'audit'">
|
|
:disabled="type === 'detail' || type === 'audit'">
|
|
<el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
|
|
<el-option v-for="item in warehouseList" :key="item.id" :label="item.name" :value="item.id" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="报损类型" prop="damage_type_value" class="change-form-item">
|
|
|
|
- <span v-if="id">{{ getRoleSplit(goodsInventoryAddForm.damage_type_value) }}</span>
|
|
|
|
- <el-select v-model="goodsInventoryAddForm.damage_type_value" :disabled="type === 'detail' || type === 'audit'">
|
|
|
|
|
|
+ <el-form-item label="报损类型" prop="damage_type_value" class="change-form-item">
|
|
|
|
+ <span v-if="type == 'detail'">{{ getRoleSplit(goodsInventoryAddForm.damage_type_value) }}</span>
|
|
|
|
+ <el-select v-else v-model="goodsInventoryAddForm.damage_type_value"
|
|
|
|
+ :disabled="type === 'detail' || type === 'audit'">
|
|
<el-option v-for="item in roleSplit" :key="item.label" :label="item.label" :value="item.value" />
|
|
<el-option v-for="item in roleSplit" :key="item.label" :label="item.label" :value="item.value" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="制单人" prop="creator_id" class="change-form-item">
|
|
<el-form-item label="制单人" prop="creator_id" class="change-form-item">
|
|
- <span v-if="id">{{ getadminList(goodsInventoryAddForm.creator_id) }}</span>
|
|
|
|
- <el-select v-else
|
|
|
|
- v-model="goodsInventoryAddForm.creator_id"
|
|
|
|
- :disabled="type === 'detail' || type === 'audit'"
|
|
|
|
|
|
+ <span v-if="type == 'detail'">{{ getadminList(goodsInventoryAddForm.creator_id) }}</span>
|
|
|
|
+ <el-select v-else v-model="goodsInventoryAddForm.creator_id" :disabled="type === 'detail' || type === 'audit'"
|
|
@change="changeCreator">
|
|
@change="changeCreator">
|
|
<el-option v-for="item in adminList" :key="item.id" :label="item.real_name" :value="item.id" />
|
|
<el-option v-for="item in adminList" :key="item.id" :label="item.real_name" :value="item.id" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="报损说明" prop="report_desc" class="change-form-item" style="width: 61%;">
|
|
<el-form-item label="报损说明" prop="report_desc" class="change-form-item" style="width: 61%;">
|
|
- <span v-if="id">{{ goodsInventoryAddForm.report_desc }}</span>
|
|
|
|
- <el-input style="flex: 1;" v-else v-model="goodsInventoryAddForm.report_desc" type="textarea"
|
|
|
|
|
|
+ <span v-if="type == 'detail'">{{ goodsInventoryAddForm.report_desc }}</span>
|
|
|
|
+ <el-input v-else style="flex: 1;" v-model="goodsInventoryAddForm.report_desc" type="textarea"
|
|
:disabled="type === 'detail' || type === 'audit'" :autosize="{ minRows: 3, maxRows: 4 }"
|
|
:disabled="type === 'detail' || type === 'audit'" :autosize="{ minRows: 3, maxRows: 4 }"
|
|
placeholder="请输入报损说明"></el-input>
|
|
placeholder="请输入报损说明"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<div class="mx">
|
|
<div class="mx">
|
|
<h3>报损商品明细</h3>
|
|
<h3>报损商品明细</h3>
|
|
|
|
+ <el-button v-if=" type == 'edit'" class="button" size="mini" type="primary"
|
|
|
|
+ @click="scanCode">录入SKU</el-button>
|
|
<el-button v-if="type !== 'detail'" class="button" size="mini" type="primary"
|
|
<el-button v-if="type !== 'detail'" class="button" size="mini" type="primary"
|
|
@click="handleSelectWarehouseEntryBatch">选择</el-button>
|
|
@click="handleSelectWarehouseEntryBatch">选择</el-button>
|
|
</div>
|
|
</div>
|
|
@@ -59,8 +60,8 @@
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
{{ scope.row.stock_sn }}
|
|
{{ scope.row.stock_sn }}
|
|
</template>
|
|
</template>
|
|
- </el-table-column> -->
|
|
|
|
- <el-table-column label="商品编号">
|
|
|
|
|
|
+</el-table-column> -->
|
|
|
|
+ <el-table-column label="商品编号">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span v-if="id"> {{ scope.row.goods_vo.sn }}</span>
|
|
<span v-if="id"> {{ scope.row.goods_vo.sn }}</span>
|
|
<span v-else>{{ scope.row.goods_vo.sn }}</span>
|
|
<span v-else>{{ scope.row.goods_vo.sn }}</span>
|
|
@@ -72,6 +73,20 @@
|
|
<span v-else>{{ scope.row.goods_vo.name }}</span>
|
|
<span v-else>{{ scope.row.goods_vo.name }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column label="sku">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.product_vo.sku }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="序列号" v-if="sn_code_list">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div class="sn-code-container">
|
|
|
|
+ <span v-for="item in scope.row.sn_code_list" :key="item.id">
|
|
|
|
+ <p>{{ item.sn_code }}</p>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column prop="product_vo.spec_name" label="规格型号">
|
|
<el-table-column prop="product_vo.spec_name" label="规格型号">
|
|
<!-- <template slot-scope="scope">
|
|
<!-- <template slot-scope="scope">
|
|
<span v-if="!id">{{ scope.row.product_vo.spec_name.join("/") }}</span>
|
|
<span v-if="!id">{{ scope.row.product_vo.spec_name.join("/") }}</span>
|
|
@@ -81,7 +96,7 @@
|
|
<el-table-column label="单位">
|
|
<el-table-column label="单位">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span v-if="!id"> {{ scope.row.product_vo.unit }}</span>
|
|
<span v-if="!id"> {{ scope.row.product_vo.unit }}</span>
|
|
- <span v-else> {{ scope.row.product_vo.unit }}</span>
|
|
|
|
|
|
+ <span v-else> {{ scope.row.product_vo.unit }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="库存数量">
|
|
<el-table-column label="库存数量">
|
|
@@ -99,10 +114,16 @@
|
|
</el-table-column> -->
|
|
</el-table-column> -->
|
|
<el-table-column label="报损数量">
|
|
<el-table-column label="报损数量">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-input v-model="scope.row.report_num" type="number" :min="0" :maxlength="20"
|
|
|
|
|
|
+ <span v-if="type == 'edit'">{{ scope.row.num }}</span>
|
|
|
|
+ <el-input v-else v-model="scope.row.num" type="number" :min="0" :maxlength="20"
|
|
:disabled="type === 'detail' || type === 'audit'"></el-input>
|
|
:disabled="type === 'detail' || type === 'audit'"></el-input>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column label="录入数量" v-if="type == 'edit'">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ scope.row.report_num }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<!-- <el-table-column label="调整说明">
|
|
<!-- <el-table-column label="调整说明">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-input v-model="scope.row.report_remark" :min="0" :maxlength="50"
|
|
<el-input v-model="scope.row.report_remark" :min="0" :maxlength="50"
|
|
@@ -124,15 +145,35 @@
|
|
</el-button>
|
|
</el-button>
|
|
<el-button v-if="type === 'audit'" type="danger" @click="dialogVisible = true">审核驳回
|
|
<el-button v-if="type === 'audit'" type="danger" @click="dialogVisible = true">审核驳回
|
|
</el-button> -->
|
|
</el-button> -->
|
|
- <el-button v-if="type !== 'audit' && type !== 'detail'" type="primary" @click="submitGoodsInventoryAddForm">保存
|
|
|
|
|
|
+ <el-button v-if="type !== 'edit'&& type !== 'audit' && type !== 'detail' && checkPermission(['goodsInventoryLoss:submit'])"
|
|
|
|
+ type="primary" @click="submitGoodsInventoryAddForm">保存
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button v-if="type === 'edit' && checkPermission(['goodsInventoryLoss:submit'])"
|
|
|
|
+ type="primary" @click="submitcont">确认
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button @click="printIng" v-if="type=='detail'">打印</el-button>
|
|
|
|
|
|
+ <el-button @click="printIng" v-if="type == 'detail'">打印</el-button>
|
|
<el-button @click="$router.back()">返回
|
|
<el-button @click="$router.back()">返回
|
|
</el-button>
|
|
</el-button>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
|
|
+ <el-dialog title="扫码出库" :visible.sync="scanDialogVisible" width="30%" :close-on-click-modal="false">
|
|
|
|
+ <el-form ref="scanGoodsForm" :model="scanGoodsForm" inline>
|
|
|
|
+ <el-form-item label="sku" prop="bar_code">
|
|
|
|
+ <el-input v-model="scanGoodsForm.bar_code" ref="input" @keyup.enter.native="toSearch()" :minlength="0"
|
|
|
|
+ :maxlength="100"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="序列号" prop="sn_code">
|
|
|
|
+ <el-input v-model="sn_code" ref="sn_input" @keyup.enter.native="toSnCode()" :minlength="0"
|
|
|
|
+ :maxlength="100"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <!-- <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="handleRejectGoodsExchange()">确 定</el-button> -->
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
|
|
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
|
|
- <el-form ref="goodsInventoryAddForm" :model="goodsInventoryAddForm" label-width="120px" inline style="width:900px">
|
|
|
|
|
|
+ <el-form ref="goodsInventoryAddForm" :model="goodsInventoryAddForm" label-width="120px" inline
|
|
|
|
+ style="width:900px">
|
|
<el-form-item label="驳回原因" prop="reject_reason">
|
|
<el-form-item label="驳回原因" prop="reject_reason">
|
|
<el-input v-model="goodsInventoryAddForm.reject_reason" type="textarea" :minlength="0"
|
|
<el-input v-model="goodsInventoryAddForm.reject_reason" type="textarea" :minlength="0"
|
|
:maxlength="100"></el-input>
|
|
:maxlength="100"></el-input>
|
|
@@ -150,6 +191,7 @@
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
import { Foundation, RegExp } from '~/ui-utils'
|
|
import { Foundation, RegExp } from '~/ui-utils'
|
|
import * as API_GoodsInventoryLossLoss from '@/api/goodsInventoryLoss'
|
|
import * as API_GoodsInventoryLossLoss from '@/api/goodsInventoryLoss'
|
|
|
|
+import * as API_GoodsExchange from "@/api/goodsExchange";
|
|
import * as API_Setting from '@/api/setting'
|
|
import * as API_Setting from '@/api/setting'
|
|
import * as API_BasicSetting from '@/api/basicSetting'
|
|
import * as API_BasicSetting from '@/api/basicSetting'
|
|
import * as API_Erp from '@/api/erp'
|
|
import * as API_Erp from '@/api/erp'
|
|
@@ -189,7 +231,13 @@ export default {
|
|
dept_id: { required: true, message: '请选择所属部门', trigger: 'change' },
|
|
dept_id: { required: true, message: '请选择所属部门', trigger: 'change' },
|
|
creator_id: { required: true, message: '请选择制单人', trigger: 'change' }
|
|
creator_id: { required: true, message: '请选择制单人', trigger: 'change' }
|
|
},
|
|
},
|
|
- warehouseProduct: null
|
|
|
|
|
|
+ warehouseProduct: null,
|
|
|
|
+ scanDialogVisible: false,
|
|
|
|
+ sn_code: "",
|
|
|
|
+ sku: "",
|
|
|
|
+ sn_code_list: [],
|
|
|
|
+ index: "",
|
|
|
|
+ scanGoodsForm: {},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -197,12 +245,14 @@ export default {
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
if (this.$route.name === 'goodsInventoryLossEdit') {
|
|
if (this.$route.name === 'goodsInventoryLossEdit') {
|
|
|
|
+ console.log(112);
|
|
this.type = 'edit'
|
|
this.type = 'edit'
|
|
} else if (this.$route.name === 'goodsInventoryLossAudit') {
|
|
} else if (this.$route.name === 'goodsInventoryLossAudit') {
|
|
this.type = 'audit'
|
|
this.type = 'audit'
|
|
} else if (this.$route.name === 'goodsInventoryLossReturn') {
|
|
} else if (this.$route.name === 'goodsInventoryLossReturn') {
|
|
this.type = 'return'
|
|
this.type = 'return'
|
|
} else if (this.$route.name === 'goodsInventoryLossAdd') {
|
|
} else if (this.$route.name === 'goodsInventoryLossAdd') {
|
|
|
|
+ this.type = 'add'
|
|
this.goodsInventoryAddForm.creator_id = this.user.uid
|
|
this.goodsInventoryAddForm.creator_id = this.user.uid
|
|
this.goodsInventoryAddForm.dept_id = this.user.dept_id
|
|
this.goodsInventoryAddForm.dept_id = this.user.dept_id
|
|
this.GET_WarehouseList({ dept_id: this.user.dept_id })
|
|
this.GET_WarehouseList({ dept_id: this.user.dept_id })
|
|
@@ -214,15 +264,151 @@ export default {
|
|
this.id = this.$route.params.id
|
|
this.id = this.$route.params.id
|
|
this.GET_goodsInventoryAddDetail()
|
|
this.GET_goodsInventoryAddDetail()
|
|
}
|
|
}
|
|
- this.GET_AdministratorList()
|
|
|
|
this.GET_DeptList()
|
|
this.GET_DeptList()
|
|
this.GET_DictDataInfo()
|
|
this.GET_DictDataInfo()
|
|
|
|
+ this.GET_WarehouseList({ dept_id: this.user.dept_id })
|
|
|
|
+ this.GET_AdministratorList()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 扫码出库
|
|
|
|
+ scanCode() {
|
|
|
|
+ this.scanDialogVisible = true;
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.input.focus();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /* 出库扫码 */
|
|
|
|
+ toSearch() {
|
|
|
|
+ API_GoodsExchange.getProduct(
|
|
|
|
+ this.goodsInventoryAddForm.warehouse_id,
|
|
|
|
+ this.scanGoodsForm.bar_code.replace(/\s+/g, '')
|
|
|
|
+ ).then((res) => {
|
|
|
|
+ res.sn_code_list = []
|
|
|
|
+ this.sku = res.product_vo.sku;
|
|
|
|
+ // 查找当前商品是否已存在于列表中
|
|
|
|
+ const indexs = this.goodsInventoryAddForm.product_list.findIndex((el) => {
|
|
|
|
+ return (
|
|
|
|
+ el.goods_vo.id === res.goods_id &&
|
|
|
|
+ el.product_id === res.product_id &&
|
|
|
|
+ el.product_vo.sku === res.product_vo.sku
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+ // 如果商品不存在,则添加到列表
|
|
|
|
+ if (indexs === -1) {
|
|
|
|
+ // 检查是否有相同商品在product_list中
|
|
|
|
+ const existingProduct = this.goodsInventoryAddForm.product_list.find(el => (
|
|
|
|
+ el.goods_vo.id === res.goods_id &&
|
|
|
|
+ el.product_id === res.product_id &&
|
|
|
|
+ el.product_vo.sku === res.product_vo.sku
|
|
|
|
+ ));
|
|
|
|
+
|
|
|
|
+ if (!existingProduct) {
|
|
|
|
+ this.$message.error('订单内没有该商品,请重新录入');
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.input.focus();
|
|
|
|
+ });
|
|
|
|
+ return; // 退出函数,不继续执行
|
|
|
|
+ }
|
|
|
|
+ this.index = this.goodsInventoryAddForm.product_list.length
|
|
|
|
+ this.goodsInventoryAddForm.product_list.push(res);
|
|
|
|
+ } else {
|
|
|
|
+ this.index = indexs
|
|
|
|
+ }
|
|
|
|
+ if (res.product_vo.have_sn) {
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.sn_input.focus();
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.goodsInventoryAddForm.product_list[this.index].report_num += 1
|
|
|
|
+ if( this.goodsInventoryAddForm.product_list[this.index].report_num==this.goodsInventoryAddForm.product_list[this.index].num){
|
|
|
|
+ this.scanDialogVisible = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ //扫序列号goodsInventoryAddForm.product_list[this.index].sn_code_list
|
|
|
|
+ toSnCode() {
|
|
|
|
+ if (this.sku == '') return this.$message.error('请录入正确的sku')
|
|
|
|
+ API_GoodsExchange.getSnCode("out", this.sku, this.sn_code.replace(/\s+/g, '')).then((res) => {
|
|
|
|
+ this.sn_code = "";
|
|
|
|
+ // 假设res是一个对象,我们根据res的某个属性(如sn)来检查重复
|
|
|
|
+ let exists = this.goodsInventoryAddForm.product_list[
|
|
|
|
+ this.index
|
|
|
|
+ ].sn_code_list.find(
|
|
|
|
+ (item) => item.sn_code === res.sn_code && item.sku === res.sku
|
|
|
|
+ );
|
|
|
|
+ if (!exists) {
|
|
|
|
+ this.goodsInventoryAddForm.product_list[this.index].sn_code_list.push(
|
|
|
|
+ res
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ this.goodsInventoryAddForm.product_list[this.index].report_num = this.goodsInventoryAddForm.product_list[this.index].sn_code_list.length
|
|
|
|
+ const indexs = this.product_list.findIndex((el) => {
|
|
|
|
+ return (
|
|
|
|
+ el.goods_id === res.goods_id &&
|
|
|
|
+ el.product_id === res.product_id &&
|
|
|
|
+ el.product_vo.sku === res.sku
|
|
|
|
+ );
|
|
|
|
+ });
|
|
|
|
+ this.goodsInventoryAddForm.product_list[this.index].id = this.product_list[indexs].id
|
|
|
|
+ if (this.goodsInventoryAddForm.product_list[this.index].report_num == this.product_list[indexs].report_num) {
|
|
|
|
+ this.scanGoodsForm.bar_code = "";
|
|
|
|
+ this.scanDialogVisible = false;
|
|
|
|
+ } else {
|
|
|
|
+ this.scanGoodsForm.bar_code = "";
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.input.focus();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /* 确认 */
|
|
|
|
+ submitcont(){
|
|
|
|
+ this.$refs['goodsInventoryAddForm'].validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ const { id } = this.goodsInventoryAddForm
|
|
|
|
+ const params = this.MixinClone(this.goodsInventoryAddForm)
|
|
|
|
+ if (params.dept_id) {
|
|
|
|
+ params.dept_name = this.deptListAll.find(dept => dept.id === params.dept_id).name
|
|
|
|
+ }
|
|
|
|
+ if (params.warehouse_id) {
|
|
|
|
+ params.warehouse_name = this.warehouseList.find(ware => ware.id === params.warehouse_id).name
|
|
|
|
+ }
|
|
|
|
+ /* params.report_time = Math.floor(params.report_time / 1000) */
|
|
|
|
+ if (params.damage_type_value) {
|
|
|
|
+ params.damage_type_key = this.roleSplit.find(ware => ware.value === params.damage_type_value).label
|
|
|
|
+ }
|
|
|
|
+ if (params.creator_id) {
|
|
|
|
+ params.creator = this.adminList.find(admin => admin.id === params.creator_id).real_name
|
|
|
|
+ }
|
|
|
|
+ params.product_list = params.product_list.map(item => {
|
|
|
|
+ const query = {
|
|
|
|
+ report_num: item.report_num,
|
|
|
|
+ product_id: item.product_id,
|
|
|
|
+ product_stock_id: item.product_stock_id
|
|
|
|
+ }
|
|
|
|
+ return query
|
|
|
|
+ })
|
|
|
|
+ API_GoodsInventoryLossLoss.submit(id, params).then(response => {
|
|
|
|
+ this.$message.success('确认成功!')
|
|
|
|
+ const { callback } = this.$route.params
|
|
|
|
+ if (typeof callback === 'function') callback()
|
|
|
|
+ this.$store.dispatch('delCurrentViews', {
|
|
|
|
+ view: this.$route,
|
|
|
|
+ $router: this.$router
|
|
|
|
+ })
|
|
|
|
+ this.$router.push({ name: 'goodsInventoryLoss' })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
getadminList(value) {
|
|
getadminList(value) {
|
|
// Access orderTypeList directly from the component's data
|
|
// Access orderTypeList directly from the component's data
|
|
const type = this.adminList.find(type => type.id === value);
|
|
const type = this.adminList.find(type => type.id === value);
|
|
- return type ? type.name : '未知类型';
|
|
|
|
|
|
+ return type ? type.real_name : '未知类型';
|
|
},
|
|
},
|
|
getRoleSplit(value) {
|
|
getRoleSplit(value) {
|
|
// Access orderTypeList directly from the component's data
|
|
// Access orderTypeList directly from the component's data
|
|
@@ -231,11 +417,11 @@ export default {
|
|
},
|
|
},
|
|
getWarehouse(value) {
|
|
getWarehouse(value) {
|
|
// Access orderTypeList directly from the component's data
|
|
// Access orderTypeList directly from the component's data
|
|
- const type = this.WarehouseList.find(type => type.id === value);
|
|
|
|
|
|
+ const type = this.warehouseList.find(type => type.id === value);
|
|
return type ? type.name : '未知类型';
|
|
return type ? type.name : '未知类型';
|
|
},
|
|
},
|
|
// 打印功能
|
|
// 打印功能
|
|
- printIng(){
|
|
|
|
|
|
+ printIng() {
|
|
|
|
|
|
},
|
|
},
|
|
/** 修改报单人 */
|
|
/** 修改报单人 */
|
|
@@ -301,7 +487,7 @@ export default {
|
|
},
|
|
},
|
|
/** 获取仓库 */
|
|
/** 获取仓库 */
|
|
GET_WarehouseList(e) {
|
|
GET_WarehouseList(e) {
|
|
- API_BasicSetting.getWarehouseListAll(e).then(response => {
|
|
|
|
|
|
+ API_BasicSetting.getWarehouseListAll().then(response => {
|
|
this.warehouseList = response
|
|
this.warehouseList = response
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -325,9 +511,9 @@ export default {
|
|
}
|
|
}
|
|
params.product_list = params.product_list.map(item => {
|
|
params.product_list = params.product_list.map(item => {
|
|
const query = {
|
|
const query = {
|
|
- report_num:item.report_num,
|
|
|
|
|
|
+ report_num: item.num,
|
|
product_id: item.product_id,
|
|
product_id: item.product_id,
|
|
- product_stock_id:item.id
|
|
|
|
|
|
+ product_stock_id: item.id
|
|
}
|
|
}
|
|
return query
|
|
return query
|
|
})
|
|
})
|
|
@@ -371,26 +557,26 @@ export default {
|
|
})
|
|
})
|
|
this.goodsInventoryAddForm.warehouse_id = goodsData.warehouse_id
|
|
this.goodsInventoryAddForm.warehouse_id = goodsData.warehouse_id
|
|
this.goodsInventoryAddForm.product_list = goodsData.purchasePlans
|
|
this.goodsInventoryAddForm.product_list = goodsData.purchasePlans
|
|
- /* .map(item => {
|
|
|
|
- const query = {
|
|
|
|
- stock_sn: item.warehouse_id,
|
|
|
|
- product_sn: item.product_sn,
|
|
|
|
- product_name: item.product_name,
|
|
|
|
- specification: item.warehouse_id,
|
|
|
|
- unit: item.product_unit,
|
|
|
|
- stock_num: item.remain_num,
|
|
|
|
- price: item.entry_price,
|
|
|
|
- cost_price: item.product_cost_price,
|
|
|
|
- tax_rate: item.tax_rate,
|
|
|
|
- batch_id: item.id,
|
|
|
|
- goods_id: item.goods_id,
|
|
|
|
- product_id: item.product_id,
|
|
|
|
- batch_sn: item.sn,
|
|
|
|
- category_id: item.category_id,
|
|
|
|
- category_name: item.category_name
|
|
|
|
- }
|
|
|
|
- return query
|
|
|
|
- }) */
|
|
|
|
|
|
+ /* .map(item => {
|
|
|
|
+ const query = {
|
|
|
|
+ stock_sn: item.warehouse_id,
|
|
|
|
+ product_sn: item.product_sn,
|
|
|
|
+ product_name: item.product_name,
|
|
|
|
+ specification: item.warehouse_id,
|
|
|
|
+ unit: item.product_unit,
|
|
|
|
+ stock_num: item.remain_num,
|
|
|
|
+ price: item.entry_price,
|
|
|
|
+ cost_price: item.product_cost_price,
|
|
|
|
+ tax_rate: item.tax_rate,
|
|
|
|
+ batch_id: item.id,
|
|
|
|
+ goods_id: item.goods_id,
|
|
|
|
+ product_id: item.product_id,
|
|
|
|
+ batch_sn: item.sn,
|
|
|
|
+ category_id: item.category_id,
|
|
|
|
+ category_name: item.category_name
|
|
|
|
+ }
|
|
|
|
+ return query
|
|
|
|
+ }) */
|
|
},
|
|
},
|
|
/** 获取部门 */
|
|
/** 获取部门 */
|
|
GET_DeptList() {
|
|
GET_DeptList() {
|
|
@@ -402,51 +588,58 @@ export default {
|
|
/** 获取详情页面数据 */
|
|
/** 获取详情页面数据 */
|
|
GET_goodsInventoryAddDetail() {
|
|
GET_goodsInventoryAddDetail() {
|
|
API_GoodsInventoryLossLoss.getGoodsInventoryLossInfo(this.id).then(response => {
|
|
API_GoodsInventoryLossLoss.getGoodsInventoryLossInfo(this.id).then(response => {
|
|
|
|
+ response.product_list.map(el => {
|
|
|
|
+ el.num = el.report_num
|
|
|
|
+ if (this.type == 'edit') {
|
|
|
|
+ el.report_num = 0
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ })
|
|
this.goodsInventoryAddForm = response
|
|
this.goodsInventoryAddForm = response
|
|
- this.GET_WarehouseList({ dept_id: response.dept_id })
|
|
|
|
|
|
+ /* this.GET_WarehouseList({ dept_id: response.dept_id }) */
|
|
/* this.goodsInventoryAddForm.report_time = Math.floor(this.goodsInventoryAddForm.report_time * 1000) */
|
|
/* this.goodsInventoryAddForm.report_time = Math.floor(this.goodsInventoryAddForm.report_time * 1000) */
|
|
this.goodsInventoryAddForm.distribution_name = response.staff_name
|
|
this.goodsInventoryAddForm.distribution_name = response.staff_name
|
|
- /*this.goodsInventoryAddForm.product_list = this.goodsInventoryAddForm.product_list.map(el => {
|
|
|
|
- item.product_specification = item.specification
|
|
|
|
- item.product_unit = item.unit
|
|
|
|
- item.remain_num = item.stock_num
|
|
|
|
|
|
+ /*this.goodsInventoryAddForm.product_list = this.goodsInventoryAddForm.product_list.map(el => {
|
|
|
|
+ item.product_specification = item.specification
|
|
|
|
+ item.product_unit = item.unit
|
|
|
|
+ item.remain_num = item.stock_num
|
|
|
|
|
|
- el.allow_sn=el.goods_vo.allow_sn
|
|
|
|
- el.bar_code=el.goods_vo.bar_code
|
|
|
|
- el.brand_id=el.goods_vo.brand_id
|
|
|
|
- el.brand_name=el.goods_vo.brand_name
|
|
|
|
- el.category_id=el.goods_vo.category_id
|
|
|
|
- el.category_ids=el.goods_vo.category_ids
|
|
|
|
- el.category_name=el.goods_vo.category_name
|
|
|
|
- el.cost_price=el.goods_vo.cost_price
|
|
|
|
- el.create_time=el.goods_vo.create_time
|
|
|
|
- el.creator=el.goods_vo.creator
|
|
|
|
- el.description=el.goods_vo.description
|
|
|
|
- el.en_name=el.goods_vo.en_name
|
|
|
|
- el.freight_template_id=el.goods_vo.freight_template_id
|
|
|
|
- el.goods_style=el.goods_vo.goods_style
|
|
|
|
- el.goods_unit=el.goods_vo.goods_unit
|
|
|
|
- el.goods_unit=el.goods_vo.goods_unit
|
|
|
|
- el.have_spec=el.goods_vo.have_spec
|
|
|
|
- el.hire_or_sail=el.goods_vo.hire_or_sail
|
|
|
|
- el.image=el.goods_vo.image
|
|
|
|
- el.image_list=el.goods_vo.image_list
|
|
|
|
- el.label_names=el.goods_vo.label_names
|
|
|
|
- el.market_enable=el.goods_vo.market_enable
|
|
|
|
- el.mkt_price=el.goods_vo.mkt_price
|
|
|
|
- el.name=el.goods_vo.name
|
|
|
|
- el.params_list=el.goods_vo.params_list
|
|
|
|
- el.price=el.goods_vo.price
|
|
|
|
- el.sn=el.goods_vo.sn
|
|
|
|
- el.sn_code=el.goods_vo.sn_code
|
|
|
|
- el.sort=el.goods_vo.sort
|
|
|
|
- el.update_time=el.goods_vo.update_time
|
|
|
|
- el.updater=el.goods_vo.updater
|
|
|
|
- el.usable_stock=el.goods_vo.usable_stock
|
|
|
|
- el.video=el.goods_vo.video
|
|
|
|
|
|
+ el.allow_sn=el.goods_vo.allow_sn
|
|
|
|
+ el.bar_code=el.goods_vo.bar_code
|
|
|
|
+ el.brand_id=el.goods_vo.brand_id
|
|
|
|
+ el.brand_name=el.goods_vo.brand_name
|
|
|
|
+ el.category_id=el.goods_vo.category_id
|
|
|
|
+ el.category_ids=el.goods_vo.category_ids
|
|
|
|
+ el.category_name=el.goods_vo.category_name
|
|
|
|
+ el.cost_price=el.goods_vo.cost_price
|
|
|
|
+ el.create_time=el.goods_vo.create_time
|
|
|
|
+ el.creator=el.goods_vo.creator
|
|
|
|
+ el.description=el.goods_vo.description
|
|
|
|
+ el.en_name=el.goods_vo.en_name
|
|
|
|
+ el.freight_template_id=el.goods_vo.freight_template_id
|
|
|
|
+ el.goods_style=el.goods_vo.goods_style
|
|
|
|
+ el.goods_unit=el.goods_vo.goods_unit
|
|
|
|
+ el.goods_unit=el.goods_vo.goods_unit
|
|
|
|
+ el.have_spec=el.goods_vo.have_spec
|
|
|
|
+ el.hire_or_sail=el.goods_vo.hire_or_sail
|
|
|
|
+ el.image=el.goods_vo.image
|
|
|
|
+ el.image_list=el.goods_vo.image_list
|
|
|
|
+ el.label_names=el.goods_vo.label_names
|
|
|
|
+ el.market_enable=el.goods_vo.market_enable
|
|
|
|
+ el.mkt_price=el.goods_vo.mkt_price
|
|
|
|
+ el.name=el.goods_vo.name
|
|
|
|
+ el.params_list=el.goods_vo.params_list
|
|
|
|
+ el.price=el.goods_vo.price
|
|
|
|
+ el.sn=el.goods_vo.sn
|
|
|
|
+ el.sn_code=el.goods_vo.sn_code
|
|
|
|
+ el.sort=el.goods_vo.sort
|
|
|
|
+ el.update_time=el.goods_vo.update_time
|
|
|
|
+ el.updater=el.goods_vo.updater
|
|
|
|
+ el.usable_stock=el.goods_vo.usable_stock
|
|
|
|
+ el.video=el.goods_vo.video
|
|
|
|
|
|
- return el
|
|
|
|
- })*/
|
|
|
|
|
|
+ return el
|
|
|
|
+ })*/
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|