|
|
@ -13,7 +13,7 @@ |
|
|
|
<!-- end 详情按钮 --> |
|
|
|
</div> |
|
|
|
<div class="listconadd"> |
|
|
|
<el-form ref="form_obj" :model="formobj" class="formaddcopy02"> |
|
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02"> |
|
|
|
<div class="title"> |
|
|
|
<div>基础信息</div> |
|
|
|
</div> |
|
|
@ -33,9 +33,9 @@ |
|
|
|
clearable /></el-form-item> |
|
|
|
</el-col> --> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">单据日期</div> |
|
|
|
<el-form-item> <el-date-picker v-model="formobj.createTime" type="date" class="addinputInfo" |
|
|
|
value-format="yyyy-MM-dd" placeholder="选择日期"> |
|
|
|
<div class="span-sty"><span class="must">*</span> 单据日期</div> |
|
|
|
<el-form-item prop="createTime"> <el-date-picker v-model="formobj.createTime" type="date" |
|
|
|
class="addinputInfo" value-format="yyyy-MM-dd" placeholder="选择日期"> |
|
|
|
</el-date-picker></el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
@ -46,17 +46,17 @@ |
|
|
|
<el-form-item><span class="addinputInfo">{{ formobj.sourceBillNo }}</span></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">业务类型</div> |
|
|
|
<el-form-item><el-select v-model="formobj.busTypeValue" filterable clearable placeholder="请选择" |
|
|
|
class="addinputInfo" @change="busTypeSelect"> |
|
|
|
<div class="span-sty"><span class="must">*</span> 业务类型</div> |
|
|
|
<el-form-item prop="busTypeValue"><el-select v-model="formobj.busTypeValue" filterable clearable |
|
|
|
placeholder="请选择" class="addinputInfo" @change="busTypeSelect"> |
|
|
|
<el-option v-for="item in busTypeList" :key="item.sid" :label="item.name" :value="item.sid"> |
|
|
|
</el-option> |
|
|
|
</el-select></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">供应商</div> |
|
|
|
<el-form-item> <el-select v-model="formobj.supplierName" filterable clearable placeholder="请选择" |
|
|
|
class="addinputInfo" @change="supplierNameSelect"> |
|
|
|
<div class="span-sty"><span class="must">*</span> 供应商</div> |
|
|
|
<el-form-item prop="supplierName"> <el-select v-model="formobj.supplierName" filterable clearable |
|
|
|
placeholder="请选择" class="addinputInfo" @change="supplierNameSelect"> |
|
|
|
<el-option v-for="item in supplierList" :key="item.sid" :label="item.name" :value="item.sid"> |
|
|
|
</el-option> |
|
|
|
</el-select></el-form-item> |
|
|
@ -67,9 +67,9 @@ |
|
|
|
<el-row> |
|
|
|
|
|
|
|
<el-col :span="8"> |
|
|
|
<div class="span-sty">到货日期</div> |
|
|
|
<el-form-item><el-date-picker v-model="formobj.deliveryDate" type="date" class="addinputInfo" |
|
|
|
value-format="yyyy-MM-dd" placeholder="选择日期"> |
|
|
|
<div class="span-sty"><span class="must">*</span> 到货日期</div> |
|
|
|
<el-form-item prop="deliveryDate"><el-date-picker v-model="formobj.deliveryDate" type="date" |
|
|
|
class="addinputInfo" value-format="yyyy-MM-dd" placeholder="选择日期"> |
|
|
|
</el-date-picker></el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="16"> |
|
|
@ -108,7 +108,7 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column v-if="isUpdata" label="商品名称" prop="goodsSkuTitle" align="center" width="200" /> |
|
|
|
<el-table-column v-if="isUpdata" label="商品名称" prop="goodsSpuName" align="center" width="200" /> |
|
|
|
|
|
|
|
<el-table-column label="商品名称" align="center" min-width="200" v-if="!isUpdata"> |
|
|
|
<template slot-scope="scope" v-if="!isUpdata"> |
|
|
@ -153,7 +153,7 @@ |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> --> |
|
|
|
<el-table-column label="预约数量" prop="orderCount" align="center" width="120" v-if="isUpdata" /> |
|
|
|
<!-- <el-table-column label="预约数量" prop="orderCount" align="center" width="120" v-if="isUpdata" /> --> |
|
|
|
<el-table-column label="实收数量" align="center" width="120"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input ref="focusAssumptionInput" @input="commodityComputeYHAndXSJE(scope.row,$event)" |
|
|
@ -208,8 +208,8 @@ |
|
|
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="含税单价" prop="taxPrice" @input="commodityComputeYHAndXSJE5(scope.row,$event)" |
|
|
|
align="center" width="150" /> |
|
|
|
<!-- <el-table-column label="含税单价" prop="taxPrice" @input="commodityComputeYHAndXSJE5(scope.row,$event)" |
|
|
|
align="center" width="150" /> --> |
|
|
|
<el-table-column label="入库金额" prop="amount" align="center" width="150" /> |
|
|
|
</el-table> |
|
|
|
|
|
|
@ -260,6 +260,9 @@ |
|
|
|
<script> |
|
|
|
import req from '@/api/storage/receivingGoods.js' |
|
|
|
import req2 from '@/api/storage/allocation.js' |
|
|
|
import { |
|
|
|
getCurrentDate |
|
|
|
} from '@/utils/index.js' |
|
|
|
export default { |
|
|
|
components: {}, |
|
|
|
data() { |
|
|
@ -275,12 +278,12 @@ |
|
|
|
"createBySid": window.sessionStorage.getItem('userSid'), |
|
|
|
"createByName": window.sessionStorage.getItem('name'), |
|
|
|
"departmentName": window.sessionStorage.getItem('departmentName'), |
|
|
|
"createTime": "", |
|
|
|
"createTime": getCurrentDate(), |
|
|
|
"busTypeKey": "", |
|
|
|
"busTypeValue": "", |
|
|
|
"supplierSid": "", |
|
|
|
"supplierName": "", |
|
|
|
"deliveryDate": "", |
|
|
|
"deliveryDate": getCurrentDate(), |
|
|
|
"billState": "新建", |
|
|
|
"remarks": "", |
|
|
|
"useOrgSid": window.sessionStorage.getItem('departmentSid'), |
|
|
@ -315,7 +318,29 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
commodityData: [], |
|
|
|
isUpdata: false |
|
|
|
isUpdata: false, |
|
|
|
rules: { |
|
|
|
createTime: [{ |
|
|
|
required: true, |
|
|
|
message: '到货日期不能为空', |
|
|
|
trigger: 'change' |
|
|
|
}], |
|
|
|
busTypeValue: [{ |
|
|
|
required: true, |
|
|
|
message: '请选择业务类型', |
|
|
|
trigger: 'change' |
|
|
|
}], |
|
|
|
supplierName: [{ |
|
|
|
required: true, |
|
|
|
message: '请选择供应商', |
|
|
|
trigger: 'change' |
|
|
|
}], |
|
|
|
deliveryDate: [{ |
|
|
|
required: true, |
|
|
|
message: '到货日期不能为空', |
|
|
|
trigger: 'change' |
|
|
|
}], |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
created() {}, |
|
|
@ -439,111 +464,6 @@ |
|
|
|
saveOrUpdate() { |
|
|
|
console.log('>>>>>>>>>saveOrUpdate', this.formobj) |
|
|
|
|
|
|
|
|
|
|
|
// if (this.formobj.createByName == '') { |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
|
// type: 'error', |
|
|
|
// message: '制单人姓名不能为空' |
|
|
|
// }) |
|
|
|
|
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
// if (this.formobj.createTime == '') { |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
|
// type: 'error', |
|
|
|
// message: '单据日期不能为空' |
|
|
|
// }) |
|
|
|
|
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// if (this.formobj.busTypeKey == '' || this.formobj.busTypeValue == '') { |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
|
// type: 'error', |
|
|
|
// message: '业务类型不能为空' |
|
|
|
// }) |
|
|
|
|
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
// if (this.formobj.supplierSid == '' || this.formobj.supplierName == '') { |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
|
// type: 'error', |
|
|
|
// message: '供应商不能为空' |
|
|
|
// }) |
|
|
|
|
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
// if (this.formobj.deliveryDate == '') { |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
|
// type: 'error', |
|
|
|
// message: '到货日期不能为空' |
|
|
|
// }) |
|
|
|
|
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// for (var i = 0; i < this.formobj.pcList.length; i++) { |
|
|
|
// var item = this.formobj.pcList[i] |
|
|
|
|
|
|
|
// if (item.manufactureDate == '') { |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
|
// type: 'error', |
|
|
|
// message: '生产日期不能为空' |
|
|
|
// }) |
|
|
|
|
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
// if (Number(item.batchCount) == 0) { |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
|
// type: 'error', |
|
|
|
// message: '商品批次数量不能为0' |
|
|
|
// }) |
|
|
|
|
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// for (var i = 0; i < this.formobj.list.length; i++) { |
|
|
|
// var index = i |
|
|
|
// var num = 0 |
|
|
|
// const choose = this.formobj.pcList.filter((item) => Number(item.xh) == (index + 1)) |
|
|
|
// for (var j = 0; j < choose.length; j++) { |
|
|
|
|
|
|
|
// num += Number(choose[j].batchCount) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// console.log('>>>>>>>>>saveOrUpdate', num) |
|
|
|
|
|
|
|
// if (num > Number(this.formobj.list[i].actualInCount)) { |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
|
// type: 'error', |
|
|
|
// message: '商品批次数量不能大于商品实收数量' |
|
|
|
// }) |
|
|
|
|
|
|
|
// return |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
@ -566,57 +486,6 @@ |
|
|
|
}, |
|
|
|
submit() { |
|
|
|
|
|
|
|
if (this.formobj.createByName == '') { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '制单人姓名不能为空' |
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.formobj.createTime == '') { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '单据日期不能为空' |
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.formobj.busTypeKey == '' || this.formobj.busTypeValue == '') { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '业务类型不能为空' |
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.formobj.supplierSid == '' || this.formobj.supplierName == '') { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '供应商不能为空' |
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.formobj.deliveryDate == '') { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '到货日期不能为空' |
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.formobj.list.length == 0) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
@ -643,45 +512,7 @@ |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '请添加商品实收数量' |
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (this.isUpdata) { |
|
|
|
if (item.actualInCount + item.rejectCount > item.orderCount) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '商品实收数量或拒收数量错误' |
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < this.formobj.pcList.length; i++) { |
|
|
|
var item = this.formobj.pcList[i] |
|
|
|
|
|
|
|
if (item.manufactureDate == '') { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '生产日期不能为空' |
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
if (Number(item.batchCount) == 0) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '商品批次数量不能为0' |
|
|
|
message: '实收数量不能为空' |
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
@ -689,32 +520,6 @@ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < this.formobj.list.length; i++) { |
|
|
|
var index = i |
|
|
|
var num = 0 |
|
|
|
const choose = this.formobj.pcList.filter((item) => Number(item.xh) == (index + 1)) |
|
|
|
for (var j = 0; j < choose.length; j++) { |
|
|
|
|
|
|
|
num += Number(choose[j].batchCount) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
console.log('>>>>>>>>>saveOrUpdate', num) |
|
|
|
|
|
|
|
if (num > Number(this.formobj.list[i].actualInCount)) { |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
type: 'error', |
|
|
|
message: '商品批次数量不能大于商品实收数量' |
|
|
|
}) |
|
|
|
|
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
this.submitdisabled = true |
|
|
@ -785,6 +590,15 @@ |
|
|
|
.then(resp => { |
|
|
|
if (resp.success) { |
|
|
|
this.formobj = resp.data |
|
|
|
|
|
|
|
this.formobj.createByName = window.sessionStorage.getItem('name') |
|
|
|
this.formobj.deptName = window.sessionStorage.getItem('departmentName') |
|
|
|
this.formobj.deptSid = window.sessionStorage.getItem('departmentSid') |
|
|
|
this.formobj.createBySid = window.sessionStorage.getItem('userSid') |
|
|
|
this.formobj.useOrgSid = window.sessionStorage.getItem('departmentSid') |
|
|
|
this.formobj.createOrgSid = window.sessionStorage.getItem('orgSid') |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(e => { |
|
|
@ -1037,6 +851,14 @@ |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
/deep/ .el-form-item__error { |
|
|
|
margin-left: 120px !important; |
|
|
|
} |
|
|
|
|
|
|
|
.must { |
|
|
|
color: #f00; |
|
|
|
} |
|
|
|
|
|
|
|
.span-sty { |
|
|
|
width: 130px !important; |
|
|
|
} |
|
|
@ -1050,6 +872,10 @@ |
|
|
|
width: calc(100% - 115px); |
|
|
|
} |
|
|
|
|
|
|
|
.first_row { |
|
|
|
border-top: 1px solid #E0E3EB; |
|
|
|
} |
|
|
|
|
|
|
|
.titleOne { |
|
|
|
padding: 7px; |
|
|
|
display: flex; |
|
|
|