|
@@ -28,7 +28,7 @@ interface defaultState {
|
|
|
initParamsMx: any;
|
|
|
initParamsMxSpring: any;
|
|
|
bednetMxData: any;
|
|
|
- bednetMxSprintData: any;
|
|
|
+ bednetMxSpringData: any;
|
|
|
vxeTableMxRef: any;
|
|
|
vxeTableMxSpringRef: any;
|
|
|
MtrldefDialogRef: any;
|
|
@@ -53,7 +53,7 @@ const dw_bednet_define_add_mx = {
|
|
|
wire_mtrlid: 0,
|
|
|
springid: 0,
|
|
|
springname: 0,
|
|
|
- if_part: "0",
|
|
|
+ if_part: 0,
|
|
|
if_15strip: 0,
|
|
|
if_pocket_around: 0,
|
|
|
pocket_around_springid: 0,
|
|
@@ -127,7 +127,7 @@ export const useHooks = (t?: any) => {
|
|
|
initParamsMx: {},
|
|
|
initParamsMxSpring: {},
|
|
|
bednetMxData: [],
|
|
|
- bednetMxSprintData: [],
|
|
|
+ bednetMxSpringData: [],
|
|
|
MtrldefDialogRef: null,
|
|
|
MtrldefDialogProps: {},
|
|
|
SpringDialogRef: null,
|
|
@@ -282,6 +282,18 @@ export const useHooks = (t?: any) => {
|
|
|
data.fabrics2_price = 0;
|
|
|
};
|
|
|
|
|
|
+ const rModelSetHardAroundSpring = (data: any, item: any) => {
|
|
|
+ if (item) {
|
|
|
+ data.hard_around_springid = item.springid;
|
|
|
+ data.hard_around_springname = item.name;
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const rModelClearHardAroundSpring = (data: any) => {
|
|
|
+ data.hard_around_springid = 0;
|
|
|
+ data.hard_around_springname = "";
|
|
|
+ };
|
|
|
+
|
|
|
/**
|
|
|
* @description 弹窗模块:选择物料
|
|
|
* @param data 当前数据
|
|
@@ -400,7 +412,7 @@ export const useHooks = (t?: any) => {
|
|
|
*/
|
|
|
const reload_dw2 = async (bednetData: any, cb?: any) => {
|
|
|
state.bednetMxData = [];
|
|
|
- state.bednetMxSprintData = [];
|
|
|
+ state.bednetMxSpringData = [];
|
|
|
let res = await getDataMxAdd(state.initParamsMx);
|
|
|
let result = dataCallbackMx(res);
|
|
|
|
|
@@ -490,9 +502,9 @@ export const useHooks = (t?: any) => {
|
|
|
_mainData.fork_mtrl_formula = rBednetType.fork_mtrl_formula;
|
|
|
_mainData.fork_hr_formula = rBednetType.fork_hr_formula;
|
|
|
|
|
|
- _mainData.if_rsORwa = rBednetType.if_rsORwa;
|
|
|
- _mainData.rsORwa_mtrl_formula = rBednetType.rsORwa_mtrl_formula;
|
|
|
- _mainData.rsORwa_hr_formula = rBednetType.rsORwa_hr_formula;
|
|
|
+ _mainData.if_rsorwa = rBednetType.if_rsorwa;
|
|
|
+ _mainData.rsorwa_mtrl_formula = rBednetType.rsorwa_mtrl_formula;
|
|
|
+ _mainData.rsorwa_hr_formula = rBednetType.rsorwa_hr_formula;
|
|
|
_mainData.sponge_drilling_hr_formula = rBednetType.sponge_drilling_hr_formula;
|
|
|
|
|
|
_mainData.spring_mtrl_formula = rBednetType.spring_mtrl_formula;
|
|
@@ -521,7 +533,7 @@ export const useHooks = (t?: any) => {
|
|
|
_mainData.fork_weight_formula = rBednetType.fork_weight_formula;
|
|
|
|
|
|
reload_dw2(rBednetType, () => {
|
|
|
- state.bednetMxData = [dw_bednet_define_add_mx];
|
|
|
+ state.bednetMxData = [cloneDeep(dw_bednet_define_add_mx)];
|
|
|
});
|
|
|
|
|
|
nextTick(() => {
|
|
@@ -544,23 +556,23 @@ export const useHooks = (t?: any) => {
|
|
|
// return [];
|
|
|
};
|
|
|
|
|
|
- // /**
|
|
|
- // * @description 获取明细数据
|
|
|
- // * @param params
|
|
|
- // * @returns
|
|
|
- // */
|
|
|
- // const getDataMx = (params: any) => {
|
|
|
- // console.log("getData beatad params :>> ", params);
|
|
|
- // let newParams: any = {};
|
|
|
- // params.pageNum && (newParams.pageindex = params.pageNum);
|
|
|
- // params.pageSize && (newParams.pagesize = params.pageSize);
|
|
|
- // delete params.pageNum;
|
|
|
- // delete params.pageSize;
|
|
|
- // newParams.queryParams = params;
|
|
|
- // console.log("params :>> ", params);
|
|
|
- // newParams.dsname = "web_bednet_mx";
|
|
|
- // return CommonDynamicSelect(newParams, DwnameEnum.bednetQuoteMx);
|
|
|
- // };
|
|
|
+ /**
|
|
|
+ * @description 获取明细数据
|
|
|
+ * @param params
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+ const getDataMx = (params: any) => {
|
|
|
+ console.log("getData beatad params :>> ", params);
|
|
|
+ let newParams: any = {};
|
|
|
+ params.pageNum && (newParams.pageindex = params.pageNum);
|
|
|
+ params.pageSize && (newParams.pagesize = params.pageSize);
|
|
|
+ delete params.pageNum;
|
|
|
+ delete params.pageSize;
|
|
|
+ newParams.queryParams = params;
|
|
|
+ console.log("params :>> ", params);
|
|
|
+ newParams.dsname = "web_bednet_mx";
|
|
|
+ return CommonDynamicSelect(newParams, DwnameEnum.bednetQuoteMx);
|
|
|
+ };
|
|
|
|
|
|
/**
|
|
|
* @description 获取弹簧明细
|
|
@@ -596,7 +608,14 @@ export const useHooks = (t?: any) => {
|
|
|
const dataCallback = (data: any) => {
|
|
|
console.log("dataCallback data :>> ", data);
|
|
|
let _list = data.datatable.map(t => {
|
|
|
+ t.if_doublenet = Boolean(t.if_doublenet);
|
|
|
+ t.if_doublespring = Boolean(t.if_doublespring);
|
|
|
+ t.if_side_iron = Boolean(t.if_side_iron);
|
|
|
+ t.if_rsorwa = Boolean(t.if_rsorwa);
|
|
|
+ t.if_sponge_drilling = Boolean(t.if_sponge_drilling);
|
|
|
+ t.iffork = Boolean(t.iffork);
|
|
|
t.ifsaleout = Boolean(t.ifsaleout);
|
|
|
+ t.if_jb = Boolean(t.if_jb);
|
|
|
return t;
|
|
|
});
|
|
|
return {
|
|
@@ -621,10 +640,11 @@ export const useHooks = (t?: any) => {
|
|
|
};
|
|
|
|
|
|
const handleBlur = (value: any, data: any, field: string) => {
|
|
|
- value = (value + "").replace(/[^\d.]/g, "");
|
|
|
+ //保留小数点和-号
|
|
|
+ value = (value + "").replace(/[^-\d.]/g, "");
|
|
|
console.log(value);
|
|
|
// 保留整数部分
|
|
|
- value = parseInt(value, 10).toString();
|
|
|
+ value = value == "" ? 0 : parseInt(value, 10).toString();
|
|
|
data[field] = value;
|
|
|
};
|
|
|
|
|
@@ -1520,14 +1540,16 @@ export const useHooks = (t?: any) => {
|
|
|
let item = enumArr.find((item: any) => item.value == val);
|
|
|
let arr = getDuoquVal(item);
|
|
|
|
|
|
- console.log("state.vxeTableMxRef.element.get :>> ", state.vxeTableMxRef.element.getTableData());
|
|
|
- let { fullData } = state.vxeTableMxRef.element.getTableData();
|
|
|
+ console.log("state.vxeTableMxRef :>> ", state.vxeTableMxRef);
|
|
|
+ // console.log("state.vxeTableMxRef.element.get :>> ", state.vxeTableMxRef.element.getTableData());
|
|
|
+ // let { fullData } = state.vxeTableMxRef.element.getTableData();
|
|
|
let num = arr.length;
|
|
|
- fullData[0].if_part = Number(num > 1);
|
|
|
+ state.bednetMxData[0].if_part = Boolean(num > 1);
|
|
|
+ console.log("fullData bednetMxData :>> ", state.bednetMxData);
|
|
|
|
|
|
if (num > 1) {
|
|
|
- fullData[0].springid = 0;
|
|
|
- fullData[0].springname = "";
|
|
|
+ state.bednetMxData[0].springid = 0;
|
|
|
+ state.bednetMxData[0].springname = "";
|
|
|
nextTick(() => {
|
|
|
setTimeout(async () => {
|
|
|
console.log(
|
|
@@ -1558,7 +1580,7 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
let _data = {
|
|
|
...dw_bednet_mx_spring,
|
|
|
- spring_qty_width: Number(fullData[0].spring_qty_width),
|
|
|
+ spring_qty_width: Number(state.bednetMxData[0].spring_qty_width),
|
|
|
spring_qty_length: 0
|
|
|
};
|
|
|
arr.push(_data);
|
|
@@ -1601,6 +1623,33 @@ export const useHooks = (t?: any) => {
|
|
|
return arr;
|
|
|
};
|
|
|
|
|
|
+ /**
|
|
|
+ * @description 设置多区弹簧宽度
|
|
|
+ */
|
|
|
+ const setMxSpringWidth = row => {
|
|
|
+ console.log("setMxSpringWidth val :>> ", row);
|
|
|
+
|
|
|
+ // if (Number(row.if_part)) {
|
|
|
+ // state.bednetMxSpringData = state.bednetMxSpringData.map(item => {
|
|
|
+ // item.spring_qty_width = row.spring_qty_width;
|
|
|
+ // return item;
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ if (state.vxeTableMxSpringRef) {
|
|
|
+ let { fullData: springData } = state.vxeTableMxSpringRef?.element.getTableData();
|
|
|
+
|
|
|
+ springData.forEach((item, index) => {
|
|
|
+ item.spring_qty_width = row.spring_qty_width;
|
|
|
+ });
|
|
|
+ console.log("state.vxeTableMxSpringRef.element :>> ", state.vxeTableMxSpringRef.element);
|
|
|
+
|
|
|
+ state.vxeTableMxSpringRef.element.updateFooter();
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @description 设置多区弹簧长度
|
|
|
+ */
|
|
|
const setMxSpringLength = () => {
|
|
|
const { _mainData, enumMap } = state.LjDetailRef;
|
|
|
|
|
@@ -1661,7 +1710,11 @@ export const useHooks = (t?: any) => {
|
|
|
const { column, row, status } = scope;
|
|
|
return (
|
|
|
<>
|
|
|
- <el-input-number v-model={row.bednet_height} style="width: unset" />
|
|
|
+ <el-input
|
|
|
+ v-model={row.bednet_height}
|
|
|
+ onBlur={() => handleBlur(row.bednet_height, row, "bednet_height")}
|
|
|
+ style="width: unset"
|
|
|
+ />
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
@@ -1677,6 +1730,7 @@ export const useHooks = (t?: any) => {
|
|
|
<el-input
|
|
|
v-model={row.spring_qty_width}
|
|
|
onBlur={() => handleBlur(row.spring_qty_width, row, "spring_qty_width")}
|
|
|
+ onChange={() => setMxSpringWidth(row)}
|
|
|
style="width: unset"
|
|
|
/>
|
|
|
</>
|
|
@@ -1700,26 +1754,26 @@ export const useHooks = (t?: any) => {
|
|
|
);
|
|
|
}
|
|
|
},
|
|
|
- {
|
|
|
- field: "if_part",
|
|
|
- editRender: {},
|
|
|
- editColRender: (scope: any) => {
|
|
|
- const { column, row, status } = scope;
|
|
|
+ // {
|
|
|
+ // field: "if_part"
|
|
|
+ // editRender: {},
|
|
|
+ // editColRender: (scope: any) => {
|
|
|
+ // const { column, row, status } = scope;
|
|
|
|
|
|
- console.log("if_part row :>> ", row);
|
|
|
+ // console.log("if_part row :>> ", row);
|
|
|
|
|
|
- if (Number(row.if_part) == 1) {
|
|
|
- row.springid = 0;
|
|
|
- row.springname = "";
|
|
|
- }
|
|
|
+ // if (Number(row.if_part) == 1) {
|
|
|
+ // row.springid = 0;
|
|
|
+ // row.springname = "";
|
|
|
+ // }
|
|
|
|
|
|
- return (
|
|
|
- <>
|
|
|
- <el-checkbox v-model={row.if_part} style="display: block"></el-checkbox>
|
|
|
- </>
|
|
|
- );
|
|
|
- }
|
|
|
- },
|
|
|
+ // return (
|
|
|
+ // <>
|
|
|
+ // <el-checkbox v-model={row.if_part} style="display: block"></el-checkbox>
|
|
|
+ // </>
|
|
|
+ // );
|
|
|
+ // }
|
|
|
+ // },
|
|
|
{
|
|
|
field: "springname",
|
|
|
editRender: {},
|
|
@@ -1753,7 +1807,7 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
- <el-checkbox v-model={row.if_side_iron} style="display: block"></el-checkbox>
|
|
|
+ <el-checkbox v-model={row.if_side_iron} class="vxe-edit-col-middle"></el-checkbox>
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
@@ -1783,7 +1837,7 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
- <el-checkbox v-model={row.if_hard_around} style="display: block"></el-checkbox>
|
|
|
+ <el-checkbox v-model={row.if_hard_around} class="vxe-edit-col-middle"></el-checkbox>
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
@@ -1804,6 +1858,7 @@ export const useHooks = (t?: any) => {
|
|
|
field: "hard_around_springname",
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
+ console.log("hard_around_springname editColRender scope :>> ", scope);
|
|
|
const { column, row, status } = scope;
|
|
|
let _label = column.title;
|
|
|
|
|
@@ -1814,9 +1869,9 @@ export const useHooks = (t?: any) => {
|
|
|
disabled={Number(row.if_hard_around) == 0}
|
|
|
clearable
|
|
|
placeholder={_label}
|
|
|
- onOpenModal={() => fModelChoseSpring(row, row.hard_around_springid, rModelSetSpring)}
|
|
|
- onSelect={(val: any) => rModelSetSpring(row, val)}
|
|
|
- onClear={() => rModelClearSpring(row)}
|
|
|
+ onOpenModal={() => fModelChoseSpring(row, row.hard_around_springid, rModelSetHardAroundSpring)}
|
|
|
+ onSelect={(val: any) => rModelSetHardAroundSpring(row, val)}
|
|
|
+ onClear={() => rModelClearHardAroundSpring(row)}
|
|
|
/>
|
|
|
</>
|
|
|
);
|
|
@@ -1830,7 +1885,7 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
- <el-checkbox v-model={row.if_15strip} style="display: block"></el-checkbox>
|
|
|
+ <el-checkbox v-model={row.if_15strip} class="vxe-edit-col-middle"></el-checkbox>
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
@@ -1930,6 +1985,7 @@ export const useHooks = (t?: any) => {
|
|
|
field: "springname",
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
+ console.log("springname editColRender scope :>> ", scope);
|
|
|
const { column, row, status } = scope;
|
|
|
let _label = column.title;
|
|
|
|
|
@@ -1940,9 +1996,9 @@ export const useHooks = (t?: any) => {
|
|
|
disabled={Number(row.if_part) == 1}
|
|
|
clearable
|
|
|
placeholder={_label}
|
|
|
- onOpenModal={() => fModelChoseSpring(row, row.springid, rModelSetSpring)}
|
|
|
- onSelect={(val: any) => rModelSetSpring(row, val)}
|
|
|
- onClear={() => rModelClearSpring(row)}
|
|
|
+ onOpenModal={() => fModelChoseSpring(scope.row, row.springid, rModelSetSpring)}
|
|
|
+ onSelect={(val: any) => rModelSetSpring(scope.row, val)}
|
|
|
+ onClear={() => rModelClearSpring(scope.row)}
|
|
|
/>
|
|
|
</>
|
|
|
);
|
|
@@ -2397,7 +2453,7 @@ export const useHooks = (t?: any) => {
|
|
|
dw_bednet_mx_spring,
|
|
|
reload_dw2,
|
|
|
getData,
|
|
|
- // getDataMx,
|
|
|
+ getDataMx,
|
|
|
getDataMxSpring,
|
|
|
getDataMxAdd,
|
|
|
dataCallback,
|