|
@@ -4722,7 +4722,7 @@ export const useHooks = (t?: any) => {
|
|
|
>
|
|
|
{{
|
|
|
reference: () => {
|
|
|
- return <ElButton type="danger" plain circle disabled={oItem.inputtype == 2} icon={Minus} />;
|
|
|
+ return <ElButton type="danger" plain circle disabled={oItem.extrainputtype == 2} icon={Minus} />;
|
|
|
}
|
|
|
}}
|
|
|
</ElPopconfirm>
|
|
@@ -4742,15 +4742,18 @@ export const useHooks = (t?: any) => {
|
|
|
// }
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
- console.log("extratypename state.specialProcessesEnum :>> ", state.specialProcessesEnum);
|
|
|
return (
|
|
|
- <el-select v-model={scope.row.extraid} disabled={scope.row.extraid == 1}>
|
|
|
+ <el-select
|
|
|
+ v-model={scope.row.extraid}
|
|
|
+ disabled={scope.row.extrainputtype == 2}
|
|
|
+ onChange={val => extratypeOnChange(val, scope)}
|
|
|
+ >
|
|
|
{{
|
|
|
default: () => {
|
|
|
let rs = [];
|
|
|
if (state.specialProcessesEnum.length) {
|
|
|
state.specialProcessesEnum.map((t: any) => {
|
|
|
- rs.push(<el-option label={t.typename} value={t.extraid} disabled={t.extraid == 1} />);
|
|
|
+ rs.push(<el-option label={t.typename} value={t.extraid} disabled={t.inputtype == 2} />);
|
|
|
});
|
|
|
}
|
|
|
return rs;
|
|
@@ -4773,19 +4776,43 @@ export const useHooks = (t?: any) => {
|
|
|
field: "extraname",
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
- let _disabled = scope.row.inputtype == 2;
|
|
|
- return (
|
|
|
- <el-autocomplete
|
|
|
- v-model={scope.row.extraname}
|
|
|
- disabled={_disabled}
|
|
|
- value-key="extramxname"
|
|
|
- fetch-suggestions={(queryString: string, callback: any) =>
|
|
|
- querySearch_processes(queryString, callback, scope, state.specialProcessesMxData)
|
|
|
- }
|
|
|
- onSelect={itm => additionalOnSelect(itm, scope)}
|
|
|
- clearable
|
|
|
- />
|
|
|
- );
|
|
|
+ let _disabled = scope.row.extrainputtype == 2;
|
|
|
+ if (scope.row.extrainputtype == 0) {
|
|
|
+ return (
|
|
|
+ <el-select
|
|
|
+ v-model={scope.row.extramxid}
|
|
|
+ disabled={_disabled}
|
|
|
+ onChange={val => additionalOnChange(val, scope, state.specialProcessesMxData)}
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ default: () => {
|
|
|
+ let rs = [];
|
|
|
+ if (state.specialProcessesMxData.length) {
|
|
|
+ state.specialProcessesMxData
|
|
|
+ .filter(t => t.extraid == scope.row.extraid)
|
|
|
+ .map((t: any) => {
|
|
|
+ rs.push(<el-option label={t.extramxname} value={t.extramxid} />);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return rs;
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ </el-select>
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return (
|
|
|
+ <el-autocomplete
|
|
|
+ v-model={scope.row.extraname}
|
|
|
+ disabled={_disabled}
|
|
|
+ value-key="extramxname"
|
|
|
+ fetch-suggestions={(queryString: string, callback: any) =>
|
|
|
+ querySearch_processes(queryString, callback, scope, state.specialProcessesMxData)
|
|
|
+ }
|
|
|
+ onSelect={itm => additionalOnSelect(itm, scope)}
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -4866,13 +4893,17 @@ export const useHooks = (t?: any) => {
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
return (
|
|
|
- <el-select v-model={scope.row.extraid}>
|
|
|
+ <el-select
|
|
|
+ v-model={scope.row.extraid}
|
|
|
+ disabled={scope.row.extrainputtype == 2}
|
|
|
+ onChange={val => extratypeOnChange(val, scope)}
|
|
|
+ >
|
|
|
{{
|
|
|
default: () => {
|
|
|
let rs = [];
|
|
|
if (state.additionalCostsEnum.length) {
|
|
|
- state.additionalCostsEnum.map((t: any) => {
|
|
|
- rs.push(<el-option label={t.typename} value={t.extraid} />);
|
|
|
+ state.specialProcessesEnum.map((t: any) => {
|
|
|
+ rs.push(<el-option label={t.typename} value={t.extraid} disabled={t.inputtype == 2} />);
|
|
|
});
|
|
|
}
|
|
|
return rs;
|
|
@@ -4896,19 +4927,43 @@ export const useHooks = (t?: any) => {
|
|
|
editRender: {},
|
|
|
editColRender: (scope: any) => {
|
|
|
console.log("editColRender 1111 scope :>> ", scope);
|
|
|
- let _disabled = scope.row.inputtype == 2;
|
|
|
- return (
|
|
|
- <el-autocomplete
|
|
|
- v-model={scope.row.extraname}
|
|
|
- disabled={_disabled}
|
|
|
- value-key="extramxname"
|
|
|
- fetch-suggestions={(queryString: string, callback: any) =>
|
|
|
- querySearch_additional(queryString, callback, scope, state.additionalCostsMxData)
|
|
|
- }
|
|
|
- onSelect={itm => additionalOnSelect(itm, scope)}
|
|
|
- clearable
|
|
|
- />
|
|
|
- );
|
|
|
+ let _disabled = scope.row.extrainputtype == 2;
|
|
|
+ if (scope.row.extrainputtype == 0) {
|
|
|
+ return (
|
|
|
+ <el-select
|
|
|
+ v-model={scope.row.extramxid}
|
|
|
+ disabled={_disabled}
|
|
|
+ onChange={val => additionalOnChange(val, scope, state.additionalCostsMxData)}
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ default: () => {
|
|
|
+ let rs = [];
|
|
|
+ if (state.additionalCostsMxData.length) {
|
|
|
+ state.additionalCostsMxData
|
|
|
+ .filter(t => t.extraid == scope.row.extraid)
|
|
|
+ .map((t: any) => {
|
|
|
+ rs.push(<el-option label={t.extramxname} value={t.extramxid} />);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return rs;
|
|
|
+ }
|
|
|
+ }}
|
|
|
+ </el-select>
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return (
|
|
|
+ <el-autocomplete
|
|
|
+ v-model={scope.row.extraname}
|
|
|
+ disabled={_disabled}
|
|
|
+ value-key="extramxname"
|
|
|
+ fetch-suggestions={(queryString: string, callback: any) =>
|
|
|
+ querySearch_additional(queryString, callback, scope, state.additionalCostsMxData)
|
|
|
+ }
|
|
|
+ onSelect={itm => additionalOnSelect(itm, scope)}
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
{
|
|
@@ -4940,6 +4995,35 @@ export const useHooks = (t?: any) => {
|
|
|
}
|
|
|
];
|
|
|
|
|
|
+ const extratypeOnChange = (value: any, scope: any) => {
|
|
|
+ const { row } = scope;
|
|
|
+
|
|
|
+ if (state.specialProcessesEnum.length) {
|
|
|
+ let item = state.specialProcessesEnum.find(t => t.extraid == value);
|
|
|
+ if (item) {
|
|
|
+ row.extrainputtype = item.inputtype;
|
|
|
+
|
|
|
+ row.extramxid = 0;
|
|
|
+ row.inputtype = 0;
|
|
|
+ row.extraname = "";
|
|
|
+ row.price = 0;
|
|
|
+ row.qty = 0;
|
|
|
+ row.dscrp = "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const additionalOnChange = (value: any, scope: any, enumdata: any) => {
|
|
|
+ const { row } = scope;
|
|
|
+
|
|
|
+ if (enumdata.length) {
|
|
|
+ let item = enumdata.find(t => t.extraid == row.extraid && t.extramxid == value);
|
|
|
+ if (item) {
|
|
|
+ additionalOnSelect(item, scope);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
const additionalOnSelect = (item: Record<string, any>, scope: any) => {
|
|
|
const { row } = scope;
|
|
|
// console.log("additionalOnSelect: >>", item);
|
|
@@ -4951,11 +5035,11 @@ export const useHooks = (t?: any) => {
|
|
|
// const row = visibleData[$rowIndex];
|
|
|
// console.log("additionalOnSelect: row >>", row);
|
|
|
// row.extramxname = item.extramxname;
|
|
|
- row.extramxid = item.extramxid;
|
|
|
+ row.extramxid = item.extramxid ?? 0;
|
|
|
row.inputtype = item.inputtype;
|
|
|
row.extraid = item.extraid;
|
|
|
row.extraname = item.extramxname;
|
|
|
- row.typeid = item.typeid;
|
|
|
+ // row.typeid = item.typeid;
|
|
|
row.price = item.price;
|
|
|
row.qty = item.qty;
|
|
|
row.dscrp = item.dscrp;
|