|
@@ -134,6 +134,8 @@ interface defaultState {
|
|
|
specialProcessesEnum: any;
|
|
|
additionalCostsEnum: any;
|
|
|
isShowOriginFormulaMattress: boolean;
|
|
|
+ columnsMx_subSpecs_dis: any[];
|
|
|
+ subSpecsData: any[];
|
|
|
}
|
|
|
|
|
|
interface bednetDrawerPropsdata {
|
|
@@ -401,7 +403,9 @@ export const useHooks = (t?: any) => {
|
|
|
additionalCostsMxInitData: [],
|
|
|
specialProcessesEnum: [],
|
|
|
additionalCostsEnum: [],
|
|
|
- isShowOriginFormulaMattress: false
|
|
|
+ isShowOriginFormulaMattress: false,
|
|
|
+ columnsMx_subSpecs_dis: [],
|
|
|
+ subSpecsData: []
|
|
|
});
|
|
|
|
|
|
const router = useRouter();
|
|
@@ -1079,7 +1083,7 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
/**
|
|
|
* @description 在床网tab,更新垫层的床网厚度信息
|
|
|
- * @param data 床网订单信息
|
|
|
+ * @param data 床网明细信息
|
|
|
* @param item 床网信息
|
|
|
* @param action 动作,add,set,del,clear
|
|
|
*/
|
|
@@ -1144,64 +1148,43 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
/**
|
|
|
* @description 更新床网tab的垫层床网信息
|
|
|
- * @param data 床网订单信息
|
|
|
+ * @param data 垫层明细信息
|
|
|
*/
|
|
|
- const wf_rtr_bednet = (data: any, item: any, action: string) => {
|
|
|
- console.log("wf_rtr_cwdc data :>> ", data);
|
|
|
+ const wf_rtr_bednet = (data: any) => {
|
|
|
+ console.log("wf_rtr_bednet data :>> ", data);
|
|
|
const $table = state.cushionsMxRef.element;
|
|
|
- let { fullData } = $table.getTableData();
|
|
|
+ let { visibleData } = $table.getTableData();
|
|
|
+ let currentcushionsIndex = $table.getRowSeq(data);
|
|
|
+ console.log("currentcushionsIndex :>> ", currentcushionsIndex);
|
|
|
|
|
|
- // fullData.map(item => {
|
|
|
- // if (Number(item.formulakind) == 999 && Number(item.thickness) == 0) {
|
|
|
- // $table.setRow(item, {
|
|
|
- // thickness: data.bednet_height,
|
|
|
- // qty: 1
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
+ const $tableBednet = state.bednetMxRef.element;
|
|
|
+ let { visibleData: visibleData_bednet } = $tableBednet.getTableData();
|
|
|
+ let currentBednetIndex = 0;
|
|
|
+ let index = 0;
|
|
|
+ visibleData.map((o, idx) => {
|
|
|
+ if (Number(o.formulakind) == 999) {
|
|
|
+ if (idx + 1 == currentcushionsIndex) {
|
|
|
+ currentBednetIndex = index;
|
|
|
+ }
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- // const $tableBednet = state.bednetMxRef.element;
|
|
|
- // let { fullData: bednetFullData } = $tableBednet.getTableData();
|
|
|
- // let currentBednetIndex = $tableBednet.getRowSeq(data);
|
|
|
+ console.log("wf_rtr_bednet currentBednetIndex :>> ", currentBednetIndex);
|
|
|
|
|
|
- // if (action == "add") {
|
|
|
- // let records = cloneDeep(fullData.find(o => o.formulakind == 999));
|
|
|
- // records.thickness = 0;
|
|
|
- // records.qty = 0;
|
|
|
- // records._X_ROW_KEY = "";
|
|
|
+ if (visibleData_bednet.length == 1) {
|
|
|
+ visibleData_bednet[0].mtrlid = 0;
|
|
|
+ visibleData_bednet[0].mtrlname = "";
|
|
|
+ visibleData_bednet[0].price = 0;
|
|
|
+ $tableBednet.reloadData(visibleData_bednet);
|
|
|
+ } else {
|
|
|
+ funcDelMtrlMx({ row: visibleData_bednet[currentBednetIndex], data: visibleData_bednet }, "bednetMxRef");
|
|
|
+ }
|
|
|
|
|
|
- // let bednetList = fullData.filter(o => Number(o.formulakind) == 999);
|
|
|
- // let lastIndex = bednetList[bednetList.length - 1];
|
|
|
- // console.log("wf_rtr_cwdc lastIndex :>> ", bednetList, lastIndex, records);
|
|
|
- // $tableBednet.insertAt(records, lastIndex);
|
|
|
- // } else {
|
|
|
- // console.log("wf_rtr_cwdc currentBednetIndex :>> ", action, currentBednetIndex);
|
|
|
- // let index = 1;
|
|
|
- // fullData.map(o => {
|
|
|
- // if (Number(o.formulakind) == 999) {
|
|
|
- // if (index == currentBednetIndex) {
|
|
|
- // if (action == "set") {
|
|
|
- // $table.setRow(o, {
|
|
|
- // thickness: item?.bednet_height,
|
|
|
- // qty: 1
|
|
|
- // });
|
|
|
- // } else if (action == "clear") {
|
|
|
- // $table.setRow(o, {
|
|
|
- // thickness: 0,
|
|
|
- // qty: 0
|
|
|
- // });
|
|
|
- // } else if (action == "del") {
|
|
|
- // // $table.setRow(o, {
|
|
|
- // // thickness: 0,
|
|
|
- // // qty: 0
|
|
|
- // // });
|
|
|
- // $table.remove(o);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // index++;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
+ // 床网与主副规格互联
|
|
|
+ nextTick(() => {
|
|
|
+ updateSubspecsTable();
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -1229,6 +1212,11 @@ export const useHooks = (t?: any) => {
|
|
|
console.log("wf_rtr_cwdc curIndex :>> ", curIndex);
|
|
|
rModelClearMtrl(scope.row);
|
|
|
funcAddMtrlMx({ row: visibleData_bednet[curIndex] }, null, "bednetMxRef", arr.length == 0);
|
|
|
+
|
|
|
+ // 床网与主副规格互联
|
|
|
+ nextTick(() => {
|
|
|
+ updateSubspecsTable();
|
|
|
+ });
|
|
|
}
|
|
|
} else if (Number(val) !== 999 && Number(lastVal) === 999) {
|
|
|
// 删除
|
|
@@ -1246,6 +1234,11 @@ export const useHooks = (t?: any) => {
|
|
|
}
|
|
|
rModelClearMtrl(scope.row);
|
|
|
funcDelBednet({ row: visibleData_bednet[curIndex], data: visibleData_bednet }, null, "bednetMxRef");
|
|
|
+
|
|
|
+ // 床网与主副规格互联
|
|
|
+ nextTick(() => {
|
|
|
+ updateSubspecsTable();
|
|
|
+ });
|
|
|
}
|
|
|
} else {
|
|
|
rModelClearMtrl(scope.row);
|
|
@@ -1277,6 +1270,9 @@ export const useHooks = (t?: any) => {
|
|
|
$table.clearEdit();
|
|
|
nextTick(() => {
|
|
|
$table.setActiveRow(data);
|
|
|
+
|
|
|
+ // 床网与主副规格互联
|
|
|
+ updateSubspecsTable();
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -1292,6 +1288,11 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
if ($table) {
|
|
|
$table.clearEdit();
|
|
|
+
|
|
|
+ nextTick(() => {
|
|
|
+ // 床网与主副规格互联
|
|
|
+ updateSubspecsTable();
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -1345,6 +1346,7 @@ export const useHooks = (t?: any) => {
|
|
|
data.cloth_width = item.cloth_width;
|
|
|
data.if_inputqty = Number(item.if_inputqty);
|
|
|
data.if_areaprice = item.if_areaprice;
|
|
|
+ data.if_subspecs = item.if_subspecs;
|
|
|
data.mtrlname = item.mtrlname;
|
|
|
data.priceunit = item.priceunit;
|
|
|
data.shrinkage = item.price; // 收缩率
|
|
@@ -1368,6 +1370,12 @@ export const useHooks = (t?: any) => {
|
|
|
$table.clearEdit();
|
|
|
nextTick(() => {
|
|
|
$table.setActiveRow(data);
|
|
|
+
|
|
|
+ console.log("rModelSetMtrl data.formulatype == 99 :>> ", data.formulatype == 1);
|
|
|
+ if (data.formulatype == 1) {
|
|
|
+ // 床网与主副规格互联
|
|
|
+ updateSubspecsTable();
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -1383,6 +1391,7 @@ export const useHooks = (t?: any) => {
|
|
|
data.cloth_width = 0;
|
|
|
data.if_inputqty = 0;
|
|
|
data.if_areaprice = 0;
|
|
|
+ data.if_subspecs = 0;
|
|
|
data.mtrlname = "";
|
|
|
data.priceunit = "";
|
|
|
data.shrinkage = 0;
|
|
@@ -1392,6 +1401,14 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
if ($table) {
|
|
|
$table.clearEdit();
|
|
|
+
|
|
|
+ console.log("rModelClearMtrl data.formulatype == 99 :>> ", data.formulatype == 1);
|
|
|
+ nextTick(() => {
|
|
|
+ if (data.formulatype == 1) {
|
|
|
+ // 床网与主副规格互联
|
|
|
+ updateSubspecsTable();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -1894,6 +1911,11 @@ export const useHooks = (t?: any) => {
|
|
|
}
|
|
|
cb && cb();
|
|
|
funcDelMtrlMx(scope, refName);
|
|
|
+
|
|
|
+ // 床网与主副规格互联
|
|
|
+ nextTick(() => {
|
|
|
+ updateSubspecsTable();
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
/**
|
|
@@ -2834,8 +2856,8 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
// 表格配置项
|
|
|
const columns: ColumnProps<any>[] = [
|
|
|
- { type: "checkbox", width: 50, fixed: "left" },
|
|
|
- { title: "#", field: "pid", fixed: "left", width: 80 },
|
|
|
+ { type: "checkbox", width: 40, fixed: "left" },
|
|
|
+ { title: "#", type: "seq", fixed: "left", width: 80 },
|
|
|
{
|
|
|
field: "deptid",
|
|
|
title: "部门",
|
|
@@ -2914,19 +2936,19 @@ export const useHooks = (t?: any) => {
|
|
|
return !scope.row?.child_count && !scope.row?.parentid ? (
|
|
|
scope.row?.mattressname
|
|
|
) : scope.row?.parentid ? (
|
|
|
- <>
|
|
|
- <el-tag type="warning" effect="light" disable-transitions size="small" class="mr-4">
|
|
|
+ <div class="flx-justify-between">
|
|
|
+ <span class="mle">{scope.row?.mattressname}</span>
|
|
|
+ <el-tag type="warning" effect="light" disable-transitions size="small" round class="ml-4">
|
|
|
副
|
|
|
</el-tag>
|
|
|
- {scope.row?.mattressname}
|
|
|
- </>
|
|
|
+ </div>
|
|
|
) : (
|
|
|
- <>
|
|
|
- <el-tag type="primary" effect="light" disable-transitions size="small" class="mr-4">
|
|
|
+ <div class="flx-justify-between">
|
|
|
+ <span class="mle">{scope.row?.mattressname}</span>
|
|
|
+ <el-tag type="primary" effect="light" disable-transitions size="small" round class="ml-4">
|
|
|
主
|
|
|
</el-tag>
|
|
|
- {scope.row?.mattressname}
|
|
|
- </>
|
|
|
+ </div>
|
|
|
);
|
|
|
}
|
|
|
},
|
|
@@ -5147,29 +5169,29 @@ export const useHooks = (t?: any) => {
|
|
|
// </>
|
|
|
// );
|
|
|
// }
|
|
|
- },
|
|
|
- {
|
|
|
- title: "弹簧排列个数-宽",
|
|
|
- field: "spring_qty_width",
|
|
|
- datatype: "integer",
|
|
|
- editRender: {
|
|
|
- name: "$input"
|
|
|
- // props: {
|
|
|
- // type: "number"
|
|
|
- // }
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: "弹簧排列个数-长",
|
|
|
- field: "spring_qty_length",
|
|
|
- datatype: "integer",
|
|
|
- editRender: {
|
|
|
- name: "$input"
|
|
|
- // props: {
|
|
|
- // type: "number"
|
|
|
- // }
|
|
|
- }
|
|
|
}
|
|
|
+ // {
|
|
|
+ // title: "弹簧排列个数-宽",
|
|
|
+ // field: "spring_qty_width",
|
|
|
+ // datatype: "integer",
|
|
|
+ // editRender: {
|
|
|
+ // name: "$input"
|
|
|
+ // // props: {
|
|
|
+ // // type: "number"
|
|
|
+ // // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title: "弹簧排列个数-长",
|
|
|
+ // field: "spring_qty_length",
|
|
|
+ // datatype: "integer",
|
|
|
+ // editRender: {
|
|
|
+ // name: "$input"
|
|
|
+ // // props: {
|
|
|
+ // // type: "number"
|
|
|
+ // // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
];
|
|
|
|
|
|
const handleToImportMxInner = async () => {
|
|
@@ -5447,39 +5469,43 @@ export const useHooks = (t?: any) => {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- let _mainData = visibleData[0];
|
|
|
-
|
|
|
let _pricelistid = getPriceid();
|
|
|
- let bednet = cloneDeep(_mainData);
|
|
|
- bednet.bednetid = _mainData.mtrlid;
|
|
|
- // bednet.if_doublenet = Number(bednet.if_doublenet);
|
|
|
- // bednet.if_doublespring = Number(bednet.if_doublespring);
|
|
|
- // bednet.if_side_iron = Number(bednet.if_side_iron);
|
|
|
- // bednet.if_rsorwa = Number(bednet.if_rsorwa);
|
|
|
- // bednet.if_sponge_drilling = Number(bednet.if_sponge_drilling);
|
|
|
- // bednet.iffork = Number(bednet.iffork);
|
|
|
- // bednet.ifsaleout = Number(bednet.ifsaleout);
|
|
|
- // bednet.if_jb = Number(bednet.if_jb);
|
|
|
- // bednet.flag = Number(bednet.flag);
|
|
|
- bednet.mattress_length = row.mattress_length;
|
|
|
- bednet.mattress_width = row.mattress_width;
|
|
|
- bednet.pricelistid = _pricelistid;
|
|
|
-
|
|
|
- let _params: any = {
|
|
|
- bednet: bednet
|
|
|
- // bednetMx: state.vxeTableMxRef?.element.getTableData().fullData ?? [],
|
|
|
- // spring: state.vxeTableMxSpringRef?.element.getTableData().fullData ?? []
|
|
|
- };
|
|
|
- console.log("setMxSpringQtyWidthAndLength _params :>> ", _params);
|
|
|
- let res = await GetComputeSpring(_params);
|
|
|
-
|
|
|
- console.log("setMxSpringQtyWidthAndLength res :>> ", res);
|
|
|
- console.log("setMxSpringQtyWidthAndLength row :>> ", row);
|
|
|
- if (!res?.message) {
|
|
|
- scope.row.spring_qty_width = res.bednetMx[0].spring_qty_width;
|
|
|
- scope.row.spring_qty_length = res.bednetMx[0].spring_qty_length;
|
|
|
+ for (let i = 0; i < visibleData.length; i++) {
|
|
|
+ let _mainData = visibleData[i];
|
|
|
+
|
|
|
+ if (_mainData.mtrlid > 0) {
|
|
|
+ let bednet = cloneDeep(_mainData);
|
|
|
+ bednet.bednetid = _mainData.mtrlid;
|
|
|
+ // bednet.if_doublenet = Number(bednet.if_doublenet);
|
|
|
+ // bednet.if_doublespring = Number(bednet.if_doublespring);
|
|
|
+ // bednet.if_side_iron = Number(bednet.if_side_iron);
|
|
|
+ // bednet.if_rsorwa = Number(bednet.if_rsorwa);
|
|
|
+ // bednet.if_sponge_drilling = Number(bednet.if_sponge_drilling);
|
|
|
+ // bednet.iffork = Number(bednet.iffork);
|
|
|
+ // bednet.ifsaleout = Number(bednet.ifsaleout);
|
|
|
+ // bednet.if_jb = Number(bednet.if_jb);
|
|
|
+ // bednet.flag = Number(bednet.flag);
|
|
|
+ bednet.mattress_length = row.mattress_length;
|
|
|
+ bednet.mattress_width = row.mattress_width;
|
|
|
+ bednet.pricelistid = _pricelistid;
|
|
|
+
|
|
|
+ let _params: any = {
|
|
|
+ bednet: bednet
|
|
|
+ // bednetMx: state.vxeTableMxRef?.element.getTableData().fullData ?? [],
|
|
|
+ // spring: state.vxeTableMxSpringRef?.element.getTableData().fullData ?? []
|
|
|
+ };
|
|
|
+ console.log("setMxSpringQtyWidthAndLength _params :>> ", _params);
|
|
|
+ let res = await GetComputeSpring(_params);
|
|
|
+
|
|
|
+ console.log("setMxSpringQtyWidthAndLength res :>> ", res);
|
|
|
+ console.log("setMxSpringQtyWidthAndLength row :>> ", row);
|
|
|
+ if (!res?.message) {
|
|
|
+ scope.row["spring_qty_width_" + (i + 1)] = res.bednetMx[0].spring_qty_width;
|
|
|
+ scope.row["spring_qty_length_" + (i + 1)] = res.bednetMx[0].spring_qty_length;
|
|
|
+ }
|
|
|
+ console.log("setMxSpringQtyWidthAndLength scopes row :>> ", scope.row);
|
|
|
+ }
|
|
|
}
|
|
|
- console.log("setMxSpringQtyWidthAndLength scopes row :>> ", scope.row);
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -5576,6 +5602,170 @@ export const useHooks = (t?: any) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ /**
|
|
|
+ * @description 更新主副规格表结构
|
|
|
+ */
|
|
|
+ const updateSubspecsTable = () => {
|
|
|
+ // state.columnsMx_subSpecs_dis = [];
|
|
|
+ // 检查床网
|
|
|
+ console.log("updateSubspecsTable state.columnsMx_subSpecs_dis :>> ", state.columnsMx_subSpecs_dis);
|
|
|
+ const $tableBendet = state.bednetMxRef.element;
|
|
|
+ const $tableSubspecs = state.subSpecsRef?.element;
|
|
|
+ let cols = [];
|
|
|
+ let visibleData = [];
|
|
|
+ if ($tableSubspecs) {
|
|
|
+ visibleData = $tableSubspecs.getTableData().visibleData;
|
|
|
+ }
|
|
|
+ if ($tableBendet) {
|
|
|
+ const { visibleData: bednetVisibleData } = $tableBendet.getTableData();
|
|
|
+
|
|
|
+ if (bednetVisibleData && bednetVisibleData.length) {
|
|
|
+ // let filedsName = state.columnsMx_subSpecs_dis
|
|
|
+ // .filter((item: any) => item.field && item.field.indexOf("spring_qty_width_") > -1)
|
|
|
+ // .map(item => item.field);
|
|
|
+ // let bednetFieldsName = bednetVisibleData
|
|
|
+ // .filter((item: any) => item.mtrlid)
|
|
|
+ // .map(item => "spring_qty_width_" + item.mtrlid);
|
|
|
+
|
|
|
+ console.log(
|
|
|
+ 'filedsName.join(",") != bednetFieldsName.join(",") :>> ',
|
|
|
+ // filedsName.join(","),
|
|
|
+ // bednetFieldsName.join(","),
|
|
|
+ bednetVisibleData
|
|
|
+ );
|
|
|
+ // if (filedsName.join(",") != bednetFieldsName.join(",")) {
|
|
|
+ bednetVisibleData.map((item: any, idx: any) => {
|
|
|
+ if (item.mtrlid) {
|
|
|
+ cols.push({
|
|
|
+ title: "弹簧排列个数-宽" + "-床网" + (idx + 1),
|
|
|
+ field: "spring_qty_width_" + (idx + 1),
|
|
|
+ datatype: "integer",
|
|
|
+ editRender: {
|
|
|
+ name: "$input"
|
|
|
+ }
|
|
|
+ });
|
|
|
+ cols.push({
|
|
|
+ title: "弹簧排列个数-宽" + "-床网" + (idx + 1),
|
|
|
+ field: "spring_qty_length_" + (idx + 1),
|
|
|
+ datatype: "integer",
|
|
|
+ editRender: {
|
|
|
+ name: "$input"
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const $tableCushions = state.cushionsMxRef.element;
|
|
|
+ if ($tableCushions) {
|
|
|
+ const { visibleData: cushionsVisibleData } = $tableCushions.getTableData();
|
|
|
+ if (cushionsVisibleData && cushionsVisibleData.length) {
|
|
|
+ // let filedsName = state.columnsMx_subSpecs_dis
|
|
|
+ // .filter((item: any) => item.field && item.field.indexOf("cushions_subspecs_") > -1)
|
|
|
+ // .map(item => item.field);
|
|
|
+ // let cushionsFieldsName = cushionsVisibleData
|
|
|
+ // .filter((item: any) => item.mtrlid && item.if_subspecs)
|
|
|
+ // .map(item => "cushions_subspecs_" + item.mtrlid);
|
|
|
+
|
|
|
+ // console.log('filedsName.join(",") ', filedsName.join(","));
|
|
|
+ // console.log(' cushionsFieldsName.join(",") :>> ', cushionsFieldsName.join(","));
|
|
|
+ // if (filedsName.join(",") != cushionsFieldsName.join(",")) {
|
|
|
+ let idx = 0;
|
|
|
+ cushionsVisibleData.map((item: any, index: any) => {
|
|
|
+ if (item.mtrlid && item.if_subspecs) {
|
|
|
+ let _field = "cushions_subspecs_" + (idx + 1);
|
|
|
+ let _mtrlname = "cushions_subspecs_mtrlname_" + (idx + 1);
|
|
|
+ let _formulakind = "cushions_subspecs_formulakind_" + (idx + 1);
|
|
|
+
|
|
|
+ idx++;
|
|
|
+ visibleData = visibleData.map(itm => {
|
|
|
+ itm[_formulakind] = item.formulakind;
|
|
|
+ return itm;
|
|
|
+ });
|
|
|
+ cols.push({
|
|
|
+ title: "垫层物料-" + item.chastr + " " + (index + 1),
|
|
|
+ field: _mtrlname,
|
|
|
+ width: "200",
|
|
|
+ datatype: "integer",
|
|
|
+ editRender: {},
|
|
|
+ editColRender: (scope: any) => {
|
|
|
+ const { column, row, status, $table } = scope;
|
|
|
+ let _label = column.title;
|
|
|
+ let _pricelistid = getPriceid();
|
|
|
+
|
|
|
+ let _mtrltypeItem: any = mtrltypeTabList_cushions.find(t => t.formulakinds.includes(Number(row[_formulakind])));
|
|
|
+ if (!_mtrltypeItem) {
|
|
|
+ // ElMessage.error("不是垫层类型行,不能选物料");
|
|
|
+ // return <></>;
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log("updateSubspecsTable _mtrltypeItem :>> ", _mtrltypeItem);
|
|
|
+
|
|
|
+ let params = {
|
|
|
+ mtrltype: _mtrltypeItem?.value,
|
|
|
+ pricelistid: _pricelistid
|
|
|
+ };
|
|
|
+
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <MtrldefSelect
|
|
|
+ value={row[_field]}
|
|
|
+ {...params}
|
|
|
+ disabled={!_mtrltypeItem}
|
|
|
+ clearable
|
|
|
+ placeholder={_label}
|
|
|
+ onOpenModal={() =>
|
|
|
+ fModelChoseMtrl(
|
|
|
+ row,
|
|
|
+ params,
|
|
|
+ (data, val: any) => {
|
|
|
+ row[_field] = val.mtrlid;
|
|
|
+ row[_mtrlname] = val.mtrlname;
|
|
|
+ },
|
|
|
+ _mtrltypeItem?.label,
|
|
|
+ $table
|
|
|
+ )
|
|
|
+ }
|
|
|
+ onSelect={(val: any) => {
|
|
|
+ row[_field] = val.mtrlid;
|
|
|
+ row[_mtrlname] = val.mtrlname;
|
|
|
+ }}
|
|
|
+ onClear={() => {
|
|
|
+ row[_field] = 0;
|
|
|
+ row[_mtrlname] = "";
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ label: () => row[_mtrlname]
|
|
|
+ }}
|
|
|
+ </MtrldefSelect>
|
|
|
+ </>
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // if (cols.length > 0) {
|
|
|
+ state.columnsMx_subSpecs_dis = columnsMx_subSpecs.concat(cols);
|
|
|
+ console.log("updateSubspecsTable state.columnsMx_subSpecs_dis 321:>> ", state.columnsMx_subSpecs_dis);
|
|
|
+ nextTick(() => {
|
|
|
+ // state.subSpecsRef.element.loadColumn(state.columnsMx_subSpecs_dis);
|
|
|
+ state.subSpecsRef.loadColumns(state.columnsMx_subSpecs_dis);
|
|
|
+
|
|
|
+ console.log("visibleData :>> ", visibleData);
|
|
|
+ if ($tableSubspecs) {
|
|
|
+ state.subSpecsData = visibleData;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // }
|
|
|
+ };
|
|
|
+
|
|
|
return {
|
|
|
...toRefs(state),
|
|
|
columns,
|
|
@@ -5613,6 +5803,7 @@ export const useHooks = (t?: any) => {
|
|
|
resetSpecialProcesses,
|
|
|
resetMergeCellsTopCotton,
|
|
|
wf_rtr_cwdc,
|
|
|
- gotoErpapi
|
|
|
+ gotoErpapi,
|
|
|
+ updateSubspecsTable
|
|
|
};
|
|
|
};
|