|
|
@@ -184,7 +184,27 @@
|
|
|
prop="materialNo"
|
|
|
width="160"
|
|
|
show-overflow-tooltip
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-select
|
|
|
+ v-model="scope.row.materialNo"
|
|
|
+ filterable
|
|
|
+ remote
|
|
|
+ reserve-keyword
|
|
|
+ placeholder="请选择物料编码"
|
|
|
+ :remote-method="remoteMaterialNo"
|
|
|
+ :loading="loading"
|
|
|
+ @change="changeMaterialNo"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in materialNoList"
|
|
|
+ :key="item.code"
|
|
|
+ :label="item.code"
|
|
|
+ :value="item.code + '-' + scope.$index"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
label="物料名称"
|
|
|
align="center"
|
|
|
@@ -306,6 +326,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ materialNoList: [],
|
|
|
materialNameList: [],
|
|
|
sourceOrderNoList: [],
|
|
|
businessDescribeList: [],
|
|
|
@@ -399,6 +420,24 @@ export default {
|
|
|
console.log(row);
|
|
|
this.formData.list.splice(row.$index, 1);
|
|
|
},
|
|
|
+ remoteMaterialNo(query) {
|
|
|
+ if (query !== "") {
|
|
|
+ const that = this;
|
|
|
+ this.loading = true;
|
|
|
+ setTimeout(async () => {
|
|
|
+ this.loading = false;
|
|
|
+ const {
|
|
|
+ data: { list },
|
|
|
+ } = await InRequestApi.getMaterialPage({
|
|
|
+ code: query,
|
|
|
+ pageSize: 999,
|
|
|
+ });
|
|
|
+ this.materialNoList = list || [];
|
|
|
+ }, 200);
|
|
|
+ } else {
|
|
|
+ this.materialNoList = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
remoteMaterialName(query) {
|
|
|
if (query !== "") {
|
|
|
const that = this;
|
|
|
@@ -467,6 +506,16 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ changeMaterialNo(value) {
|
|
|
+ const data = value.split("-");
|
|
|
+ this.materialNoList.map((v) => {
|
|
|
+ if (v.code == data[0]) {
|
|
|
+ v.materialNo = v.code;
|
|
|
+ v.materialName = v.name;
|
|
|
+ this.formData.list[data[1]] = v;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
changeMaterialName(value) {
|
|
|
const data = value.split("-");
|
|
|
this.materialNameList.map((v) => {
|