|
@@ -241,7 +241,7 @@ export const useHooks = (t?: any) => {
|
|
|
ref: "specialProcessesMxRef"
|
|
|
},
|
|
|
{
|
|
|
- label: "其他额外费用",
|
|
|
+ label: "材料额外费用",
|
|
|
name: "additionalCosts",
|
|
|
ref: "additionalCostsMxRef"
|
|
|
}
|
|
@@ -1295,7 +1295,7 @@ export const useHooks = (t?: any) => {
|
|
|
* @param status 当前订单状态
|
|
|
* @returns Promise
|
|
|
*/
|
|
|
- const fModelChoseMtrl = (data: any, params: any, cb: any, label?: string, $table?: any) => {
|
|
|
+ const fModelChoseMtrl = (data: any, params: any, cb: any, label?: string, $table?: any, qty = 1) => {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
// if (!ALLOW_EDIT_STATE.includes(status)) return;
|
|
|
|
|
@@ -1309,7 +1309,7 @@ export const useHooks = (t?: any) => {
|
|
|
// submit
|
|
|
console.log("openCustDialog res", res);
|
|
|
nextTick(() => {
|
|
|
- cb(data, res.value[0], $table);
|
|
|
+ cb(data, res.value[0], $table, qty);
|
|
|
resolve(1);
|
|
|
});
|
|
|
},
|
|
@@ -1327,7 +1327,7 @@ export const useHooks = (t?: any) => {
|
|
|
* @param data 当前数据
|
|
|
* @param item 当前选择的数据
|
|
|
*/
|
|
|
- const rModelSetMtrl = (data: any, item: any, $table?: any) => {
|
|
|
+ const rModelSetMtrl = (data: any, item: any, $table?: any, qty = 1) => {
|
|
|
console.log("rModelSetMtrl data :>> ", data);
|
|
|
console.log("rModelSetMtrl item :>> ", item);
|
|
|
if (item) {
|
|
@@ -1344,7 +1344,7 @@ export const useHooks = (t?: any) => {
|
|
|
data.shrinkage = item.price; // 收缩率
|
|
|
data.thickness = Number(item.thickness);
|
|
|
data.price_formula = item.price_formula;
|
|
|
- data.qty = 1;
|
|
|
+ data.qty = qty;
|
|
|
|
|
|
// cb && cb();
|
|
|
if ($table) {
|
|
@@ -3020,6 +3020,7 @@ export const useHooks = (t?: any) => {
|
|
|
disabled={_disabled}
|
|
|
label="面拆"
|
|
|
class="mr-8"
|
|
|
+ onChange={val => autoLoadExtraData_chai(val, "if_m_chai")}
|
|
|
/>
|
|
|
<el-checkbox
|
|
|
v-model={scope.searchParam.if_z_chai}
|
|
@@ -3028,6 +3029,7 @@ export const useHooks = (t?: any) => {
|
|
|
disabled={_disabled}
|
|
|
label="中拆"
|
|
|
class="mr-8"
|
|
|
+ onChange={val => autoLoadExtraData_chai(val, "if_z_chai")}
|
|
|
/>
|
|
|
<el-checkbox
|
|
|
v-model={scope.searchParam.if_d_chai}
|
|
@@ -3035,6 +3037,7 @@ export const useHooks = (t?: any) => {
|
|
|
false-value={0}
|
|
|
disabled={_disabled}
|
|
|
label="底拆"
|
|
|
+ onChange={val => autoLoadExtraData_chai(val, "if_d_chai")}
|
|
|
/>
|
|
|
</>
|
|
|
);
|
|
@@ -3541,7 +3544,7 @@ export const useHooks = (t?: any) => {
|
|
|
row.formulakind == 7
|
|
|
);
|
|
|
|
|
|
- return <el-input v-model={scope.row.thickness} type="number" disabled={_disabled}></el-input>;
|
|
|
+ return <el-input v-model={scope.row.thickness} disabled={_disabled}></el-input>;
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -3549,8 +3552,6 @@ export const useHooks = (t?: any) => {
|
|
|
field: "mtrlname",
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
- console.log("mtrlname hooks render scope :>> ", scope);
|
|
|
- console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
|
|
|
const { $table, column, row, status } = scope;
|
|
|
let field = column.field;
|
|
|
let _label = column.title;
|
|
@@ -3558,9 +3559,6 @@ export const useHooks = (t?: any) => {
|
|
|
// _label = handleRowAccordingToProp(searchParam, field, column?.format);
|
|
|
// }
|
|
|
let _pricelistid = getPriceid();
|
|
|
- console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
|
|
|
-
|
|
|
- console.log("state.mtrltypeTabList :>> ", mtrltypeTabList);
|
|
|
|
|
|
let _mtrltypeItem: any = mtrltypeTabList.find(t => t.formulakinds.includes(Number(row.formulakind)));
|
|
|
!_mtrltypeItem && (_mtrltypeItem = { value: -1 });
|
|
@@ -3570,6 +3568,13 @@ export const useHooks = (t?: any) => {
|
|
|
pricelistid: _pricelistid
|
|
|
};
|
|
|
|
|
|
+ // 拉手刺绣及其他工艺,大侧压压布、拉链等自动带出数量=周长
|
|
|
+ let ifCircum = [7, 8, 9, 202].includes(row.formulakind);
|
|
|
+
|
|
|
+ let mattress_width = state.LjDetailRef._mainData.mattress_width ?? 0;
|
|
|
+ let mattress_length = state.LjDetailRef._mainData.mattress_length ?? 0;
|
|
|
+ let _qty = ifCircum ? (mattress_width / 100 + mattress_length / 100) * 2 : 1;
|
|
|
+
|
|
|
return (
|
|
|
<>
|
|
|
<MtrldefSelect
|
|
@@ -3577,8 +3582,8 @@ export const useHooks = (t?: any) => {
|
|
|
{...params}
|
|
|
clearable
|
|
|
placeholder={_label}
|
|
|
- onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table)}
|
|
|
- onSelect={val => rModelSetMtrl(row, val, $table)}
|
|
|
+ onOpenModal={() => fModelChoseMtrl(row, params, rModelSetMtrl, _mtrltypeItem.label, $table, _qty)}
|
|
|
+ onSelect={val => rModelSetMtrl(row, val, $table, _qty)}
|
|
|
onClear={() => rModelClearMtrl(row, $table)}
|
|
|
>
|
|
|
{{
|
|
@@ -3597,7 +3602,35 @@ export const useHooks = (t?: any) => {
|
|
|
editColRender: (scope: any) => {
|
|
|
const { $table, column, row, status } = scope;
|
|
|
|
|
|
- return <el-input v-model={scope.row.qty} type="number" disabled={row.mtrlid == 0}></el-input>;
|
|
|
+ // 面料(面、底、侧)的数量/长度,不能输入
|
|
|
+ let arr = [
|
|
|
+ {
|
|
|
+ // label: "裥面",
|
|
|
+ type: [0, 80, 40, 50, 60, 70, 9000]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // label: "裥底",
|
|
|
+ type: [1, 81, 41, 51, 61, 71, 9001]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ // label: "裥大恻",
|
|
|
+ type: [2, 82, 42, 52, 62, 72, 9002]
|
|
|
+ }
|
|
|
+ // {
|
|
|
+ // // label: "裥小恻",
|
|
|
+ // type: [3, 83, 43, 53, 63, 73, 9003]
|
|
|
+ // // ref: "fabricMxTab11Ref"
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // // label: "裥V恻",
|
|
|
+ // type: [4, 84, 44, 54, 64, 74, 9004]
|
|
|
+ // // ref: "fabricMxTab12Ref"
|
|
|
+ // }
|
|
|
+ ];
|
|
|
+
|
|
|
+ let _disabled = arr.some(t => t.type.includes(row.formulakind));
|
|
|
+
|
|
|
+ return <el-input v-model={scope.row.qty} type="number" disabled={row.mtrlid == 0 || _disabled}></el-input>;
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -4095,8 +4128,6 @@ export const useHooks = (t?: any) => {
|
|
|
editRender: {},
|
|
|
width: 250,
|
|
|
editColRender: (scope: any) => {
|
|
|
- console.log("mtrlname hooks render scope :>> ", scope);
|
|
|
- console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
|
|
|
const { column, row, status, $table } = scope;
|
|
|
let _label = column.title;
|
|
|
let _deptid = state.LjDetailRef._mainData.deptid;
|
|
@@ -4270,15 +4301,11 @@ export const useHooks = (t?: any) => {
|
|
|
field: "mtrlname",
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
- console.log("mtrlname hooks render scope :>> ", scope);
|
|
|
- console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
|
|
|
const { column, row, status, $table } = scope;
|
|
|
let _label = column.title;
|
|
|
let _pricelistid = getPriceid();
|
|
|
- console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
|
|
|
|
|
|
let _mtrltypeItem: any = mtrltypeTabList_cushions.find(t => t.formulakinds.includes(Number(row.formulakind)));
|
|
|
- console.log("state.mtrltypeTabList :>> ", mtrltypeTabList_cushions, _mtrltypeItem);
|
|
|
if (!_mtrltypeItem) {
|
|
|
// ElMessage.error("不是垫层类型行,不能选物料");
|
|
|
// return <></>;
|
|
@@ -4355,8 +4382,6 @@ export const useHooks = (t?: any) => {
|
|
|
field: "mtrlname",
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
- console.log("mtrlname hooks render scope :>> ", scope);
|
|
|
- console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
|
|
|
const { column, row, status, $table } = scope;
|
|
|
let field = column.field;
|
|
|
let _label = column.title;
|
|
@@ -4364,9 +4389,6 @@ export const useHooks = (t?: any) => {
|
|
|
// _label = handleRowAccordingToProp(searchParam, field, column?.format);
|
|
|
// }
|
|
|
let _pricelistid = getPriceid();
|
|
|
- console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
|
|
|
-
|
|
|
- console.log("state.mtrltypeTabList :>> ", state.mtrltypeTabList);
|
|
|
|
|
|
let _mtrltypeItem: any = mtrltypeTabList_accessories.find(t => t.formulakinds.includes(Number(row.formulakind)));
|
|
|
if (!_mtrltypeItem) {
|
|
@@ -4415,8 +4437,6 @@ export const useHooks = (t?: any) => {
|
|
|
field: "mtrlname",
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
- console.log("mtrlname hooks render scope :>> ", scope);
|
|
|
- console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
|
|
|
const { column, row, status, $table } = scope;
|
|
|
let field = column.field;
|
|
|
let _label = column.title;
|
|
@@ -4424,9 +4444,6 @@ export const useHooks = (t?: any) => {
|
|
|
// _label = handleRowAccordingToProp(searchParam, field, column?.format);
|
|
|
// }
|
|
|
let _pricelistid = getPriceid();
|
|
|
- console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
|
|
|
-
|
|
|
- console.log("state.mtrltypeTabList :>> ", state.mtrltypeTabList);
|
|
|
|
|
|
let _mtrltypeItem: any = mtrltypeTabList_packag.find(t => t.formulakinds.includes(Number(row.formulakind)));
|
|
|
!_mtrltypeItem && (_mtrltypeItem = { value: -1 });
|
|
@@ -4575,14 +4592,9 @@ export const useHooks = (t?: any) => {
|
|
|
field: "mtrlname",
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
- console.log("mtrlname hooks render scope :>> ", scope);
|
|
|
- console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
|
|
|
const { column, row, status, $table } = scope;
|
|
|
let _label = column.title;
|
|
|
let _pricelistid = getPriceid();
|
|
|
- console.log("_pricelistid :>> ", _pricelistid, row.formulakind);
|
|
|
-
|
|
|
- console.log("state.mtrltypeTabList :>> ", state.mtrltypeTabList);
|
|
|
|
|
|
let _mtrltypeItem: any = mtrltypeTabList_inner.find(t => t.formulakinds.includes(Number(row.formulakind)));
|
|
|
!_mtrltypeItem && (_mtrltypeItem = { value: -1 });
|
|
@@ -4647,8 +4659,24 @@ export const useHooks = (t?: any) => {
|
|
|
field: "addmx",
|
|
|
width: 80,
|
|
|
render: (scope: any) => {
|
|
|
+ let oItem = state.specialProcessesMxData.find(o => o.extraid == scope.row.extraid);
|
|
|
+ if (!oItem) {
|
|
|
+ oItem = {
|
|
|
+ inputtype: 1
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
if (state.orderStatus) {
|
|
|
- return <ElButton type="primary" plain circle icon={Plus} onClick={() => funcAddMtrlMx(scope)}></ElButton>;
|
|
|
+ return (
|
|
|
+ <ElButton
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ circle
|
|
|
+ icon={Plus}
|
|
|
+ disabled={oItem.inputtype == 2}
|
|
|
+ onClick={() => funcAddMtrlMx(scope)}
|
|
|
+ ></ElButton>
|
|
|
+ );
|
|
|
} else {
|
|
|
return <>+</>;
|
|
|
}
|
|
@@ -4659,6 +4687,13 @@ export const useHooks = (t?: any) => {
|
|
|
field: "delmx",
|
|
|
width: 80,
|
|
|
render: (scope: any) => {
|
|
|
+ let oItem = state.specialProcessesMxData.find(o => o.extraid == scope.row.extraid);
|
|
|
+ if (!oItem) {
|
|
|
+ oItem = {
|
|
|
+ inputtype: 1
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
if (state.orderStatus) {
|
|
|
return (
|
|
|
<>
|
|
@@ -4672,7 +4707,7 @@ export const useHooks = (t?: any) => {
|
|
|
>
|
|
|
{{
|
|
|
reference: () => {
|
|
|
- return <ElButton type="danger" plain circle icon={Minus} />;
|
|
|
+ return <ElButton type="danger" plain circle disabled={oItem.inputtype == 2} icon={Minus} />;
|
|
|
}
|
|
|
}}
|
|
|
</ElPopconfirm>
|
|
@@ -4960,7 +4995,7 @@ export const useHooks = (t?: any) => {
|
|
|
editColRender: (scope: any) => {
|
|
|
return (
|
|
|
<>
|
|
|
- <el-input v-model={scope.row.mattress_width} type="number" onChange={() => disshow_subspecs(scope.row)} />
|
|
|
+ <el-input v-model={scope.row.mattress_width} onChange={() => disshow_subspecs(scope.row)} />
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
@@ -4979,7 +5014,7 @@ export const useHooks = (t?: any) => {
|
|
|
editColRender: (scope: any) => {
|
|
|
return (
|
|
|
<>
|
|
|
- <el-input v-model={scope.row.mattress_length} type="number" onChange={() => disshow_subspecs(scope.row)} />
|
|
|
+ <el-input v-model={scope.row.mattress_length} onChange={() => disshow_subspecs(scope.row)} />
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
@@ -4998,7 +5033,7 @@ export const useHooks = (t?: any) => {
|
|
|
editColRender: (scope: any) => {
|
|
|
return (
|
|
|
<>
|
|
|
- <el-input v-model={scope.row.mattress_height} type="number" onChange={() => disshow_subspecs(scope.row)} />
|
|
|
+ <el-input v-model={scope.row.mattress_height} onChange={() => disshow_subspecs(scope.row)} />
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
@@ -5008,10 +5043,10 @@ export const useHooks = (t?: any) => {
|
|
|
field: "spring_qty_width",
|
|
|
datatype: "integer",
|
|
|
editRender: {
|
|
|
- name: "$input",
|
|
|
- props: {
|
|
|
- type: "number"
|
|
|
- }
|
|
|
+ name: "$input"
|
|
|
+ // props: {
|
|
|
+ // type: "number"
|
|
|
+ // }
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -5019,10 +5054,10 @@ export const useHooks = (t?: any) => {
|
|
|
field: "spring_qty_length",
|
|
|
datatype: "integer",
|
|
|
editRender: {
|
|
|
- name: "$input",
|
|
|
- props: {
|
|
|
- type: "number"
|
|
|
- }
|
|
|
+ name: "$input"
|
|
|
+ // props: {
|
|
|
+ // type: "number"
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
];
|
|
@@ -5261,7 +5296,6 @@ export const useHooks = (t?: any) => {
|
|
|
*/
|
|
|
const getPriceid = () => {
|
|
|
let _deptid = state.LjDetailRef?._mainData?.deptid ?? 0;
|
|
|
- console.log("getPriceid state.LjDetailRef _deptid :>> ", _deptid);
|
|
|
if (!_deptid) {
|
|
|
ElMessage.warning("请先选择部门");
|
|
|
state.LjDetailRef?.baseformRef.element.validateField("deptid");
|
|
@@ -5270,10 +5304,8 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
let deptEnum = state.LjDetailRef.enumMap.get("deptid");
|
|
|
let _pricelistid = 0;
|
|
|
- console.log("deptEnum :>> ", deptEnum);
|
|
|
if (deptEnum) {
|
|
|
let depItem = deptEnum.find((item: any) => item.value == _deptid);
|
|
|
- console.log("depItem :>> ", depItem);
|
|
|
if (depItem) {
|
|
|
_pricelistid = Number(depItem.pricelistid);
|
|
|
}
|
|
@@ -5337,6 +5369,70 @@ export const useHooks = (t?: any) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ /**
|
|
|
+ * @description 自动导入修改特殊工艺费用
|
|
|
+ */
|
|
|
+ const autoLoadExtraData_chai = (value?: any, fieldName?: any) => {
|
|
|
+ console.log("autoLoadExtraData_chai value :>> ", value);
|
|
|
+ let _type = "";
|
|
|
+ switch (fieldName) {
|
|
|
+ case "if_m_chai":
|
|
|
+ _type = "面拆";
|
|
|
+ break;
|
|
|
+ case "if_z_chai":
|
|
|
+ _type = "中拆";
|
|
|
+ break;
|
|
|
+ case "if_d_chai":
|
|
|
+ _type = "底拆";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log("state. specialProcessesEnum:>> ", state.specialProcessesEnum, state.specialProcessesMxData);
|
|
|
+
|
|
|
+ let result = state.specialProcessesMxData.filter((item: any) => item.extramxname.indexOf(_type) > -1);
|
|
|
+ if (result.length) {
|
|
|
+ const $tableTarget = state.specialProcessesMxRef.element;
|
|
|
+ const { visibleData: tgVisibleData } = $tableTarget.getTableData();
|
|
|
+
|
|
|
+ if (tgVisibleData) {
|
|
|
+ let _remove = [];
|
|
|
+ tgVisibleData.map(t => {
|
|
|
+ let _itm = result.find(i => i.extraid === t.extraid);
|
|
|
+ if (_itm) {
|
|
|
+ _remove.push(t);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $tableTarget.remove(_remove);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (value) {
|
|
|
+ // 新增
|
|
|
+ if (result.length) {
|
|
|
+ let _arr = [];
|
|
|
+ let _mattressId = state.LjDetailRef._mainData.mattressid;
|
|
|
+ result.map(o => {
|
|
|
+ let _itm = {
|
|
|
+ mattressid: _mattressId,
|
|
|
+ mattressmxid: 0,
|
|
|
+ extraid: o.extraid,
|
|
|
+ // extratypename: "",
|
|
|
+ extraname: o.extramxname,
|
|
|
+ price: o.price,
|
|
|
+ qty: o.qty,
|
|
|
+ dscrp: o.dscrp,
|
|
|
+ inputtype: o.inputtype,
|
|
|
+ typeid: o.typeid
|
|
|
+ };
|
|
|
+ _arr.push(_itm);
|
|
|
+ });
|
|
|
+ $tableTarget.insertAt(_arr, -1);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 删除
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
return {
|
|
|
...toRefs(state),
|
|
|
columns,
|