Andy 3 năm trước cách đây
mục cha
commit
8f550c2482

+ 2 - 1
src/routerMap/index.js

@@ -1196,7 +1196,8 @@ const routerMap = [{
         path: '/cms/BasicSettings/CustomerProductPrice/list',
         name: 'CustomerProductPriceList', //客户档案→客户产品价格表→列表
         meta: {
-            index: 3
+            index: 3,
+            keepAlive: true,
         },
         component: (resolve) =>
             require(['@/views/BasicSettings/CustomerProductPrice/list'], resolve),

+ 194 - 128
src/views/BasicSettings/CustomerProductPrice/list.vue

@@ -1,48 +1,49 @@
 <template>
   <div>
-    <FullPage title='客户产品价格表'
-              :list='set_list'
-              @init='init'
-              :loading='loading'
-              @searchData='searchData'
-              @changePage='changePage'
-              @changeSize='changeSize'
-              :tableColums='tableColums'
-              :tableData='tableData'
-              :page_index='page_index'
-              :total='total'>
-      <div slot='titleButton'
-           style="display:flex;">
-        <Upload name='your_file'
-                :show-upload-list='false'
-                :headers='headers'
-                :on-error='uploadError'
-                :on-success='uploadSuccess'
-                :action="$store.state.ip+'/api/measure_orders_import'">
-          <Button type="success"
-                  ghost
-                  icon='md-exit'
-                  style="margin-right:10px;">导入</Button>
+    <FullPage
+      title="客户产品价格表"
+      :list="set_list"
+      @init="init"
+      :loading="loading"
+      @searchData="searchData"
+      @changePage="changePage"
+      @changeSize="changeSize"
+      :tableColums="tableColums"
+      :tableData="tableData"
+      :page_index="page_index"
+      :total="total"
+    >
+      <div slot="titleButton" style="display:flex;">
+        <Upload
+          name="your_file"
+          :show-upload-list="false"
+          :headers="headers"
+          :on-error="uploadError"
+          :on-success="uploadSuccess"
+          :action="$store.state.ip + '/api/measure_orders_import'"
+        >
+          <Button type="success" ghost icon="md-exit" style="margin-right:10px;"
+            >导入</Button
+          >
         </Upload>
-        <Button @click="handleSet({},-1,1)"
-                type='primary'
-                style="margin-right:10px;">新增</Button>
+        <Button
+          @click="handleSet({}, -1, 1)"
+          type="primary"
+          style="margin-right:10px;"
+          >新增</Button
+        >
       </div>
-      <template slot='set'
-                slot-scope='{row,index}'>
+      <template slot="set" slot-scope="{ row, index }">
         <div class="table-set">
           <!-- <a style="margin:0 5px"
              @click="handleSet(row,index,5)">审核</a> -->
-          <a style="margin:0 5px"
-             @click="handleSet(row,index,2)">编辑</a>
-          <a style="margin:0 5px"
-             @click="handleSet(row,index,3)">查看</a>
+          <a style="margin:0 5px" @click="handleSet(row, index, 2)">编辑</a>
+          <a style="margin:0 5px" @click="handleSet(row, index, 3)">查看</a>
           <!-- <a style="margin:0 5px"
              @click="handleSet(row,index,6)">变更</a>
           <a style="margin:0 5px"
              @click="handleSet(row,index,7)">变更记录</a> -->
-          <a style="margin:0 5px"
-             @click="handleSet(row,index,4)">删除</a>
+          <a style="margin:0 5px" @click="handleSet(row, index, 4)">删除</a>
         </div>
       </template>
     </FullPage>
@@ -54,13 +55,11 @@
 // 例如:import 《组件名称》 from '《组件路径》';
 
 export default {
-  name: 'AdditionalProjectIndex',
-  components: {
-
-  },
+  name: "AdditionalProjectIndex",
+  components: {},
   props: {},
   // import引入的组件需要注入到对象中才能使用
-  data () {
+  data() {
     // 这里存放数据
     return {
       loading: false,
@@ -70,10 +69,32 @@ export default {
       page_size: 10,
       proxyObj: {},
       tableColums: [
-        { title: '客户分类编码', key: 'type_code', align: 'center', minWidth: 140 },
-        { title: '客户分类名称', key: 'type_title', align: 'center', minWidth: 140 },
-        { title: '客户编码', key: 'code', align: 'center', tooltip: true, minWidth: 140 },
-        { title: '客户名称', key: 'title', align: 'center', tooltip: true, minWidth: 140 },
+        {
+          title: "客户分类编码",
+          key: "type_code",
+          align: "center",
+          minWidth: 140,
+        },
+        {
+          title: "客户分类名称",
+          key: "type_title",
+          align: "center",
+          minWidth: 140,
+        },
+        {
+          title: "客户编码",
+          key: "code",
+          align: "center",
+          tooltip: true,
+          minWidth: 140,
+        },
+        {
+          title: "客户名称",
+          key: "title",
+          align: "center",
+          tooltip: true,
+          minWidth: 140,
+        },
         // {
         //   title: '审核人', key: 'service_id', align: 'center', tooltip: true, minWidth: 140,
         //   render: (h, params) => {
@@ -93,146 +114,191 @@ export default {
         //     return h('span', {}, text)
         //   }
         // },
-        { title: '操作', key: '', align: 'center', slot: 'set', width: 300 },
+        { title: "操作", key: "", align: "center", slot: "set", width: 300 },
       ],
       tableData: [],
       type: null,
       userList: [],
       overStandardList: [],
-      headers: { 'Authorization': localStorage.getItem('token') },
-    }
+      headers: { Authorization: localStorage.getItem("token") },
+    };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
-  created () {
+  created() {
     // 获取用户列表
-    this.axios({ method: 'get', url: '/api/user', }).then((res) => { this.userList = res.data.data }).catch((err) => { });
+    this.axios({ method: "get", url: "/api/user" })
+      .then((res) => {
+        this.userList = res.data.data;
+      })
+      .catch((err) => {});
     // 获取超标方案
-    this.axios({ method: 'get', url: '/api/overdraft_list', }).then((res) => { this.overStandardList = res.data.data }).catch((err) => { });
+    this.axios({ method: "get", url: "/api/overdraft_list" })
+      .then((res) => {
+        this.overStandardList = res.data.data;
+      })
+      .catch((err) => {});
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted () {
-
-  },
+  mounted() {},
   methods: {
-    init (row) {
-      this.proxyObj = row
-      this.axios.get('/api/custom_product_list', {
-        params: {
-          page_index: this.page_index,
-          page_size: this.page_size,
-          ...row
-        }
-      }).then(res => {
-        console.log(res)
-        if (res.code == 200) {
-          this.total = res.data.total
-          this.tableData = res.data.data
-        }
-      }).catch(err => { console.error(err); })
+    init(row) {
+      this.proxyObj = row;
+      this.axios
+        .get("/api/custom_product_list", {
+          params: {
+            page_index: this.page_index,
+            page_size: this.page_size,
+            ...row,
+          },
+        })
+        .then((res) => {
+          console.log(res);
+          if (res.code == 200) {
+            this.total = res.data.total;
+            this.tableData = res.data.data;
+          }
+        })
+        .catch((err) => {
+          console.error(err);
+        });
     },
-    searchData (row) {
+    searchData(row) {
       this.page_index = 1;
-      this.init(row)
+      this.init(row);
     },
-    handleSet (row, index, type) {
-      this.type = type
+    handleSet(row, index, type) {
+      this.type = type;
       // 1新增 2编辑 3查看 4删除 5审核 6变更 7变更记录
       switch (type) {
         case 1:
         case 2:
         case 3:
           this.$router.push({
-            path: '/cms/BasicSettings/CustomerProductPrice/detail',
+            path: "/cms/BasicSettings/CustomerProductPrice/detail",
             query: {
               type,
               custom_id: row.custom_id,
-            }
-          })
+            },
+          });
           break;
         case 4:
           this.$Modal.confirm({
-            title: '确认删除?',
-            content: '此操作无法恢复,请确认!',
+            title: "确认删除?",
+            content: "此操作无法恢复,请确认!",
             onOk: () => {
               this.axios({
-                method: 'post',
-                url: '/api/custom_product_del',
+                method: "post",
+                url: "/api/custom_product_del",
                 data: {
-                  custom_id: row.custom_id
-                }
-              }).then((res) => {
-                this.$Message.success(res.msg)
-                this.init(this.proxyObj)
-              }).catch((err) => { });
+                  custom_id: row.custom_id,
+                },
+              })
+                .then((res) => {
+                  this.$Message.success(res.msg);
+                  this.init(this.proxyObj);
+                })
+                .catch((err) => {});
             },
-            onCancel: () => { }
-          })
+            onCancel: () => {},
+          });
           break;
         default:
           break;
       }
     },
-    changePage (e) {
+    changePage(e) {
       this.page_index = e;
-      this.init(this.proxyObj)
+      this.init(this.proxyObj);
     },
-    changeSize (e) {
+    changeSize(e) {
       this.page_size = e;
-      this.init(this.proxyObj)
+      this.init(this.proxyObj);
     },
-    uploadSuccess (res) {
+    uploadSuccess(res) {
       if (res.code == 200) {
-        this.$Message.success(res.msg || '上传成功')
+        this.$Message.success(res.msg || "上传成功");
       } else {
-        this.$Message.warning(res.msg || '上传失败')
+        this.$Message.warning(res.msg || "上传失败");
       }
-      this.getData(this.proxyObj)
-    },
-    uploadError (err) {
-      this.$Message.error(err.msg || '上传失败')
+      this.getData(this.proxyObj);
     },
-    async exportData () {
-      const res = await this.axios('/api/parts_classify_export', { params: { ...this.proxyObj } })
-      if (res.code == 200) {
-        let url = `${this.$store.state.ip}/api/storage/${res.data.file}`
-        location.href = url
-      }
+    uploadError(err) {
+      this.$Message.error(err.msg || "上传失败");
     },
-    uploadSuccess (res) {
+    async exportData() {
+      const res = await this.axios("/api/parts_classify_export", {
+        params: { ...this.proxyObj },
+      });
       if (res.code == 200) {
-        this.$Message.success(res.msg || '上传成功')
-      } else {
-        this.$Message.warning(res.msg || '上传失败')
+        let url = `${this.$store.state.ip}/api/storage/${res.data.file}`;
+        location.href = url;
       }
-      this.getData(this.proxyObj)
-    },
-    uploadError (err) {
-      this.$Message.error(err.msg || '上传失败')
     },
   },
   // 监听属性 类似于data概念
   computed: {
-    set_list () {
+    set_list() {
       return [
-        { title: '客户分类编码', name: 'Input', value: '', serverName: 'type_code', placeholder: '请输入客户分类编码' },
-        { title: '客户分类名称', name: 'Input', value: '', serverName: 'type_title', placeholder: '请输入客户分类名称' },
-        { title: '客户编码', name: 'Input', value: '', serverName: 'code', placeholder: '请输入客户编码' },
-        { title: '客户名称', name: 'Input', value: '', serverName: 'title', placeholder: '请输入客户名称' },
-        { title: '审核状态', name: 'Select', value: '', placeholder: '请选择审核状态', serverName: 'state', option: [{ label: '未审核', value: 0 }, { label: '已审核', value: 1 }] },
-      ]
+        {
+          title: "客户分类编码",
+          name: "Input",
+          value: "",
+          serverName: "type_code",
+          placeholder: "请输入客户分类编码",
+        },
+        {
+          title: "客户分类名称",
+          name: "Input",
+          value: "",
+          serverName: "type_title",
+          placeholder: "请输入客户分类名称",
+        },
+        {
+          title: "客户编码",
+          name: "Input",
+          value: "",
+          serverName: "code",
+          placeholder: "请输入客户编码",
+        },
+        {
+          title: "客户名称",
+          name: "Input",
+          value: "",
+          serverName: "title",
+          placeholder: "请输入客户名称",
+        },
+        {
+          title: "审核状态",
+          name: "Select",
+          value: "",
+          placeholder: "请选择审核状态",
+          serverName: "state",
+          option: [
+            { label: "未审核", value: 0 },
+            { label: "已审核", value: 1 },
+          ],
+        },
+      ];
+    },
+  },
+  beforeRouteLeave(to, from, next) {
+    if (to.path == "/cms/BasicSettings/CustomerProductPrice/detail") {
+      this.$route.meta.keepAlive = true;
+    } else {
+      this.$route.meta.keepAlive = false;
     }
+    next();
   },
   // 监控data中的数据变化
   watch: {},
-  beforeCreate () { }, // 生命周期 - 创建之前
-  beforeMount () { }, // 生命周期 - 挂载之前
-  beforeUpdate () { }, // 生命周期 - 更新之前
-  updated () { }, // 生命周期 - 更新之后
-  beforeDestroy () { }, // 生命周期 - 销毁之前
-  destroyed () { }, // 生命周期 - 销毁完成
-  activated () { }, // 如果页面有keep-alive缓存功能,这个函数会触发
-}
+  beforeCreate() {}, // 生命周期 - 创建之前
+  beforeMount() {}, // 生命周期 - 挂载之前
+  beforeUpdate() {}, // 生命周期 - 更新之前
+  updated() {}, // 生命周期 - 更新之后
+  beforeDestroy() {}, // 生命周期 - 销毁之前
+  destroyed() {}, // 生命周期 - 销毁完成
+  activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
+};
 </script>
 
-<style lang='scss' scoped>
-</style>
+<style lang="scss" scoped></style>

+ 30 - 10
src/views/BidSystem/ProductDeOrder/deorderdetail.vue

@@ -329,7 +329,11 @@
           >
             <template slot="processLineSet" slot-scope="{ row, index }">
               <a
-                :style="type == 2?'margin: 0 5px; color: #ccc':'margin: 0 5px; color: red'"
+                :style="
+                  type == 2
+                    ? 'margin: 0 5px; color: #ccc'
+                    : 'margin: 0 5px; color: red'
+                "
                 :disabled="!partsItem.isAddProcessRoute || type == 2"
                 @click="handleProcessLineDele(row, index, partsIndex)"
                 >删除</a
@@ -499,7 +503,11 @@
                 >复制</a
               >
               <a
-                :style="type == 2?'margin: 0 5px; color: #ccc':'margin: 0 5px; color: red'"
+                :style="
+                  type == 2
+                    ? 'margin: 0 5px; color: #ccc'
+                    : 'margin: 0 5px; color: red'
+                "
                 :disabled="!partsItem.isAddPart || type == 2"
                 @click="handlePartWoodDele(row, index, partsIndex)"
                 >删除</a
@@ -568,7 +576,11 @@
                 >复制</a
               >
               <a
-                :style="type == 2?'margin: 0 5px; color: #ccc':'margin: 0 5px; color: red'"
+                :style="
+                  type == 2
+                    ? 'margin: 0 5px; color: #ccc'
+                    : 'margin: 0 5px; color: red'
+                "
                 :disabled="!partsItem.isAddPart || type == 2"
                 @click="handlePartMetalsDele(row, index, partsIndex)"
                 >删除</a
@@ -1109,8 +1121,8 @@ export default {
       tempSimilarProductData: {},
       tempProcessLineData: {},
       order_no: this.$route.query.order_no,
-      orders_area_product_detail_id:
-        this.$route.query.orders_area_product_detail_id,
+      orders_area_product_detail_id: this.$route.query
+        .orders_area_product_detail_id,
       selectTags: [], //已选列表
       info: {
         title: "",
@@ -1467,7 +1479,9 @@ export default {
               element.proportion = element.ratio;
               element.thick = element.formula_h;
               element.long = element.formula_l;
-              element.ProcessAttrList = JSON.parse(JSON.stringify(this.tempProcessAttrList)); //工艺属性列表
+              element.ProcessAttrList = JSON.parse(
+                JSON.stringify(this.tempProcessAttrList)
+              ); //工艺属性列表
               this.axios("/api/parts_detail", {
                 params: { id: element.part_id },
               })
@@ -1544,11 +1558,17 @@ export default {
     },
     //新增工艺组合名称
     handleProcessRouteCreate(item, val) {
-      item.ProcessAttrList = JSON.parse(JSON.stringify(this.tempProcessAttrList));
+      item.ProcessAttrList = JSON.parse(
+        JSON.stringify(this.tempProcessAttrList)
+      );
+      if (!item.partsProcessRouteList) {
+        item.partsProcessRouteList = [];
+      }
       item.partsProcessRouteList.push({
         id: val,
         title: val,
       });
+      this.$forceUpdate()
     },
     // 部件名称
     handlePartsNameSelect(item, val) {
@@ -2011,8 +2031,8 @@ export default {
             data: {
               ...this.formData,
               order_no: this.$route.query.order_no,
-              orders_area_product_detail_id:
-                this.$route.query.orders_area_product_detail_id,
+              orders_area_product_detail_id: this.$route.query
+                .orders_area_product_detail_id,
             },
           }).then((res) => {
             if (res.code == 200) {
@@ -2132,7 +2152,7 @@ export default {
 };
 </script>
 
-<style lang='scss' scoped>
+<style lang="scss" scoped>
 .BidSystemProductDeOrderDeorderdetail {
   position: relative;
   overflow: hidden;

+ 25 - 5
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -605,6 +605,7 @@
                       @on-change="
                         (e) => handleProductMeasureChange(e, item, ele)
                       "
+                      @on-blur="(e) => handleProductMeasureBlur(e, item, ele)"
                       style="width: 120px"
                     />
                   </FormItem>
@@ -628,7 +629,6 @@
                   <FormItem label="产品单价:">
                     <Input
                       size="small"
-                      disabled
                       v-model="item.unit_price"
                       style="width: 120px"
                       placeholder="自动带出"
@@ -872,7 +872,7 @@
                                   ele.title || ele.part_detail_title || '请选择'
                                 "
                               > -->
-                                {{ ele.title || ele.part_detail_title }}
+                              {{ ele.title || ele.part_detail_title }}
                               <!-- </Tooltip> -->
                             </div>
                           </FormItem>
@@ -918,7 +918,7 @@
                                     ele.material_detail_title || '请选择'
                                   "
                                 > -->
-                                  {{ ele.material_detail_title || "请选择" }}
+                                {{ ele.material_detail_title || "请选择" }}
                                 <!-- </Tooltip> -->
                               </div>
                             </FormItem>
@@ -1194,7 +1194,18 @@ export default {
         onCancel: () => {},
       });
     } else {
-      next(() => {});
+      if (this.isAllowLeave) {
+        next(() => {});
+      } else {
+        this.$Modal.confirm({
+          title: "提示",
+          content: "切换页面会导致数据丢失,是否确认切换?",
+          onOk: () => {
+            next(() => {});
+          },
+          onCancel: () => {},
+        });
+      }
     }
   },
   data() {
@@ -1340,6 +1351,7 @@ export default {
         },
       ],
       originalData: [],
+      isAllowLeave: false,
     };
   },
   computed: {
@@ -1469,6 +1481,7 @@ export default {
       this.axios.post("/api/order_save_new", params).then((res) => {
         if (res.code == 200) {
           this.$Message.success(res.msg);
+          this.isAllowLeave = true;
           this.back();
         }
       });
@@ -2061,7 +2074,6 @@ export default {
       row.num = element[0].num;
       row.price = element[0].price;
       row.total_price = (row.num * row.price).toFixed(2);
-      //////
       this.handleTotalPriceCalc(row, item);
     },
     handleSameProcessDisabled(array, currencyChooseValue, currencyChooseIndex) {
@@ -2541,6 +2553,14 @@ export default {
         });
       }
     },
+    handleProductMeasureBlur(e, product, measure_detail) {
+      try {
+        measure_detail.value = eval(e.target.value);
+      } catch (error) {
+        console.log("error :>> ", error);
+      }
+      this.$forceUpdate();
+    },
     handleProductMeasureChange(e, product, measure_detail) {
       let cur_measure = measure_detail.measureCalc;
       let cur_value = measure_detail.value;

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 449 - 371
src/views/ProductMannage/edit.vue


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác