|
|
@@ -1,4 +1,4 @@
|
|
|
-<!-- @desc:其它入库新建 @auth:常皓宁 @time : 2024/2/19 9:38 -->
|
|
|
+<!-- @desc:其它出库新建 @auth:常皓宁 @time : 2024/2/19 9:38 -->
|
|
|
<template>
|
|
|
<div class="main-div">
|
|
|
<!--加载中-->
|
|
|
@@ -8,27 +8,27 @@
|
|
|
<DkPanel prop="essentialInformation">
|
|
|
<div id="search-cond-div" ref="search-cond-div" slot="content" class="form-content-class">
|
|
|
<DkForm slot="content" ref="formInline" v-model="formData" style="width:100%" :label-max-words="6">
|
|
|
- <!--入库单号-->
|
|
|
- <DkFormItem prop="intoNo">
|
|
|
- <InputPop ref="intoNo" v-model="formData.intoNo"
|
|
|
+ <!--出库单号-->
|
|
|
+ <DkFormItem prop="outNo">
|
|
|
+ <InputPop ref="outNo" v-model="formData.outNo"
|
|
|
:readonly="true"/>
|
|
|
</DkFormItem>
|
|
|
- <!-- 入库对象 -->
|
|
|
- <DkFormItem prop="objId" >
|
|
|
+ <!-- 出库对象 -->
|
|
|
+ <DkFormItem prop="objId" :label="$t('objOutId')" >
|
|
|
<SelectMagnifier v-model="formData.objId"
|
|
|
ref="objId"
|
|
|
primary-key="objId"
|
|
|
- :display-text="formData.inboundObjectName"
|
|
|
+ :display-text="formData.outboundObjectName"
|
|
|
:multiple=false
|
|
|
:disabled="canEditFlag"
|
|
|
@ok="inboundObjectChange"
|
|
|
:type="this.$config.MagnifierType.supplierAndCustomer">
|
|
|
</SelectMagnifier>
|
|
|
</DkFormItem>
|
|
|
- <!-- 入库原因 -->
|
|
|
- <DkFormItem prop="intoReason" :required="true" >
|
|
|
- <SelectPop v-model="formData.intoReason" :multiple="false" :options="inboundReasonList"
|
|
|
- ref="intoReason"
|
|
|
+ <!-- 出库原因 -->
|
|
|
+ <DkFormItem prop="outReason" :required="true" >
|
|
|
+ <SelectPop v-model="formData.outReason" :multiple="false" :options="inboundReasonList"
|
|
|
+ ref="outReason"
|
|
|
:labelInValue="true"
|
|
|
:disabled="canEditFlag"
|
|
|
labelKey="dataValue"
|
|
|
@@ -60,8 +60,8 @@
|
|
|
ref="orgId"
|
|
|
:type="this.$config.MagnifierType.organization"></SelectMagnifier>
|
|
|
</DkFormItem>
|
|
|
- <!--自动入库标识-->
|
|
|
- <DkFormItem prop="autoFlag" v-show="showAutoFlag">
|
|
|
+ <!--自动出库标识-->
|
|
|
+ <DkFormItem prop="autoOutFlag" v-show="showAutoFlag">
|
|
|
<template>
|
|
|
<i-switch v-model="formData.flgAutoHandle" @on-change="changeIntoStatus"
|
|
|
:disabled="type === $config.formMode.handle">
|
|
|
@@ -70,10 +70,10 @@
|
|
|
</i-switch>
|
|
|
</template>
|
|
|
</DkFormItem>
|
|
|
- <!--入库日期-->
|
|
|
- <DkFormItem prop="intoDate" v-show="showIntoDate">
|
|
|
- <DatePickerPop v-model="formData.intoDate"
|
|
|
- :placeholder="$t('inputWords',{'search-name':$t('intoDate')})"
|
|
|
+ <!--出库日期-->
|
|
|
+ <DkFormItem prop="outDate" v-show="showoutDate">
|
|
|
+ <DatePickerPop v-model="formData.outDate"
|
|
|
+ :placeholder="$t('inputWords',{'search-name':$t('outDate')})"
|
|
|
type="date" :short-cut-flag="true" :readonly="true"/>
|
|
|
</DkFormItem>
|
|
|
<!--备注-->
|
|
|
@@ -94,7 +94,7 @@
|
|
|
controlId="skuId"
|
|
|
@on-choose="getTotals"
|
|
|
@changeValue="changeValue"
|
|
|
- @onBatchChoose="batchChoose"
|
|
|
+ @cell-click="handleClickTable"
|
|
|
:add-flag="this.addFlag"
|
|
|
:delete-flag="this.deleteFlag"
|
|
|
></EditTable>
|
|
|
@@ -136,20 +136,20 @@
|
|
|
return {
|
|
|
//画面模式选项角标
|
|
|
bottomList: ['1', '2', '3', '5'],
|
|
|
- //入库原因
|
|
|
+ //出库原因
|
|
|
inboundReasonList: [],
|
|
|
- //是否显示自动办理入库标识
|
|
|
+ //是否显示自动办理出库标识
|
|
|
showAutoFlag: true,
|
|
|
- //入库日期是否显示
|
|
|
- showIntoDate: false,
|
|
|
+ //出库日期是否显示
|
|
|
+ showoutDate: false,
|
|
|
// 画面表单数据
|
|
|
formData: {
|
|
|
- intoId: null,//入库单Id
|
|
|
- objId: null,//入库对象id
|
|
|
- intoNo: null,//入库单号
|
|
|
- intoDate:null,//入库日期
|
|
|
- intoReason: null,//入库原因
|
|
|
- flgAutoHandle: false,//自动入库标识
|
|
|
+ outId: null,//出库单Id
|
|
|
+ objId: null,//出库对象id
|
|
|
+ outNo: null,//出库单号
|
|
|
+ outDate:null,//出库日期
|
|
|
+ outReason: null,//出库原因
|
|
|
+ flgAutoHandle: false,//自动出库标识
|
|
|
cusId: null,//客户id
|
|
|
cusName: null,//客户名称
|
|
|
cusPhone: null,//客户电话
|
|
|
@@ -158,7 +158,6 @@
|
|
|
makeTime:new Date().format(),//制单日期
|
|
|
supId: null,//供应商id
|
|
|
remarks: null,//备注
|
|
|
- defWhId: null,//部门默认仓库ID
|
|
|
// 附件
|
|
|
annexPaths: [],
|
|
|
staffId:null,
|
|
|
@@ -175,8 +174,8 @@
|
|
|
controlId: 'skuId',
|
|
|
type: 'tableSelect',
|
|
|
width: 200,
|
|
|
- dataType: self.$config.tableSelectType.goodsForOrder,
|
|
|
- fieldUpdate: self.$updateColumns.orderChooseGoods,
|
|
|
+ dataType: self.$config.tableSelectType.inventory,
|
|
|
+ fieldUpdate: self.$updateColumns.outChooseIvt,
|
|
|
searchDetailFlag: true
|
|
|
},
|
|
|
// 商品名称
|
|
|
@@ -185,55 +184,68 @@
|
|
|
controlId: 'skuId',
|
|
|
type: 'tableSelect',
|
|
|
width: 200,
|
|
|
- dataType: self.$config.tableSelectType.goods,
|
|
|
- fieldUpdate: self.$updateColumns.orderChooseGoods,
|
|
|
+ dataType: self.$config.tableSelectType.inventory,
|
|
|
+ fieldUpdate: self.$updateColumns.outChooseIvt,
|
|
|
searchDetailFlag: true
|
|
|
},
|
|
|
- // 入库数量
|
|
|
+ //库存数量
|
|
|
+ {
|
|
|
+ field: 'invQty',
|
|
|
+ type: 'disabled',
|
|
|
+ },
|
|
|
+ // 出库数量
|
|
|
{
|
|
|
field: 'outingQty',
|
|
|
- title: self.$t('entryQty'),
|
|
|
+ title: self.$t('outQuantity'),
|
|
|
type: 'number',
|
|
|
digits: 0,
|
|
|
sum: true,
|
|
|
formula: {
|
|
|
- outingAmt: ['priceOut*outingQty', 'priceOut', 'outingQty'],
|
|
|
+ outingAmt: ['priceInto*outingQty', 'priceInto', 'outingQty'],
|
|
|
},
|
|
|
},
|
|
|
- //入库单价
|
|
|
+ //出库单价
|
|
|
{
|
|
|
- field: 'priceOut',
|
|
|
- type: 'number',
|
|
|
+ field: 'priceInto',
|
|
|
+ title: self.$t('priceOut'),
|
|
|
+ type: 'disabled',
|
|
|
digits: 2,
|
|
|
- flgUserSensitive: true,
|
|
|
formula: {
|
|
|
- outingAmt: ['priceOut*outingQty', 'priceOut', 'outingQty'],
|
|
|
+ outingAmt: ['priceInto*outingQty', 'priceInto', 'outingQty'],
|
|
|
},
|
|
|
},
|
|
|
- //入库金额
|
|
|
+ //出库金额
|
|
|
{
|
|
|
field: 'outingAmt',
|
|
|
- title: self.$t('entryAmt'),
|
|
|
+ title: self.$t('outAmount'),
|
|
|
type: 'disabled',
|
|
|
digits: 2,
|
|
|
sum: true,
|
|
|
formula: {
|
|
|
- priceOut: ['outingAmt/outingQty', 'outingAmt', 'outingQty'],
|
|
|
+ priceInto: ['outingAmt/outingQty', 'outingAmt', 'outingQty'],
|
|
|
},
|
|
|
},
|
|
|
//仓库名称
|
|
|
{
|
|
|
- field: 'whId',
|
|
|
- type: 'select',
|
|
|
- options: () => self.warehouseList,
|
|
|
- labelKey: 'whName',
|
|
|
- valueKey: 'whId',
|
|
|
- dataType: self.$config.tableSelectType.warehouse,
|
|
|
+ field: 'whName',
|
|
|
+ type: 'tableSelect',
|
|
|
+ multiple: false,
|
|
|
+ sortBoolean: false,
|
|
|
+ dataType: self.$config.tableSelectType.inventory,
|
|
|
+ otherSearchParam: () => {
|
|
|
+ return {
|
|
|
+ skuId: self.currentRow?.skuId,
|
|
|
+ nonStdCode: self.currentRow?.nonStdCode,
|
|
|
+ }
|
|
|
+ },
|
|
|
fieldUpdate: [
|
|
|
- {updateField: 'whName', valueFiled: 'whName'},
|
|
|
+ {updateField: 'invQty', valueFiled: 'invQty'},
|
|
|
+ {updateField: 'usableQty', valueFiled: 'usableQty'},
|
|
|
+ {updateField: 'invId', valueFiled: 'invId'},
|
|
|
{updateField: 'whId', valueFiled: 'whId'},
|
|
|
+ {updateField: 'whName', valueFiled: 'whName'},
|
|
|
],
|
|
|
- searchDataFlag: false,
|
|
|
+ searchDetailFlag: true
|
|
|
},
|
|
|
{field: 'brandName', type: 'disabled'},//商品品牌
|
|
|
{field: 'skuSpec', type: 'disabled'}, //规格
|
|
|
@@ -243,10 +255,6 @@
|
|
|
goodsFootFormData: {
|
|
|
sumGoodsAmount: 0,
|
|
|
},
|
|
|
- //仓库
|
|
|
- warehouseList: [],
|
|
|
- whId:null,
|
|
|
- whName:null,
|
|
|
//可以编辑标识
|
|
|
canEditFlag:false,
|
|
|
addFlag: true ,//商品信息新增
|
|
|
@@ -256,7 +264,7 @@
|
|
|
|
|
|
methods: {
|
|
|
/**
|
|
|
- * @desc : 入库对象改变事件
|
|
|
+ * @desc : 出库对象改变事件
|
|
|
* @date : 2024/3/13 10:55
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
@@ -273,21 +281,31 @@
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
- * @desc : 自动入库标识变更
|
|
|
- * @author : 夏常明
|
|
|
- * @date : 2023/9/1 16:34
|
|
|
+ * @desc : 自动出库标识变更
|
|
|
+ * @date : 2024/4/8 15:31
|
|
|
+ * @author : 寇珊珊
|
|
|
*/
|
|
|
changeIntoStatus() {
|
|
|
if (this.type === this.$config.formMode.add) {
|
|
|
if (this.formData.flgAutoHandle) {
|
|
|
- this.formData.intoDate = new Date().format("yyyy-MM-dd")
|
|
|
- this.showIntoDate = true
|
|
|
+ this.formData.outDate = new Date().format("yyyy-MM-dd")
|
|
|
+ this.showoutDate = true
|
|
|
}else{
|
|
|
- this.formData.intoDate = null
|
|
|
- this.showIntoDate = false
|
|
|
+ this.formData.outDate = null
|
|
|
+ this.showoutDate = false
|
|
|
}
|
|
|
}else {
|
|
|
- this.formData.intoDate = new Date().format("yyyy-MM-dd")
|
|
|
+ this.formData.outDate = new Date().format("yyyy-MM-dd")
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 表格点击事件
|
|
|
+ * @date : 2024/4/8 14:35
|
|
|
+ * @author : 寇珊珊
|
|
|
+ */
|
|
|
+ handleClickTable(e) {
|
|
|
+ if (e) {
|
|
|
+ this.currentRow = e.row
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
@@ -326,45 +344,6 @@
|
|
|
this.goodsFootFormData.sumGoodsAmount = itemAmount;
|
|
|
this.formData.outingAmt = outingAmt;
|
|
|
this.formData.outingQty = outingQty;
|
|
|
- //选择数据带出默认仓库
|
|
|
- if (!row.whId || row.whId === 0 || row.whId === null) {
|
|
|
- this.$set(row, 'whId', this.whId);
|
|
|
- this.$set(row, 'whId_Name', this.whName);
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 批量选择
|
|
|
- * @date : 2024/3/14 10:04
|
|
|
- * @author : 寇珊珊
|
|
|
- */
|
|
|
- batchChoose(batchRows,rowIndex){
|
|
|
- console.log("batchRows",batchRows)
|
|
|
- batchRows.forEach(it=> {
|
|
|
- if(!it.whId || it.whId === 0 || it.whId === null){
|
|
|
- this.$set(it,'whId',this.whId);
|
|
|
- this.$set(it,'whId_Name',this.whName);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- /**
|
|
|
- * @desc : 查询仓库
|
|
|
- * @date : 2024/3/14 8:45
|
|
|
- * @author : 寇珊珊
|
|
|
- */
|
|
|
- getWarehouse() {
|
|
|
- let params = {
|
|
|
- 'cpId': this.$store.state.user.cpId,
|
|
|
- 'flgValid': true
|
|
|
- }
|
|
|
- this.excute(this.$service.commonService, this.$service.commonService.getWarehouse, params, false).then(res => {
|
|
|
- if (res.code === this.$config.SUCCESS_CODE) {
|
|
|
- this.warehouseList = res.data
|
|
|
- //赋值默认仓库 组件需要
|
|
|
- let newList = res.data.filter(it=>it.flgDefault)
|
|
|
- this.whId = newList[0].whId
|
|
|
- this.whName = newList[0].whName
|
|
|
- }
|
|
|
- })
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 获取数据字典
|
|
|
@@ -374,7 +353,7 @@
|
|
|
getDictionaryData() {
|
|
|
let params = {
|
|
|
'cpId': this.$store.state.user.cpId,
|
|
|
- 'dictCode': this.$config.kindCode.basicEnter,
|
|
|
+ 'dictCode': this.$config.kindCode.basicOut,
|
|
|
'flgValid': true
|
|
|
}
|
|
|
this.excute(this.$service.commonService, this.$service.commonService.getDictionaryData, params, false).then(res => {
|
|
|
@@ -389,8 +368,6 @@
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
initData() {
|
|
|
- //获取仓库
|
|
|
- this.getWarehouse()
|
|
|
//获取数据字典
|
|
|
this.getDictionaryData()
|
|
|
},
|
|
|
@@ -410,10 +387,15 @@
|
|
|
this.$message.warning(this.$t('W_041', {'param': this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('outingQty')}))
|
|
|
return false;
|
|
|
}
|
|
|
- if (!itemTable[i].priceOut || itemTable[i].priceOut === '') {
|
|
|
+ if (!itemTable[i].priceInto || itemTable[i].priceInto === '') {
|
|
|
this.$message.warning(this.$t('W_041', {'param': this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('priceOut')}))
|
|
|
return false;
|
|
|
}
|
|
|
+ if (itemTable[i].outingQty > itemTable[i].usableQty) {
|
|
|
+ this.$message.warning(this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('W_119'))
|
|
|
+ // this.$Message.warning(this.$t('W_007', {'param': '本次出库数量不能大于库存量'}))
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
@@ -430,14 +412,15 @@
|
|
|
this.formData.outingQty =null
|
|
|
this.formData.outingAmt = null
|
|
|
}
|
|
|
- //入库时间
|
|
|
- if(this.formData.intoDate){
|
|
|
- this.formData.intoDate = new Date(this.formData.intoDate).format('yyyy-MM-dd')
|
|
|
+ //出库时间
|
|
|
+ if(this.formData.outDate){
|
|
|
+ this.formData.outDate = new Date(this.formData.outDate).format('yyyy-MM-dd')
|
|
|
}
|
|
|
// 修改新增的表数据
|
|
|
let itemTable = this.$refs['goodsTable'].getTableDataFilter();
|
|
|
- if(itemTable.filter(it=>it.whId).length==itemTable.length){
|
|
|
- this.params.whId =itemTable[0].whId
|
|
|
+ //出库价赋值
|
|
|
+ for(let i=0;i<itemTable.length;i++){
|
|
|
+ itemTable[i].priceOut = itemTable[i].priceInto
|
|
|
}
|
|
|
this.formData.staffId = this.formData.makeStaff
|
|
|
this.formData.itemList = itemTable;
|
|
|
@@ -452,15 +435,15 @@
|
|
|
saveData() {
|
|
|
//新建
|
|
|
if (this.type === this.$config.formMode.add) {
|
|
|
- return this.excute(this.$service.otherInboundService, this.$service.otherInboundService.inboundInsert, this.params)
|
|
|
+ return this.excute(this.$service.otherOutboundService, this.$service.otherOutboundService.outboundInsert, this.params)
|
|
|
}
|
|
|
- //入库办理
|
|
|
+ //出库办理
|
|
|
else if(this.type === this.$config.formMode.handle) {
|
|
|
- return this.excute(this.$service.otherInboundService, this.$service.otherInboundService.handleInbound, this.params)
|
|
|
+ return this.excute(this.$service.otherOutboundService, this.$service.otherOutboundService.handleOutbound, this.params)
|
|
|
}
|
|
|
//编辑
|
|
|
else if(this.type === this.$config.formMode.edit){
|
|
|
- return this.excute(this.$service.otherInboundService, this.$service.otherInboundService.inboundUpdate, this.params)
|
|
|
+ return this.excute(this.$service.otherOutboundService, this.$service.otherOutboundService.outboundUpdate, this.params)
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
@@ -470,12 +453,12 @@
|
|
|
*/
|
|
|
clear() {
|
|
|
this.formData = {
|
|
|
- intoId: null,//入库单Id
|
|
|
- inboundObject: null,//入库对象id
|
|
|
- intoNo: null,//入库单号
|
|
|
- intoDate: null,//入库日期
|
|
|
- intoReason: null,//入库原因
|
|
|
- flgAutoHandle: false,//自动入库标识
|
|
|
+ outId: null,//出库单Id
|
|
|
+ inboundObject: null,//出库对象id
|
|
|
+ outNo: null,//出库单号
|
|
|
+ outDate: null,//出库日期
|
|
|
+ outReason: null,//出库原因
|
|
|
+ flgAutoHandle: false,//自动出库标识
|
|
|
cusId: null,//客户id
|
|
|
cusName: null,//客户名称
|
|
|
cusPhone: null,//客户电话
|
|
|
@@ -484,7 +467,6 @@
|
|
|
makeTime:new Date().format(),//制单日期
|
|
|
supId: null,//供应商id
|
|
|
remarks: null,//备注
|
|
|
- defWhId: null,//部门默认仓库ID
|
|
|
// 附件
|
|
|
annexPaths: [],
|
|
|
staffId:null,
|
|
|
@@ -498,7 +480,7 @@
|
|
|
* @author : 寇珊珊
|
|
|
*/
|
|
|
detail(id) {
|
|
|
- return this.excuteNoParam(this.$service.otherInboundService, this.$service.otherInboundService.selectByUpdate, [id]);
|
|
|
+ return this.excuteNoParam(this.$service.otherOutboundService, this.$service.otherOutboundService.selectByUpdate, [id]);
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 编辑页面赋值
|
|
|
@@ -510,16 +492,19 @@
|
|
|
if (data) {
|
|
|
this.formData = data["data"];
|
|
|
this.formData.limitEdit= true
|
|
|
- this.formData.intoDate = new Date().format("yyyy-MM-dd")
|
|
|
- //入库对象赋值
|
|
|
+ this.formData.outDate = new Date().format("yyyy-MM-dd")
|
|
|
+ //出库对象赋值
|
|
|
if(data['data'].supId && data["data"].supId!=null){
|
|
|
this.formData.objId = data["data"].supId
|
|
|
- this.formData.inboundObjectName = data["data"].supplierName
|
|
|
+ this.formData.outboundObjectName = data["data"].supplierName
|
|
|
}else if(data['data'].cusId && data["data"].cusId!=null){
|
|
|
this.formData.objId = data["data"].cusId
|
|
|
- this.formData.inboundObjectName = data["data"].cusName
|
|
|
+ this.formData.outboundObjectName = data["data"].cusName
|
|
|
}
|
|
|
//明细赋值
|
|
|
+ for(let i=0;i<data["dataItem"].length;i++){
|
|
|
+ data["dataItem"][i].priceInto = data["dataItem"][i].priceOut
|
|
|
+ }
|
|
|
this.formData.itemList = data["dataItem"];
|
|
|
this.goodsFootFormData.sumGoodsAmount = this.formData.outingAmt;
|
|
|
//办理
|
|
|
@@ -546,7 +531,7 @@
|
|
|
dataItem.map(row => {
|
|
|
let item = row
|
|
|
// 不可查询
|
|
|
- this.$set(item, 'readOnly', ['skuModel','skuName','outingQty','outingAmt','priceOut','whId'])
|
|
|
+ this.$set(item, 'readOnly', ['skuModel','skuName','outingQty','whId'])
|
|
|
return item
|
|
|
})
|
|
|
this.formData.itemList = dataItem;
|
|
|
@@ -555,14 +540,14 @@
|
|
|
},
|
|
|
},
|
|
|
created() {
|
|
|
- this.focusItem = 'intoId'; // 给第一个组件赋值,可以在混入中自动去聚焦
|
|
|
- this.primaryKey = 'intoId' // 设置主键Id
|
|
|
+ this.focusItem = 'outId'; // 给第一个组件赋值,可以在混入中自动去聚焦
|
|
|
+ this.primaryKey = 'outId' // 设置主键Id
|
|
|
//设置默认值
|
|
|
if (this.$route.params.id){
|
|
|
- // 入库办理
|
|
|
+ // 出库办理
|
|
|
if (this.type === this.$config.formMode.handle) {
|
|
|
this.showAutoFlag = false;
|
|
|
- this.showIntoDate = true;
|
|
|
+ this.showoutDate = true;
|
|
|
}
|
|
|
}
|
|
|
}
|