|
@@ -4,7 +4,7 @@
|
|
|
:title="title"
|
|
|
:close-on-click-modal="false"
|
|
|
v-dialogDrag
|
|
|
- width="1300px"
|
|
|
+ width="1500px"
|
|
|
@close="close"
|
|
|
@keyup.enter.native="doSubmit"
|
|
|
:visible.sync="visible">
|
|
@@ -161,6 +161,24 @@
|
|
|
<el-input v-model="scope.row.wareHouseType" @focus="typePullForm(scope.$rowIndex)"></el-input>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
+ <vxe-table-column min-width="180px" align="center" field="tradeName" title="商品名称" :edit-render="{}">
|
|
|
+ <template v-slot:edit="scope">
|
|
|
+ <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>
|
|
|
+ </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>
|
|
@@ -192,12 +210,6 @@
|
|
|
</vxe-pulldown>
|
|
|
</template>
|
|
|
</vxe-table-column>
|
|
|
- <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>
|
|
|
- </template>
|
|
|
- </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)" maxlength="10"></el-input>
|
|
@@ -539,19 +551,6 @@
|
|
|
getProgramForType (rows) {
|
|
|
this.inputForm.wareHouse[this.indexRow].wareHouseTypeId = rows.id
|
|
|
this.inputForm.wareHouse[this.indexRow].wareHouseType = rows.name
|
|
|
- let i = this.inputForm.wareHouse.length
|
|
|
- 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.commonJS.isNotEmpty(this.inputForm.wareHouse[j].tradeName) &&
|
|
|
- this.commonJS.isNotEmpty(this.inputForm.wareHouse[k].tradeName) && this.inputForm.wareHouse[j].tradeName === this.inputForm.wareHouse[k].tradeName) {
|
|
|
- // parseFloat(item.account).toFixed(2)
|
|
|
- this.inputForm.wareHouse.splice(k, 1)
|
|
|
- this.$message.warning(`同种入库类型的商品名称只能输入一条信息!`)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
// this.inputForm.detailInfos[this.indexRow].procurementType = rows.name
|
|
|
this.indexRow = ''
|
|
|
this.$forceUpdate()
|
|
@@ -746,6 +745,20 @@
|
|
|
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.commonJS.isNotEmpty(this.inputForm.wareHouse[j].tradeName) &&
|
|
|
+ this.commonJS.isNotEmpty(this.inputForm.wareHouse[k].tradeName) && this.inputForm.wareHouse[j].tradeName === this.inputForm.wareHouse[k].tradeName) {
|
|
|
+ // parseFloat(item.account).toFixed(2)
|
|
|
+ // this.inputForm.wareHouse.splice(k, 1)
|
|
|
+ this.$message.warning(`入库详情中,同种入库类型的商品名称只能输入一条信息`)
|
|
|
+ this.loading = false
|
|
|
+ throw new Error('入库详情中,同种入库类型的商品名称只能输入一条信息')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
this.inputForm.files = this.$refs.uploadComponent.getDataList()
|
|
|
this.wareHouseService.save(this.inputForm).then(({data}) => {
|
|
@@ -841,19 +854,6 @@
|
|
|
isSupplier: this.inputForm.detailInfos[index].isSupplier
|
|
|
}
|
|
|
this.inputForm.wareHouse.push(param)
|
|
|
- let i = this.inputForm.wareHouse.length
|
|
|
- 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.commonJS.isNotEmpty(this.inputForm.wareHouse[j].tradeName) &&
|
|
|
- this.commonJS.isNotEmpty(this.inputForm.wareHouse[k].tradeName) && this.inputForm.wareHouse[j].tradeName === this.inputForm.wareHouse[k].tradeName) {
|
|
|
- // parseFloat(item.account).toFixed(2)
|
|
|
- this.inputForm.wareHouse.splice(k, 1)
|
|
|
- this.$message.warning(`同种入库类型的商品名称只能输入一条信息!`)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
focusEvent4 (rowIndex) {
|
|
|
this.$refs.xDown4.showPanel()
|
|
@@ -893,6 +893,28 @@
|
|
|
this.tablePage4.total = data.total
|
|
|
this.loading4 = false
|
|
|
})
|
|
|
+ },
|
|
|
+ focusEvent1 (row) {
|
|
|
+ row.tradeNameList = []
|
|
|
+ row.tradeNameData = []
|
|
|
+ if (this.commonJS.isNotEmpty(row.wareHouseTypeId)) {
|
|
|
+ this.wareHouseService.findTradeByTypeId(row.wareHouseTypeId).then(({data}) => {
|
|
|
+ row.tradeNameList = JSON.parse(JSON.stringify(data))
|
|
|
+ row.tradeNameData = JSON.parse(JSON.stringify(data))
|
|
|
+ this.$refs.xDown1.showPanel()
|
|
|
+ }).catch(() => {
|
|
|
+ this.$refs.xDown1.showPanel()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$refs.xDown1.showPanel()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ keyupEvent1 (row) {
|
|
|
+ row.tradeNameData = this.commonJS.isNotEmpty(row.tradeName) ? row.tradeNameList.filter(item => item.tradeName.indexOf(row.tradeName) > -1) : row.tradeNameList
|
|
|
+ },
|
|
|
+ selectEvent1 (row, item) {
|
|
|
+ row.tradeName = item.tradeName
|
|
|
+ this.$refs.xDown1.hidePanel()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -905,4 +927,21 @@
|
|
|
.vxe-pulldown--panel {
|
|
|
z-index: 9997 !important
|
|
|
}
|
|
|
+
|
|
|
+ /*.my-dropdown1、.list-item1、.list-item1:hover 为商品名称下拉选择框样式*/
|
|
|
+ .my-dropdown1 {
|
|
|
+ height: 155px;
|
|
|
+ overflow: auto;
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
+ background-color: #fff;
|
|
|
+ }
|
|
|
+ .list-item1 {
|
|
|
+ line-height: 30px;
|
|
|
+ text-align: center;
|
|
|
+ border-bottom: #c4c7cc73 1px solid;
|
|
|
+ }
|
|
|
+ .list-item1:hover {
|
|
|
+ background-color: #f5f7fa;
|
|
|
+ }
|
|
|
</style>
|