|
@@ -66,21 +66,14 @@
|
|
|
</el-divider>
|
|
</el-divider>
|
|
|
<el-row :gutter="15">
|
|
<el-row :gutter="15">
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
- <vxe-table border show-footer show-overflow :footer-method="footerMethod" ref="detailTable"
|
|
|
|
|
- class="vxe-table-element" :data="inputForm.detailInfos" style="margin-left: 3em">
|
|
|
|
|
- <vxe-column min-width="100" align="center" field="purchaserAgent"
|
|
|
|
|
- title="采购人"></vxe-column>
|
|
|
|
|
- <vxe-column min-width="100" align="center" field="procurementOffice"
|
|
|
|
|
- title="采购部门"></vxe-column>
|
|
|
|
|
|
|
+ <vxe-table border show-footer show-overflow ref="detailTable" class="vxe-table-element"
|
|
|
|
|
+ :data="inputForm.detailInfos" style="margin-left: 3em">
|
|
|
<vxe-column min-width="100" align="center" field="procurementType"
|
|
<vxe-column min-width="100" align="center" field="procurementType"
|
|
|
- title="采购类型"></vxe-column>
|
|
|
|
|
- <vxe-column min-width="100" align="center" field="supplierName"
|
|
|
|
|
- title="供应商"></vxe-column>
|
|
|
|
|
- <vxe-column min-width="220" align="center" field="tradeName" title="商品名称"></vxe-column>
|
|
|
|
|
- <vxe-column min-width="100" align="center" field="tradePrice"
|
|
|
|
|
- title="商品单价(元)"></vxe-column>
|
|
|
|
|
- <vxe-column min-width="80" align="center" field="tradeNumber" title="商品数量"></vxe-column>
|
|
|
|
|
- <vxe-column min-width="100" align="center" field="priceSum" title="商品总价"></vxe-column>
|
|
|
|
|
|
|
+ title="商品名称"></vxe-column>
|
|
|
|
|
+ <vxe-column min-width="80" align="center" field="tradeNumber" title="采购数量"></vxe-column>
|
|
|
|
|
+ <vxe-column min-width="100" align="center" field="brand" title="品牌"></vxe-column>
|
|
|
|
|
+ <vxe-column min-width="100" align="center" field="specification"
|
|
|
|
|
+ title="规格"></vxe-column>
|
|
|
<vxe-column min-width="100" align="center" field="company" title="单位"></vxe-column>
|
|
<vxe-column min-width="100" align="center" field="company" title="单位"></vxe-column>
|
|
|
<vxe-column min-width="100" align="center" field="remarks" title="备注"></vxe-column>
|
|
<vxe-column min-width="100" align="center" field="remarks" title="备注"></vxe-column>
|
|
|
<vxe-column align="center" title="操作" fixed="right" width="150">
|
|
<vxe-column align="center" title="操作" fixed="right" width="150">
|
|
@@ -104,12 +97,11 @@
|
|
|
</el-divider>
|
|
</el-divider>
|
|
|
<el-row :gutter="15">
|
|
<el-row :gutter="15">
|
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
|
- <vxe-table border show-footer show-overflow :footer-method="footerMethod2" ref="detailTableWare"
|
|
|
|
|
- class="vxe-table-element" :data="inputForm.wareHouse" style="margin-left: 3em"
|
|
|
|
|
- highlight-current-row
|
|
|
|
|
|
|
+ <vxe-table border show-footer show-overflow ref="detailTableWare" class="vxe-table-element"
|
|
|
|
|
+ :data="inputForm.wareHouse" style="margin-left: 3em" highlight-current-row
|
|
|
:edit-config="{ trigger: 'click', mode: 'row', showStatus: false, autoClear: !shelfLifeUnitSelectVisible, icon: '-' }"
|
|
:edit-config="{ trigger: 'click', mode: 'row', showStatus: false, autoClear: !shelfLifeUnitSelectVisible, icon: '-' }"
|
|
|
:edit-rules="validRules" :key="tableKey">
|
|
:edit-rules="validRules" :key="tableKey">
|
|
|
- <vxe-table-column min-width="100px" align="center" field="wareHouseMan" title="入库人"
|
|
|
|
|
|
|
+ <!-- <vxe-table-column min-width="100px" align="center" field="wareHouseMan" title="入库人"
|
|
|
:edit-render="{}">
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
<el-input v-model="scope.row.wareHouseMan"
|
|
<el-input v-model="scope.row.wareHouseMan"
|
|
@@ -121,15 +113,15 @@
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
<el-input :disabled='true' v-model="scope.row.wareHouseManOffice"></el-input>
|
|
<el-input :disabled='true' v-model="scope.row.wareHouseManOffice"></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
|
|
- <vxe-table-column min-width="100px" align="center" field="wareHouseType" title="入库类型"
|
|
|
|
|
|
|
+ </vxe-table-column> -->
|
|
|
|
|
+ <vxe-table-column min-width="100px" align="center" field="wareHouseType" title="商品名称"
|
|
|
:edit-render="{}">
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
<el-input v-model="scope.row.wareHouseType"
|
|
<el-input v-model="scope.row.wareHouseType"
|
|
|
@focus="typePullForm(scope.$rowIndex)"></el-input>
|
|
@focus="typePullForm(scope.$rowIndex)"></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-table-column>
|
|
</vxe-table-column>
|
|
|
- <vxe-table-column min-width="180px" align="center" field="tradeName" title="商品名称"
|
|
|
|
|
|
|
+ <!-- <vxe-table-column min-width="180px" align="center" field="tradeName" title="商品名称"
|
|
|
:edit-render="{}">
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
<vxe-pulldown ref="xDown1" transfer>
|
|
<vxe-pulldown ref="xDown1" transfer>
|
|
@@ -148,8 +140,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-pulldown>
|
|
</vxe-pulldown>
|
|
|
</template>
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
|
|
- <vxe-table-column min-width="100px" align="center" field="supplierName" title="供应商"
|
|
|
|
|
|
|
+ </vxe-table-column> -->
|
|
|
|
|
+ <!-- <vxe-table-column min-width="100px" align="center" field="supplierName" title="供应商"
|
|
|
:edit-render="{}">
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
<vxe-pulldown ref="xDown4" transfer>
|
|
<vxe-pulldown ref="xDown4" transfer>
|
|
@@ -175,8 +167,8 @@
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-pulldown>
|
|
</vxe-pulldown>
|
|
|
</template>
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
|
|
- <vxe-table-column min-width="80px" align="center" field="tradeNumber" title="商品数量"
|
|
|
|
|
|
|
+ </vxe-table-column> -->
|
|
|
|
|
+ <vxe-table-column min-width="80px" align="center" field="tradeNumber" title="入库数量"
|
|
|
:edit-render="{}">
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
<el-input @change="changeValue2" v-model="scope.row.tradeNumber"
|
|
<el-input @change="changeValue2" v-model="scope.row.tradeNumber"
|
|
@@ -184,45 +176,45 @@
|
|
|
maxlength="10"></el-input>
|
|
maxlength="10"></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-table-column>
|
|
</vxe-table-column>
|
|
|
- <vxe-table-column min-width="80px" align="center" field="company" title="单位"
|
|
|
|
|
- :edit-render="{}">
|
|
|
|
|
|
|
+ <vxe-table-column min-width="80px" align="center" field="brand" title="品牌">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
- <el-input maxlength="64" v-model="scope.row.company"></el-input>
|
|
|
|
|
|
|
+ <el-input maxlength="64" v-model="scope.row.brand"></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-table-column>
|
|
</vxe-table-column>
|
|
|
- <vxe-table-column min-width="80px" align="center" field="spec" title="包装规格"
|
|
|
|
|
- :edit-render="{}">
|
|
|
|
|
|
|
+ <vxe-table-column min-width="80px" align="center" field="specification" title="规格">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
- <!-- 只能输入数字 -->
|
|
|
|
|
- <el-input maxlength="64" v-model="scope.row.spec"
|
|
|
|
|
- @blur="scope.row.spec = handleCheckNumber(scope.row.spec)"></el-input>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <el-input maxlength="64" v-model="scope.row.specification"></el-input>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </vxe-table-column>
|
|
|
|
|
+ <vxe-table-column min-width="80px" align="center" field="company" title="单位">
|
|
|
|
|
+ <template v-slot:edit="scope">
|
|
|
|
|
+ <el-input maxlength="64" v-model="scope.row.company"></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-table-column>
|
|
</vxe-table-column>
|
|
|
- <vxe-table-column min-width="80px" align="center" field="tradePrice" title="商品单价(元)"
|
|
|
|
|
|
|
+ <!-- <vxe-table-column min-width="80px" align="center" field="tradePrice" title="商品单价(元)"
|
|
|
:edit-render="{}">
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
<el-input @change="changeValue2" maxlength="15" v-model="scope.row.tradePrice"
|
|
<el-input @change="changeValue2" maxlength="15" v-model="scope.row.tradePrice"
|
|
|
@blur="scope.row.tradePrice = twoDecimalPlaces2(scope.row.tradePrice)"></el-input>
|
|
@blur="scope.row.tradePrice = twoDecimalPlaces2(scope.row.tradePrice)"></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
|
|
- <vxe-table-column min-width="80px" align="center" field="priceSum" title="商品总价"
|
|
|
|
|
|
|
+ </vxe-table-column> -->
|
|
|
|
|
+ <!-- <vxe-table-column min-width="80px" align="center" field="priceSum" title="商品总价"
|
|
|
:edit-render="{}">
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
<el-input :disabled='true' v-model="scope.row.priceSum"
|
|
<el-input :disabled='true' v-model="scope.row.priceSum"
|
|
|
@blur="scope.row.priceSum = twoDecimalPlaces(scope.row.priceSum)"
|
|
@blur="scope.row.priceSum = twoDecimalPlaces(scope.row.priceSum)"
|
|
|
maxlength="15"></el-input>
|
|
maxlength="15"></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
|
|
- <vxe-table-column min-width="180px" align="center" field="produceDate" title="生产日期"
|
|
|
|
|
|
|
+ </vxe-table-column> -->
|
|
|
|
|
+ <!-- <vxe-table-column min-width="180px" align="center" field="produceDate" title="生产日期"
|
|
|
:edit-render="{}">
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
<el-date-picker v-model="scope.row.produceDate" type="date" placement="bottom-start"
|
|
<el-date-picker v-model="scope.row.produceDate" type="date" placement="bottom-start"
|
|
|
value-format="YYYY-MM-DD" style="width: 100%" placeholder="选择生产日期">
|
|
value-format="YYYY-MM-DD" style="width: 100%" placeholder="选择生产日期">
|
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
|
</template>
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
|
|
- <vxe-table-column min-width="160px" align="center" field="shelfLife" title="保质期"
|
|
|
|
|
|
|
+ </vxe-table-column> -->
|
|
|
|
|
+ <!-- <vxe-table-column min-width="160px" align="center" field="shelfLife" title="保质期"
|
|
|
:edit-render="{}">
|
|
:edit-render="{}">
|
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
|
<span v-if="scope.row.shelfLife && scope.row.shelfLifeUnit">
|
|
<span v-if="scope.row.shelfLife && scope.row.shelfLifeUnit">
|
|
@@ -241,15 +233,15 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</template>
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
|
|
- <vxe-table-column min-width="80px" align="center" field="actualPrice" title="实际价格"
|
|
|
|
|
|
|
+ </vxe-table-column> -->
|
|
|
|
|
+ <!-- <vxe-table-column min-width="80px" align="center" field="actualPrice" title="实际价格"
|
|
|
:edit-render="{}">
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
<el-input v-model="scope.row.actualPrice"
|
|
<el-input v-model="scope.row.actualPrice"
|
|
|
@blur="scope.row.actualPrice = twoDecimalPlaces(scope.row.actualPrice)"
|
|
@blur="scope.row.actualPrice = twoDecimalPlaces(scope.row.actualPrice)"
|
|
|
maxlength="15"></el-input>
|
|
maxlength="15"></el-input>
|
|
|
</template>
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
|
|
|
|
+ </vxe-table-column> -->
|
|
|
|
|
|
|
|
<vxe-table-column min-width="80px" align="center" field="remarks" title="备注"
|
|
<vxe-table-column min-width="80px" align="center" field="remarks" title="备注"
|
|
|
:edit-render="{}">
|
|
:edit-render="{}">
|
|
@@ -308,29 +300,17 @@ import ContractChooseForm from '../contract/ContractChooseForm'
|
|
|
import XEUtils from 'xe-utils'
|
|
import XEUtils from 'xe-utils'
|
|
|
import UpdateInfoForm from '../info/UpdateInfoForm'
|
|
import UpdateInfoForm from '../info/UpdateInfoForm'
|
|
|
import SupplierService from '@/api/psi/SupplierService'
|
|
import SupplierService from '@/api/psi/SupplierService'
|
|
|
-import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
|
|
export default {
|
|
export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
validRules: {
|
|
validRules: {
|
|
|
- wareHouseMan: [
|
|
|
|
|
- { required: true, message: '请选择入库人' }
|
|
|
|
|
- ],
|
|
|
|
|
wareHouseType: [
|
|
wareHouseType: [
|
|
|
- { required: true, message: '请选择入库类型' }
|
|
|
|
|
- ],
|
|
|
|
|
- supplierName: [
|
|
|
|
|
- { required: true, message: '请选择供应商' }
|
|
|
|
|
- ],
|
|
|
|
|
- tradeName: [
|
|
|
|
|
{ required: true, message: '请填写商品名称' }
|
|
{ required: true, message: '请填写商品名称' }
|
|
|
],
|
|
],
|
|
|
|
|
+
|
|
|
tradeNumber: [
|
|
tradeNumber: [
|
|
|
{ required: true, message: '商品数量不能为空' }
|
|
{ required: true, message: '商品数量不能为空' }
|
|
|
],
|
|
],
|
|
|
- spec: [
|
|
|
|
|
- { required: true, message: '请填写包装规格' }
|
|
|
|
|
- ],
|
|
|
|
|
},
|
|
},
|
|
|
purchaseId: '',
|
|
purchaseId: '',
|
|
|
title: '',
|
|
title: '',
|
|
@@ -411,6 +391,7 @@ export default {
|
|
|
methods: {
|
|
methods: {
|
|
|
init(method, id) {
|
|
init(method, id) {
|
|
|
this.method = method
|
|
this.method = method
|
|
|
|
|
+ const wareHouseDate = this.moment(new Date()).format('YYYY-MM-DD')
|
|
|
this.inputForm = {
|
|
this.inputForm = {
|
|
|
wareHouseTotalPrice: '', // 入库商品总价
|
|
wareHouseTotalPrice: '', // 入库商品总价
|
|
|
wareHouseActualPrice: '', // 入库商品实际价格
|
|
wareHouseActualPrice: '', // 入库商品实际价格
|
|
@@ -421,10 +402,10 @@ export default {
|
|
|
handledBy: this.$store.state.user.name,
|
|
handledBy: this.$store.state.user.name,
|
|
|
handledById: this.$store.state.user.id,
|
|
handledById: this.$store.state.user.id,
|
|
|
handledByOffice: this.$store.state.user.office.id,
|
|
handledByOffice: this.$store.state.user.office.id,
|
|
|
- wareHouseName: '',
|
|
|
|
|
|
|
+ wareHouseName: method === 'add' || method === 'purchaseAdd' ? this.buildPurchaseSketch(wareHouseDate) : '', // 入库名称
|
|
|
wareHouseNumber: '', // 入库编号
|
|
wareHouseNumber: '', // 入库编号
|
|
|
userId: this.$store.state.user.id,
|
|
userId: this.$store.state.user.id,
|
|
|
- wareHouseDate: '',
|
|
|
|
|
|
|
+ wareHouseDate: wareHouseDate,
|
|
|
remarks: '',
|
|
remarks: '',
|
|
|
detailInfos: [],
|
|
detailInfos: [],
|
|
|
wareHouse: [],
|
|
wareHouse: [],
|
|
@@ -491,6 +472,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ buildPurchaseSketch(purchaseDate) {
|
|
|
|
|
+ return `${this.$store.state.user.name} ${purchaseDate} 入库`
|
|
|
|
|
+ },
|
|
|
getContract(row) {
|
|
getContract(row) {
|
|
|
this.materialManagementService.findById(row.id).then((data) => {
|
|
this.materialManagementService.findById(row.id).then((data) => {
|
|
|
this.inputForm.detailInfos = data.detailInfos
|
|
this.inputForm.detailInfos = data.detailInfos
|
|
@@ -583,6 +567,7 @@ export default {
|
|
|
getProgramForType(rows) {
|
|
getProgramForType(rows) {
|
|
|
this.inputForm.wareHouse[this.indexRow].wareHouseTypeId = rows.id
|
|
this.inputForm.wareHouse[this.indexRow].wareHouseTypeId = rows.id
|
|
|
this.inputForm.wareHouse[this.indexRow].wareHouseType = rows.name
|
|
this.inputForm.wareHouse[this.indexRow].wareHouseType = rows.name
|
|
|
|
|
+ this.inputForm.wareHouse[this.indexRow].tradeName = rows.name
|
|
|
// this.inputForm.detailInfos[this.indexRow].procurementType = rows.name
|
|
// this.inputForm.detailInfos[this.indexRow].procurementType = rows.name
|
|
|
this.indexRow = ''
|
|
this.indexRow = ''
|
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
@@ -747,80 +732,49 @@ export default {
|
|
|
let i = this.inputForm.wareHouse.length
|
|
let i = this.inputForm.wareHouse.length
|
|
|
for (let j = 0; j < i; j++) {
|
|
for (let j = 0; j < i; j++) {
|
|
|
let k = j + 1
|
|
let k = j + 1
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseMan)) {
|
|
|
|
|
- this.$message.error('入库详情第' + k + '行请选择入库人')
|
|
|
|
|
- this.loading = false
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseMan)) {
|
|
|
|
|
+ // this.$message.error('入库详情第' + k + '行请选择入库人')
|
|
|
|
|
+ // this.loading = false
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseType)) {
|
|
|
|
|
+ // this.$message.error('入库详情第' + k + '行请选择入库类型')
|
|
|
|
|
+ // this.loading = false
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].supplierName) || this.commonJS.isEmpty(this.inputForm.wareHouse[j].supplierId)) {
|
|
|
|
|
+ // this.$message.error('入库详情第' + k + '行请选择供应商')
|
|
|
|
|
+ // this.loading = false
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseType)) {
|
|
if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseType)) {
|
|
|
- this.$message.error('入库详情第' + k + '行请选择入库类型')
|
|
|
|
|
- this.loading = false
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].supplierName) || this.commonJS.isEmpty(this.inputForm.wareHouse[j].supplierId)) {
|
|
|
|
|
- this.$message.error('入库详情第' + k + '行请选择供应商')
|
|
|
|
|
- this.loading = false
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].tradeName)) {
|
|
|
|
|
this.$message.error('入库详情第' + k + '行请填写商品名称')
|
|
this.$message.error('入库详情第' + k + '行请填写商品名称')
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].tradeNumber)) {
|
|
if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].tradeNumber)) {
|
|
|
- this.$message.error('入库详情第' + k + '行请填写商品数量')
|
|
|
|
|
|
|
+ this.$message.error('入库详情第' + k + '行请填写入库数量')
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
this.inputForm.functionFlag = ''
|
|
this.inputForm.functionFlag = ''
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].spec)) {
|
|
|
|
|
- this.$message.error('入库详情第' + k + '行请填写包装规格')
|
|
|
|
|
- this.loading = false
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].specification)) {
|
|
|
|
|
+ // this.$message.error('入库详情第' + k + '行请填写规格')
|
|
|
|
|
+ // this.loading = false
|
|
|
|
|
+ // return
|
|
|
|
|
+ // }
|
|
|
}
|
|
}
|
|
|
for (let j = 0; j < i; j++) {
|
|
for (let j = 0; j < i; j++) {
|
|
|
for (let k = j + 1; k < i; k++) {
|
|
for (let k = j + 1; k < i; k++) {
|
|
|
if (this.inputForm.wareHouse[j].wareHouseTypeId === this.inputForm.wareHouse[k].wareHouseTypeId) { // 如果入库类型相同
|
|
if (this.inputForm.wareHouse[j].wareHouseTypeId === this.inputForm.wareHouse[k].wareHouseTypeId) { // 如果入库类型相同
|
|
|
- if (this.inputForm.wareHouse[j].tradeName === this.inputForm.wareHouse[k].tradeName) { // 如果商品名称相同
|
|
|
|
|
- // 这里直接通过判断供应商的id是否相等,因为入库只允许选择供应商,不允许手填
|
|
|
|
|
- if (this.inputForm.wareHouse[j].supplierId === this.inputForm.wareHouse[k].supplierId) {
|
|
|
|
|
- this.$message.warning(`入库详情中,同种入库类型、同一供应商的商品名称只能输入一条`)
|
|
|
|
|
- this.loading = false
|
|
|
|
|
- throw new Error('入库详情中,同种入库类型、同一供应商的商品名称只能输入一条')
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 这里直接通过判断供应商的id是否相等,因为入库只允许选择供应商,不允许手填
|
|
|
|
|
+ this.$message.warning(`入库详情中,同种入库类型的商品名称只能输入一条`)
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ throw new Error('入库详情中,同种入库类型的商品名称只能输入一条')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- let submitFlag = false
|
|
|
|
|
- let goodIndex = 0
|
|
|
|
|
- let m = this.inputForm.wareHouse.length
|
|
|
|
|
- for (let j = 0; j < m; j++) {
|
|
|
|
|
- //如果保质期和生产日期有一个为空,就提示
|
|
|
|
|
- if ((this.commonJS.isEmpty(this.inputForm.wareHouse[j].produceDate) && this.commonJS.isNotEmpty(this.inputForm.wareHouse[j].shelfLife)) || (this.commonJS.isNotEmpty(this.inputForm.wareHouse[j].produceDate) && this.commonJS.isEmpty(this.inputForm.wareHouse[j].shelfLife))) {
|
|
|
|
|
- submitFlag = true
|
|
|
|
|
- goodIndex = j
|
|
|
|
|
- break
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if (submitFlag) {
|
|
|
|
|
- ElMessageBox.confirm(
|
|
|
|
|
- '入库详情第' + (goodIndex + 1) + '行的' + this.inputForm.wareHouse[goodIndex].tradeName + '的生产日期或保质期未填写,是否继续提交?',
|
|
|
|
|
- '提示',
|
|
|
|
|
- {
|
|
|
|
|
- confirmButtonText: '确定',
|
|
|
|
|
- cancelButtonText: '取消',
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- }
|
|
|
|
|
- )
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.handleSubmitData()
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- this.handleSubmitData()
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ this.handleSubmitData()
|
|
|
},
|
|
},
|
|
|
handleSubmitData() {
|
|
handleSubmitData() {
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
@@ -869,6 +823,7 @@ export default {
|
|
|
data.wareHouseManId = this.wareHouseManId
|
|
data.wareHouseManId = this.wareHouseManId
|
|
|
data.wareHouseMan = this.name
|
|
data.wareHouseMan = this.name
|
|
|
data.wareHouseManOffice = this.officeName
|
|
data.wareHouseManOffice = this.officeName
|
|
|
|
|
+ data.spec = '1'
|
|
|
// this.inputForm.detailInfos.push(data)
|
|
// this.inputForm.detailInfos.push(data)
|
|
|
this.inputForm.wareHouse.push(data)
|
|
this.inputForm.wareHouse.push(data)
|
|
|
this.tableKey = Math.random()
|
|
this.tableKey = Math.random()
|
|
@@ -917,10 +872,12 @@ export default {
|
|
|
tradePrice: this.inputForm.detailInfos[index].tradePrice,
|
|
tradePrice: this.inputForm.detailInfos[index].tradePrice,
|
|
|
company: this.inputForm.detailInfos[index].company,
|
|
company: this.inputForm.detailInfos[index].company,
|
|
|
priceSum: this.inputForm.detailInfos[index].priceSum,
|
|
priceSum: this.inputForm.detailInfos[index].priceSum,
|
|
|
|
|
+ specification: this.inputForm.detailInfos[index].specification,
|
|
|
|
|
+ spec: this.inputForm.detailInfos[index].spec || '1',
|
|
|
|
|
+ brand: this.inputForm.detailInfos[index].brand,
|
|
|
supplierId: '',
|
|
supplierId: '',
|
|
|
supplierName: '',
|
|
supplierName: '',
|
|
|
isSupplier: '',
|
|
isSupplier: '',
|
|
|
- spec: "",
|
|
|
|
|
produceDate: "",
|
|
produceDate: "",
|
|
|
shelfLife: "",
|
|
shelfLife: "",
|
|
|
shelfLifeUnit: "月"
|
|
shelfLifeUnit: "月"
|