fix:成品出入库
This commit is contained in:
@@ -20,13 +20,13 @@
|
|||||||
and der.sale_code = #{query.sale_code}
|
and der.sale_code = #{query.sale_code}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.status != null">
|
<if test="query.status != null">
|
||||||
and der.status >= #{query.status}
|
and der.status = #{query.status}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.sale_type != null">
|
<if test="query.sale_type != null">
|
||||||
and der.sale_type >= #{query.sale_type}
|
and der.sale_type = #{query.sale_type}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.cust_code != null">
|
<if test="query.cust_code != null">
|
||||||
and der.cust_code >= #{query.cust_code}
|
and der.cust_code = #{query.cust_code}
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
@@ -26,8 +26,10 @@ public enum IOSEnum {
|
|||||||
, "领料出库", "21", "销售出库", "22", "手工出库", "23")),
|
, "领料出库", "21", "销售出库", "22", "手工出库", "23")),
|
||||||
//单据状态
|
//单据状态
|
||||||
BILL_STATUS(MapOf.of("生成", "10", "分配中", "20", "分配完", "30", "完成", "99")),
|
BILL_STATUS(MapOf.of("生成", "10", "分配中", "20", "分配完", "30", "完成", "99")),
|
||||||
//单据状态
|
//分配单据状态
|
||||||
WORK_STATUS(MapOf.of("未生成", "00", "生成", "10", "执行中", "20", "完成", "99")),
|
WORK_STATUS(MapOf.of("未生成", "00", "生成", "10", "执行中", "20", "完成", "99")),
|
||||||
|
//订单/发货单 状态
|
||||||
|
ORDER_STATUS(MapOf.of("生成", "10", "提交", "20", "发货中", "30", "确认", "99")),
|
||||||
//锁定类型
|
//锁定类型
|
||||||
LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3","损溢锁", "4","其他锁","99")),
|
LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3","损溢锁", "4","其他锁","99")),
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostor
|
|||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvCpMapper;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvCpMapper;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dto.IostorInvQuery;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dto.IostorInvQuery;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.IStIfDeliveryorderCpService;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao.StIfDeliveryorderCp;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService;
|
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
|
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
|
||||||
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
|
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
|
||||||
@@ -113,6 +115,9 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected IMdPbBucketrecordService iMdPbBucketrecordService; // 包装箱记录表服务
|
protected IMdPbBucketrecordService iMdPbBucketrecordService; // 包装箱记录表服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIfDeliveryorderCpService iStIfDeliveryorderCpService; // 发货单服务
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object pageQuery(IostorInvQuery query, PageQuery page) {
|
public Object pageQuery(IostorInvQuery query, PageQuery page) {
|
||||||
// 查询条件
|
// 查询条件
|
||||||
@@ -184,6 +189,21 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
dao.setIs_delete(true);
|
dao.setIs_delete(true);
|
||||||
|
|
||||||
this.updateById(dao);
|
this.updateById(dao);
|
||||||
|
|
||||||
|
// 修改发货单状态
|
||||||
|
List<StIvtIostorinvdtlCp> list = iostorinvdtlCpService.list(
|
||||||
|
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
|
||||||
|
.eq(StIvtIostorinvdtlCp::getIostorinv_id, id)
|
||||||
|
);
|
||||||
|
|
||||||
|
list.forEach(item -> {
|
||||||
|
iStIfDeliveryorderCpService.update(
|
||||||
|
new UpdateWrapper<StIfDeliveryorderCp>().lambda()
|
||||||
|
.set(StIfDeliveryorderCp::getStatus, IOSEnum.ORDER_STATUS.code("生成"))
|
||||||
|
.eq(StIfDeliveryorderCp::getDeliver_id, item.getSource_billdtl_id())
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -366,6 +366,20 @@ public class StIvtIostorinvCpServiceImpl extends ServiceImpl<StIvtIostorinvCpMap
|
|||||||
dao.setIs_delete(true);
|
dao.setIs_delete(true);
|
||||||
|
|
||||||
this.updateById(dao);
|
this.updateById(dao);
|
||||||
|
|
||||||
|
// 修改销售单状态
|
||||||
|
List<StIvtIostorinvdtlCp> list = iostorinvdtlCpService.list(
|
||||||
|
new QueryWrapper<StIvtIostorinvdtlCp>().lambda()
|
||||||
|
.eq(StIvtIostorinvdtlCp::getIostorinv_id, id)
|
||||||
|
);
|
||||||
|
|
||||||
|
list.forEach(item -> {
|
||||||
|
iMpsSaleOrderService.update(
|
||||||
|
new UpdateWrapper<MpsSaleOrder>().lambda()
|
||||||
|
.set(MpsSaleOrder::getStatus, IOSEnum.ORDER_STATUS.code("生成"))
|
||||||
|
.eq(MpsSaleOrder::getSale_id, item.getBase_billdtl_id())
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,15 @@ import org.nl.wms.mps_manage.ordermanage.service.saleOrder.IMpsSaleOrderService;
|
|||||||
import org.nl.wms.mps_manage.ordermanage.service.saleOrder.dao.MpsSaleOrder;
|
import org.nl.wms.mps_manage.ordermanage.service.saleOrder.dao.MpsSaleOrder;
|
||||||
import org.nl.wms.storage_manage.IOSEnum;
|
import org.nl.wms.storage_manage.IOSEnum;
|
||||||
import org.nl.wms.storage_manage.IVTEnum;
|
import org.nl.wms.storage_manage.IVTEnum;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpService;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdtlCpService;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdtlCpService;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvCp;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdisCp;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdisCp;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.StIvtIostorinvdtlCp;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvdtlCpMapper;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.dao.mapper.StIvtIostorinvdtlCpMapper;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.IStIfDeliveryorderCpService;
|
||||||
|
import org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao.StIfDeliveryorderCp;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
@@ -57,6 +61,11 @@ public class StIvtIostorinvdtlCpServiceImpl extends ServiceImpl<StIvtIostorinvdt
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected IMpsSaleOrderService iMpsSaleOrderService; // 销售订单服务
|
protected IMpsSaleOrderService iMpsSaleOrderService; // 销售订单服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIvtIostorinvCpService iStIvtIostorinvCpService; // 主表服务
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IStIfDeliveryorderCpService iStIfDeliveryorderCpService; // 发货单服务
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void batchInsert(Collection<StIvtIostorinvdtlCp> list) {
|
public void batchInsert(Collection<StIvtIostorinvdtlCp> list) {
|
||||||
@@ -69,6 +78,8 @@ public class StIvtIostorinvdtlCpServiceImpl extends ServiceImpl<StIvtIostorinvdt
|
|||||||
public double create(JSONArray rows, String iostorinvCp_id) {
|
public double create(JSONArray rows, String iostorinvCp_id) {
|
||||||
double total_qty = 0;
|
double total_qty = 0;
|
||||||
|
|
||||||
|
StIvtIostorinvCp mstDao = iStIvtIostorinvCpService.getById(iostorinvCp_id);
|
||||||
|
|
||||||
if (rows.size()>0 && StringUtils.isNotEmpty(iostorinvCp_id)){
|
if (rows.size()>0 && StringUtils.isNotEmpty(iostorinvCp_id)){
|
||||||
// 先删除在插入
|
// 先删除在插入
|
||||||
this.remove(new QueryWrapper<StIvtIostorinvdtlCp>().eq("iostorinv_id", iostorinvCp_id));
|
this.remove(new QueryWrapper<StIvtIostorinvdtlCp>().eq("iostorinv_id", iostorinvCp_id));
|
||||||
@@ -94,6 +105,20 @@ public class StIvtIostorinvdtlCpServiceImpl extends ServiceImpl<StIvtIostorinvdt
|
|||||||
row.setBase_bill_code(orderDao.getSale_code());
|
row.setBase_bill_code(orderDao.getSale_code());
|
||||||
row.setBase_bill_type(orderDao.getSale_type());
|
row.setBase_bill_type(orderDao.getSale_type());
|
||||||
row.setBase_bill_table(orderDao.getSeq_no().toString());
|
row.setBase_bill_table(orderDao.getSeq_no().toString());
|
||||||
|
|
||||||
|
if (IOSEnum.IO_TYPE.code("入库").equals(mstDao.getIo_type())){
|
||||||
|
// 入库: 更新销售单状态
|
||||||
|
orderDao.setStatus(IOSEnum.ORDER_STATUS.code("提交"));
|
||||||
|
iMpsSaleOrderService.updateById(orderDao);
|
||||||
|
} else {
|
||||||
|
// 出库: 更新发货单状态
|
||||||
|
iStIfDeliveryorderCpService.update(
|
||||||
|
new UpdateWrapper<StIfDeliveryorderCp>().lambda()
|
||||||
|
.set(StIfDeliveryorderCp::getStatus, IOSEnum.ORDER_STATUS.code("提交"))
|
||||||
|
.eq(StIfDeliveryorderCp::getDeliver_id,row.getSource_billdtl_id())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
row.setIostorinv_id(iostorinvCp_id);
|
row.setIostorinv_id(iostorinvCp_id);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao;
|
package org.nl.wms.storage_manage.productmanage.service.moreOrLess.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
@@ -26,6 +27,7 @@ public class StIfDeliveryorderCp implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 发货单标识
|
* 发货单标识
|
||||||
*/
|
*/
|
||||||
|
@TableId
|
||||||
private String deliver_id;
|
private String deliver_id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ function CRUD(options) {
|
|||||||
reset: true
|
reset: true
|
||||||
},
|
},
|
||||||
// 自定义一些扩展属性
|
// 自定义一些扩展属性
|
||||||
props: {},
|
props: { size: 10 },
|
||||||
// 在主页准备
|
// 在主页准备
|
||||||
queryOnPresenterCreated: true,
|
queryOnPresenterCreated: true,
|
||||||
// 调试开关
|
// 调试开关
|
||||||
@@ -97,7 +97,7 @@ function CRUD(options) {
|
|||||||
// 页码
|
// 页码
|
||||||
page: 0,
|
page: 0,
|
||||||
// 每页数据条数
|
// 每页数据条数
|
||||||
size: 10,
|
size: options.props.size,
|
||||||
// 总数据条数
|
// 总数据条数
|
||||||
total: 0
|
total: 0
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -219,6 +219,7 @@
|
|||||||
|
|
||||||
<AddDtl
|
<AddDtl
|
||||||
:dialog-show.sync="dtlShow"
|
:dialog-show.sync="dtlShow"
|
||||||
|
:is-single="false"
|
||||||
@tableChanged="tableChanged2"
|
@tableChanged="tableChanged2"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -368,30 +369,33 @@ export default {
|
|||||||
this.nowrow.qty_unit_name = row.unit_name
|
this.nowrow.qty_unit_name = row.unit_name
|
||||||
this.nowrow.qty_unit_id = row.base_unit_id
|
this.nowrow.qty_unit_id = row.base_unit_id
|
||||||
},
|
},
|
||||||
tableChanged2(row) {
|
tableChanged2(rows) {
|
||||||
let same_mater = true
|
rows.forEach((row) => {
|
||||||
this.form.tableData.forEach((item) => {
|
debugger
|
||||||
if (item.base_bill_code === row.sale_code && item.base_bill_table === row.seq_no) {
|
let same_mater = true
|
||||||
same_mater = false
|
this.form.tableData.forEach((item) => {
|
||||||
|
if (item.base_bill_code === row.sale_code && item.base_bill_table === row.seq_no) {
|
||||||
|
same_mater = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (same_mater) {
|
||||||
|
const data = {}
|
||||||
|
data.material_id = row.material_id
|
||||||
|
data.material_code = row.material_code
|
||||||
|
data.material_name = row.material_name
|
||||||
|
data.material_spec = row.material_spec
|
||||||
|
data.plan_qty = row.sale_qty
|
||||||
|
data.qty_unit_name = row.qty_unit_name
|
||||||
|
data.qty_unit_id = row.qty_unit_id
|
||||||
|
data.base_billdtl_id = row.sale_id
|
||||||
|
data.base_bill_type = row.sale_type
|
||||||
|
data.base_bill_code = row.sale_code
|
||||||
|
data.base_bill_table = row.seq_no
|
||||||
|
data.edit = true
|
||||||
|
this.form.tableData.splice(-1, 0, data)
|
||||||
|
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (same_mater) {
|
|
||||||
const data = {}
|
|
||||||
data.material_id = row.material_id
|
|
||||||
data.material_code = row.material_code
|
|
||||||
data.material_name = row.material_name
|
|
||||||
data.material_spec = row.material_spec
|
|
||||||
data.plan_qty = row.sale_qty
|
|
||||||
data.qty_unit_name = row.qty_unit_name
|
|
||||||
data.qty_unit_id = row.qty_unit_id
|
|
||||||
data.base_billdtl_id = row.sale_id
|
|
||||||
data.base_bill_type = row.sale_type
|
|
||||||
data.base_bill_code = row.sale_code
|
|
||||||
data.base_bill_table = row.seq_no
|
|
||||||
data.edit = true
|
|
||||||
this.form.tableData.splice(-1, 0, data)
|
|
||||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
insertEvent(row) {
|
insertEvent(row) {
|
||||||
this.dtlShow = true
|
this.dtlShow = true
|
||||||
|
|||||||
@@ -61,10 +61,12 @@
|
|||||||
v-loading="crud.loading"
|
v-loading="crud.loading"
|
||||||
:data="crud.data"
|
:data="crud.data"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
|
@select="handleSelectionChange"
|
||||||
@selection-change="crud.selectionChangeHandler"
|
@selection-change="crud.selectionChangeHandler"
|
||||||
@current-change="clickChange"
|
@current-change="clickChange"
|
||||||
>
|
>
|
||||||
<el-table-column label="选择" width="55">
|
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||||
|
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||||
</template>
|
</template>
|
||||||
@@ -127,6 +129,10 @@ export default {
|
|||||||
},
|
},
|
||||||
opendtlParam: {
|
opendtlParam: {
|
||||||
type: Object
|
type: Object
|
||||||
|
},
|
||||||
|
isSingle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -150,6 +156,7 @@ export default {
|
|||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
open() {
|
open() {
|
||||||
|
this.query.status = '10'
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
@@ -158,10 +165,31 @@ export default {
|
|||||||
clickChange(item) {
|
clickChange(item) {
|
||||||
this.tableRadio = item
|
this.tableRadio = item
|
||||||
},
|
},
|
||||||
|
handleSelectionChange(val, row) {
|
||||||
|
if (this.isSingle) {
|
||||||
|
if (val.length > 1) {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
this.$refs.table.toggleRowSelection(val.pop())
|
||||||
|
} else {
|
||||||
|
this.checkrow = row
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
submit() {
|
submit() {
|
||||||
this.$emit('update:dialogShow', false)
|
// 处理单选
|
||||||
|
if (this.isSingle && this.tableRadio) {
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.tableRadio)
|
||||||
|
return
|
||||||
|
}
|
||||||
this.rows = this.$refs.multipleTable.selection
|
this.rows = this.$refs.multipleTable.selection
|
||||||
this.$emit('tableChanged', this.tableRadio)
|
if (this.rows.length <= 0) {
|
||||||
|
this.$message('请先勾选物料')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.crud.resetQuery(false)
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.rows)
|
||||||
},
|
},
|
||||||
formterType(row) {
|
formterType(row) {
|
||||||
return this.dict.label.PCS_SAL_TYPE[row.sale_type]
|
return this.dict.label.PCS_SAL_TYPE[row.sale_type]
|
||||||
|
|||||||
@@ -188,7 +188,7 @@
|
|||||||
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库" min-width="120" />
|
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库" min-width="120" />
|
||||||
<el-table-column prop="product_area" label="生产车间" width="130" show-overflow-tooltip />
|
<el-table-column prop="product_area" label="生产车间" width="130" show-overflow-tooltip />
|
||||||
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
|
<el-table-column show-overflow-tooltip min-width="120" prop="biz_date" label="业务日期" />
|
||||||
<el-table-column label="总重量" align="center" prop="total_qty">
|
<el-table-column label="总数量" align="center" prop="total_qty">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ fun(scope.row.total_qty) }}
|
{{ fun(scope.row.total_qty) }}
|
||||||
</template>
|
</template>
|
||||||
@@ -249,7 +249,10 @@ export default {
|
|||||||
optShow: { add: true, reset: true },
|
optShow: { add: true, reset: true },
|
||||||
idField: 'iostorinv_id',
|
idField: 'iostorinv_id',
|
||||||
url: '/api/productIn',
|
url: '/api/productIn',
|
||||||
crudMethod: { ...productIn }
|
crudMethod: { ...productIn },
|
||||||
|
props: {
|
||||||
|
size: 10
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
mixins: [presenter(), header(), crud()],
|
mixins: [presenter(), header(), crud()],
|
||||||
|
|||||||
@@ -194,11 +194,13 @@
|
|||||||
|
|
||||||
<AddDtl
|
<AddDtl
|
||||||
:dialog-show.sync="dtlShow"
|
:dialog-show.sync="dtlShow"
|
||||||
|
:is-single="false"
|
||||||
@tableChanged="tableChanged2"
|
@tableChanged="tableChanged2"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<AddIvt
|
<AddIvt
|
||||||
:dialog-show.sync="ivtShow"
|
:dialog-show.sync="ivtShow"
|
||||||
|
:is-single="false"
|
||||||
@tableChanged="tableChanged3"
|
@tableChanged="tableChanged3"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -319,16 +321,32 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
deleteRow(index, rows) {
|
deleteRow(index, rows) {
|
||||||
const material_code = rows[index].material_code
|
const source_bill_code = rows[index].source_bill_code
|
||||||
let len = rows.length
|
const base_billdtl_id = rows[index].base_billdtl_id
|
||||||
while (len--) {
|
if (source_bill_code === undefined) {
|
||||||
const obj = rows[len]
|
let len = rows.length
|
||||||
if (material_code === obj.material_code) {
|
while (len--) {
|
||||||
const index = rows.indexOf(obj)
|
const obj = rows[len]
|
||||||
if (index > -1) { // 移除找到的指定元素
|
if (base_billdtl_id === obj.base_billdtl_id) {
|
||||||
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
const index = rows.indexOf(obj)
|
||||||
rows.splice(index, 1)
|
if (index > -1) { // 移除找到的指定元素
|
||||||
this.form.detail_count = this.form.tableData.length
|
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
||||||
|
rows.splice(index, 1)
|
||||||
|
this.form.detail_count = this.form.tableData.length
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let len = rows.length
|
||||||
|
while (len--) {
|
||||||
|
const obj = rows[len]
|
||||||
|
if (source_bill_code === obj.source_bill_code) {
|
||||||
|
const index = rows.indexOf(obj)
|
||||||
|
if (index > -1) { // 移除找到的指定元素
|
||||||
|
this.form.total_qty = parseFloat(this.form.total_qty) - parseFloat(rows[index].plan_qty)
|
||||||
|
rows.splice(index, 1)
|
||||||
|
this.form.detail_count = this.form.tableData.length
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -341,58 +359,62 @@ export default {
|
|||||||
this.nowrow.qty_unit_name = row.unit_name
|
this.nowrow.qty_unit_name = row.unit_name
|
||||||
this.nowrow.qty_unit_id = row.base_unit_id
|
this.nowrow.qty_unit_id = row.base_unit_id
|
||||||
},
|
},
|
||||||
tableChanged2(row) {
|
tableChanged2(rows) {
|
||||||
let same_mater = true
|
rows.forEach((row) => {
|
||||||
this.form.tableData.forEach((item) => {
|
let same_mater = true
|
||||||
if (item.source_bill_code === row.sale_code) {
|
this.form.tableData.forEach((item) => {
|
||||||
same_mater = false
|
if (item.source_bill_code === row.deliver_code) {
|
||||||
|
same_mater = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (same_mater) {
|
||||||
|
const data = {}
|
||||||
|
data.material_id = row.material_id
|
||||||
|
data.material_code = row.material_code
|
||||||
|
data.material_name = row.material_name
|
||||||
|
data.material_spec = row.material_spec
|
||||||
|
data.plan_qty = row.delivery_qty
|
||||||
|
data.qty_unit_name = row.qty_unit_name
|
||||||
|
data.qty_unit_id = row.qty_unit_id
|
||||||
|
data.source_billdtl_id = row.deliver_id
|
||||||
|
data.source_bill_type = row.deliver_type
|
||||||
|
data.source_bill_code = row.deliver_code
|
||||||
|
data.base_billdtl_id = row.sale_id
|
||||||
|
data.base_bill_code = row.sale_code
|
||||||
|
data.base_bill_table = row.sale_seq_no
|
||||||
|
data.edit = true
|
||||||
|
this.form.tableData.splice(-1, 0, data)
|
||||||
|
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty)
|
||||||
|
this.form.detail_count = this.form.tableData.length
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (same_mater) {
|
|
||||||
const data = {}
|
|
||||||
data.material_id = row.material_id
|
|
||||||
data.material_code = row.material_code
|
|
||||||
data.material_name = row.material_name
|
|
||||||
data.material_spec = row.material_spec
|
|
||||||
data.plan_qty = row.delivery_qty
|
|
||||||
data.qty_unit_name = row.qty_unit_name
|
|
||||||
data.qty_unit_id = row.qty_unit_id
|
|
||||||
data.source_billdtl_id = row.deliver_id
|
|
||||||
data.source_bill_type = row.deliver_type
|
|
||||||
data.source_bill_code = row.deliver_code
|
|
||||||
data.base_billdtl_id = row.sale_id
|
|
||||||
data.base_bill_code = row.sale_code
|
|
||||||
data.base_bill_table = row.sale_seq_no
|
|
||||||
data.edit = true
|
|
||||||
this.form.tableData.splice(-1, 0, data)
|
|
||||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty)
|
|
||||||
this.form.detail_count = this.form.tableData.length
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
tableChanged3(row) {
|
tableChanged3(rows) {
|
||||||
let same_mater = true
|
rows.forEach((row) => {
|
||||||
this.form.tableData.forEach((item) => {
|
let same_mater = true
|
||||||
if (item.sale_id === row.sale_id) {
|
this.form.tableData.forEach((item) => {
|
||||||
same_mater = false
|
if (item.base_billdtl_id === row.sale_id) {
|
||||||
|
same_mater = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (same_mater) {
|
||||||
|
const data = {}
|
||||||
|
data.material_id = row.material_id
|
||||||
|
data.material_code = row.material_code
|
||||||
|
data.material_name = row.material_name
|
||||||
|
data.material_spec = row.material_spec
|
||||||
|
data.plan_qty = row.canuse_qty
|
||||||
|
data.qty_unit_name = row.unit_name
|
||||||
|
data.qty_unit_id = row.measure_unit_id
|
||||||
|
data.base_billdtl_id = row.sale_id
|
||||||
|
data.base_bill_code = row.sale_code
|
||||||
|
data.base_bill_table = row.seq_no
|
||||||
|
data.edit = true
|
||||||
|
this.form.tableData.splice(-1, 0, data)
|
||||||
|
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty)
|
||||||
|
this.form.detail_count = this.form.tableData.length
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
if (same_mater) {
|
|
||||||
const data = {}
|
|
||||||
data.material_id = row.material_id
|
|
||||||
data.material_code = row.material_code
|
|
||||||
data.material_name = row.material_name
|
|
||||||
data.material_spec = row.material_spec
|
|
||||||
data.plan_qty = row.canuse_qty
|
|
||||||
data.qty_unit_name = row.unit_name
|
|
||||||
data.qty_unit_id = row.measure_unit_id
|
|
||||||
data.base_billdtl_id = row.sale_id
|
|
||||||
data.base_bill_code = row.sale_code
|
|
||||||
data.base_bill_table = row.seq_no
|
|
||||||
data.edit = true
|
|
||||||
this.form.tableData.splice(-1, 0, data)
|
|
||||||
this.form.total_qty = parseFloat(this.form.total_qty) + parseFloat(data.plan_qty)
|
|
||||||
this.form.detail_count = this.form.tableData.length
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
insertEvent(row) {
|
insertEvent(row) {
|
||||||
this.dtlShow = true
|
this.dtlShow = true
|
||||||
|
|||||||
@@ -72,7 +72,8 @@
|
|||||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
@current-change="clickChange"
|
@current-change="clickChange"
|
||||||
>
|
>
|
||||||
<el-table-column label="选择" width="55">
|
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||||
|
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||||
</template>
|
</template>
|
||||||
@@ -137,6 +138,10 @@ export default {
|
|||||||
},
|
},
|
||||||
storId: {
|
storId: {
|
||||||
type: String
|
type: String
|
||||||
|
},
|
||||||
|
isSingle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -172,14 +177,27 @@ export default {
|
|||||||
},
|
},
|
||||||
open() {
|
open() {
|
||||||
this.crud.query.mater_type = this.opendtlParam
|
this.crud.query.mater_type = this.opendtlParam
|
||||||
|
this.query.status = '10'
|
||||||
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
clickChange(item) {
|
clickChange(item) {
|
||||||
this.tableRadio = item
|
this.tableRadio = item
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
this.$emit('update:dialogShow', false)
|
// 处理单选
|
||||||
|
if (this.isSingle && this.tableRadio) {
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.tableRadio)
|
||||||
|
return
|
||||||
|
}
|
||||||
this.rows = this.$refs.multipleTable.selection
|
this.rows = this.$refs.multipleTable.selection
|
||||||
this.$emit('tableChanged', this.tableRadio)
|
if (this.rows.length <= 0) {
|
||||||
|
this.$message('请先勾选物料')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.crud.resetQuery(false)
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.rows)
|
||||||
},
|
},
|
||||||
formatStatus(row, column) {
|
formatStatus(row, column) {
|
||||||
return this.dict.label.PCS_DELI_STATUS[row.status]
|
return this.dict.label.PCS_DELI_STATUS[row.status]
|
||||||
|
|||||||
@@ -81,7 +81,8 @@
|
|||||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||||
@current-change="clickChange"
|
@current-change="clickChange"
|
||||||
>
|
>
|
||||||
<el-table-column label="选择" width="55">
|
<el-table-column v-if="!isSingle" type="selection" width="55" />
|
||||||
|
<el-table-column v-if="isSingle" label="选择" width="55">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
|
||||||
</template>
|
</template>
|
||||||
@@ -148,6 +149,10 @@ export default {
|
|||||||
},
|
},
|
||||||
storId: {
|
storId: {
|
||||||
type: String
|
type: String
|
||||||
|
},
|
||||||
|
isSingle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -183,14 +188,26 @@ export default {
|
|||||||
},
|
},
|
||||||
open() {
|
open() {
|
||||||
this.crud.query.lock_type = '0'
|
this.crud.query.lock_type = '0'
|
||||||
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
clickChange(item) {
|
clickChange(item) {
|
||||||
this.tableRadio = item
|
this.tableRadio = item
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
this.$emit('update:dialogShow', false)
|
// 处理单选
|
||||||
|
if (this.isSingle && this.tableRadio) {
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.tableRadio)
|
||||||
|
return
|
||||||
|
}
|
||||||
this.rows = this.$refs.multipleTable.selection
|
this.rows = this.$refs.multipleTable.selection
|
||||||
this.$emit('tableChanged', this.tableRadio)
|
if (this.rows.length <= 0) {
|
||||||
|
this.$message('请先勾选物料')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.crud.resetQuery(false)
|
||||||
|
this.$emit('update:dialogShow', false)
|
||||||
|
this.$emit('tableChanged', this.rows)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user