Andy 3 лет назад
Родитель
Сommit
aefe8ae8e5

+ 0 - 1
src/components/DownMeasurement/index.vue

@@ -92,7 +92,6 @@ export default {
     },
     handleSubmit (name) {
       this.$refs[name].validate((valid) => {
-        console.log('valid :>> ', valid);
         if (valid) {
           this.lowerMeter(this.postInfo)
         }

+ 2 - 1
src/routerMap/index.js

@@ -191,7 +191,8 @@ const routerMap = [{
         path: '/cms/processroute/index',
         name: 'ProcessRoute', //工艺列表-->工艺列表
         meta: {
-            index: 4
+            index: 4,
+            keepAlive: true
         },
         component: (resolve) => require(['@/views/ProcessRoute/index'], resolve),
     },

+ 4 - 4
src/views/BasicSettings/CustomerFiles/CustomerClassify.vue

@@ -162,8 +162,8 @@ export default {
         url: '/api/basic_custom_list',
       }).then((res) => {
         this.treeData[0].sub = res.data
-        // this.openChildrenNode(this.treeData)
-      }).catch((err) => { });
+        this.openChildrenNode(this.treeData)
+      })
     },
     handleSet () {
       this.type = 1
@@ -303,7 +303,7 @@ export default {
             this.$Message.success(res.msg)
             this.initData()
           }
-        }).catch((err) => { });
+        })
       } else {
         this.axios({
           method: 'post',
@@ -318,7 +318,7 @@ export default {
             this.$Message.success(res.msg)
             this.initData()
           }
-        }).catch((err) => { });
+        })
       }
     },
     openChildrenNode (arr) {

+ 13 - 2
src/views/BasicSettings/CustomerFiles/detail.vue

@@ -117,12 +117,18 @@
           clearable
           placeholder="请输入公式"
           v-model="tableData[index].formula"
-        ></Input>
+        />
       </template>
       <template slot="set" slot-scope="{ index }">
         <a
           style="margin:0 5px"
           :disabled="isChecked"
+          @click="handleSet(tableData[index], index, 6)"
+          >复制</a
+        >
+        <a
+          style="margin:0 5px"
+          :disabled="isChecked"
           @click="handleSet(tableData[index], index, 4)"
           >删除</a
         >
@@ -331,7 +337,6 @@ export default {
           },
         },
       ],
-      tableData: [],
       productTypeList: [],
       partsList: [],
       attrindex: null,
@@ -406,6 +411,7 @@ export default {
       this.$router.go(-1);
     },
     handleSet(row, index, type) {
+      let temp;
       switch (type) {
         case 4:
           this.tableData.splice(index, 1);
@@ -413,6 +419,11 @@ export default {
         //设为默认  todo
         case 5:
           break;
+        // 复制
+        case 6:
+          temp = JSON.parse(JSON.stringify(row));
+          this.tableData.splice(index, 0, temp);
+          break;
       }
     },
     handleAreaSet(row, index) {

+ 1 - 1
src/views/BasicSettings/OverStandardPrice/detail.vue

@@ -54,7 +54,7 @@
         >新增规则</Button
       >
     </div>
-    <Table :columns="tableColumns" max-height="600" :data="tableData" border>
+    <Table :columns="tableColumns" max-height="500" :data="tableData" border>
       <template slot="productSet" slot-scope="{ index }">
         <!-- <Select v-model="tableData[index].basic_product_id"
                 :disabled="isChecked"

+ 109 - 22
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -31,7 +31,10 @@
         style="padding: 10px 0"
         :rules="infoRules"
       >
-        <FormItem v-if="formObjs.order_no" label="订单编号:">
+        <FormItem
+          v-if="formSetTableData.filter((v) => v.key == 'order_no')[0].is_show"
+          label="订单编号:"
+        >
           <Input
             disabled
             v-if="type != 3"
@@ -42,7 +45,10 @@
           <span v-else>{{ info.order_no }}</span>
         </FormItem>
         <FormItem
-          v-if="formObjs.residential_name"
+          v-if="
+            formSetTableData.filter((v) => v.key == 'residential_name')[0]
+              .is_show
+          "
           label="项目名称:"
           prop="residential_name"
         >
@@ -55,7 +61,9 @@
           <span v-else>{{ info.residential_name }}</span>
         </FormItem>
         <FormItem
-          v-if="formObjs.warning_state"
+          v-if="
+            formSetTableData.filter((v) => v.key == 'warning_state')[0].is_show
+          "
           label="紧急程度:"
           prop="warning_state"
         >
@@ -79,7 +87,12 @@
               : ""
           }}</span>
         </FormItem>
-        <FormItem label="项目定金:">
+        <FormItem
+          label="项目定金:"
+          v-if="
+            formSetTableData.filter((v) => v.key == 'front_money')[0].is_show
+          "
+        >
           <Input
             v-model="info.front_money"
             class="auto-width"
@@ -89,9 +102,10 @@
           <span v-else>{{ info.front_money }}</span>
         </FormItem>
         <FormItem
-          v-if="formObjs.start_time"
+          v-if="
+            formSetTableData.filter((v) => v.key == 'start_time')[0].is_show
+          "
           label="开始日期:"
-          prop="start_time"
         >
           <DatePicker
             :options="options"
@@ -103,7 +117,13 @@
           ></DatePicker>
           <span v-else>{{ info.start_time }}</span>
         </FormItem>
-        <FormItem label="客户名称:" prop="custom_id">
+        <FormItem
+          label="客户名称:"
+          v-if="
+            formSetTableData.filter((v) => v.key == 'client_name')[0].is_show
+          "
+          prop="custom_id"
+        >
           <Select
             clearable
             filterable
@@ -125,7 +145,13 @@
               : ""
           }}</span>
         </FormItem>
-        <FormItem label="负责人:">
+        <FormItem
+          label="负责人:"
+          v-if="
+            formSetTableData.filter((v) => v.key == 'custom_detail_name')[0]
+              .is_show
+          "
+        >
           <Select
             placeholder="请选择负责人"
             v-if="type != 3"
@@ -143,7 +169,13 @@
           </Select>
           <span v-else>{{ info.custom_detail_name }}</span>
         </FormItem>
-        <FormItem label="手机号:">
+        <FormItem
+          label="手机号:"
+          v-if="
+            formSetTableData.filter((v) => v.key == 'custom_detail_mobile')[0]
+              .is_show
+          "
+        >
           <Select
             clearable
             filterable
@@ -160,7 +192,13 @@
           </Select>
           <span v-else>{{ info.custom_detail_mobile }}</span>
         </FormItem>
-        <FormItem label="详细地址:">
+        <FormItem
+          label="详细地址:"
+          v-if="
+            formSetTableData.filter((v) => v.key == 'custom_detail_id')[0]
+              .is_show
+          "
+        >
           <Select
             clearable
             filterable
@@ -178,7 +216,12 @@
           </Select>
           <span v-else>{{ info.custom_detail_id }}</span>
         </FormItem>
-        <FormItem label="专营业务员:">
+        <FormItem
+          label="专营业务员:"
+          v-if="
+            formSetTableData.filter((v) => v.key == 'service_id')[0].is_show
+          "
+        >
           <Select
             disabled
             v-if="type != 3"
@@ -199,7 +242,10 @@
               : ""
           }}</span>
         </FormItem>
-        <FormItem v-if="formObjs.end_time" label="交付日期:" prop="end_time">
+        <FormItem
+          v-if="formSetTableData.filter((v) => v.key == 'end_time')[0].is_show"
+          label="交付日期:"
+        >
           <DatePicker
             :options="options"
             v-if="type != 3"
@@ -211,9 +257,10 @@
           <span v-else>{{ info.end_time }}</span>
         </FormItem>
         <FormItem
-          v-if="formObjs.predict_price"
+          v-if="
+            formSetTableData.filter((v) => v.key == 'predict_price')[0].is_show
+          "
           label="产品总价:"
-          prop="predict_price"
         >
           <Input
             v-model="info.predict_price"
@@ -224,7 +271,10 @@
           />
           <span v-else>{{ info.predict_price }}</span>
         </FormItem>
-        <FormItem label="折扣金额:" prop="fax_price">
+        <FormItem
+          label="折扣金额:"
+          v-if="formSetTableData.filter((v) => v.key == 'fax_price')[0].is_show"
+        >
           <Input
             v-model="info.fax_price"
             v-if="type != 3"
@@ -234,7 +284,12 @@
           />
           <span v-else>{{ info.fax_price }}</span>
         </FormItem>
-        <FormItem label="订单金额:" prop="order_price">
+        <FormItem
+          label="订单金额:"
+          v-if="
+            formSetTableData.filter((v) => v.key == 'order_price')[0].is_show
+          "
+        >
           <Input
             v-model="info.order_price"
             v-if="type != 3"
@@ -244,7 +299,11 @@
           />
           <span v-else>{{ info.order_price }}</span>
         </FormItem>
-        <FormItem label="包装:" prop="box_id">
+        <FormItem
+          label="包装:"
+          prop="box_id"
+          v-if="formSetTableData.filter((v) => v.key == 'box_id')[0].is_show"
+        >
           <Select
             clearable
             filterable
@@ -266,7 +325,10 @@
               : ""
           }}</span>
         </FormItem>
-        <FormItem v-if="formObjs.remark" label="订单备注:" prop="remark">
+        <FormItem
+          label="订单备注:"
+          v-if="formSetTableData.filter((v) => v.key == 'remark')[0].is_show"
+        >
           <Input
             v-model="info.remark"
             type="textarea"
@@ -2115,8 +2177,13 @@
       style="max-height: 700px; overflow: hidden; overflow-y: auto"
       title="表单设置"
     >
-      <!-- <Table :max-height='600' border :columns="formSetTableColumns" :data="formSetTableData">
-      </Table> -->
+      <Table
+        :max-height="600"
+        border
+        :columns="formSetTableColumns"
+        :data="formSetTableData"
+      >
+      </Table>
       <CheckboxGroup v-model="forms_list">
         <Checkbox label="order_no">订单编号</Checkbox>
         <Checkbox label="residential_name">项目名称</Checkbox>
@@ -2338,6 +2405,19 @@ export default {
             return h("Checkbox", {
               props: {
                 value: currentRow.is_show,
+                disabled:
+                  currentRow.key == "order_no" ||
+                  currentRow.key == "residential_name" ||
+                  currentRow.key == "warning_state" ||
+                  currentRow.key == "start_time" ||
+                  currentRow.key == "end_time" ||
+                  currentRow.key == "client_name" ||
+                  currentRow.key == "predict_price" ||
+                  currentRow.key == "box_id" ||
+                  currentRow.key == "predict_price" ||
+                  currentRow.key == "order_price" ||
+                  currentRow.key == "fax_price" ||
+                  currentRow.key == "remark",
               },
               on: {
                 "on-change": (e) => {
@@ -2458,10 +2538,16 @@ export default {
           value: "订单金额",
           title: "订单金额",
         },
+        {
+          is_show: true,
+          key: "fax_price",
+          value: "折扣金额",
+          title: "折扣金额",
+        },
         { is_show: true, key: "box_id", value: "包装", title: "包装" },
         { is_show: true, key: "remark", value: "订单备注", title: "订单备注" },
-        { is_show: true, key: "pay_state", value: "收款", title: "收款" },
       ],
+      post_formSetTableData:[],
     };
   },
   computed: {
@@ -2549,6 +2635,7 @@ export default {
         }
       });
       const news_forms = {};
+      this.post_formSetTableData = JSON.parse(JSON.stringify(this.formSetTableData))
       result.forEach((element) => {
         news_forms[element] = 1;
       });
@@ -2556,7 +2643,7 @@ export default {
       if (n) {
         this.axios
           .post("/api/order_set_form", {
-            result: this.forms_list,
+            result: this.post_formSetTableData,
             all: Object.keys(this.formObjs_reset),
           })
           .then((res) => {

+ 1 - 0
src/views/OrderMannage/BusinessOrderlist/list.vue

@@ -742,6 +742,7 @@ export default {
         },
         { is_show: true, key: "state", value: "订单状态", title: "订单状态" },
         { is_show: true, key: "crt_name", value: "制单人", title: "制单人" },
+        { is_show: true, key: "crt_time", value: "订单创建时间", title: "订单创建时间" },
         { is_show: true, key: "set", value: "操作", title: "操作" },
       ],
       sub_tableModalTableData: [],

+ 87 - 69
src/views/ProcedureMannage/edit.vue

@@ -1,62 +1,62 @@
 <template>
   <div>
-    <Toptitle :title='type == 1 ? "新增工序" : "编辑工序" '>
-      <Button @click="back"
-              type='primary'
-              ghost
-              style="margin-right:10px;">返回</Button>
-      <Button type="primary"
-              @click="postData">保存</Button>
+    <Toptitle :title="type == 1 ? '新增工序' : '编辑工序'">
+      <Button @click="back" type="primary" ghost style="margin-right:10px;"
+        >返回</Button
+      >
+      <Button type="primary" @click="postData">保存</Button>
     </Toptitle>
 
     <div class="page-edit">
       <Form style="width:40%">
         <FormItem label="ID">
-          <Input v-model="info.id"
-                 disabled
-                 placeholder="自动生成"></Input>
+          <Input v-model="info.id" disabled placeholder="自动生成"></Input>
         </FormItem>
         <FormItem label="工序分类">
-          <Input disabled
-                 v-model="info.classify"></Input>
-          <!-- <Select filterable clearable v-model="info.p_id" placeholder="请选择分类">
-                        <Option v-for="item of perSonnel" :key="item.id" :value="item.id" :label="item.title"></Option>
-                    </Select> -->
+          <el-cascader
+            v-model="info.p_id"
+            size="small"
+            style="width:100%"
+            :show-all-levels="false"
+            :options="cascader_list"
+            :props="{
+              expandTrigger: 'hover',
+              children: 'child',
+              value: 'id',
+              label: 'title',
+              emitPath: false,
+            }"
+            @change="handleCascaderChange"
+          ></el-cascader>
         </FormItem>
         <FormItem label="工序名称">
-          <Input v-model="info.title"
-                 placeholder="请输入工序分类名称"></Input>
+          <Input v-model="info.title" placeholder="请输入工序分类名称"></Input>
         </FormItem>
         <FormItem label="工时">
-          <Input v-model="info.time"
-                 placeholder="请输入工时">
-          <span slot='append'>小时</span>
+          <Input v-model="info.time" placeholder="请输入工时">
+            <span slot="append">小时</span>
           </Input>
         </FormItem>
         <FormItem label="产能">
-          <Input v-model="info.capacity"
-                 placeholder="请输入产能"></Input>
+          <Input v-model="info.capacity" placeholder="请输入产能"></Input>
         </FormItem>
         <FormItem label="工价">
           <div style="display:flex;width:100%;">
-            <Select v-model="info.type"
-                    style="width:200px;margin-right:10px;">
-              <Option label="按天"
-                      :value='0'></Option>
-              <Option label="按件"
-                      :value='1'></Option>
+            <Select v-model="info.type" style="width:200px;margin-right:10px;">
+              <Option label="按天" :value="0"></Option>
+              <Option label="按件" :value="1"></Option>
             </Select>
-            <Input v-model="info.wages"
-                   placeholder="请输入价格"></Input>
+            <Input v-model="info.wages" placeholder="请输入价格"></Input>
           </div>
         </FormItem>
         <FormItem label="默认班组">
-          <Select v-model="info.employee_id"
-                  transfer>
-            <Option v-for="_item in employeeList"
-                    :key="_item.id"
-                    :value='_item.id'
-                    :label="_item.nickname"></Option>
+          <Select v-model="info.employee_id" transfer>
+            <Option
+              v-for="_item in employeeList"
+              :key="_item.id"
+              :value="_item.id"
+              :label="_item.nickname"
+            ></Option>
           </Select>
         </FormItem>
       </Form>
@@ -66,66 +66,84 @@
 
 <script>
 export default {
-  data () {
+  data() {
     return {
       type: 1,
       id: null,
       perSonnel: [],
       info: {
-        title: '',
-        time: '',
-        capacity: '',
-        wages: '',
+        title: "",
+        time: "",
+        capacity: "",
+        wages: "",
         type: 1,
         p_id: this.$route.query.id,
-        classify: this.$route.query.title || ''
+        classify: this.$route.query.title || "",
       },
-      employeeList: []
-    }
+      employeeList: [],
+      cascader_list: [],
+    };
   },
-  created () {
+  created() {
     // 获取员工列表
-    this.axios.get('/api/employee_list', { params: { type: 3 } }).then(res => { this.employeeList = res.data })
+    this.axios
+      .get("/api/employee_list", { params: { type: 3 } })
+      .then((res) => {
+        this.employeeList = res.data;
+      });
+    // 获取工序
+    // basics_procedure_index
+    this.axios.get("/api/basics_procedure_index").then((res) => {
+      console.log(res);
+      this.cascader_list = res.data.data
+    });
   },
-  mounted () {
+  mounted() {
     this.type = this.$route.query.type;
     this.id = this.$route.query.id;
     this.info.p_id = this.id * 1;
     if (this.id && this.type == 2) {
-      this.getDetails(this.id)
+      this.getDetails(this.id);
     }
   },
   methods: {
-    back () {
-      this.$router.go(-1)
+    back() {
+      this.$router.go(-1);
     },
-    postData () {//保存时提交info
-      let postUrl = this.type == 1 ? '/api/procedure_add' : '/api/procedure_edit';
+    postData() {
+      //保存时提交info
+      let postUrl =
+        this.type == 1 ? "/api/procedure_add" : "/api/procedure_edit";
       this.info.id = this.type == 1 ? this.id : this.info.id;
-      this.axios.post(postUrl, this.info).then(res => {
+      this.axios.post(postUrl, this.info).then((res) => {
         if (res.code == 200) {
-          this.$Message.success(res.msg)
-          this.back()
+          this.$Message.success(res.msg);
+          this.back();
         }
-      })
+      });
     },
-    getData () {
-      this.axios('/api/basics_procedure_get_title', { params: { id: this.info.p_id } }).then(res => {
+    handleCascaderChange(value) {},
+    getData() {
+      this.axios("/api/basics_procedure_get_title", {
+        params: { id: this.info.p_id },
+      }).then((res) => {
         if (res.code == 200) {
-          console.log(res.data)
+          console.log(res.data);
           this.info.classify = res.data;
         }
-      })
+      });
     },
-    getDetails (row) {
-      this.axios('/api/procedure_detail', { params: { id: row } }).then(res => {
-        res.data[0].classify = ''
-        this.info = res.data[0];
-        this.getData()
-      })
+    getDetails(row) {
+      this.axios("/api/procedure_detail", { params: { id: row } }).then(
+        (res) => {
+          res.data[0].classify = "";
+          this.info = res.data[0];
+          this.getData();
+        }
+      );
     },
-  }
-}
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -137,4 +155,4 @@ export default {
   height: 85%;
   padding-bottom: 20px;
 }
-</style>
+</style>

+ 55 - 32
src/views/ProcessLine/index.vue

@@ -52,6 +52,7 @@
     </FullPage>
     <Modal
       class-name="vertical-center-modal"
+      width="1000"
       v-model="showModal"
       :title="isCheck ? '工艺路线详情' : '工艺路线编辑'"
     >
@@ -73,13 +74,13 @@
             placeholder="请输入工艺路线名称"
             size="small"
             :disabled="isCheck"
-            style="width: 150px"
+            style="width: 250px"
           />
         </div>
       </div>
-      <span>已选:</span>
-      <Form>
-        <FormItem>
+      <div class="modal_content">
+        <div class="modal_content_left">
+          <span>已选:</span>
           <SlickList
             :distance="10"
             :lockToContainerEdges="true"
@@ -108,28 +109,33 @@
               </div>
             </SlickItem>
           </SlickList>
-        </FormItem>
-        <FormItem
-          v-for="(item, index) of info.bps"
-          :key="index"
-          :label="item.title"
-        >
-          <Tooltip v-for="(_item, _index) of item.cld" :key="_index">
-            <div slot="content">
-              <p>工时:{{ _item.time }}</p>
-              <p>工价:{{ _item.wages }}</p>
-              <p>产能:{{ _item.capacity }}</p>
+        </div>
+        <div class="modal_content_right">
+          <div
+            v-for="(item, index) of info.bps"
+            :key="index"
+            :label="item.title"
+          >
+            <div v-for="(_item, _index) in item.cld" :key="_index" >
+              <div v-if="_item.cld&&_item.cld.length>0" style="position:relative;left:0;top:0">{{ _item.title }}:</div>
+              <Tooltip v-for="(__item, __index) of _item.cld" :key="__index">
+                <div slot="content">
+                  <p>工时:{{ __item.time }}</p>
+                  <p>工价:{{ __item.wages }}</p>
+                  <p>产能:{{ __item.capacity }}</p>
+                </div>
+                <Checkbox
+                  @on-change="changeCheck($event, __item, selectTags)"
+                  v-model="__item.show"
+                  :disabled="isCheck"
+                  style="padding: 0px 5px"
+                  >{{ __item.title }}</Checkbox
+                >
+              </Tooltip>
             </div>
-            <Checkbox
-              @on-change="changeCheck($event, _item, selectTags)"
-              v-model="_item.show"
-              :disabled="isCheck"
-              style="padding: 0px 5px"
-              >{{ _item.title }}</Checkbox
-            >
-          </Tooltip>
-        </FormItem>
-      </Form>
+          </div>
+        </div>
+      </div>
       <div slot="footer">
         <Button @click="showModal = false" type="primary" ghost>取消</Button>
         <Button @click="saveTableData()" v-show="!isCheck" type="primary"
@@ -257,12 +263,16 @@ export default {
         arr.forEach((element) => {
           for (const key in this.info.bps) {
             const el = this.info.bps[key];
-            el.cld.forEach((z) => {
-              if (z.id == element) {
-                z.show = true;
-                this.selectTags.push(z);
-              }
-            });
+            for (const k in el.cld) {
+              const e = el.cld[k];
+              e.cld &&
+                e.cld.forEach((z) => {
+                  if (z.id == element) {
+                    z.show = true;
+                    this.selectTags.push(z);
+                  }
+                });
+            }
           }
         });
         switch (type) {
@@ -433,7 +443,7 @@ export default {
 };
 </script>
 
-<style lang='scss' scoped>
+<style lang="scss" scoped>
 .vertical-center-modal {
   display: flex;
   align-items: center;
@@ -451,6 +461,19 @@ export default {
     margin: 5px 0;
   }
 }
+.modal_content {
+  display: flex;
+  justify-content: space-around;
+  .modal_content_left {
+    width: 40%;
+  }
+  .modal_content_right {
+    width: 60%;
+    max-height: 500px;
+    overflow: hidden;
+    overflow-y: auto;
+  }
+}
 .tag-modal {
   display: flex;
   align-items: center;

+ 1 - 0
src/views/ProcessMannage/index.vue

@@ -234,6 +234,7 @@ export default {
         post_data = {
           id: this.$route.query.id,
           title: result.join(","),
+          type_title:this.classInfo.type_title
         };
       } else {
         post_url = "/api/properties_edit";

+ 313 - 139
src/views/ProcessRoute/index.vue

@@ -1,91 +1,187 @@
 <template>
   <div>
-    <FullPage title='工艺组合'
-              :list='list'
-              @init='init'
-              :loading='loading'
-              @searchData='init'
-              @changePage='changePage'
-              @changeSize='changeSize'
-              :tableColums='tableColums'
-              :tableData='tableData'
-              :pageIndex='pageIndex'
-              :total='total'>
-      <div slot='titleButton'
-           style="display:flex;">
-        <Upload v-if='persimissionData["批量导入"]||persimissionData.all'
-                name='your_file'
-                :show-upload-list='false'
-                :headers='headers'
-                :on-error='uploadError'
-                :on-success='uploadSuccess'
-                :action="$store.state.ip+'/api/process_route_index_import'">
-          <Button type="success"
-                  ghost
-                  icon='md-exit'
-                  style="margin-right:10px;">批量导入</Button>
+    <FullPage
+      title="工艺组合"
+      :list="list"
+      @init="init"
+      :loading="loading"
+      @searchData="init"
+      @changePage="changePage"
+      @changeSize="changeSize"
+      :tableColums="tableColums"
+      :tableData="tableData"
+      :pageIndex="pageIndex"
+      :total="total"
+    >
+      <div slot="titleButton" style="display:flex;">
+        <Upload
+          v-if="persimissionData['批量导入'] || persimissionData.all"
+          name="your_file"
+          :show-upload-list="false"
+          :headers="headers"
+          :on-error="uploadError"
+          :on-success="uploadSuccess"
+          :action="$store.state.ip + '/api/process_route_index_import'"
+        >
+          <Button type="success" ghost icon="md-exit" style="margin-right:10px;"
+            >批量导入</Button
+          >
         </Upload>
-        <Button v-if='persimissionData["批量导出"]||persimissionData.all'
-                @click="exportData"
-                type="warning"
-                ghost
-                icon='md-return-left'
-                style="margin-right:10px;">批量导出</Button>
-        <Button v-if='persimissionData["新增工艺"]||persimissionData.all'
-                @click="goPage(1)"
-                type="primary"
-                ghost
-                icon='md-add'>新增工艺组合</Button>
+        <Button
+          v-if="persimissionData['批量导出'] || persimissionData.all"
+          @click="exportData"
+          type="warning"
+          ghost
+          icon="md-return-left"
+          style="margin-right:10px;"
+          >批量导出</Button
+        >
+        <Button
+          v-if="persimissionData['新增工艺'] || persimissionData.all"
+          @click="goPage(1)"
+          type="primary"
+          ghost
+          icon="md-add"
+          >新增工艺组合</Button
+        >
       </div>
-      <div slot='navButton'>
+      <div slot="navButton">
+        <Button @click="handleSortSet" type="primary">排序设置</Button>
       </div>
 
-      <template slot='set'
-                slot-scope='{row}'>
+      <template slot="set" slot-scope="{ row }">
         <div class="table-set">
-          <svg style="font-size:20px"
-               color='#3764FF'
-               @click="goPage(4,row)"
-               class="icon icon-nav"
-               aria-hidden="true">
+          <svg
+            style="font-size:20px"
+            color="#3764FF"
+            @click="goPage(4, row)"
+            class="icon icon-nav"
+            aria-hidden="true"
+          >
             <use xlink:href="#iconcopy-01"></use>
           </svg>
-          <svg v-if='persimissionData["编辑"]||persimissionData.all'
-               style="font-size:20px"
-               color='#3764FF'
-               @click="goPage(2,row)"
-               class="icon icon-nav"
-               aria-hidden="true">
+          <svg
+            v-if="persimissionData['编辑'] || persimissionData.all"
+            style="font-size:20px"
+            color="#3764FF"
+            @click="goPage(2, row)"
+            class="icon icon-nav"
+            aria-hidden="true"
+          >
             <use xlink:href="#iconbianji"></use>
           </svg>
-          <svg style="font-size:20px"
-               color='green'
-               @click="goPage(3,row)"
-               class="icon icon-nav"
-               aria-hidden="true">
+          <svg
+            style="font-size:20px"
+            color="green"
+            @click="goPage(3, row)"
+            class="icon icon-nav"
+            aria-hidden="true"
+          >
             <use xlink:href="#iconxiangqing"></use>
           </svg>
-          <svg v-if='persimissionData["删除"]||persimissionData.all'
-               @click="delItems(row)"
-               class="icon icon-nav"
-               style="font-size:20px"
-               color='red'
-               aria-hidden="true">
+          <svg
+            v-if="persimissionData['删除'] || persimissionData.all"
+            @click="delItems(row)"
+            class="icon icon-nav"
+            style="font-size:20px"
+            color="red"
+            aria-hidden="true"
+          >
             <use xlink:href="#iconshanchu"></use>
           </svg>
         </div>
       </template>
     </FullPage>
+    <Modal v-model="showSortModal" title="排序设置" width="650">
+      <div>
+        <Form
+          :label-width="80"
+          inline
+          v-for="(_item, _index) in sortList"
+          :key="_index"
+        >
+          <FormItem :label="'关键字' + (_index + 1)">
+            <Select filterable clearable transfer v-model="_item.value">
+              <Option
+                v-for="item of headerList"
+                :key="item.key"
+                :label="item.title"
+                :disabled="
+                  item.title == '操作' ||
+                    item.title == '已收款' ||
+                    item.title == '未收款'
+                "
+                :value="item.key"
+              ></Option>
+            </Select>
+          </FormItem>
+          <FormItem label="排序方式">
+            <Select
+              style="width:150px"
+              filterable
+              clearable
+              transfer
+              v-model="_item.sort"
+            >
+              <Option label="升序" :value="1"></Option>
+              <Option label="降序" :value="2"></Option>
+            </Select>
+          </FormItem>
+          <FormItem :label-width="10">
+            <Icon
+              @click="
+                handleSortListChange(sortList, 0, _index, {
+                  sort: null,
+                  level: sortList.length + 1,
+                  value: '',
+                })
+              "
+              v-show="sortList.length < 2"
+              style="'margin:0 10px"
+              size="20"
+              type="ios-add"
+            />
+            <Icon
+              @click="handleSortListChange(sortList, 1, _index, null)"
+              v-show="sortList.length > 1"
+              style="'margin:0 10px"
+              size="20"
+              type="ios-remove"
+            />
+          </FormItem>
+        </Form>
+      </div>
+      <div slot="footer">
+        <Button
+          @click="showSortModal = false"
+          type="primary"
+          style="margin-right: 10px"
+          >取消</Button
+        >
+        <Button
+          @click="handleConfirmSort"
+          type="primary"
+          style="margin-right: 10px"
+          >确定</Button
+        >
+      </div>
+    </Modal>
   </div>
 </template>
 
 <script>
-import { mapState } from 'vuex'
+import { mapState } from "vuex";
 export default {
-  data () {
+  data() {
     return {
       list: [
-        { title: '工艺组合名称', name: 'Input', value: '', serverName: 'title', placeholder: '请输入工艺组合名称' },
+        {
+          title: "工艺组合名称",
+          name: "Input",
+          value: "",
+          serverName: "title",
+          placeholder: "请输入工艺组合名称",
+        },
       ],
       tableColums: [],
       tableData: [],
@@ -94,129 +190,207 @@ export default {
       pageSize: 10,
       proxyObj: {},
       loading: false,
-      headers: { 'Authorization': localStorage.getItem('token') },
-    }
+      headers: { Authorization: localStorage.getItem("token") },
+      showSortModal: false,
+      sortList: [{ sort: null, level: 1, value: "" }],
+      headerList: [
+        { key: "part_title", title: "部件名称" },
+        { key: "process_title", title: "工艺组合名称" },
+      ],
+    };
   },
   computed: {
-    ...mapState(['persimissionData']),
+    ...mapState(["persimissionData"]),
+  },
+  beforeRouteLeave(to, from, next) {
+    if (to.path == "/cms/processroute/edit") {
+      this.$route.meta.keepAlive = true;
+    } else {
+      this.$route.meta.keepAlive = false;
+    }
+    next();
+  },
+  beforeRouteEnter(to, from, next) {
+    next((vm) => {
+      vm.getData(vm.proxyObj);
+    });
   },
   methods: {
-    init (row) {
+    init(row) {
       this.pageIndex = 1;
-      row.page_index = this.pageIndex
+      row.page_index = this.pageIndex;
       row.page_size = this.pageSize;
-      this.proxyObj = row
-      this.getData(row)
+      this.proxyObj = row;
+      this.getData(row);
     },
-    getData (row) {
+    getData(row) {
       this.loading = true;
-      this.axios('/api/process_route_index', { params: row }).then(res => {
+      this.axios("/api/process_route_index", { params: row }).then((res) => {
         this.loading = false;
-        res.data.top.map(((v, i) => {
-          if (v.key == '颜色') { v.hover = 1 }
+        res.data.top.map((v, i) => {
+          if (v.key == "颜色") {
+            v.hover = 1;
+          }
           if (i == 0) {
-            v.fixed = 'left'
-            v.width = '100'
+            v.fixed = "left";
+            v.width = "100";
           } else {
             if (i == res.data.top.length - 1) {
-              v.fixed = 'right'
-              v.width = '150'
+              v.fixed = "right";
+              v.width = "150";
             } else {
-              v.minWidth = 150
+              v.minWidth = 150;
             }
           }
 
           if (v.hover == 1) {
-            v.render = function (h, params) {
-              const { row } = params
+            v.render = function(h, params) {
+              const { row } = params;
 
-              return h('Tooltip', {
-                props: {
-                  content: row[v.key],
-                  placement: "right",
-                  maxWidth: '200',
-                  style: {
-                    zIndex: 10000
-                  }
+              return h(
+                "Tooltip",
+                {
+                  props: {
+                    content: row[v.key],
+                    placement: "right",
+                    maxWidth: "200",
+                    style: {
+                      zIndex: 10000,
+                    },
+                  },
                 },
-              }, [
-                h('div', {
-                  props: {},
-                  style: {
-                    width: '100px',
-                    overflow: 'hidden',
-                    whiteSpace: 'nowrap',
-                    textOverflow: 'ellipsis'
-                  }
-                }, row[v.key])
-              ])
-            }
+                [
+                  h(
+                    "div",
+                    {
+                      props: {},
+                      style: {
+                        width: "100px",
+                        overflow: "hidden",
+                        whiteSpace: "nowrap",
+                        textOverflow: "ellipsis",
+                      },
+                    },
+                    row[v.key]
+                  ),
+                ]
+              );
+            };
           }
-
-
-        }))
+        });
         this.tableColums = res.data.top;
         this.tableData = res.data.detail;
         this.total = res.data.total;
-      })
+      });
     },
-    changePage (e) {
+    changePage(e) {
       this.pageIndex = e;
       this.proxyObj.page_index = this.pageIndex;
-      this.getData(this.proxyObj)
+      this.getData(this.proxyObj);
     },
-    changeSize (e) {
+    changeSize(e) {
       this.pageSize = e;
       this.proxyObj.page_size = this.pageSize;
-      this.getData(this.proxyObj)
+      this.getData(this.proxyObj);
     },
-    goPage (n, row) {
-      let id = row ? row.id : ''
+    goPage(n, row) {
+      let id = row ? row.id : "";
       this.$router.push({
-        path: '/cms/processroute/edit',
+        path: "/cms/processroute/edit",
         query: {
           type: n,
-          id: id
-        }
-      })
+          id: id,
+        },
+      });
+    },
+    handleSortSet() {
+      this.showSortModal = true;
     },
-    delItems (row) {
+    handleSortListChange(arr, type, index, obj) {
+      if (obj) {
+        arr.splice(index + 1, type, obj);
+      } else {
+        arr.splice(index, type);
+      }
+    },
+    handleConfirmSort() {
+      if (
+        this.sortList.length > 1 ||
+        (this.sortList.length == 1 && this.sortList[0].sort)
+      ) {
+        this.loading = true;
+        this.axios("/api/order_list_new", {
+          params: { ...this.proxyObj, sortList: this.sortList },
+        }).then((res) => {
+          if (res.code == 200) {
+            this.loading = false;
+            if (!res.data.data) {
+              return this.$Message.error("列表数据返回格式不正确");
+            }
+            this.tableData = res.data.data;
+            this.total = res.data.total;
+            this.showSortModal = false;
+            // this.tableModalTableData =
+            //   res.data.tableSet.tableSet.length < 1
+            //     ? this.tableModalTableData
+            //     : res.data.tableSet.tableSet;
+            // this.formModalTableData =
+            //   res.data.tableSet.formSet.length < 1
+            //     ? this.formModalTableData
+            //     : res.data.tableSet.formSet;
+            // this.sub_formModalTableData = JSON.parse(
+            //   JSON.stringify(this.formModalTableData)
+            // );
+            // this.sub_tableModalTableData = JSON.parse(
+            //   JSON.stringify(this.tableModalTableData)
+            // );
+          }
+        });
+      } else {
+        this.showSortModal = false;
+      }
+    },
+    delItems(row) {
       this.confirmDelete({
-        content: '确认删除么?',
+        content: "确认删除么?",
         then: () => {
-          this.axios.post('/api/process_route_del', { id: row.id, state: 0 }).then(res => {
-            if (res.code == 200) {
-              this.$Message.success(res.msg)
-              this.getData(this.proxyObj)
-            }
-          })
-        }
-      })
+          this.axios
+            .post("/api/process_route_del", { id: row.id, state: 0 })
+            .then((res) => {
+              if (res.code == 200) {
+                this.$Message.success(res.msg);
+                this.getData(this.proxyObj);
+              }
+            });
+        },
+      });
     },
-    async exportData () {
-      const res = await this.axios('/api/process_route_index_export', { params: { ...this.proxyObj, page: 0 } })
+    async exportData() {
+      const res = await this.axios("/api/process_route_index_export", {
+        params: { ...this.proxyObj, page: 0 },
+      });
       if (res.code == 200) {
-        let url = `${this.$store.state.ip}/api/storage/${res.data.file}`
-        location.href = url
+        let url = `${this.$store.state.ip}/api/storage/${res.data.file}`;
+        location.href = url;
       }
     },
-    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)
+      this.getData(this.proxyObj);
     },
-    uploadError (err) {
-      this.$Message.error(err.msg || '上传失败')
-    }
-  }
-}
+    uploadError(err) {
+      this.$Message.error(err.msg || "上传失败");
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
 /deep/ .ivu-table-wrapper {
   overflow: visible;
 }
-</style>
+</style>

+ 31 - 3
src/views/ProductMannage/index.vue

@@ -110,7 +110,7 @@
               <Button
                 type="primary"
                 style="cursor:default;border-radius:0"
-                ghost
+                :ghost="!isSelectAll"
                 @click="handleProductAllClick(tableData)"
                 >产品名称</Button
               >
@@ -482,6 +482,7 @@ export default {
       currencyChoose: {},
       attrindex: null,
       attrName: "",
+      isSelectAll: false,
     };
   },
   beforeRouteLeave(to, from, next) {
@@ -566,12 +567,40 @@ export default {
         },
       });
     },
-    handleProductAllClick(product) {},
+    handleProductAllClick(product) {
+      this.isSelectAll = !this.isSelectAll;
+      // let  flag
+      product.map((item) => {
+        item.isSelect = this.isSelectAll;
+      });
+      let ids = product.map((item) => item.id);
+      this.isSelectAll &&
+        this.axios
+          .post("/api/support_product_get_part", {
+            type: 2,
+            basic_product_id: [this.$route.query.id],
+            product_id: ids,
+            part_id: [],
+          })
+          .then((res) => {
+            console.log(res);
+            this.productPartList = res.data;
+            this.productPartList.map((item) => (item.isSelect = false));
+          });
+    },
     handleProductClick(product, type) {
       product.isSelect = !product.isSelect;
       this.currentProductList = product;
       const temp_product = this.tableData.filter((item) => item.isSelect);
       const product_id = temp_product.map((item) => item.id);
+      // 判断是否全选,全选标题选中
+      let flag = true
+      this.tableData.map(item=>{
+        if (!item.isSelect) {
+          flag = false
+        }
+      })
+      this.isSelectAll = flag
       this.axios
         .post("/api/support_product_get_part", {
           type,
@@ -583,7 +612,6 @@ export default {
           console.log(res);
           this.productPartList = res.data;
           this.productPartList.map((item) => (item.isSelect = false));
-          console.log("this.productPartList :>> ", this.productPartList);
         });
       this.$forceUpdate();
     },