|
@@ -66,21 +66,28 @@
|
|
|
</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 ref="detailTable" class="vxe-table-element"
|
|
|
|
|
- :data="inputForm.detailInfos" style="margin-left: 3em">
|
|
|
|
|
|
|
+ <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="procurementType"
|
|
<vxe-column min-width="100" align="center" field="procurementType"
|
|
|
- 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>
|
|
|
|
|
|
|
+ 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>
|
|
|
<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">
|
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
|
|
|
+ <vxe-button size="small" v-if="method === 'purchaseAdd'" status="primary"
|
|
|
|
|
+ :disabled="false" @click="wareHouseAdd(scope.$rowIndex)">入库</vxe-button>
|
|
|
<vxe-button size="small" status="primary" :disabled="false"
|
|
<vxe-button size="small" status="primary" :disabled="false"
|
|
|
- @click="wareHouseAdd(scope.$rowIndex)">入库</vxe-button>
|
|
|
|
|
- <vxe-button v-show="false" size="small" status="primary" :disabled="false"
|
|
|
|
|
@click="seeFileInfo(scope.$rowIndex)">附件</vxe-button>
|
|
@click="seeFileInfo(scope.$rowIndex)">附件</vxe-button>
|
|
|
</template>
|
|
</template>
|
|
|
</vxe-column>
|
|
</vxe-column>
|
|
@@ -97,11 +104,12 @@
|
|
|
</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 ref="detailTableWare" class="vxe-table-element"
|
|
|
|
|
- :data="inputForm.wareHouse" style="margin-left: 3em" highlight-current-row
|
|
|
|
|
|
|
+ <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
|
|
|
: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"
|
|
@@ -113,15 +121,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>
|
|
@@ -140,8 +148,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>
|
|
@@ -167,55 +175,54 @@
|
|
|
</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"
|
|
|
- @input="scope.row.tradeNumber = formatPositiveInteger($event)"
|
|
|
|
|
- @blur="scope.row.tradeNumber = formatPositiveInteger(scope.row.tradeNumber)"
|
|
|
|
|
|
|
+ @blur="scope.row.tradeNumber = twoDecimalPlaces2(scope.row.tradeNumber)"
|
|
|
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="brand" title="品牌">
|
|
|
|
|
- <template v-slot:edit="scope">
|
|
|
|
|
- <el-input maxlength="64" v-model="scope.row.brand"></el-input>
|
|
|
|
|
- </template>
|
|
|
|
|
- </vxe-table-column>
|
|
|
|
|
- <vxe-table-column min-width="80px" align="center" field="specification" title="规格">
|
|
|
|
|
|
|
+ <vxe-table-column min-width="80px" align="center" field="company" title="单位"
|
|
|
|
|
+ :edit-render="{}">
|
|
|
<template v-slot:edit="scope">
|
|
<template v-slot:edit="scope">
|
|
|
- <el-input maxlength="64" v-model="scope.row.specification"></el-input>
|
|
|
|
|
|
|
+ <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="company" title="单位">
|
|
|
|
|
|
|
+ <vxe-table-column min-width="80px" align="center" field="spec" title="包装规格"
|
|
|
|
|
+ :edit-render="{}">
|
|
|
<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.spec"
|
|
|
|
|
+ @blur="scope.row.spec = handleCheckNumber(scope.row.spec)"></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">
|
|
@@ -234,15 +241,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="{}">
|
|
@@ -252,9 +259,9 @@
|
|
|
</vxe-table-column>
|
|
</vxe-table-column>
|
|
|
<vxe-table-column align="center" fixed="right" title="操作" width="220px">
|
|
<vxe-table-column align="center" fixed="right" title="操作" width="220px">
|
|
|
<template v-slot="scope">
|
|
<template v-slot="scope">
|
|
|
- <vxe-button status="primary" v-show="false" :disabled="false"
|
|
|
|
|
|
|
+ <vxe-button status="primary" v-show="method === 'view'" :disabled="false"
|
|
|
@click="seeFileInfo2(scope.$rowIndex)">查看附件</vxe-button>
|
|
@click="seeFileInfo2(scope.$rowIndex)">查看附件</vxe-button>
|
|
|
- <vxe-button status="primary" v-if="method !== 'view'" v-show="false"
|
|
|
|
|
|
|
+ <vxe-button status="primary" v-if="method !== 'view'"
|
|
|
@click="sss2(scope.$rowIndex)">上传附件</vxe-button>
|
|
@click="sss2(scope.$rowIndex)">上传附件</vxe-button>
|
|
|
<vxe-button status="danger" v-if="method !== 'view'"
|
|
<vxe-button status="danger" v-if="method !== 'view'"
|
|
|
@click="removeEvent(scope.row, scope.$rowIndex, 'detail')">删除</vxe-button>
|
|
@click="removeEvent(scope.row, scope.$rowIndex, 'detail')">删除</vxe-button>
|
|
@@ -267,11 +274,7 @@
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<!-- 附件 -->
|
|
<!-- 附件 -->
|
|
|
<UpdateInfoForm ref="updateInfoForm"></UpdateInfoForm>
|
|
<UpdateInfoForm ref="updateInfoForm"></UpdateInfoForm>
|
|
|
- <div v-show="method === 'view'">
|
|
|
|
|
- <div v-show="false">
|
|
|
|
|
- <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
|
|
|
<MaterialManagementDialog ref="materialManagementDialog" @getUpload="getUpload"></MaterialManagementDialog>
|
|
<MaterialManagementDialog ref="materialManagementDialog" @getUpload="getUpload"></MaterialManagementDialog>
|
|
|
<CwProgramPageForm ref="cwProgramPageForm" @getProgram="getProgram"></CwProgramPageForm>
|
|
<CwProgramPageForm ref="cwProgramPageForm" @getProgram="getProgram"></CwProgramPageForm>
|
|
|
<MaterialTypePullForm ref="materialTypePullForm" @getProgramForType="getProgramForType">
|
|
<MaterialTypePullForm ref="materialTypePullForm" @getProgramForType="getProgramForType">
|
|
@@ -305,17 +308,29 @@ 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: '',
|
|
@@ -396,7 +411,6 @@ 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: '', // 入库商品实际价格
|
|
@@ -407,10 +421,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: method === 'add' || method === 'purchaseAdd' ? this.buildPurchaseSketch(wareHouseDate) : '', // 入库名称
|
|
|
|
|
|
|
+ wareHouseName: '',
|
|
|
wareHouseNumber: '', // 入库编号
|
|
wareHouseNumber: '', // 入库编号
|
|
|
userId: this.$store.state.user.id,
|
|
userId: this.$store.state.user.id,
|
|
|
- wareHouseDate: wareHouseDate,
|
|
|
|
|
|
|
+ wareHouseDate: '',
|
|
|
remarks: '',
|
|
remarks: '',
|
|
|
detailInfos: [],
|
|
detailInfos: [],
|
|
|
wareHouse: [],
|
|
wareHouse: [],
|
|
@@ -470,13 +484,13 @@ export default {
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ if (method === 'add') {
|
|
|
|
|
+ this.inputForm.wareHouseDate = new Date()
|
|
|
|
|
+ }
|
|
|
this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'psi')
|
|
this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'psi')
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- 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
|
|
@@ -567,19 +581,8 @@ export default {
|
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
|
},
|
|
},
|
|
|
getProgramForType(rows) {
|
|
getProgramForType(rows) {
|
|
|
- const exists = this.inputForm.wareHouse.some((item, index) => {
|
|
|
|
|
- return String(index) !== String(this.indexRow) && String(item.wareHouseTypeId) === String(rows.id)
|
|
|
|
|
- })
|
|
|
|
|
- if (exists) {
|
|
|
|
|
- this.$message.warning('同种商品只能选择一次')
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
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.wareHouse[this.indexRow].brand = rows.brand
|
|
|
|
|
- this.inputForm.wareHouse[this.indexRow].specification = rows.specification || rows.spec
|
|
|
|
|
- this.inputForm.wareHouse[this.indexRow].company = rows.company
|
|
|
|
|
// this.inputForm.detailInfos[this.indexRow].procurementType = rows.name
|
|
// this.inputForm.detailInfos[this.indexRow].procurementType = rows.name
|
|
|
this.indexRow = ''
|
|
this.indexRow = ''
|
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
@@ -655,20 +658,6 @@ export default {
|
|
|
str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
|
|
str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
|
|
|
return str
|
|
return str
|
|
|
},
|
|
},
|
|
|
- formatPositiveInteger(value) {
|
|
|
|
|
- if (value === null || value === undefined || value === '') {
|
|
|
|
|
- return ''
|
|
|
|
|
- }
|
|
|
|
|
- let text = String(value).replace(/[^\d.]/g, '')
|
|
|
|
|
- const dotIndex = text.indexOf('.')
|
|
|
|
|
- if (dotIndex !== -1) {
|
|
|
|
|
- const integerPart = text.substring(0, dotIndex)
|
|
|
|
|
- const decimalPart = text.substring(dotIndex + 1).replace(/\./g, '').replace(/[1-9]/g, '')
|
|
|
|
|
- text = integerPart + '.' + decimalPart
|
|
|
|
|
- }
|
|
|
|
|
- text = text.replace(/^0+(\d)/, '$1')
|
|
|
|
|
- return text === '.' ? '' : text
|
|
|
|
|
- },
|
|
|
|
|
// 采购人下拉弹窗
|
|
// 采购人下拉弹窗
|
|
|
userPullListForm(rowIndex) {
|
|
userPullListForm(rowIndex) {
|
|
|
this.indexRow = rowIndex
|
|
this.indexRow = rowIndex
|
|
@@ -758,55 +747,80 @@ 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].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].wareHouseMan)) {
|
|
|
|
|
+ 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 (!/^[1-9]\d*(?:\.0+)?$/.test(String(this.inputForm.wareHouse[j].tradeNumber))) {
|
|
|
|
|
- this.$message.error('入库详情第' + k + '行入库数量请输入正整数')
|
|
|
|
|
|
|
+ if (this.commonJS.isEmpty(this.inputForm.wareHouse[j].spec)) {
|
|
|
|
|
+ this.$message.error('入库详情第' + k + '行请填写包装规格')
|
|
|
this.loading = false
|
|
this.loading = false
|
|
|
- this.inputForm.functionFlag = ''
|
|
|
|
|
return
|
|
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) { // 如果入库类型相同
|
|
|
- // 这里直接通过判断供应商的id是否相等,因为入库只允许选择供应商,不允许手填
|
|
|
|
|
- this.$message.warning(`入库详情中,同种入库类型的商品名称只能输入一条`)
|
|
|
|
|
- this.loading = false
|
|
|
|
|
- throw new Error('入库详情中,同种入库类型的商品名称只能输入一条')
|
|
|
|
|
|
|
+ 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.handleSubmitData()
|
|
|
|
|
|
|
+ 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()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
handleSubmitData() {
|
|
handleSubmitData() {
|
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
this.$refs['inputForm'].validate((valid) => {
|
|
@@ -855,7 +869,6 @@ 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()
|
|
@@ -904,12 +917,10 @@ 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: "月"
|