浏览代码

JLHWEB: 1、床垫报价明细,取消拉链可编辑;2、修复下拉点击无返回;

JohnnyChan 1 月之前
父节点
当前提交
ae3a0b8f5a

+ 3 - 1
JLHWEB/package.json

@@ -40,6 +40,7 @@
     "@vue-office/excel": "^1.7.8",
     "@vue-office/pdf": "^2.0.2",
     "@vueuse/core": "^10.1.2",
+    "@vxe-ui/plugin-render-element": "4.0.7",
     "@wangeditor/editor": "^5.1.23",
     "@wangeditor/editor-for-vue": "^5.1.12",
     "axios": "^1.4.0",
@@ -68,7 +69,8 @@
     "vue-router": "^4.2.1",
     "vue-toastification": "2.0.0-rc.5",
     "vuedraggable": "^4.1.0",
-    "vxe-table": "4.6.21",
+    "vxe-pc-ui": "4.2.0",
+    "vxe-table": "4.7.81",
     "xe-utils": "^3.5.11"
   },
   "devDependencies": {

+ 10 - 5
JLHWEB/src/components/LjDetail/index.vue

@@ -1199,11 +1199,16 @@ onMounted(async () => {
 
   if (props.requestAuto) {
     getTableList().then(() => {
-      console.log("detail onMountedData", tableData.value);
-      console.log("_mainData :>> ", _mainData.value);
-      console.log("props.data :>> ", props.data);
-      console.log("onMounted detail end!!!! :>> ");
-      emit("afterMounted", _mainData.value);
+      console.log("getTableList orderStatus.value :>> ", orderStatus.value, tableData.value);
+      if (props.requestApi && !tableData.value.length && orderStatus.value != "new") {
+        ElNotification({
+          title: t("sys.api.selectFailed"),
+          message: t("sys.api.selectFailedMessage"),
+          type: "warning"
+        });
+      } else {
+        emit("afterMounted", _mainData.value);
+      }
     });
   } else {
     console.log("onMounted detail end!!!! :>> ");

+ 3 - 1
JLHWEB/src/languages/modules/zh-cn/sys.json

@@ -28,7 +28,9 @@
     "sueccessToDel": "成功删除",
     "sueccessToRefresh": "成功刷新",
     "sueccessToSave": "成功保存",
-    "timeoutMessage": "登录超时,请重新登录!"
+    "timeoutMessage": "登录超时,请重新登录!",
+    "selectFailed": "查询失败",
+    "selectFailedMessage": "无法查询到数据"
   },
   "app": {
     "logoutMessage": "是否确认退出系统?",

+ 153 - 83
JLHWEB/src/main.ts

@@ -87,48 +87,74 @@ import {
 // vxe-table
 // import XEUtils from "xe-utils";
 
+// import {
+//   // 全局对象
+//   VXETable,
+
+//   // 表格功能
+//   Filter,
+//   Edit,
+//   Menu,
+//   Export,
+//   Keyboard,
+//   Validator,
+
+//   // 可选组件
+//   Icon,
+//   Column,
+//   Colgroup,
+//   Grid,
+//   Tooltip,
+//   Toolbar,
+//   Pager,
+//   Form,
+//   FormItem,
+//   FormGather,
+//   Checkbox,
+//   CheckboxGroup,
+//   Radio,
+//   RadioGroup,
+//   RadioButton,
+//   Switch,
+//   Input,
+//   Select,
+//   Optgroup,
+//   Option,
+//   Textarea,
+//   Button,
+//   Modal,
+//   List,
+//   Pulldown,
+
+//   // 表格
+//   Table
+// } from "vxe-table";
+
 import {
-  // 全局对象
-  VXETable,
-
-  // 表格功能
-  Filter,
-  Edit,
-  Menu,
-  Export,
-  Keyboard,
-  Validator,
-
-  // 可选组件
-  Icon,
-  Column,
-  Colgroup,
-  Grid,
-  Tooltip,
-  Toolbar,
-  Pager,
-  Form,
-  FormItem,
-  FormGather,
-  Checkbox,
-  CheckboxGroup,
-  Radio,
-  RadioGroup,
-  RadioButton,
-  Switch,
-  Input,
-  Select,
-  Optgroup,
-  Option,
-  Textarea,
-  Button,
-  Modal,
-  List,
-  Pulldown,
-
-  // 表格
-  Table
-} from "vxe-table";
+  VxeUI,
+  VxeButton,
+  VxeButtonGroup,
+  VxeDrawer,
+  VxeForm,
+  VxeFormGroup,
+  VxeFormItem,
+  VxeIcon,
+  VxeInput,
+  VxeLoading,
+  VxeModal,
+  VxePager,
+  VxePrint,
+  VxeSelect,
+  VxeTooltip,
+  VxeUpload
+} from "vxe-pc-ui";
+
+import { VxeTable, VxeColumn, VxeColgroup, VxeGrid, VxeToolbar } from "vxe-table";
+
+// 导入主题变量,也可以重写主题变量
+import "vxe-table/styles/cssvar.scss";
+import "vxe-pc-ui/styles/cssvar.scss";
+
 // import "vxe-table/styles/variable.scss";
 // import "vxe-table/styles/cssvar.scss";
 // import "vxe-table/lib/style.css";
@@ -137,53 +163,59 @@ import "@/styles/var/vant-variable.scss";
 
 import { Tab as VanTab, Tabs as VanTabs, Cell, CellGroup, Empty as VanEmpty } from "vant";
 
+import VxeUIPluginRenderElement from "@vxe-ui/plugin-render-element";
+import "@vxe-ui/plugin-render-element/dist/style.css";
+
+VxeUI.use(VxeUIPluginRenderElement);
+
 // 按需加载的方式默认是不带国际化的,自定义国际化需要自行解析占位符 '{0}',例如:
-VXETable.setup({
-  // @ts-ignore
-  i18n: (key, args) => I18n.global.t(key, args),
-  // 重置vxetable的图标
-  icon: {
-    TABLE_FILTER_NONE: "iconfont iconfilter-funnel-01",
-    TABLE_FILTER_MATCH: "iconfont iconfilter-funnel-01-fill"
-  }
-});
+// VXETable.setup({
+//   // @ts-ignore
+//   i18n: (key, args) => I18n.global.t(key, args),
+//   // 重置vxetable的图标
+//   icon: {
+//     TABLE_FILTER_NONE: "iconfont iconfilter-funnel-01",
+//     TABLE_FILTER_MATCH: "iconfont iconfilter-funnel-01-fill"
+//   }
+// });
 
 import "@/components/LjVxeTable/interface/plugins.tsx";
 
 function useTable(app: App) {
-  // 表格功能
-  app.use(Filter).use(Edit).use(Menu).use(Export).use(Keyboard).use(Validator);
-
-  // 可选组件
-  app
-    .use(Icon)
-    .use(Column)
-    .use(Colgroup)
-    .use(Grid)
-    .use(Tooltip)
-    .use(Toolbar)
-    .use(Pager)
-    .use(Form)
-    .use(FormItem)
-    .use(FormGather)
-    .use(Checkbox)
-    .use(CheckboxGroup)
-    .use(Radio)
-    .use(RadioGroup)
-    .use(RadioButton)
-    .use(Switch)
-    .use(Input)
-    .use(Select)
-    .use(Optgroup)
-    .use(Option)
-    .use(Textarea)
-    .use(Button)
-    .use(Modal)
-    .use(List)
-    .use(Pulldown)
-
-    // 安装表格
-    .use(Table);
+  app.use(lazyVxeUI).use(lazyVxeTable);
+  //   // 表格功能
+  //   app.use(Filter).use(Edit).use(Menu).use(Export).use(Keyboard).use(Validator);
+
+  //   // 可选组件
+  //   app
+  //     .use(Icon)
+  //     .use(Column)
+  //     .use(Colgroup)
+  //     .use(Grid)
+  //     .use(Tooltip)
+  //     .use(Toolbar)
+  //     .use(Pager)
+  //     .use(Form)
+  //     .use(FormItem)
+  //     .use(FormGather)
+  //     .use(Checkbox)
+  //     .use(CheckboxGroup)
+  //     .use(Radio)
+  //     .use(RadioGroup)
+  //     .use(RadioButton)
+  //     .use(Switch)
+  //     .use(Input)
+  //     .use(Select)
+  //     .use(Optgroup)
+  //     .use(Option)
+  //     .use(Textarea)
+  //     .use(Button)
+  //     .use(Modal)
+  //     .use(List)
+  //     .use(Pulldown)
+
+  //     // 安装表格
+  //     .use(Table);
 }
 
 // import VXETable from "vxe-table";
@@ -198,6 +230,44 @@ function useTable(app: App) {
 //   app.use(VXETable);
 // }
 
+// 可选组件
+function lazyVxeUI(app: App) {
+  app.use(VxeButton);
+  app.use(VxeButtonGroup);
+  app.use(VxeDrawer);
+  app.use(VxeForm);
+  app.use(VxeFormGroup);
+  app.use(VxeFormItem);
+  app.use(VxeIcon);
+  app.use(VxeInput);
+  app.use(VxeLoading);
+  app.use(VxeModal);
+  app.use(VxePager);
+  app.use(VxePrint);
+  app.use(VxeSelect);
+  app.use(VxeTooltip);
+  app.use(VxeUpload);
+}
+
+function lazyVxeTable(app: App) {
+  app.use(VxeTable);
+  app.use(VxeColumn);
+  app.use(VxeColgroup);
+  app.use(VxeGrid);
+  app.use(VxeToolbar);
+}
+VxeUI.setConfig({
+  zIndex: 3000,
+  // 对组件内置的提示语进行国际化翻译
+  i18n: (key: any, args: any) => I18n.global.t(key, args)
+});
+
+// 重置vxetable的图标
+VxeUI.setIcon({
+  TABLE_FILTER_NONE: "iconfont iconfilter-funnel-01",
+  TABLE_FILTER_MATCH: "iconfont iconfilter-funnel-01-fill"
+});
+
 const app = createApp(MainApp);
 
 app.config.errorHandler = errorHandler;

+ 3 - 1
JLHWEB/src/styles/var/vxe-variable.scss

@@ -1,5 +1,7 @@
 // @import "./color.scss";
-@import "vxe-table/styles/index.scss";
+// @import "vxe-table/styles/index.scss";
+@import "vxe-pc-ui/lib/style.css";
+@import "vxe-table/lib/style.css";
 
 /*font*/
 

+ 44 - 30
JLHWEB/src/views/erpapi/mattressInterface/detail.vue

@@ -198,38 +198,52 @@ const orderDefaultAction = [
     label: t("common.saveText"),
     loading: () => loadingStatus.save,
     limited: () => !orderStatus.value,
-    clickFunc: item => {
-      ElMessageBox.confirm("是否确定要保存吗?", "询问", {
-        confirmButtonText: "是",
-        cancelButtonText: "否",
-        type: "warning"
-      }).then(async () => {
-        try {
-          const res = await SaveMattressInterface({
-            mattress: LjDetailRef.value?._mainData,
-            interfaceList: mattressYWList.value,
-            qdList: mattressQDList.value
-          })
-            .then(res => {
-              ElNotification({
-                title: "温馨提示",
-                message: t("sys.api.sueccessToSave"),
-                type: "success"
-              });
-              tabRemove(route.fullPath);
-              router.push(
-                `/erpapi/mattressInterface/detail?id=${LjDetailRef.value?._mainData.mattressid}&code=${LjDetailRef.value?._mainData.mattresscode}`
-              );
-              loadingStatus.save = false;
+    clickFunc: async item => {
+      try {
+        await LjDetailRef.value.toValidateForm();
+
+        ElMessageBox.confirm("是否确定要保存吗?", "询问", {
+          confirmButtonText: "是",
+          cancelButtonText: "否",
+          type: "warning"
+        }).then(async () => {
+          loadingStatus.save = true;
+          try {
+            const res = await SaveMattressInterface({
+              mattress: LjDetailRef.value?._mainData,
+              interfaceList: mattressYWList.value,
+              qdList: mattressQDList.value
             })
-            .catch(error => {
-              console.log("error !! :>> ", error);
-              loadingStatus.save = false;
-            });
-        } catch (error) {
-          ElMessage.error(t("sys.api.operationFailed"));
+              .then(res => {
+                ElNotification({
+                  title: "温馨提示",
+                  message: t("sys.api.sueccessToSave"),
+                  type: "success"
+                });
+                tabRemove(route.fullPath);
+                router.push(
+                  `/erpapi/mattressInterface/detail?id=${LjDetailRef.value?._mainData.mattressid}&code=${LjDetailRef.value?._mainData.mattresscode}`
+                );
+                loadingStatus.save = false;
+              })
+              .catch(error => {
+                console.log("error !! :>> ", error);
+                loadingStatus.save = false;
+              });
+          } catch (error) {
+            loadingStatus.save = false;
+            ElMessage.error(t("sys.api.operationFailed"));
+          }
+        });
+      } catch (error) {
+        for (const key in error) {
+          if (Object.prototype.hasOwnProperty.call(error, key)) {
+            const element = error[key];
+            ElMessage.error(element[0].message);
+          }
         }
-      });
+        return false;
+      }
     }
   }),
   [

+ 10 - 4
JLHWEB/src/views/erpapi/mattressInterface/hooks/index.tsx

@@ -511,7 +511,8 @@ export const useHooks = (t?: any) => {
         editable: ALLOW_EDIT_STATE,
         group: "单据信息",
         order: 5,
-        span: 1
+        span: 1,
+        rules: [{ required: true, message: "物料单位不能为空" }]
       }
     },
     {
@@ -874,7 +875,10 @@ export const useHooks = (t?: any) => {
       // editRender: {
       //   name: "$input"
       // }
-      editRender: {},
+      editRender: {
+        // name: "$select"
+        autoFocus: "input"
+      },
       editColRender: (scope: any) => {
         console.log("mtrlname hooks render scope :>> ", scope);
         console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
@@ -1018,11 +1022,12 @@ export const useHooks = (t?: any) => {
       isFilterEnum: true,
       editRender: {
         // name: "$select"
+        autoFocus: "input"
       },
       editColRender: (scope: any) => {
         console.log("formulakind editColRender scope :>> ", scope);
         return (
-          <el-select v-model={scope.row.wrkgrpid} onChange={val => rModelSetWrkgrp1(val, scope.row)}>
+          <el-select v-model={scope.row.wrkgrpid} filterable onChange={val => rModelSetWrkgrp1(val, scope.row)}>
             {{
               default: () => {
                 let rs = [];
@@ -1063,11 +1068,12 @@ export const useHooks = (t?: any) => {
       isFilterEnum: true,
       editRender: {
         // name: "$select"
+        autoFocus: "input"
       },
       editColRender: (scope: any) => {
         console.log("formulakind editColRender scope :>> ", scope);
         return (
-          <el-select v-model={scope.row.wrkgrpid2} onChange={val => rModelSetWrkgrp2(val, scope.row)}>
+          <el-select v-model={scope.row.wrkgrpid2} filterable onChange={val => rModelSetWrkgrp2(val, scope.row)}>
             {{
               default: () => {
                 let rs = [];

+ 2 - 2
JLHWEB/src/views/quote/bednetQuote/components/FormulaItem.vue

@@ -70,7 +70,7 @@ const RenderVariable = (data: any, rprops: any) => {
         return c;
       }
     });
-    if (_trgItem) {
+    if (_trgItem && !_trgItem.ifFold) {
       let sumVal = props.fields.find(f => {
         let _label = f.label.slice(1, -1);
         if (_label === fieldName) {
@@ -83,7 +83,7 @@ const RenderVariable = (data: any, rprops: any) => {
           <div class="flx-col flx-end formula-wrapper__item formula-wrapper__item-children">
             <div class="formula-wrapper__item-children-inner">
               <span class="value text-primary-text text-h5-b flx-end-end">
-                (<RenderFormulaItem data={_trgItem} fields={props.fields} />)
+                (<RenderFormulaItem data={_trgItem} fields={props.fields} ifFold={_trgItem.ifFold} />)
               </span>
               <div class="curly-brace">
                 <div class="triangle-arrow"></div>

+ 2 - 2
JLHWEB/src/views/quote/mattressQuote/components/AllFormula.vue

@@ -36,7 +36,7 @@
           />
           <FormulaGroup :data="isNormalFormulasPart2" :fields="isFieldsReplace" />
         </el-tab-pane>
-        <el-tab-pane label="旧公式" name="second" v-if="!iforigin">
+        <el-tab-pane label="旧公式" name="second" v-if="iforigin">
           <FormulaGroup :data="isNormalFormulasOri" :fields="isFieldsReplaceOri" />
         </el-tab-pane>
       </el-tabs>
@@ -122,7 +122,7 @@ const isNormalFormulasBednet = computed(() => {
       if (matchArr.length > 0) {
         item.children = matchArr;
       }
-      // if (["【车间成本】"].includes(item.label)) item.ifFold = true;
+      if (["【大小单系数】"].includes(item.label)) item.ifFold = true;
       return item;
     })
     .filter((item: any) => item.type == 0);

+ 9 - 3
JLHWEB/src/views/quote/mattressQuote/detail.vue

@@ -1648,9 +1648,10 @@ const save = async () => {
               // 检查明细输入是否正确
               let _disabled = !(
                 (itm.if_inputqty == 0 && [50, 51, 52, 53, 54, 104, 114, 11, 12, 13, 14, 32, 33].includes(itm.formulakind)) ||
-                itm.formulakind == 7 ||
-                itm.formulakind == 202
+                // itm.formulakind == 202 ||
+                itm.formulakind == 7
               );
+              console.log("_disabled :>> ", _disabled);
               if (t.ref == "cushionsMxRef") {
                 _disabled = !(
                   (itm.if_inputqty == 0 && [50, 51, 52, 53, 54, 104, 114, 11, 14, 32, 33].includes(itm.formulakind)) ||
@@ -1660,10 +1661,15 @@ const save = async () => {
               } else if (t.ref == "innerClothLayerMxRef") {
                 _disabled = !(
                   (itm.if_inputqty == 0 && [50, 51, 52, 53, 54, 104, 114, 11, 14, 32, 33].includes(itm.formulakind)) ||
-                  itm.formulakind == 202 ||
+                  // itm.formulakind == 202 ||
                   itm.formulakind == 203
                 );
               }
+              console.log(
+                "itm.mtrlid > 0 && !_disabled && Number(itm.thickness) <= 0 :>> ",
+                _disabled,
+                itm.mtrlid > 0 && !_disabled && Number(itm.thickness) <= 0
+              );
               if (itm.mtrlid > 0 && !_disabled && Number(itm.thickness) <= 0) {
                 throw new Error(t.label + "相关厚度输入有误,请检查");
               }

+ 8 - 7
JLHWEB/src/views/quote/mattressQuote/hooks/cpQuote.ts

@@ -133,12 +133,13 @@ export const useHooksCpQuote = (t?: any) => {
 
   const setResultData = (target: any, label: string, value: any) => {
     let result = cloneDeep(target);
+    let _value = formatCutNumber({ val: value });
     result.label = label;
-    result.costamt = value;
-    result.costamt_1 = value;
-    result.costamt_2 = value;
-    result.costamt_3 = value;
-    result.costamt_4 = value;
+    result.costamt = _value;
+    result.costamt_1 = _value;
+    result.costamt_2 = _value;
+    result.costamt_3 = _value;
+    result.costamt_4 = _value;
     return result;
   };
 
@@ -844,8 +845,8 @@ export const useHooksCpQuote = (t?: any) => {
       }
 
       //胶水材料成本
-      if (bednet.pocket_around_fabrics_cost > 0) {
-        bednet_qingdan_item.push(setResultData(default_bednet_qingdan, "胶水材料成本", bednet.pocket_around_fabrics_cost));
+      if (bednet.glue_mtrl_cost > 0) {
+        bednet_qingdan_item.push(setResultData(default_bednet_qingdan, "胶水材料成本", bednet.glue_mtrl_cost));
       }
 
       //C钉/夹码材料

+ 3 - 3
JLHWEB/src/views/quote/mattressQuote/hooks/index.tsx

@@ -3443,8 +3443,8 @@ export const useHooks = (t?: any) => {
         const { $table, column, row, status } = scope;
         const _disabled = !(
           (row.if_inputqty == 0 && [50, 51, 52, 53, 54, 104, 114, 11, 12, 13, 14, 32, 33].includes(row.formulakind)) ||
-          row.formulakind == 7 ||
-          row.formulakind == 202
+          // row.formulakind == 202 ||
+          row.formulakind == 7
         );
 
         return <el-input v-model={scope.row.thickness} type="number" disabled={_disabled}></el-input>;
@@ -4469,7 +4469,7 @@ export const useHooks = (t?: any) => {
         const { $table, column, row, status } = scope;
         const _disabled = !(
           (row.if_inputqty == 0 && [50, 51, 52, 53, 54, 104, 114, 11, 14, 32, 33].includes(row.formulakind)) ||
-          row.formulakind == 202 ||
+          // row.formulakind == 202 ||
           row.formulakind == 203
         );