|
|
@@ -65,17 +65,19 @@
|
|
|
<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-column min-width="100" align="center" field="purchaserAgent" title="采购人"></vxe-column> -->
|
|
|
+ <!-- <vxe-column min-width="100" align="center" field="procurementOffice"
|
|
|
+ title="采购部门"></vxe-column> -->
|
|
|
<vxe-column min-width="100" align="center" field="procurementType"
|
|
|
- title="采购类型"></vxe-column>
|
|
|
+ title="商品名称"></vxe-column>
|
|
|
<vxe-column min-width="220" align="center" field="tradeName" title="商品名称"></vxe-column>
|
|
|
- <vxe-column min-width="100" align="center" field="supplierName" 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>
|
|
|
- <vxe-column min-width="100" align="center" field="company" title="单位"></vxe-column>
|
|
|
+ <vxe-column min-width="80px" align="center" field="brand" title="品牌"></vxe-column>
|
|
|
+ <vxe-column min-width="80px" align="center" field="specification" title="规格"></vxe-column>
|
|
|
+ <vxe-column min-width="80px" align="center" field="company" title="单位"></vxe-column>
|
|
|
+ <!-- <vxe-column min-width="100" align="center" field="supplierName" 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> -->
|
|
|
<vxe-column min-width="100" align="center" field="remarks" title="备注"></vxe-column>
|
|
|
<vxe-column align="center" title="操作" fixed="right" width="80">
|
|
|
<template v-slot="scope">
|
|
|
@@ -96,7 +98,7 @@
|
|
|
<vxe-table border show-footer show-overflow :footer-method="footerMethod2" ref="detailTableWare"
|
|
|
class="vxe-table-element" :data="inputForm.wareHouse" style="margin-left: 3em"
|
|
|
:row-class-name="rowClassName" :key="tableKey">
|
|
|
- <vxe-column min-width="100px" align="center" field="wareHouseMan" title="入库人">
|
|
|
+ <!-- <vxe-column min-width="100px" align="center" field="wareHouseMan" title="入库人">
|
|
|
<template v-slot="scope">
|
|
|
<span v-if="scope.row.upFlag === '1'"> {{ scope.row.wareHouseMan }}(修改前) </span>
|
|
|
<span v-else-if="scope.row.upFlag === '2'"> {{ scope.row.wareHouseMan }}(已删除) </span>
|
|
|
@@ -105,20 +107,31 @@
|
|
|
<span v-else-if="scope.row.upFlag === '0' && commonJS.isEmpty(scope.row.sourceId)">
|
|
|
{{ scope.row.wareHouseMan }} </span>
|
|
|
</template>
|
|
|
+ </vxe-column> -->
|
|
|
+ <!-- <vxe-column min-width="100px" align="center" field="wareHouseManOffice"
|
|
|
+ title="入库部门"></vxe-column> -->
|
|
|
+ <vxe-column min-width="100px" align="center" field="wareHouseType" title="商品名称">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <span v-if="scope.row.upFlag === '1'"> {{ scope.row.tradeName }}(修改前) </span>
|
|
|
+ <span v-else-if="scope.row.upFlag === '2'"> {{ scope.row.tradeName }}(已删除) </span>
|
|
|
+ <span v-else-if="scope.row.upFlag === '0' && commonJS.isNotEmpty(scope.row.sourceId)">
|
|
|
+ {{ scope.row.tradeName }}(修改后) </span>
|
|
|
+ <span v-else-if="scope.row.upFlag === '0' && commonJS.isEmpty(scope.row.sourceId)">
|
|
|
+ {{ scope.row.tradeName }} </span>
|
|
|
+ </template>
|
|
|
</vxe-column>
|
|
|
- <vxe-column min-width="100px" align="center" field="wareHouseManOffice"
|
|
|
- title="入库部门"></vxe-column>
|
|
|
- <vxe-column min-width="100px" align="center" field="wareHouseType" title="入库类型"></vxe-column>
|
|
|
- <vxe-column min-width="180px" align="center" field="tradeName" title="商品名称"></vxe-column>
|
|
|
- <vxe-column min-width="150px" align="center" field="supplierName" title="供应商"></vxe-column>
|
|
|
+ <!-- <vxe-column min-width="180px" align="center" field="tradeName" title="商品名称"></vxe-column> -->
|
|
|
+ <!-- <vxe-column min-width="150px" align="center" field="supplierName" title="供应商"></vxe-column> -->
|
|
|
<vxe-column min-width="80px" align="center" field="tradeNumber" title="商品数量"></vxe-column>
|
|
|
+ <vxe-column min-width="80px" align="center" field="brand" title="品牌"></vxe-column>
|
|
|
+ <vxe-column min-width="80px" align="center" field="specification" title="规格"></vxe-column>
|
|
|
<vxe-column min-width="80px" align="center" field="company" title="单位"></vxe-column>
|
|
|
- <vxe-column min-width="80px" align="center" field="spec" title="包装规格"></vxe-column>
|
|
|
- <vxe-column min-width="80px" align="center" field="tradePrice" title="商品单价(元)"></vxe-column>
|
|
|
- <vxe-column min-width="80px" align="center" field="priceSum" title="商品总价"></vxe-column>
|
|
|
- <vxe-column min-width="180px" align="center" field="produceDate" title="生产日期"></vxe-column>
|
|
|
- <vxe-column min-width="80px" align="center" field="shelfLife" title="保质期"></vxe-column>
|
|
|
- <vxe-column min-width="80px" align="center" field="actualPrice" title="实际价格"></vxe-column>
|
|
|
+ <!-- <vxe-column min-width="80px" align="center" field="spec" title="包装规格"></vxe-column> -->
|
|
|
+ <!-- <vxe-column min-width="80px" align="center" field="tradePrice" title="商品单价(元)"></vxe-column> -->
|
|
|
+ <!-- <vxe-column min-width="80px" align="center" field="priceSum" title="商品总价"></vxe-column> -->
|
|
|
+ <!-- <vxe-column min-width="180px" align="center" field="produceDate" title="生产日期"></vxe-column> -->
|
|
|
+ <!-- <vxe-column min-width="80px" align="center" field="shelfLife" title="保质期"></vxe-column> -->
|
|
|
+ <!-- <vxe-column min-width="80px" align="center" field="actualPrice" title="实际价格"></vxe-column> -->
|
|
|
<vxe-column min-width="110px" align="center" field="remarks" title="备注"></vxe-column>
|
|
|
<vxe-column align="center" fixed="right" title="操作" width="80px">
|
|
|
<template v-slot="scope">
|
|
|
@@ -136,7 +149,7 @@
|
|
|
highlight-current-row
|
|
|
:edit-config="{ trigger: 'click', mode: 'row', showStatus: false, autoClear: !shelfLifeUnitSelectVisible, icon: '-' }"
|
|
|
:edit-rules="validRules">
|
|
|
- <vxe-table-column min-width="100px" align="center" field="wareHouseMan" title="入库人"
|
|
|
+ <!-- <vxe-table-column min-width="100px" align="center" field="wareHouseMan" title="入库人"
|
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
|
<el-input v-model="scope.row.wareHouseMan"
|
|
|
@@ -148,8 +161,8 @@
|
|
|
<template v-slot:edit="scope">
|
|
|
<el-input :disabled='true' v-model="scope.row.wareHouseManOffice"></el-input>
|
|
|
</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="{}">
|
|
|
<template v-slot:edit="scope">
|
|
|
<el-input v-model="scope.row.wareHouseType"
|
|
|
@@ -157,27 +170,27 @@
|
|
|
</template>
|
|
|
</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="{}">
|
|
|
<template v-slot:edit="scope">
|
|
|
- <!-- <el-input @change="ifSameValue" maxlength="64" v-model="scope.row.tradeName"></el-input>-->
|
|
|
- <vxe-pulldown ref="xDown1" transfer>
|
|
|
- <template #default>
|
|
|
- <vxe-input v-model="scope.row.tradeName" placeholder="请输入商品名称" maxlength="64"
|
|
|
- @focus="focusEvent1(scope.row)" @input="keyupEvent1(scope.row)"></vxe-input>
|
|
|
- </template>
|
|
|
- <template #dropdown>
|
|
|
- <div class="my-dropdown1">
|
|
|
- <div class="list-item1" v-for="item in scope.row.tradeNameData"
|
|
|
- :key="item.id" @click="selectEvent1(scope.row, item)">
|
|
|
- <span>{{ item.tradeName }}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </vxe-pulldown>
|
|
|
+ <el-input @change="ifSameValue" maxlength="64" v-model="scope.row.tradeName"></el-input>
|
|
|
+ <vxe-pulldown ref="xDown1" transfer>
|
|
|
+ <template #default>
|
|
|
+ <vxe-input v-model="scope.row.tradeName" placeholder="请输入商品名称" maxlength="64"
|
|
|
+ @focus="focusEvent1(scope.row)" @input="keyupEvent1(scope.row)"></vxe-input>
|
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
- <vxe-table-column min-width="100px" align="center" field="supplierName" title="供应商"
|
|
|
+ <template #dropdown>
|
|
|
+ <div class="my-dropdown1">
|
|
|
+ <div class="list-item1" v-for="item in scope.row.tradeNameData" :key="item.id"
|
|
|
+ @click="selectEvent1(scope.row, item)">
|
|
|
+ <span>{{ item.tradeName }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </vxe-pulldown>
|
|
|
+</template>
|
|
|
+ </vxe-table-column> -->
|
|
|
+ <!-- <vxe-table-column min-width="100px" align="center" field="supplierName" title="供应商"
|
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
|
<vxe-pulldown ref="xDown4" transfer>
|
|
|
@@ -202,44 +215,47 @@
|
|
|
</template>
|
|
|
</vxe-pulldown>
|
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
+ </vxe-table-column> -->
|
|
|
<vxe-table-column min-width="80px" align="center" field="tradeNumber" title="商品数量"
|
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
|
- <el-input @change="changeValue2" v-model="scope.row.tradeNumber"
|
|
|
- @blur="scope.row.tradeNumber = twoDecimalPlaces2(scope.row.tradeNumber)"
|
|
|
+ <el-input @input="scope.row.tradeNumber = formatNonNegativeInteger($event)"
|
|
|
+ @change="changeValue2" v-model="scope.row.tradeNumber"
|
|
|
+ @blur="scope.row.tradeNumber = formatNonNegativeInteger(scope.row.tradeNumber)"
|
|
|
maxlength="10"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
- <vxe-table-column min-width="80px" align="center" field="company" title="单位" :edit-render="{}">
|
|
|
+ <vxe-column min-width="80px" align="center" field="brand" title="品牌"></vxe-column>
|
|
|
+ <vxe-column min-width="80px" align="center" field="specification" title="规格"></vxe-column>
|
|
|
+
|
|
|
+ <!-- <vxe-table-column min-width="80px" align="center" field="company" title="单位" :edit-render="{}">
|
|
|
<template #edit="scope">
|
|
|
<el-input maxlength="64" v-model="scope.row.company"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
<vxe-table-column min-width="80px" align="center" field="spec" title="包装规格" :edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
|
- <!-- 只能输入数字 -->
|
|
|
<el-input maxlength="64" v-model="scope.row.spec"
|
|
|
@blur="scope.row.spec = handleCheckNumber(scope.row.spec)"></el-input>
|
|
|
|
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
- <vxe-table-column min-width="80px" align="center" field="tradePrice" title="商品单价(元)"
|
|
|
+ </vxe-table-column> -->
|
|
|
+ <!-- <vxe-table-column min-width="80px" align="center" field="tradePrice" title="商品单价(元)"
|
|
|
:edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
|
<el-input @change="changeValue2" maxlength="15" v-model="scope.row.tradePrice"
|
|
|
@blur="scope.row.tradePrice = twoDecimalPlaces2(scope.row.tradePrice)"></el-input>
|
|
|
</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="{}">
|
|
|
<template v-slot:edit="scope">
|
|
|
<el-input :disabled='true' v-model="scope.row.priceSum"
|
|
|
@blur="scope.row.priceSum = twoDecimalPlaces(scope.row.priceSum)"
|
|
|
maxlength="15"></el-input>
|
|
|
</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="{}">
|
|
|
<template v-slot:edit="scope">
|
|
|
<el-date-picker v-model="scope.row.produceDate" type="date" placement="bottom-start"
|
|
|
@@ -266,15 +282,15 @@
|
|
|
</template>
|
|
|
</el-input>
|
|
|
</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="{}">
|
|
|
<template #edit="scope">
|
|
|
<el-input v-model="scope.row.actualPrice"
|
|
|
@blur="scope.row.actualPrice = twoDecimalPlaces(scope.row.actualPrice)"
|
|
|
maxlength="15"></el-input>
|
|
|
</template>
|
|
|
- </vxe-table-column>
|
|
|
+ </vxe-table-column> -->
|
|
|
|
|
|
<vxe-table-column min-width="80px" align="center" field="remarks" title="备注" :edit-render="{}">
|
|
|
<template #edit="scope">
|
|
|
@@ -333,15 +349,15 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
validRules: {
|
|
|
- wareHouseMan: [
|
|
|
- { required: true, message: '请选择入库人' }
|
|
|
- ],
|
|
|
+ // wareHouseMan: [
|
|
|
+ // { required: true, message: '请选择入库人' }
|
|
|
+ // ],
|
|
|
wareHouseType: [
|
|
|
- { required: true, message: '请选择入库类型' }
|
|
|
- ],
|
|
|
- supplierName: [
|
|
|
- { required: true, message: '请选择供应商' }
|
|
|
+ { required: true, message: '请选择商品' }
|
|
|
],
|
|
|
+ // supplierName: [
|
|
|
+ // { required: true, message: '请选择供应商' }
|
|
|
+ // ],
|
|
|
tradeName: [
|
|
|
{ required: true, message: '请填写商品名称' }
|
|
|
],
|
|
|
@@ -713,53 +729,35 @@ export default {
|
|
|
let i = this.inputForm.wareHouse.length
|
|
|
for (let j = 0; j < i; j++) {
|
|
|
let k = j + 1
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseMan)) {
|
|
|
- this.$message.error('入库详情第' + k + '行请选择入库人')
|
|
|
- this.loading = false
|
|
|
- this.inputForm.functionFlag = ''
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseMan)) {
|
|
|
+ // this.$message.error('入库详情第' + k + '行请选择入库人')
|
|
|
+ // this.loading = false
|
|
|
+ // this.inputForm.functionFlag = ''
|
|
|
+ // return
|
|
|
+ // }
|
|
|
if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].wareHouseType)) {
|
|
|
- this.$message.error('入库详情第' + k + '行请选择入库类型')
|
|
|
- this.loading = false
|
|
|
- this.inputForm.functionFlag = ''
|
|
|
- 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
|
|
|
- this.inputForm.functionFlag = ''
|
|
|
- return
|
|
|
- }
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].tradeName)) {
|
|
|
- this.$message.error('入库详情第' + k + '行请填写商品名称')
|
|
|
+ this.$message.error('入库详情第' + k + '行请选择商品')
|
|
|
this.loading = false
|
|
|
this.inputForm.functionFlag = ''
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].tradeNumber)) {
|
|
|
this.$message.error('入库详情第' + k + '行请填写商品数量')
|
|
|
this.loading = false
|
|
|
this.inputForm.functionFlag = ''
|
|
|
return
|
|
|
}
|
|
|
- if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].spec)) {
|
|
|
- this.$message.error('入库详情第' + k + '行请填写包装规格')
|
|
|
- this.loading = false
|
|
|
- this.inputForm.functionFlag = ''
|
|
|
- return
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
for (let j = 0; j < i; j++) {
|
|
|
for (let k = j + 1; k < i; k++) {
|
|
|
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('入库详情中,同种入库类型、同一供应商的商品名称只能输入一条')
|
|
|
- }
|
|
|
+ this.$message.warning(`入库详情中,同种入库类型、同一供应商的商品名称只能输入一条`)
|
|
|
+ this.loading = false
|
|
|
+ throw new Error('入库详情中,同种入库类型、同一供应商的商品名称只能输入一条')
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -885,6 +883,16 @@ export default {
|
|
|
// eslint-disable-next-line no-useless-escape
|
|
|
this.inputForm.detailInfos[index].priceSum = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
|
|
|
},
|
|
|
+ formatNonNegativeInteger(value) {
|
|
|
+ if (value === null || value === undefined || value === '') {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ const text = String(value).replace(/[^\d]/g, '')
|
|
|
+ if (text === '') {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ return String(Number(text))
|
|
|
+ },
|
|
|
countAmount(row) {
|
|
|
let amount
|
|
|
let taxAmount
|
|
|
@@ -909,6 +917,7 @@ export default {
|
|
|
getProgramForType(rows) {
|
|
|
this.inputForm.wareHouse[this.indexRow].wareHouseTypeId = rows.id
|
|
|
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.indexRow = ''
|
|
|
this.$forceUpdate()
|