Andy 3 lat temu
rodzic
commit
4eba34bc30

Plik diff jest za duży
+ 726 - 686
src/components/product/add/index.vue


+ 338 - 260
src/views/BasicSettings/EmployeeManage/EmployeeManage.vue

@@ -2,140 +2,177 @@
   <div class="SippliersList">
     <Toptitle title="员工管理">
       <slot name="titleButton">
-        <!-- <Button @click="handleSet()"
-                type="primary"
-                style="margin-right:10px;">新增分类</Button> -->
+        <Button @click="exportData()" type="primary" style="margin-right: 10px"
+          >批量导出</Button
+        >
+        <Button
+          type="primary"
+          @click="handleEmployeeEdit(1, '')"
+          style="margin-right:10px;"
+          >新增员工</Button
+        >
       </slot>
     </Toptitle>
     <div class="content">
       <div class="content_left">
-        <Tree :data="treeData"
-              select-node
-              children-key='sub'
-              style="width:100%;"
-              @on-select-change="handleTreeSelect"
-              class="demo-tree-render"></Tree>
+        <Tree
+          :data="treeData"
+          select-node
+          children-key="sub"
+          style="width:100%;"
+          @on-select-change="handleTreeSelect"
+          class="demo-tree-render"
+        ></Tree>
       </div>
       <div class="content_right">
         <div class="content_right_topform">
-          <Form :label-width="90"
-                :model="searchData"
-                style="display:flex;justify-content:space-between;">
-                <div>
-            <FormItem label="员工姓名:">
-              <Input type="text"
-                     size="small"
-                     clearable
-                     v-model="searchData.title"
-                     style="width: 150px"
-                     placeholder="请输入姓名" />
-            </FormItem>
-            <FormItem label="部门类别:">
-              <Select v-model="searchData.type"
-                      style="width: 150px"
-                      clearable
-                      filterable
-                      placeholder="请选择部门类别"
-                      size="small">
-                <Option v-for="item in departmentTypeList"
-                        :key="item.value"
-                        :label="item.label"
-                        :value="item.value" />
-              </Select>
-            </FormItem></div>
-            <Button @click="exportData()" type="primary" style="margin-right: 10px">批量导出</Button>
+          <Form
+            :label-width="90"
+            :model="searchData"
+            style="display:flex;justify-content:space-between;"
+          >
+            <div>
+              <FormItem label="员工姓名:">
+                <Input
+                  type="text"
+                  size="small"
+                  clearable
+                  v-model="searchData.title"
+                  style="width: 150px"
+                  placeholder="请输入姓名"
+                />
+              </FormItem>
+              <FormItem label="部门类别:">
+                <Select
+                  v-model="searchData.type"
+                  style="width: 150px"
+                  clearable
+                  filterable
+                  placeholder="请选择部门类别"
+                  size="small"
+                >
+                  <Option
+                    v-for="item in departmentTypeList"
+                    :key="item.value"
+                    :label="item.label"
+                    :value="item.value"
+                  />
+                </Select>
+              </FormItem>
+              <FormItem>
+                <Button
+                  type="primary"
+                  size="small"
+                  @click="initData(searchData)"
+                  style="margin-right:10px;"
+                  >搜索</Button
+                >
+              </FormItem>
+            </div>
           </Form>
-          <div class="content_right_topfrom_btn">
-            <Button type="primary"
-                    size="small"
-                    @click="initData(searchData)"
-                    style="margin-right:10px;">搜索</Button>
-          </div>
+          <div class="content_right_topfrom_btn"></div>
         </div>
         <div class="content_right_content">
-          <div class="content_right_content_btn">
-            <Button type="primary"
-                    @click="handleEmployeeEdit(1,'')"
-                    style="margin-right:10px;">新增员工</Button>
-          </div>
+          <div class="content_right_content_btn"></div>
           <div class="content_right_content_table">
-            <Table :columns="tableColumns"
-                   border
-                   :loading="tableLoading"
-                   :data="tableData">
-              <template slot="setSlot"
-                        slot-scope="{row,index}">
-                <a style="margin:0 5px"
-                   @click="handleSet(2,row,index)">编辑</a>
-                <a style="margin:0 5px;color:red"
-                   @click="handleSet(3,row,index)">删除</a>
+            <Table
+              :columns="tableColumns"
+              border
+              :loading="tableLoading"
+              :data="tableData"
+            >
+              <template slot="setSlot" slot-scope="{ row, index }">
+                <a style="margin:0 5px" @click="handleSet(2, row, index)"
+                  >编辑</a
+                >
+                <a
+                  style="margin:0 5px;color:red"
+                  @click="handleSet(3, row, index)"
+                  >删除</a
+                >
               </template>
             </Table>
             <div class="content_right_content_page">
-              <Page :page-size-opts="[10, 20, 30, 40,100]"
-                    @on-page-size-change='changeSize'
-                    @on-change='changePage'
-                    :current='pageIndex'
-                    :total="total"
-                    show-sizer
-                    :page-size='pageSize' />
+              <Page
+                :page-size-opts="[10, 20, 30, 40, 100]"
+                @on-page-size-change="changeSize"
+                @on-change="changePage"
+                :current="pageIndex"
+                :total="total"
+                show-sizer
+                :page-size="pageSize"
+              />
             </div>
           </div>
         </div>
       </div>
     </div>
-    <Modal v-model="showModal"
-           :title="type==1?'新增员工':'编辑员工'"
-           @on-ok="handleModalOk"
-           @on-cancel="showModal = false">
+    <Modal
+      v-model="showModal"
+      :title="type == 1 ? '新增员工' : '编辑员工'"
+      @on-ok="handleModalOk"
+      @on-cancel="showModal = false"
+    >
       <div class="modal_content">
         <div class="modal_content_label">
           <span>ID: </span>
           <div style="width: 220px">
-            {{employeeForm.id||'自动生成'}}
+            {{ employeeForm.id || "自动生成" }}
           </div>
         </div>
         <div class="modal_content_label">
           <span>员工姓名: </span>
-          <Input type="text"
-                 size="small"
-                 placeholder="请输入"
-                 v-model="employeeForm.nickname"
-                 style="width: 220px" />
+          <Input
+            type="text"
+            size="small"
+            placeholder="请输入"
+            v-model="employeeForm.nickname"
+            style="width: 220px"
+          />
         </div>
         <div class="modal_content_label">
           <span>手机号: </span>
-          <Input type="text"
-                 size="small"
-                 placeholder="请输入"
-                 v-model="employeeForm.mobile"
-                 style="width: 220px" />
+          <Input
+            type="text"
+            size="small"
+            placeholder="请输入"
+            v-model="employeeForm.mobile"
+            style="width: 220px"
+          />
         </div>
         <div class="modal_content_label">
           <span>部门: </span>
-          <Select size="small"
-                  placeholder="请选择"
-                  width='220px'
-                  clearable
-                  v-model="employeeForm.depart_code"
-                  style="width: 220px">
-            <Option v-for="item in departmentList"
-                    :key="item.code"
-                    :label="item.title"
-                    :value="item.code" />
+          <Select
+            size="small"
+            placeholder="请选择"
+            width="220px"
+            clearable
+            v-model="employeeForm.depart_code"
+            style="width: 220px"
+          >
+            <Option
+              v-for="item in departmentList"
+              :key="item.code"
+              :label="item.title"
+              :value="item.code"
+            />
           </Select>
         </div>
         <div class="modal_content_label">
           <span>部门类别: </span>
-          <Select size="small"
-                  placeholder="请选择"
-                  v-model="employeeForm.type"
-                  clearable
-                  style="width: 220px">
-            <Option v-for="item in departmentTypeList"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value" />
+          <Select
+            size="small"
+            placeholder="请选择"
+            v-model="employeeForm.type"
+            clearable
+            style="width: 220px"
+          >
+            <Option
+              v-for="item in departmentTypeList"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
           </Select>
         </div>
         <div class="modal_content_label">
@@ -147,19 +184,22 @@
             </RadioGroup>
           </div>
         </div>
-        <div class="modal_content_label"
-             v-show="employeeForm.is_bind">
+        <div class="modal_content_label" v-show="employeeForm.is_bind">
           <span>绑定人员: </span>
           <div style="width: 220px">
-            <Select size="small"
-                    placeholder="请选择"
-                    v-model="employeeForm.sys_user_id"
-                    clearable
-                    style="width: 220px">
-              <Option v-for="item in userList"
-                      :key="item.id"
-                      :label="item.nickname"
-                      :value="item.id" />
+            <Select
+              size="small"
+              placeholder="请选择"
+              v-model="employeeForm.sys_user_id"
+              clearable
+              style="width: 220px"
+            >
+              <Option
+                v-for="item in userList"
+                :key="item.id"
+                :label="item.nickname"
+                :value="item.id"
+              />
             </Select>
           </div>
         </div>
@@ -173,65 +213,94 @@
 // 例如:import 《组件名称》 from '《组件路径》';
 
 export default {
-  name: 'EmployeeManage',
-  components: {
-
-  },
+  name: "EmployeeManage",
+  components: {},
   props: {},
   // import引入的组件需要注入到对象中才能使用
-  data () {
+  data() {
     // 这里存放数据
     return {
-      type: '',
+      type: "",
       partsNameList: [],
       treeData: [
         {
-          title: '员工分类',
+          title: "员工分类",
           expand: true,
           sub: [],
           render: (h, { root, node, data }) => {
-            return h('span', {
-              style: {
-                display: 'inline-block',
-                width: '100%'
-              }
-            }, [
-              h('span', [
-                h('Icon', {
-                  props: {
-                    type: 'ios-folder-outline'
-                  },
-                  style: {
-                    marginRight: '8px'
-                  }
-                }),
-                h('span', data.title)
-              ])]);
+            return h(
+              "span",
+              {
+                style: {
+                  display: "inline-block",
+                  width: "100%",
+                },
+              },
+              [
+                h("span", [
+                  h("Icon", {
+                    props: {
+                      type: "ios-folder-outline",
+                    },
+                    style: {
+                      marginRight: "8px",
+                    },
+                  }),
+                  h("span", data.title),
+                ]),
+              ]
+            );
           },
-        }
+        },
       ],
       buttonProps: {
-        type: 'default',
-        size: 'small',
+        type: "default",
+        size: "small",
       },
       tableColumns: [
-        { title: '序号', type: 'index', key: 'id', align: 'center', minWidth: 90 },
-        { title: '员工姓名', key: 'nickname', align: 'center', minWidth: 110 },
-        { title: '手机号', key: 'mobile', align: 'center', minWidth: 150 },
         {
-          title: '部门类别', key: 'type', align: 'center', minWidth: 100,
+          title: "序号",
+          type: "index",
+          key: "id",
+          align: "center",
+          minWidth: 90,
+        },
+        { title: "员工姓名", key: "nickname", align: "center", minWidth: 110 },
+        { title: "手机号", key: "mobile", align: "center", minWidth: 150 },
+        {
+          title: "部门类别",
+          key: "type",
+          align: "center",
+          minWidth: 100,
           render: (h, params) => {
-            return h('span', {}, params.row.type == 1 ? '制单人' : params.row.type == 2 ? '业务员' : '车间人员')
-          }
+            return h(
+              "span",
+              {},
+              params.row.type == 1
+                ? "制单人"
+                : params.row.type == 2
+                ? "业务员"
+                : "车间人员"
+            );
+          },
         },
         {
-          title: '是否登录系统', key: 'is_bind', align: 'center', minWidth: 150,
+          title: "是否登录系统",
+          key: "is_bind",
+          align: "center",
+          minWidth: 150,
           render: (h, params) => {
-            const { row } = params
-            return h('span', {}, row.is_bind == 1 ? '是' : '否')
-          }
+            const { row } = params;
+            return h("span", {}, row.is_bind == 1 ? "是" : "否");
+          },
+        },
+        {
+          title: "操作",
+          key: "code",
+          align: "center",
+          minWidth: 120,
+          slot: "setSlot",
         },
-        { title: '操作', key: 'code', align: 'center', minWidth: 120, slot: 'setSlot' },
       ],
       tableData: [],
       tableLoading: false,
@@ -239,188 +308,200 @@ export default {
       pageSize: 10,
       total: 0,
       searchData: {
-        nickname: '',
-        type: '',
-        code: ''
+        nickname: "",
+        type: "",
+        code: "",
       },
-      suppliersTypeTitle: '',
-      suppliersTypeId: '',
+      suppliersTypeTitle: "",
+      suppliersTypeId: "",
       showModal: false,
       employeeForm: {
-        id: '',
-        nickname: '',
-        mobile: '',
-        depart_code: '',
-        is_blind: '',
+        id: "",
+        nickname: "",
+        mobile: "",
+        depart_code: "",
+        is_blind: "",
       },
       departmentList: [],
       departmentTypeList: [
-        { label: '制单人', value: 1 },
-        { label: '业务员', value: 2 },
-        { label: '车间人员', value: 3 }
+        { label: "制单人", value: 1 },
+        { label: "业务员", value: 2 },
+        { label: "车间人员", value: 3 },
       ],
       userList: [],
       type: null,
-    }
+    };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
-  created () {
+  created() {
     this.axios({
-      method: 'get',
-      url: '/api/user',
-    }).then((res) => {
-      this.userList = res.data.data
-    }).catch((err) => { });
+      method: "get",
+      url: "/api/user",
+    })
+      .then((res) => {
+        this.userList = res.data.data;
+      })
+      .catch((err) => {});
     this.axios({
-      method: 'get',
-      url: '/api/employee_depart_list',
-    }).then((res) => {
-      this.treeData[0].sub = res.data
-      this.handleDepartment(res.data)
-    }).catch((err) => { });
+      method: "get",
+      url: "/api/employee_depart_list",
+    })
+      .then((res) => {
+        this.treeData[0].sub = res.data;
+        this.handleDepartment(res.data);
+      })
+      .catch((err) => {});
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted () {
-    this.initData(this.searchData)
+  mounted() {
+    this.initData(this.searchData);
   },
   methods: {
-    async exportData(){
-            const res = await this.axios('/api/employee_export')
-           if(res.code == 200){
-                let url = `${this.$store.state.ip}/api/storage/${res.data.file}`
-                location.href = url
-            }
-        },
-    initData (row) {
-      this.tableLoading = true
+    async exportData() {
+      const res = await this.axios("/api/employee_export");
+      if (res.code == 200) {
+        let url = `${this.$store.state.ip}/api/storage/${res.data.file}`;
+        location.href = url;
+      }
+    },
+    initData(row) {
+      this.tableLoading = true;
       this.axios({
-        method: 'get',
-        url: '/api/employee_list',
+        method: "get",
+        url: "/api/employee_list",
         params: {
           ...row,
           page_index: this.pageIndex,
-          page_size: this.pageSize
-        }
-      }).then((res) => {
-        this.tableLoading = false
-        this.tableData = res.data
-      }).catch((err) => { });
+          page_size: this.pageSize,
+        },
+      })
+        .then((res) => {
+          this.tableLoading = false;
+          this.tableData = res.data;
+        })
+        .catch((err) => {});
     },
-    handleSet (type, row, index) {
+    handleSet(type, row, index) {
       // 2编辑 3删除
       switch (type) {
         case 2:
-          this.employeeForm = JSON.parse(JSON.stringify(row))
-          this.handleEmployeeEdit(type, row)
+          this.employeeForm = JSON.parse(JSON.stringify(row));
+          this.handleEmployeeEdit(type, row);
           break;
         case 3:
           this.$Modal.confirm({
-            title: '确认删除?',
-            content: '此操作无法恢复,请确认!',
+            title: "确认删除?",
+            content: "此操作无法恢复,请确认!",
             onOk: () => {
               this.axios({
-                method: 'post',
-                url: '/api/employee_del',
+                method: "post",
+                url: "/api/employee_del",
                 data: {
-                  id: row.id
-                }
-              }).then((res) => {
-                this.$Message.success(res.msg)
-                this.initData()
-              }).catch((err) => { });
+                  id: row.id,
+                },
+              })
+                .then((res) => {
+                  this.$Message.success(res.msg);
+                  this.initData();
+                })
+                .catch((err) => {});
             },
-            onCancel: () => { }
-          })
+            onCancel: () => {},
+          });
           break;
       }
     },
-    append (data) {
+    append(data) {
       const children = data.children || [];
       children.push({
         code: this.form.code,
         title: this.form.title,
-        expand: true
+        expand: true,
       });
-      this.$set(data, 'children', children);
+      this.$set(data, "children", children);
     },
-    remove (root, node, data) {
+    remove(root, node, data) {
       if (node.children && node.children.length > 0) {
-        this.$Message.error('有子集时不可删除')
+        this.$Message.error("有子集时不可删除");
       } else {
-        const parentKey = root.find(el => el === node).parent;
-        const parent = root.find(el => el.nodeKey === parentKey).node;
+        const parentKey = root.find((el) => el === node).parent;
+        const parent = root.find((el) => el.nodeKey === parentKey).node;
         const index = parent.children.indexOf(data);
         parent.children.splice(index, 1);
       }
     },
-    handleModalOk () {
-      let url = ''
-      this.type == 1 ? url = '/api/employee_add' : url = '/api/employee_edit'
+    handleModalOk() {
+      let url = "";
+      this.type == 1
+        ? (url = "/api/employee_add")
+        : (url = "/api/employee_edit");
       this.axios({
-        method: 'post',
+        method: "post",
         url,
         data: {
-          ...this.employeeForm
-        }
-      }).then((res) => {
-        this.$Message.success(res.msg)
-        this.initData()
-      }).catch((err) => { });
+          ...this.employeeForm,
+        },
+      })
+        .then((res) => {
+          this.$Message.success(res.msg);
+          this.initData();
+        })
+        .catch((err) => {});
     },
-    handleTreeSelect (arr, row) {
-      console.log('row :>> ', row);
-      this.searchData.code = row.code
-      this.suppliersTypeTitle = row.title
-      this.suppliersTypeId = row.id
-      this.initData(this.searchData)
+    handleTreeSelect(arr, row) {
+      console.log("row :>> ", row);
+      this.searchData.code = row.code;
+      this.suppliersTypeTitle = row.title;
+      this.suppliersTypeId = row.id;
+      this.initData(this.searchData);
     },
-    changeSize (e) {
+    changeSize(e) {
       this.pageSize = e;
-      this.initData(this.searchData)
+      this.initData(this.searchData);
     },
-    changePage (e) {
+    changePage(e) {
       this.pageIndex = e;
-      this.initData(this.searchData)
+      this.initData(this.searchData);
     },
-    handleEmployeeEdit (type, item) {
-      this.type = type
+    handleEmployeeEdit(type, item) {
+      this.type = type;
       if (type == 1) {
         this.employeeForm = {
-          id: '',
-          nickname: '',
-          mobile: '',
-          depart_code: '',
-          is_blind: '',
-          sys_user_id: '',
-        }
+          id: "",
+          nickname: "",
+          mobile: "",
+          depart_code: "",
+          is_blind: "",
+          sys_user_id: "",
+        };
       }
-      this.showModal = true
+      this.showModal = true;
     },
-    handleDepartment (list) {
-      list.forEach(element => {
+    handleDepartment(list) {
+      list.forEach((element) => {
         if (element.sub && element.sub.length > 0) {
-          return this.handleDepartment(element.sub)
+          return this.handleDepartment(element.sub);
         } else {
-          this.departmentList.push(element)
+          this.departmentList.push(element);
         }
       });
-    }
+    },
   },
   // 监听属性 类似于data概念
   computed: {},
   // 监控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 lang="scss" scoped>
 .content {
   width: 100%;
   display: flex;
@@ -449,9 +530,6 @@ export default {
       }
     }
     .content_right_content {
-      border-top: 1px solid #f4f4f4;
-      margin-top: 20px;
-      padding-top: 20px;
       .content_right_content_btn {
         display: flex;
         justify-content: flex-end;

+ 1 - 1
src/views/BidSystem/ContractList/edit.vue

@@ -323,7 +323,7 @@
           @click="handleAreaDele(areaIndex)"
           type="error"
           size="small"
-          v-show="areaIndex != 0"
+          v-show="formData.list.length > 1"
           :disabled="isChecked"
           style="margin-right: 10px"
           >删除区域</Button

+ 52 - 144
src/views/BidSystem/ProductDeOrder/deorderdetail.vue

@@ -192,28 +192,6 @@
               placeholder="请输入单位"
             />
           </FormItem>
-          <!-- <FormItem label="工艺组合名称:">
-            <Select
-              v-model="partsItem.processCombination"
-              size="small"
-              clearable
-              filterable
-              allow-create
-              label-in-value
-              :disabled="type == 2"
-              @on-create="(e) => handleProcessRouteCreate(partsItem, e)"
-              @on-change="(e) => handleProcessRouteSelect(partsItem, e)"
-              style="width: 150px"
-            >
-              <Option
-                v-for="sitem in partsItem.partsProcessRouteList"
-                :key="sitem.id"
-                :label="sitem.title"
-                :value="sitem.id"
-              >
-              </Option>
-            </Select>
-          </FormItem> -->
           <!-- <FormItem label="工艺价格:">
             <Input
               type="text"
@@ -561,17 +539,17 @@
             <template slot="partSet" slot-scope="{ row, index }">
               <a
                 style="margin: 0 5px"
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 @click="handlePartWoodCopy(row, index, partsIndex)"
                 >复制</a
               >
               <a
                 :style="
-                  !partsItem.isAddPart || type == 2
+                  type == 2
                     ? 'margin: 0 5px; color: #ccc'
                     : 'margin: 0 5px; color: red'
                 "
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 @click="handlePartWoodDele(row, index, partsIndex)"
                 >删除</a
               >
@@ -634,17 +612,17 @@
             <template slot="metalsSet" slot-scope="{ row, index }">
               <a
                 style="margin: 0 5px"
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 @click="handlePartMetalsCopy(row, index, partsIndex)"
                 >复制</a
               >
               <a
                 :style="
-                  !partsItem.isAddPart || type == 2
+                  type == 2
                     ? 'margin: 0 5px; color: #ccc'
                     : 'margin: 0 5px; color: red'
                 "
-                :disabled="!partsItem.isAddPart || type == 2"
+                :disabled="type == 2"
                 @click="handlePartMetalsDele(row, index, partsIndex)"
                 >删除</a
               >
@@ -1433,7 +1411,7 @@ export default {
       // });
       this.tempProcessAttrList = JSON.parse(JSON.stringify(res.data));
       this.formData.parts.forEach((element) => {
-        element.ProcessAttrList = res.data;
+        element.ProcessAttrList = JSON.parse(JSON.stringify(res.data));
       });
     });
   },
@@ -1687,13 +1665,13 @@ export default {
         }).then((res) => {
           if (res.code == 200) {
             res.data.part.forEach((element) => {
+              element.part_title = element.title;
               this.formData.parts.forEach((ele, idx) => {
                 if (element.part_id == ele.part_id) {
                   element.process_ids = ele.process_ids;
                   element.route_id = ele.route_id;
                   element.produce_list = ele.produce_list;
                   element.process_list = ele.process_list;
-                  element.part_title = element.title
                   if (isEditItem) {
                     const temp_arr = isEditItem.parts.filter(
                       (v) => v.part_id == element.part_id
@@ -1726,49 +1704,24 @@ export default {
               element.ProcessAttrList = JSON.parse(
                 JSON.stringify(this.tempProcessAttrList)
               ); //工艺属性列表
-              element.part_id &&
-                this.axios("/api/parts_detail", {
-                  params: { id: element.part_id },
-                }).then((re) => {
-                  // element.company = re.data.company
-                  element.isAddPart = true;
-                  element.isAddProcessRoute = true;
-                  element.parts_type = re.data.p_id;
-                  this.axios({
-                    method: "get",
-                    url: "/api/parts_index",
-                    params: {
-                      bp_id: element.parts_type,
-                    },
-                  }).then((r) => {
-                    element.partsNameList = r.data.data;
-                    element.part_id = re.data.id;
-                    console.log("element :>> ", element);
-                    if (isEditItem) {
-                      let item = isEditItem;
-                      // let item = JSON.parse(JSON.stringify(isEditItem));
-                      item.parts.forEach((it) => {
-                        it.processCombination = it.route_id;
-                        let obj = { value: it.route_id, label: "" };
-                        this.handleProcessRouteSelect(it, obj);
-                      });
-                      isEditItem = item;
-                    } else {
-                      element.thick = element.formula_h;
-                      element.wide = element.formula_w;
-                      element.long = element.formula_l;
-                    }
-                    this.$forceUpdate();
-                  });
-                  element.company = re.data.company;
-                  // element.partsNameList = [{ id: re.data.id, title: re.data.title }]
-                  element.pay_state = re.data.label;
-                  // element.partsWoodTableData = re.data.detail;
-                  this.showSimilarProductModal = false;
-                });
               let obj = { value: element.part_id, title: element.title };
+              if (!isEditItem) {
+                element.thick = element.formula_h;
+                element.wide = element.formula_w;
+                element.long = element.formula_l;
+              }
               this.handlePartsNameSelect_test(element, obj);
             });
+            if (isEditItem) {
+              let item = isEditItem;
+              // let item = JSON.parse(JSON.stringify(isEditItem));
+              item.parts.forEach((it) => {
+                it.processCombination = it.route_id;
+                let obj = { value: it.route_id, label: "" };
+                this.handleProcessRouteSelect(it, obj);
+              });
+              isEditItem = item;
+            }
           }
         });
       } else {
@@ -1801,38 +1754,10 @@ export default {
       });
       this.$forceUpdate();
     },
-    //新增工艺组合名称
-    handleProcessRouteCreate(item, val) {
-      //////
-      item.isAddProcessRoute = true;
-      item.ProcessAttrList = JSON.parse(
-        JSON.stringify(this.tempProcessAttrList)
-      );
-      // 新增工艺组合,展示所有工艺
-      item.ProcessAttrList.map((item) => {
-        item.cld &&
-          item.cld.length > 0 &&
-          item.cld.map((level1) => {
-            level1.list &&
-              level1.list.length > 0 &&
-              level1.list.map((level2) => {
-                level2.display = true;
-              });
-          });
-      });
-      if (!item.partsProcessRouteList) {
-        item.partsProcessRouteList = [];
-      }
-      item.partsProcessRouteList.push({
-        id: val,
-        title: val,
-      });
-      this.$forceUpdate();
-    },
     // 部件名称
     handlePartsNameSelect(item, val) {
       if (val && val.value) {
-        item.part_title = val.label
+        item.part_title = val.label;
         if (val.label != val.value) {
           item.isAddPart = false;
           this.axios({
@@ -1844,7 +1769,9 @@ export default {
           }).then((res) => {
             item.pay_state = res.data.label;
             item.company = res.data.company;
-            item.ProcessAttrList = this.tempProcessAttrList;
+            item.ProcessAttrList = JSON.parse(
+              JSON.stringify(this.tempProcessAttrList)
+            );
             item.partsWoodTableData ? "" : (item.partsWoodTableData = []);
             item.partsMetalseData ? "" : (item.partsMetalseData = []);
             item.partsWoodTableData = res.data.detail.filter(
@@ -1853,20 +1780,6 @@ export default {
             item.partsMetalseData = res.data.detail.filter(
               (v) => v.type_id == 5
             );
-            this.axios({
-              method: "get",
-              url: "/api/process_route_index",
-              params: {
-                part_id: val.value,
-              },
-            })
-              .then((re) => {
-                this.$nextTick(() => {
-                  item.partsProcessRouteList = re.data.detail;
-                  this.$forceUpdate();
-                });
-              })
-              .catch((err) => {});
           });
         } else {
           item.isAddPart = true;
@@ -1876,7 +1789,7 @@ export default {
           // item.process_name = "";
         }
       }
-      console.log('item :>> ', item);
+      console.log("item :>> ", item);
     },
     handlePartsNameSelect_test(item, val) {
       if (val && val.value) {
@@ -1891,13 +1804,14 @@ export default {
           }).then((res) => {
             item.pay_state = res.data.label;
             item.company = res.data.company;
-            item.ProcessAttrList = this.tempProcessAttrList;
+            item.ProcessAttrList = JSON.parse(
+              JSON.stringify(this.tempProcessAttrList)
+            );
             item.partsWoodTableData ? "" : (item.partsWoodTableData = []);
             item.partsMetalseData ? "" : (item.partsMetalseData = []);
             item.partsWoodTableData = res.data.detail.filter(
               (v) => v.type_id == 1 || v.type_id == 2
             );
-            console.log("item :>> ", item);
             item.partsWoodTableData.map((v, k) => {
               const temp_arr = item.detail.filter((w) => w.id == v.id);
               if (temp_arr.length > 0) {
@@ -1910,18 +1824,25 @@ export default {
             item.partsMetalseData = res.data.detail.filter(
               (v) => v.type_id == 5
             );
+            item.isAddPart = true;
+            item.isAddProcessRoute = true;
+            item.parts_type = res.data.p_id;
             this.axios({
               method: "get",
-              url: "/api/process_route_index",
+              url: "/api/parts_index",
               params: {
-                part_id: val.value,
+                bp_id: item.parts_type,
               },
-            }).then((re) => {
-              this.$nextTick(() => {
-                item.partsProcessRouteList = re.data.detail;
-                this.$forceUpdate();
-              });
+            }).then((r) => {
+              item.partsNameList = r.data.data;
+              item.part_id = res.data.id;
+              this.$forceUpdate();
             });
+            item.company = res.data.company;
+            // item.partsNameList = [{ id: res.data.id, title: res.data.title }]
+            item.pay_state = res.data.label;
+            // item.partsWoodTableData = res.data.detail;
+            this.showSimilarProductModal = false;
           });
         } else {
           item.isAddPart = true;
@@ -1935,18 +1856,6 @@ export default {
     // 选择工艺组合名称
     handleProcessRouteSelect(item, val) {
       if (val) {
-        // item.ProcessAttrList.map((level0) => {
-        //   level0.cld &&
-        //     level0.cld.length > 0 &&
-        //     level0.cld.map((level1) => {
-        //       level1.list &&
-        //         level1.list.length > 0 &&
-        //         level1.list.map((level2) => {
-        //           level2.display = true;
-        //         });
-        //     });
-        // });
-        // if (val.label != val.value) {
         item.isAddProcessRoute = false;
         this.axios({
           method: "get",
@@ -1961,8 +1870,6 @@ export default {
           this.selectTags = res.data.produce_list;
           const selectTagsId = this.selectTags.map((item) => item.id);
           item.ProcessAttrList = res.data.list;
-          console.log("item.ProcessAttrList :>> ", item.ProcessAttrList);
-          console.log("item.process_list :>> ", item.process_list);
           item.process_list.map((v) => {
             item.ProcessAttrList.map((c) => {
               if (c.name == v.name) {
@@ -2001,9 +1908,6 @@ export default {
             item.partsProcessLineTableData = this.selectTags;
           }
         });
-        // } else {
-        //   item.isAddProcessRoute = true;
-        // }
       }
     },
     handleProcessSelect() {},
@@ -2394,8 +2298,12 @@ export default {
                     op: "add",
                   },
                 });
-                element.route_id = res.data.id;
-                element.part_id = result.data.id;
+                if (res.code == 200) {
+                  element.route_id = res.data.id;
+                  element.part_id = result.data.id;
+                } else {
+                  return;
+                }
               } else {
                 element.route_id = element.processCombination;
               }
@@ -2418,7 +2326,7 @@ export default {
                 method: "post",
                 url: "/api/order_area_explode_process",
                 data: {
-                  parts_id: element.part_id, /////
+                  parts_id: element.part_id,
                   price: element.process_price || 0,
                   properties,
                   title: element.processCombination || "",

+ 14 - 15
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -2512,7 +2512,6 @@ export default {
       wood_title_count: [],
       isCheck: false,
       warningList: [],
-      process_Select_match_list: [], //选中的list
       originalTableColumns: [
         { title: "原材料名称", align: "center", key: "title" },
         { title: "原材料库存", align: "center", key: "stock" },
@@ -3935,8 +3934,8 @@ export default {
         route_id_at_copy,
         then: (addProductArray) => {
           console.log("addProductArray :>> ", addProductArray);
-          this.modalArray = addProductArray
-          this.modalArray.forEach((element) => {
+          this.modalArray = addProductArray;
+          this.modalArray.map((element) => {
             // 工艺属性
             if (!element.procedure_properties_str) {
               element.procedure_properties_str = [];
@@ -4052,10 +4051,6 @@ export default {
       // 1 新增 2 编辑 3 删除 4复制  5详情
       switch (type) {
         case 1:
-          // this.handleShowAddProductModal(
-          //   this.info.custom_id,
-          //   this.route_id_at_copy
-          // );
           this.title_state = 1;
           if (this.info.custom_id) {
             this.modalArray = [
@@ -4069,7 +4064,11 @@ export default {
               },
             ];
             this.currentTabIndex = "0";
-            this.showAddProduct = true;
+            // this.showAddProduct = true;
+            this.handleShowAddProductModal(
+              this.info.custom_id,
+              this.route_id_at_copy
+            );
           } else {
             this.$Message.warning("请先选择客户");
           }
@@ -5313,13 +5312,13 @@ export default {
         }
         modelData.procedure_properties[ele.key - 1] = e.value;
         let isStart = true;
-        let match_list = []; //当前选中的list
-        this.process_match_list.map((item) => {
-          if (item.detail[ele.key] == e.value) {
-            match_list.push(item.detail);
-          }
-        });
-        this.process_Select_match_list = match_list;
+        // let match_list = []; //当前选中的list
+        // this.process_match_list.map((item) => {
+        //   if (item.detail[ele.key] == e.value) {
+        //     match_list.push(item.detail);
+        //   }
+        // });
+        // this.process_Select_match_list = match_list;
         modelData.process.forEach((element) => {
           if (element.value == "") {
             isStart = false;

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików