|
@@ -6,16 +6,17 @@ import { CommonDynamicSelect } from "@/api/modules/common";
|
|
|
import { useUserStore } from "@/stores/modules/user";
|
|
|
import MtrldefSelect from "@/views/system/selector/mtrldef/select.vue";
|
|
|
import SpringSelect from "@/views/system/selector/spring/select.vue";
|
|
|
-import { handleRowAccordingToProp } from "@/utils";
|
|
|
+// import { handleRowAccordingToProp } from "@/utils";
|
|
|
import { ElButton, ElMessage, ElPopconfirm, ElMessageBox } from "element-plus";
|
|
|
import { Minus, Plus, InfoFilled } from "@element-plus/icons-vue";
|
|
|
import { DwnameEnum } from "@/enums/dwnameEnum";
|
|
|
import { isArray } from "@/utils/is";
|
|
|
-import { calculateFormula, formulaPartsFormula, floatAdd, floatMul, formatFixedNumber } from "@/utils/index";
|
|
|
+import { calculateFormula, formulaPartsFormula, floatAdd, floatMul, formatFixedNumber, formatIntNumber } from "@/utils/index";
|
|
|
import { cloneDeep, defaultsDeep } from "lodash-es";
|
|
|
import { TYPE, useToast, POSITION } from "vue-toastification";
|
|
|
import ToastFormula from "@/components/ToastWidget/Formula/index.vue";
|
|
|
import ToastHistoryPrice from "@/components/ToastWidget/HistoryPrice/index.vue";
|
|
|
+import { numCheck } from "@/utils/rules/index";
|
|
|
|
|
|
interface defaultState {
|
|
|
/**
|
|
@@ -525,7 +526,7 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
nextTick(() => {
|
|
|
console.log("wf_b_bednet_type_ch state.vxeTableMxRef :>> ", state.vxeTableMxRef);
|
|
|
- state.vxeTableMxRef.refresh();
|
|
|
+ state.vxeTableMxRef && state.vxeTableMxRef.refresh();
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -543,23 +544,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 获取弹簧明细
|
|
@@ -594,8 +595,12 @@ export const useHooks = (t?: any) => {
|
|
|
|
|
|
const dataCallback = (data: any) => {
|
|
|
console.log("dataCallback data :>> ", data);
|
|
|
+ let _list = data.datatable.map(t => {
|
|
|
+ t.ifsaleout = Boolean(t.ifsaleout);
|
|
|
+ return t;
|
|
|
+ });
|
|
|
return {
|
|
|
- list: data.datatable,
|
|
|
+ list: _list,
|
|
|
tableinfo: data.tableinfo,
|
|
|
total: data.totalcnt,
|
|
|
pageNum: data.pageindex,
|
|
@@ -615,30 +620,12 @@ export const useHooks = (t?: any) => {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
- const numCheck = (rule: any, value: any, callback: any) => {
|
|
|
- // 我这里不是必填的,如果是必填的再判断一下value === ''
|
|
|
- let capital = /^[0-9.]*$/;
|
|
|
- if (!capital.test(value)) {
|
|
|
- callback(new Error(`请输入整数或小数`));
|
|
|
- } else {
|
|
|
- let data = JSON.stringify(value);
|
|
|
- let arr = data.split("");
|
|
|
- let mix = data.indexOf(".");
|
|
|
- if (mix != -1) {
|
|
|
- if (mix == 0 || mix == arr.length - 1) {
|
|
|
- callback(new Error(`小数点不能在第一位或最后一位`));
|
|
|
- return;
|
|
|
- }
|
|
|
- let dianNum = arr.filter((x: any) => x == ".");
|
|
|
- if (dianNum.length > 1) {
|
|
|
- callback(new Error(`小数点只能有一个`));
|
|
|
- return;
|
|
|
- }
|
|
|
- callback();
|
|
|
- } else {
|
|
|
- callback();
|
|
|
- }
|
|
|
- }
|
|
|
+ const handleBlur = (value: any, data: any, field: string) => {
|
|
|
+ value = (value + "").replace(/[^\d.]/g, "");
|
|
|
+ console.log(value);
|
|
|
+ // 保留整数部分
|
|
|
+ value = parseInt(value, 10).toString();
|
|
|
+ data[field] = value;
|
|
|
};
|
|
|
|
|
|
const columns: ColumnProps<any>[] = [
|
|
@@ -773,13 +760,13 @@ export const useHooks = (t?: any) => {
|
|
|
el: "input",
|
|
|
rules: [{ validator: numCheck, trigger: "blur" }],
|
|
|
editable: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.bednettypeid) > 11) {
|
|
|
+ if (Number(scope.searchParam.bednettypeid) > 11) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.bednettypeid) > 11) {
|
|
|
+ if (Number(scope.searchParam.bednettypeid) > 11) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1115,7 +1102,7 @@ export const useHooks = (t?: any) => {
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.iffork)) {
|
|
|
+ if (Number(scope.searchParam.iffork)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1197,7 +1184,7 @@ export const useHooks = (t?: any) => {
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
|
|
|
+ if (Number(scope.searchParam.ifsaleout)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1206,13 +1193,24 @@ export const useHooks = (t?: any) => {
|
|
|
return (
|
|
|
<>
|
|
|
<div class="flx w-full">
|
|
|
- <el-select v-model={scope.searchParam.packtype} placeholder="方式" clearable>
|
|
|
+ <el-select
|
|
|
+ v-model={scope.searchParam.packtype}
|
|
|
+ placeholder="方式"
|
|
|
+ clearable
|
|
|
+ disabled={!ALLOW_EDIT_STATE.includes(scope.status)}
|
|
|
+ >
|
|
|
<el-option label="压包" value="压包" />
|
|
|
<el-option label="卷包" value="卷包" />
|
|
|
<el-option label="不压不卷" value="不压不卷" />
|
|
|
<el-option label="裸包装" value="裸包装" />
|
|
|
</el-select>
|
|
|
- <el-select v-model={scope.searchParam.packmtrl} class="ml-4" placeholder="材料" clearable>
|
|
|
+ <el-select
|
|
|
+ v-model={scope.searchParam.packmtrl}
|
|
|
+ class="ml-4"
|
|
|
+ placeholder="材料"
|
|
|
+ clearable
|
|
|
+ disabled={!ALLOW_EDIT_STATE.includes(scope.status)}
|
|
|
+ >
|
|
|
<el-option label="编辑袋" value="编辑袋" />
|
|
|
<el-option label="牛皮纸" value="牛皮纸" />
|
|
|
<el-option label="胶袋" value="胶袋" />
|
|
@@ -1237,7 +1235,7 @@ export const useHooks = (t?: any) => {
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
|
|
|
+ if (Number(scope.searchParam.ifsaleout)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1303,7 +1301,7 @@ export const useHooks = (t?: any) => {
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
|
|
|
+ if (Number(scope.searchParam.ifsaleout)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1326,7 +1324,7 @@ export const useHooks = (t?: any) => {
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
|
|
|
+ if (Number(scope.searchParam.ifsaleout)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1349,7 +1347,7 @@ export const useHooks = (t?: any) => {
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
|
|
|
+ if (Number(scope.searchParam.ifsaleout)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1379,7 +1377,7 @@ export const useHooks = (t?: any) => {
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
|
|
|
+ if (Number(scope.searchParam.ifsaleout)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1402,7 +1400,7 @@ export const useHooks = (t?: any) => {
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
|
|
|
+ if (Number(scope.searchParam.ifsaleout)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1422,7 +1420,7 @@ export const useHooks = (t?: any) => {
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
|
|
|
+ if (Number(scope.searchParam.ifsaleout)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1445,7 +1443,7 @@ export const useHooks = (t?: any) => {
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
|
|
|
+ if (Number(scope.searchParam.ifsaleout)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1466,7 +1464,7 @@ export const useHooks = (t?: any) => {
|
|
|
return false;
|
|
|
},
|
|
|
editvisible: (scope: any) => {
|
|
|
- if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.ifsaleout)) {
|
|
|
+ if (Number(scope.searchParam.ifsaleout)) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
@@ -1489,19 +1487,21 @@ export const useHooks = (t?: any) => {
|
|
|
}
|
|
|
return false;
|
|
|
},
|
|
|
- render: scope => {
|
|
|
+ render: (scope: any) => {
|
|
|
+ console.log("duo_qv_str scope :>> ", scope);
|
|
|
+ let optionRender = [];
|
|
|
+ scope.enum.map(item => {
|
|
|
+ optionRender.push(<el-option label={item.label} value={item.value} />);
|
|
|
+ });
|
|
|
return (
|
|
|
<>
|
|
|
<el-select
|
|
|
v-model={scope.searchParam.duo_qv_str}
|
|
|
disabled={!ALLOW_EDIT_STATE.includes(scope.status)}
|
|
|
clearable
|
|
|
- onChange={handelChangeDuoqv}
|
|
|
+ onChange={val => handelChangeDuoqv(val, scope.enum)}
|
|
|
>
|
|
|
- <el-option label="单" value="单" />
|
|
|
- <el-option label="3" value="3" />
|
|
|
- <el-option label="5" value="5" />
|
|
|
- <el-option label="7" value="7" />
|
|
|
+ {optionRender}
|
|
|
</el-select>
|
|
|
</>
|
|
|
);
|
|
@@ -1514,22 +1514,18 @@ export const useHooks = (t?: any) => {
|
|
|
* @description 多区select,控制多区明细条数
|
|
|
* @param val
|
|
|
*/
|
|
|
- const handelChangeDuoqv = (val: any) => {
|
|
|
+ const handelChangeDuoqv = (val: any, enumArr: any) => {
|
|
|
console.log("duo_qv_str val :>> ", val);
|
|
|
- let num = 0;
|
|
|
- if (val != "单") {
|
|
|
- num = Number(val);
|
|
|
- }
|
|
|
|
|
|
- console.log("wf_b_bednet_type_ch state.vxeTableMxRef :>> ", num, state.vxeTableMxRef);
|
|
|
+ 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();
|
|
|
- fullData[0].if_part = Boolean(num);
|
|
|
-
|
|
|
- // const { areaArr, total } = setMxSpringLength();
|
|
|
- // console.log("areaArr, total :>> ", areaArr, total);
|
|
|
+ let num = arr.length;
|
|
|
+ fullData[0].if_part = Number(num > 1);
|
|
|
|
|
|
- if (num > 0) {
|
|
|
+ if (num > 1) {
|
|
|
fullData[0].springid = 0;
|
|
|
fullData[0].springname = "";
|
|
|
nextTick(() => {
|
|
@@ -1544,7 +1540,7 @@ export const useHooks = (t?: any) => {
|
|
|
const { fullData: springData } = $table.getTableData();
|
|
|
console.log("handleAreaChange fullData :>> ", springData, num > 0 && springData.length < num);
|
|
|
|
|
|
- if (num > 0 && springData.length < num) {
|
|
|
+ if (springData.length < num) {
|
|
|
let arr = [];
|
|
|
// let sum = Number(fullData[0].spring_qty_length);
|
|
|
// let lengthValSum = 0;
|
|
@@ -1578,29 +1574,54 @@ export const useHooks = (t?: any) => {
|
|
|
}
|
|
|
}, 200);
|
|
|
});
|
|
|
+ } else {
|
|
|
+ // 1
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- const setMxSpringLength = (val = state.currentArea) => {
|
|
|
- let item = state.AreaList.find(t => t.areaname == val);
|
|
|
- console.log("item :>> ", item, state.AreaList);
|
|
|
+ /**
|
|
|
+ * @description 获取多区数据,数组化
|
|
|
+ * @param item
|
|
|
+ * @returns
|
|
|
+ */
|
|
|
+ const getDuoquVal = item => {
|
|
|
let arr = [];
|
|
|
for (const key in item) {
|
|
|
- if (key.indexOf("area_") > -1 && Number(item[key]) > 0) {
|
|
|
+ if (key.indexOf("area_") > -1) {
|
|
|
arr.push(Number(item[key]));
|
|
|
}
|
|
|
}
|
|
|
+ // 忽略数组中尾部出现的多个0
|
|
|
+ let i = arr.length - 1;
|
|
|
+ while (arr[i] === 0) {
|
|
|
+ i--;
|
|
|
+ }
|
|
|
+ arr = arr.slice(0, i + 1);
|
|
|
+
|
|
|
+ return arr;
|
|
|
+ };
|
|
|
+
|
|
|
+ const setMxSpringLength = () => {
|
|
|
+ const { _mainData, enumMap } = state.LjDetailRef;
|
|
|
+
|
|
|
+ console.log("setMxSpringLength object :>> ", _mainData, enumMap);
|
|
|
+ let duoEnum = enumMap.get("duo_qv_str");
|
|
|
+ let item = {};
|
|
|
+ if (duoEnum) {
|
|
|
+ item = duoEnum.find(t => t.value == _mainData.duo_qv_str);
|
|
|
+ }
|
|
|
+ console.log("setMxSpringLength item :>> ", item);
|
|
|
+
|
|
|
+ let arr = getDuoquVal(item);
|
|
|
|
|
|
let totality = arr.reduce((a, b) => a + b, 0);
|
|
|
|
|
|
- // return { areaArr: arr, total: totality };
|
|
|
let { fullData } = state.vxeTableMxRef.element.getTableData();
|
|
|
let sum = Number(fullData[0].spring_qty_length);
|
|
|
console.log("arr, totality :>> ", arr, totality, sum);
|
|
|
|
|
|
if (state.vxeTableMxSpringRef) {
|
|
|
let { fullData: springData } = state.vxeTableMxSpringRef?.element.getTableData();
|
|
|
- // fullData[0].if_part = Boolean(num);
|
|
|
let lengthValSum = 0;
|
|
|
|
|
|
springData.forEach((item, index) => {
|
|
@@ -1608,11 +1629,13 @@ export const useHooks = (t?: any) => {
|
|
|
if (arr.length >= index + 1) {
|
|
|
console.log("index, arr.length :>> ", index, arr.length);
|
|
|
if (index <= arr.length - 1) {
|
|
|
+ console.log("index == arr.length - 1 :>> ", index, arr.length - 1);
|
|
|
if (index == arr.length - 1) {
|
|
|
lengthVal = sum - lengthValSum;
|
|
|
+ console.log("lengthVal end:>> ", lengthVal, lengthValSum, sum);
|
|
|
} else {
|
|
|
- lengthVal = (arr[index] / totality) * sum;
|
|
|
- lengthValSum += lengthVal;
|
|
|
+ lengthVal = formatIntNumber({ val: (arr[index] / totality) * sum });
|
|
|
+ lengthValSum += Number(lengthVal);
|
|
|
}
|
|
|
} else {
|
|
|
lengthVal = 0;
|
|
@@ -1645,12 +1668,17 @@ export const useHooks = (t?: any) => {
|
|
|
},
|
|
|
{
|
|
|
field: "spring_qty_width",
|
|
|
+ datatype: "integer",
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
const { column, row, status } = scope;
|
|
|
return (
|
|
|
<>
|
|
|
- <el-input-number v-model={row.spring_qty_width} style="width: unset" />
|
|
|
+ <el-input
|
|
|
+ v-model={row.spring_qty_width}
|
|
|
+ onBlur={() => handleBlur(row.spring_qty_width, row, "spring_qty_width")}
|
|
|
+ style="width: unset"
|
|
|
+ />
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
@@ -1662,7 +1690,12 @@ export const useHooks = (t?: any) => {
|
|
|
const { column, row, status } = scope;
|
|
|
return (
|
|
|
<>
|
|
|
- <el-input-number v-model={row.spring_qty_length} onChange={() => setMxSpringLength()} style="width: unset" />
|
|
|
+ <el-input
|
|
|
+ v-model={row.spring_qty_length}
|
|
|
+ onBlur={() => handleBlur(row.spring_qty_length, row, "spring_qty_length")}
|
|
|
+ onChange={() => setMxSpringLength()}
|
|
|
+ style="width: unset"
|
|
|
+ />
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
@@ -1922,7 +1955,11 @@ export const useHooks = (t?: any) => {
|
|
|
const { column, row, status } = scope;
|
|
|
return (
|
|
|
<>
|
|
|
- <el-input-number v-model={row.spring_qty_width} style="width: unset" />
|
|
|
+ <el-input
|
|
|
+ v-model={row.spring_qty_width}
|
|
|
+ onBlur={() => handleBlur(row.spring_qty_width, row, "spring_qty_width")}
|
|
|
+ style="width: unset"
|
|
|
+ />
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
@@ -1934,7 +1971,11 @@ export const useHooks = (t?: any) => {
|
|
|
const { column, row, status } = scope;
|
|
|
return (
|
|
|
<>
|
|
|
- <el-input-number v-model={row.spring_qty_length} style="width: unset" />
|
|
|
+ <el-input
|
|
|
+ v-model={row.spring_qty_length}
|
|
|
+ onBlur={() => handleBlur(row.spring_qty_length, row, "spring_qty_length")}
|
|
|
+ style="width: unset"
|
|
|
+ />
|
|
|
</>
|
|
|
);
|
|
|
}
|
|
@@ -2347,362 +2388,6 @@ export const useHooks = (t?: any) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- /**
|
|
|
- * @description 主表计算公式
|
|
|
- */
|
|
|
- const summaryData = ref<any>([
|
|
|
- {
|
|
|
- label: "弹簧材料总成本",
|
|
|
- field: "spring_mtrl_cost",
|
|
|
- formula:
|
|
|
- "if([折叠款] = 1, ([总材料成本]*[大小单]+[款式费用]+[边带费用]+[额外费用]+[制造费用]) * 2, [总材料成本]*[大小单]+[款式费用]+[边带费用]+[额外费用]+[制造费用])"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "弹簧人工总成本",
|
|
|
- field: "spring_hr_cost",
|
|
|
- formula: "[总成本] * ([工厂利润率] + [利润率点数] + [布套点数] + [拆装点数] + [海绵点数]) * [管理费点]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "蛇线材料成本",
|
|
|
- field: "snake_wire_mtrl_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1)) * [额外点数] + [fob]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "四周口袋弹簧成本",
|
|
|
- field: "pocket_around_spring_cost",
|
|
|
- formula: "([部门售价] * ([税率] - 1)) + [佣金] * 0.05"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "四周口袋无纺布成本",
|
|
|
- field: "pocket_around_fabrics_cost",
|
|
|
- formula: "([部门售价] + [佣金] * 0.06) * [税率] * if([fob] = 0, 1, [折扣率])"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "四周加硬材料成本",
|
|
|
- field: "hard_around_mtrl_cost",
|
|
|
- formula: "if([汇率] <> 0, [部门含税价] / [汇率], 0)"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "四周加硬人力成本",
|
|
|
- field: "hard_around_hr_cost",
|
|
|
- formula: "if(([dept_profitrate] + [dept_profitrate_rangli] / 100) <> 0, [dijia_cost] ,0 )"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "入袋无纺布材料成本",
|
|
|
- field: "fabrics1_mtrl_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "胶水材料成本",
|
|
|
- field: "glue_mtrl_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "底面无纺布材料成本",
|
|
|
- field: "fabrics2_mtrl_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "边铁人力成本",
|
|
|
- field: "side_iron_hr_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "边铁材料成本",
|
|
|
- field: "side_iron_mtrl_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "C钉/夹码材料成本",
|
|
|
- field: "cnail_mtrl_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "C钉/夹码人力成本",
|
|
|
- field: "cnail_hr_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "海绵包边材料成本",
|
|
|
- field: "sponge_mtrl_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "海绵包边人力成本",
|
|
|
- field: "sponge_hr_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "填充海绵成本",
|
|
|
- field: "sponge_mtrl_tc_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "封边材料成本",
|
|
|
- field: "edge_mtrl_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "封边人力成本",
|
|
|
- field: "edge_hr_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "弹叉材料成本",
|
|
|
- field: "fork_mtrl_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "弹叉人力成本",
|
|
|
- field: "fork_hr_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "胶条/包角材料成本",
|
|
|
- field: "rsorwa_mtrl_cost",
|
|
|
- formula: "[dijia_cost] / (1 - ([佣金点数] - 1 )) - [dijia_cost]"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "胶条/包角人力成本",
|
|
|
- field: "rsorwa_hr_cost",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "海绵打孔人力成本",
|
|
|
- field: "sponge_drilling_hr_cost",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "上垫层物料成本",
|
|
|
- field: "felt_mtrl_cost",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "下垫层物料成本",
|
|
|
- field: "felt_mtrl_x_cost",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "上垫层人力成本",
|
|
|
- field: "felt_hr_cost",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "下垫层人力成本",
|
|
|
- field: "felt_hr_x_cost",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "包装材料成本",
|
|
|
- field: "packet_mtrl_cost",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "包装人工成本",
|
|
|
- field: "packet_hr_cost",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "总材料成本",
|
|
|
- field: "total_mtrl_cost",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "总人力成本",
|
|
|
- field: "total_hr_cost",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "总成本",
|
|
|
- field: "total_cost",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "钢丝重量",
|
|
|
- field: "spring_weight_qty",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "边铁重量",
|
|
|
- field: "side_iron_weight_qty",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "四周加硬重量",
|
|
|
- field: "hard_around_weight_qty",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "入袋无纺布重量",
|
|
|
- field: "fabrics1_weight_qty",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "面底无纺布重量",
|
|
|
- field: "fabrics2_weight_qty",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- // {
|
|
|
- // label: "上垫层重量",
|
|
|
- // field: "felt_mtrl_cost",
|
|
|
- // formula: ""
|
|
|
- // },
|
|
|
- {
|
|
|
- label: "下垫层重量",
|
|
|
- field: "felt_weight_qty",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "C钉/夹码重量",
|
|
|
- field: "cnail_weight_qty",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "海绵包边重量",
|
|
|
- field: "sponge_weight_qty",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "填充海绵重量",
|
|
|
- field: "sponge_weight_tc_qty",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "封边材料重量",
|
|
|
- field: "edge_weight_qty",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "弹叉材料重量",
|
|
|
- field: "fork_weight_qty",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "重量汇总",
|
|
|
- field: "sum_weight",
|
|
|
- formula: ""
|
|
|
- },
|
|
|
- {
|
|
|
- label: "FOB",
|
|
|
- field: "fob",
|
|
|
- formula: "[fob]"
|
|
|
- }
|
|
|
- ]);
|
|
|
-
|
|
|
- /**
|
|
|
- * @description 主表公式字段照表
|
|
|
- */
|
|
|
- const fieldParams = ref<any>([
|
|
|
- {
|
|
|
- label: "总成本",
|
|
|
- field: "total_cost"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "不含税出厂价",
|
|
|
- field: "nottax_factory_cost"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "部门售价",
|
|
|
- field: "nottax_dept_cost"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "税金",
|
|
|
- field: "taxes"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "部门含税价",
|
|
|
- field: "dept_cost"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "外币价",
|
|
|
- field: "foreign_cost"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "总材料成本",
|
|
|
- field: "total_material_cost"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "大小单",
|
|
|
- field: "dannum_rate"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "款式费用",
|
|
|
- field: "hrcost"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "边带费用",
|
|
|
- field: "biandaicost"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "额外费用",
|
|
|
- field: "extras_cost"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "制造费用",
|
|
|
- field: "zhizao_amt"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "折叠款",
|
|
|
- field: "if_zhedie_type"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "管理费点",
|
|
|
- field: "guanli_rate"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "工厂利润率",
|
|
|
- field: "profitrate"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "利润率点数",
|
|
|
- field: "profitrate_point"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "布套点数",
|
|
|
- field: "butao_point"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "拆装点数",
|
|
|
- field: "chaizhuang_point"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "海绵点数",
|
|
|
- field: "haimian_point"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "部门利润率",
|
|
|
- field: "dept_profitrate"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "部门让利点",
|
|
|
- field: "dept_profitrate_rangli"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "额外点数",
|
|
|
- field: "other_rate"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "佣金点数",
|
|
|
- field: "commission"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "税率",
|
|
|
- field: "taxrate"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "折扣率",
|
|
|
- field: "discount"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "汇率",
|
|
|
- field: "moneyrate"
|
|
|
- },
|
|
|
- {
|
|
|
- label: "底价",
|
|
|
- field: "dijia_cost"
|
|
|
- }
|
|
|
- ]);
|
|
|
-
|
|
|
return {
|
|
|
...toRefs(state),
|
|
|
columns,
|
|
@@ -2712,7 +2397,7 @@ export const useHooks = (t?: any) => {
|
|
|
dw_bednet_mx_spring,
|
|
|
reload_dw2,
|
|
|
getData,
|
|
|
- getDataMx,
|
|
|
+ // getDataMx,
|
|
|
getDataMxSpring,
|
|
|
getDataMxAdd,
|
|
|
dataCallback,
|