|
@@ -92,9 +92,9 @@
|
|
|
<el-form-item label="当前载具:" prop="carrierIds" label-width="82px">
|
|
|
<el-select v-model="form.carrierIds" multiple
|
|
|
filterable remote reserve-keyword placeholder="请选择载具" value-key="value" style="width: 300px;"
|
|
|
- :remote-method="(arg) => remoteCarriers(arg, form.carriers)" :loading="loadingCarrier"
|
|
|
+ :remote-method="(arg) => remoteCarriers(arg, form.carrierList)" :loading="loadingCarrier"
|
|
|
@change="(arg) => handleCarrierChange(arg)">
|
|
|
- <el-option v-for="item in carriers" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-option v-for="item in form.carriers" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
<el-popover placement="top-start" effect="dark" trigger="hover"
|
|
|
content="修改载具仅修改最新当前载具,无法修改绑定历史记录。">
|
|
@@ -297,9 +297,9 @@ const open = (row) => {
|
|
|
});
|
|
|
lotId.value = row.lotId;
|
|
|
//页面操作是编辑还是删除
|
|
|
- console.log("row", row);
|
|
|
+ // console.log("row", row);
|
|
|
detailInfo.value = proxy.deepClone(row);
|
|
|
- console.log(detailInfo.value);
|
|
|
+ // console.log(detailInfo.value);
|
|
|
//是否是当前工序
|
|
|
currentDept.value = row.currentDept;
|
|
|
form.value.id = row.id;
|
|
@@ -367,12 +367,10 @@ function getCarriers() {
|
|
|
...res.rows.map((v) => ({ value: v.id, label: v.code }))
|
|
|
);
|
|
|
carriers.value.push(...form.value.carriers);
|
|
|
- console.log(carriers.value);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function getNowCarriers(data) {
|
|
|
- console.log(data)
|
|
|
form.value.carriers =
|
|
|
data.carrierList && data.carrierList.length > 0
|
|
|
? data.carrierList.map((v) => ({
|
|
@@ -387,20 +385,30 @@ function getNowCarriers(data) {
|
|
|
code: v.carrierCode,
|
|
|
}))
|
|
|
: []
|
|
|
- console.log(carriers)
|
|
|
- console.log()
|
|
|
const carrierIds = data.carrierList && data.carrierList.length > 0
|
|
|
? data.carrierList.map((v) => (
|
|
|
v.carrierId
|
|
|
))
|
|
|
: [];
|
|
|
form.value.carrierIds = carrierIds.filter(v => carriers.some(e => e.id == v));
|
|
|
- console.log(form.value.carriers)
|
|
|
- getCarriers()
|
|
|
+ carriers.value = data.carrierList && data.carrierList.length > 0
|
|
|
+ ? data.carrierList.map((v) => ({
|
|
|
+ id: v.carrierId,
|
|
|
+ code: v.carrierCode,
|
|
|
+ }))
|
|
|
+ : []
|
|
|
+ form.value.carrierList = data.carrierList && data.carrierList.length > 0
|
|
|
+ ? data.carrierList.map((v) => ({
|
|
|
+ id: v.carrierId,
|
|
|
+ code: v.carrierCode,
|
|
|
+ }))
|
|
|
+ : []
|
|
|
+ console.log(carriers.value)
|
|
|
+ // getCarriers()
|
|
|
|
|
|
}
|
|
|
function remoteCarriers(queryString, choiced) {
|
|
|
- console.log(choiced);
|
|
|
+ console.log(choiced)
|
|
|
loadingCarrier.value = true;
|
|
|
getListNotInspectionList({
|
|
|
isAbandoned: 0,
|
|
@@ -408,32 +416,55 @@ function remoteCarriers(queryString, choiced) {
|
|
|
code: queryString != "" ? queryString : null,
|
|
|
}).then((res) => {
|
|
|
if (res.code === 200) {
|
|
|
- carriers.value = res.rows.map((v) => ({
|
|
|
+ form.value.carriers = res.rows.map((v) => ({
|
|
|
value: v.id,
|
|
|
label: v.code,
|
|
|
category: v.categoryId,
|
|
|
}));
|
|
|
- console.log(carriers.value)
|
|
|
- carriers.value.push(
|
|
|
- ...choiced
|
|
|
- .filter((v) => !carriers.value.map((e) => e.value).includes(v.id))
|
|
|
- .map((v) => ({ value: v.id, label: v.code }))
|
|
|
+ // console.log(form.value.carriers.length)
|
|
|
+ // console.log(carriers.value,"data")
|
|
|
+
|
|
|
+ if(choiced.length>0 &&choiced[0].id != undefined) {
|
|
|
+ choiced = choiced.map((v) => ({
|
|
|
+ value:v.id,
|
|
|
+ label:v.code
|
|
|
+ }));
|
|
|
+ }
|
|
|
+
|
|
|
+ let distinctList = []
|
|
|
+ choiced.forEach(item => {
|
|
|
+ if(!form.value.carriers.some(v => v.value == item.value) ){
|
|
|
+ distinctList.push(item)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(distinctList)
|
|
|
+ form.value.carriers.push(
|
|
|
+ ...distinctList
|
|
|
+ // .filter((v) => !carriers.value.map((e) => e.value).includes(v.id))
|
|
|
);
|
|
|
+
|
|
|
+ console.log( form.value.carrierList)
|
|
|
} else {
|
|
|
- carriers.value = [];
|
|
|
- carriers.value.push(...choiced);
|
|
|
+ form.value.carriers = [];
|
|
|
+ form.value.carriers.push(...choiced);
|
|
|
}
|
|
|
+ console.log(res.rows)
|
|
|
+ // console.log(carriers.value)
|
|
|
+ // console.log(form.value.carriers)
|
|
|
loadingCarrier.value = false;
|
|
|
});
|
|
|
- console.log(carriers.value)
|
|
|
}
|
|
|
|
|
|
function handleCarrierChange(arg) {
|
|
|
- console.log(arg)
|
|
|
- form.value.carriers = carriers.value
|
|
|
+ console.log(from.value.carrierIds)
|
|
|
+ console.log(form.value.carriers)
|
|
|
+ console.log(carriers.value)
|
|
|
+ form.value.carriers = form.value.carrierList
|
|
|
.filter((v) => arg.includes(v.value))
|
|
|
- .map((v) => ({ id: v.value, code: v.label }));
|
|
|
- console.log(form.value.carriers)
|
|
|
+ .map((v) => ({ value: v.id, label: v.code }));
|
|
|
+
|
|
|
+ form.value.carrierList = form.value.carrierList
|
|
|
+ .filter((v) => arg.includes(v.value));
|
|
|
}
|
|
|
function getEquipmentInfo(data) {
|
|
|
getEquipmentList({
|