|
@@ -1414,9 +1414,8 @@ export const useHooks = (t?: any) => {
|
|
|
nextTick(() => {
|
|
|
$table.setActiveRow(data);
|
|
|
|
|
|
- console.log("rModelSetMtrl data.formulatype == 99 :>> ", data.formulatype == 1);
|
|
|
- if (data.formulatype == 1) {
|
|
|
- // 床网与主副规格互联
|
|
|
+ // 垫层tab、辅料tab,修改物料后,触发刷新主规格
|
|
|
+ if (data.formulatype == 1 || data.formulatype == 2) {
|
|
|
updateSubspecsTable();
|
|
|
}
|
|
|
autoLoadMtrlExtra(item);
|
|
@@ -1451,10 +1450,9 @@ export const useHooks = (t?: any) => {
|
|
|
if ($table) {
|
|
|
$table.clearEdit();
|
|
|
|
|
|
- console.log("rModelClearMtrl data.formulatype == 99 :>> ", data.formulatype == 1);
|
|
|
nextTick(() => {
|
|
|
- if (data.formulatype == 1) {
|
|
|
- // 床网与主副规格互联
|
|
|
+ // 垫层tab、辅料tab,修改物料后,触发刷新主规格
|
|
|
+ if (data.formulatype == 1 || data.formulatype == 2) {
|
|
|
updateSubspecsTable();
|
|
|
}
|
|
|
|
|
@@ -1946,7 +1944,11 @@ export const useHooks = (t?: any) => {
|
|
|
*/
|
|
|
const funcDelMtrlMx = (data: any, refName?: string) => {
|
|
|
let { row } = data;
|
|
|
-
|
|
|
+ const _item = {
|
|
|
+ mtrlid: row.mtrlid,
|
|
|
+ mtrlname: row.mtrlname,
|
|
|
+ extra_cost: row.extra_cost
|
|
|
+ };
|
|
|
let tgRefName = "";
|
|
|
if (refName) {
|
|
|
tgRefName = refName;
|
|
@@ -1961,6 +1963,8 @@ export const useHooks = (t?: any) => {
|
|
|
const $table = state[tgRefName].element;
|
|
|
if ($table) {
|
|
|
$table.remove(row);
|
|
|
+
|
|
|
+ autoLoadMtrlExtra(_item, 5, "del");
|
|
|
}
|
|
|
};
|
|
|
|
|
@@ -6001,6 +6005,9 @@ export const useHooks = (t?: any) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @description 垫层tab-记录需要变更的主副规格调整物料
|
|
|
+ */
|
|
|
const $tableCushions = state.cushionsMxRef.element;
|
|
|
if ($tableCushions) {
|
|
|
const { visibleData: cushionsVisibleData } = $tableCushions.getTableData();
|
|
@@ -6031,7 +6038,6 @@ export const useHooks = (t?: any) => {
|
|
|
title: "垫层物料-" + item.chastr + " " + (index + 1),
|
|
|
field: _mtrlname,
|
|
|
width: "200",
|
|
|
- datatype: "integer",
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
const { column, row, status, $table } = scope;
|
|
@@ -6094,6 +6100,95 @@ export const useHooks = (t?: any) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @description 辅料tab-记录需要变更的主副规格调整物料
|
|
|
+ */
|
|
|
+ const $tableAccessories = state.accessoriesMxRef.element;
|
|
|
+ if ($tableAccessories) {
|
|
|
+ const { visibleData: accessVisibleData } = $tableAccessories.getTableData();
|
|
|
+ if (accessVisibleData && accessVisibleData.length) {
|
|
|
+ let idx = 0;
|
|
|
+ accessVisibleData.map((item: any, index: any) => {
|
|
|
+ if (item.mtrlid && item.if_subspecs) {
|
|
|
+ let _field = "accessories_subspecs_" + (idx + 1);
|
|
|
+ let _mtrlname = "accessories_subspecs_mtrlname_" + (idx + 1);
|
|
|
+ let _formulakind = "accessories_subspecs_formulakind_" + (idx + 1);
|
|
|
+
|
|
|
+ idx++;
|
|
|
+ visibleData = visibleData.map(itm => {
|
|
|
+ itm[_formulakind] = item.formulakind;
|
|
|
+ return itm;
|
|
|
+ });
|
|
|
+
|
|
|
+ let itmName = state.formulaKindEnum.find(t => t.value == item.formulakind)?.label ?? "";
|
|
|
+ cols.push({
|
|
|
+ title: "辅料物料-" + itmName + " " + (index + 1),
|
|
|
+ field: _mtrlname,
|
|
|
+ width: "200",
|
|
|
+ editRender: {},
|
|
|
+ editColRender: (scope: any) => {
|
|
|
+ const { column, row, status, $table } = scope;
|
|
|
+ let _label = column.title;
|
|
|
+ let _pricelistid = getPriceid();
|
|
|
+
|
|
|
+ let _mtrltypeItem: any = mtrltypeTabList_accessories.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);
|