Andy 3 vuotta sitten
vanhempi
commit
1f88e3a191

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

@@ -73,7 +73,7 @@ export default {
         postData.start_time = new Date(this.time[0]).toLocaleDateString().replace(/\//g, "-")
         postData.end_time = new Date(this.time[1]).toLocaleDateString().replace(/\//g, "-")
       }
-      this.axios.post('/api/' + this.url, this.postInfo).then(res => {
+      this.axios.post(this.url, this.postInfo).then(res => {
         if (res.code == 200) {
           this.$Message.success(res.msg)
           this.show = false;

+ 395 - 275
src/views/BasicSettings/CustomerProductPrice/detail.vue

@@ -1,48 +1,67 @@
 <template>
   <div>
-    <Toptitle :title="type==1?'新增客户产品价格':type==2?'编辑客户产品价格':'查看客户产品价格'">
+    <Toptitle
+      :title="
+        type == 1
+          ? '新增客户产品价格'
+          : type == 2
+          ? '编辑客户产品价格'
+          : '查看客户产品价格'
+      "
+    >
       <slot name="titleButton">
-        <Button @click="showModal=true"
-                type="primary"
-                v-show="!isChecked"
-                ghost
-                style="margin-right:10px;">选择产品</Button>
-        <Button @click="goBack"
-                type="primary"
-                ghost
-                style="margin-right:10px;">返回</Button>
-        <Button @click="postData"
-                v-show="!isChecked"
-                type="primary"
-                style="margin-right:10px;">保存</Button>
+        <Button
+          @click="showModal = true"
+          type="primary"
+          v-show="!isChecked"
+          ghost
+          style="margin-right:10px;"
+          >选择产品</Button
+        >
+        <Button @click="goBack" type="primary" ghost style="margin-right:10px;"
+          >返回</Button
+        >
+        <Button
+          @click="postData"
+          v-show="!isChecked"
+          type="primary"
+          style="margin-right:10px;"
+          >保存</Button
+        >
       </slot>
     </Toptitle>
     <div class="top_search">
-      <Form :model="formData"
-            :label-width="100"
-            class="top_search_form">
+      <Form :model="formData" :label-width="100" class="top_search_form">
         <FormItem label="客户编码:">
-          <Select v-model="formData.custom_id"
-                  filterable
-                  clearable
-                  @on-change="handleCustomerChange"
-                  :disabled="isChecked">
-            <Option v-for="item of customList"
-                    :key="item.id"
-                    :value="item.id"
-                    :label="item.code"></Option>
+          <Select
+            v-model="formData.custom_id"
+            filterable
+            clearable
+            @on-change="handleCustomerChange"
+            :disabled="isChecked"
+          >
+            <Option
+              v-for="item of customList"
+              :key="item.id"
+              :value="item.id"
+              :label="item.code"
+            ></Option>
           </Select>
         </FormItem>
         <FormItem label="客户名称:">
-          <Select v-model="formData.custom_id"
-                  filterable
-                  clearable
-                  @on-change="handleCustomerChange"
-                  :disabled="isChecked">
-            <Option v-for="item of customList"
-                    :key="item.id"
-                    :value="item.id"
-                    :label="item.title"></Option>
+          <Select
+            v-model="formData.custom_id"
+            filterable
+            clearable
+            @on-change="handleCustomerChange"
+            :disabled="isChecked"
+          >
+            <Option
+              v-for="item of customList"
+              :key="item.id"
+              :value="item.id"
+              :label="item.title"
+            ></Option>
           </Select>
         </FormItem>
       </Form>
@@ -52,97 +71,120 @@
               :disabled="isChecked"
               type="primary">新增</Button> -->
     </div>
-    <Table :columns="tableColumns"
-           max-height="600"
-           :data="tableData"
-           border>
-      <template slot="priceSet"
-                slot-scope="{index}">
-        <Input :disabled='type == 3'
-               @on-focus="openKey(index)"
-               clearable
-               placeholder="请输入公式"
-               v-model="tableData[index].formula"></Input>
+    <Table :columns="tableColumns" max-height="600" :data="tableData" border>
+      <template slot="priceSet" slot-scope="{ index }">
+        <Input
+          :disabled="type == 3"
+          @on-focus="openKey(index)"
+          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,4)">删除</a>
+      <template slot="set" slot-scope="{ index }">
+        <a
+          style="margin:0 5px"
+          :disabled="isChecked"
+          @click="handleSet(tableData[index], index, 4)"
+          >删除</a
+        >
       </template>
     </Table>
-    <Modal v-model="showModal"
-           title="选择产品"
-           width='80'
-           @on-ok="handleSelect"
-           @on-cancel="showModal=false">
+    <Modal
+      v-model="showModal"
+      title="选择产品"
+      width="80"
+      @on-ok="handleSelect"
+      @on-cancel="showModal = false"
+    >
       <div class="modal_content">
         <div class="modal_content_left">
-          <Tree :data="modalData.treeData"
-                children-key='child'
-                style="width:100%;"
-                @on-select-change="handleTreeSlect"
-                class="demo-tree-render"></Tree>
+          <Tree
+            :data="modalData.treeData"
+            children-key="child"
+            style="width:100%;"
+            @on-select-change="handleTreeSlect"
+            class="demo-tree-render"
+          ></Tree>
         </div>
         <div class="modal_content_center">
           <div class="modal_content_center_top">
-            <div><span>产品分类:</span>
-              <Select v-model="modalData.type_title"
-                      filterable
-                      size="small"
-                      placeholder="请选择产品分类"
-                      clearable>
-                <Option v-for="item of productTypeList"
-                        :key="item.id"
-                        :value="item.title"
-                        :label="item.title"></Option>
+            <div>
+              <span>产品分类:</span>
+              <Select
+                v-model="modalData.type_title"
+                filterable
+                size="small"
+                placeholder="请选择产品分类"
+                clearable
+              >
+                <Option
+                  v-for="item of productTypeList"
+                  :key="item.id"
+                  :value="item.title"
+                  :label="item.title"
+                ></Option>
               </Select>
             </div>
-            <div><span>产品名称:</span>
-              <Input type="text"
-                     size="small"
-                     v-model="modalData.title"
-                     placeholder="请输入产品名称" />
+            <div>
+              <span>产品名称:</span>
+              <Input
+                type="text"
+                size="small"
+                v-model="modalData.title"
+                placeholder="请输入产品名称"
+              />
             </div>
-            <Button @click="initModal()"
-                    type="primary"
-                    size="small"
-                    style="margin:0 10px;">搜索</Button>
+            <Button
+              @click="initModal()"
+              type="primary"
+              size="small"
+              style="margin:0 10px;"
+              >搜索</Button
+            >
           </div>
           <div class="modal_content_center_body">
-            <Table :columns="modalTableColumns"
-                   height="520"
-                   border
-                   ref="modelTable"
-                   @on-select-all="handleSelectionAll"
-                   @on-select-all-cancel="handleSelectionAllCancel"
-                   @on-select="handleSelection"
-                   @on-select-cancel="handleSelectionCancel"
-                   :loading="modalTableLoading"
-                   :data="modalData.tableData">
+            <Table
+              :columns="modalTableColumns"
+              height="520"
+              border
+              ref="modelTable"
+              @on-select-all="handleSelectionAll"
+              @on-select-all-cancel="handleSelectionAllCancel"
+              @on-select="handleSelection"
+              @on-select-cancel="handleSelectionCancel"
+              :loading="modalTableLoading"
+              :data="modalData.tableData"
+            >
             </Table>
             <div class="modal_content_center_footer">
-              <Page :page-size-opts="[10, 20, 30, 40,100]"
-                    @on-page-size-change='changeModalSize'
-                    @on-change='changeModalPage'
-                    :current='modal_page_index'
-                    show-total
-                    :total="modal_total"
-                    show-sizer
-                    :page-size='modal_page_size' />
+              <Page
+                :page-size-opts="[10, 20, 30, 40, 100]"
+                @on-page-size-change="changeModalSize"
+                @on-change="changeModalPage"
+                :current="modal_page_index"
+                show-total
+                :total="modal_total"
+                show-sizer
+                :page-size="modal_page_size"
+              />
             </div>
           </div>
         </div>
         <div class="modal_content_right">
           <span>已选</span>
-          <Table :columns="selectedColumns"
-                 max-height="500"
-                 border
-                 :data="modalData.selectedData">
-            <template slot="selectedSetSlot"
-                      slot-scope="{row,index}">
-              <a style="margin:0 5px;color:red"
-                 @click="handleSelectedDele(row,index)">删除</a>
+          <Table
+            :columns="selectedColumns"
+            max-height="500"
+            border
+            :data="modalData.selectedData"
+          >
+            <template slot="selectedSetSlot" slot-scope="{ row, index }">
+              <a
+                style="margin:0 5px;color:red"
+                @click="handleSelectedDele(row, index)"
+                >删除</a
+              >
             </template>
           </Table>
         </div>
@@ -154,14 +196,14 @@
 <script>
 // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 // 例如:import 《组件名称》 from '《组件路径》';
-import KeyBoard from '../../../components/keyboard/index'
+import KeyBoard from "../../../components/keyboard/index";
 
 export default {
-  name: '',
+  name: "",
   components: { KeyBoard },
   props: {},
   // import引入的组件需要注入到对象中才能使用
-  data () {
+  data() {
     // 这里存放数据
     return {
       type: this.$route.query.type || null,
@@ -175,29 +217,46 @@ export default {
       formData: {},
       keyModal: false,
       tableColumns: [
-        { title: '产品分类', key: 'type_title', align: 'center', minWidth: 120, },
-        { title: '产品名称', key: 'title', align: 'center', minWidth: 120, },
-        { title: '计量单位', key: 'unit', align: 'center', minWidth: 120, },
-        { title: '型号', key: 'model', align: 'center', minWidth: 120, },
         {
-          title: '单价', key: 'price', align: 'center', minWidth: 120,
+          title: "产品分类",
+          key: "type_title",
+          align: "center",
+          minWidth: 120,
+        },
+        { title: "产品名称", key: "title", align: "center", minWidth: 120 },
+        { title: "计量单位", key: "unit", align: "center", minWidth: 120 },
+        { title: "型号", key: "model", align: "center", minWidth: 120 },
+        {
+          title: "单价",
+          key: "price",
+          align: "center",
+          minWidth: 120,
           render: (h, params) => {
-            const { row, index } = params
-            const currencyRow = this.tableData[index]
-            return this.type != 3 ? h('Input', {
-              props: {
-                value: currencyRow.price,
-                placeholder: '请输入单价'
-              },
-              on: {
-                'on-change': (e) => {
-                  currencyRow.price = e.target.value
-                  currencyRow.discount_price = (currencyRow.price * currencyRow.fax / 100).toFixed(2)
-                  this.tableData.splice(index, 1, currencyRow)
-                }
-              }
-            }, currencyRow.price) : h('span', {}, currencyRow.price)
-          }
+            const { row, index } = params;
+            const currencyRow = this.tableData[index];
+            return this.type != 3
+              ? h(
+                  "Input",
+                  {
+                    props: {
+                      value: currencyRow.price,
+                      placeholder: "请输入单价",
+                    },
+                    on: {
+                      "on-change": (e) => {
+                        currencyRow.price = e.target.value;
+                        currencyRow.discount_price = (
+                          (currencyRow.price * currencyRow.fax) /
+                          100
+                        ).toFixed(2);
+                        this.tableData.splice(index, 1, currencyRow);
+                      },
+                    },
+                  },
+                  currencyRow.price
+                )
+              : h("span", {}, currencyRow.price);
+          },
         },
         // { title: '折扣率', key: 'fax', align: 'center', minWidth: 120, },
         // {
@@ -220,45 +279,49 @@ export default {
         //     }, currencyRow.discount_price) : h('span', {}, currencyRow.discount_price)
         //   }
         // },
-        { title: '操作', key: '', align: 'center', slot: 'set', width: 200 },
+        { title: "操作", key: "", align: "center", slot: "set", width: 200 },
       ],
       modalData: {
-        title: '',
+        title: "",
         tableData: [{}],
         selectedData: [],
         treeData: [
           {
-            title: '产品分类',
+            title: "产品分类",
             expand: true,
             child: [],
             render: (h, { root, node, data }) => {
-              return h('span', {
-                style: {
-                  display: 'inline-block',
-                  width: '100%'
-                }
-              }, [
-                h('span', [
-                  h('Icon', {
-                    props: {
-                      type: 'ios-folder-outline'
-                    },
+              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),
+                  ]),
+                  h("span", {
                     style: {
-                      marginRight: '8px'
-                    }
+                      display: "inline-block",
+                      // float: 'right',
+                      marginRight: "32px",
+                    },
                   }),
-                  h('span', data.title)
-                ]),
-                h('span', {
-                  style: {
-                    display: 'inline-block',
-                    // float: 'right',
-                    marginRight: '32px'
-                  }
-                })
-              ]);
+                ]
+              );
             },
-          }
+          },
         ],
       },
       tableData: [],
@@ -271,166 +334,223 @@ export default {
       selected: null,
       currencyIndex: null,
       modalTableColumns: [
-        { title: '全选', type: 'selection', align: 'center', minWidth: 60 },
-        { title: '产品分类', key: 'type_name', align: 'center', minWidth: 90 },
-        { title: '产品名称', key: 'title', align: 'center', minWidth: 90 },
-        { title: '产品规格', key: 'model', align: 'center', minWidth: 90 },
-        { title: '计量单位', key: 'unit', align: 'center', minWidth: 90 },
+        { title: "全选", type: "selection", align: "center", minWidth: 60 },
+        { title: "产品分类", key: "type_name", align: "center", minWidth: 90 },
+        { title: "产品名称", key: "title", align: "center", minWidth: 90 },
+        { title: "产品规格", key: "model", align: "center", minWidth: 90 },
+        { title: "计量单位", key: "unit", align: "center", minWidth: 90 },
       ],
       modalTableLoading: false,
       modal_page_index: 1,
       modal_page_size: 10,
       modal_total: 0,
       selectedColumns: [
-        { title: '产品名称', key: 'title', align: 'center', minWidth: 110 },
-        { title: '操作', key: 'title', align: 'center', minWidth: 90, slot: 'selectedSetSlot' },
+        { title: "产品名称", key: "title", align: "center", minWidth: 110 },
+        {
+          title: "操作",
+          key: "title",
+          align: "center",
+          minWidth: 90,
+          slot: "selectedSetSlot",
+        },
       ],
       customList: [],
       fax: null,
-    }
+    };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
-  created () {
+  created() {
     // 获取基础产品类型
-    this.axios.get('/api/basics_product_index').then(res => { this.productTypeList = res.data.data; this.modalData.treeData[0].child = res.data.data })
+    this.axios.get("/api/basics_product_index").then((res) => {
+      this.productTypeList = res.data.data;
+      this.modalData.treeData[0].child = res.data.data;
+    });
     // 获取用户列表
-    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.get('/api/custom_list')
-      .then(res => {
-        this.customList = res.data.data
+    this.axios({ method: "get", url: "/api/overdraft_list" })
+      .then((res) => {
+        this.overStandardList = res.data.data;
       })
-    this.initModal()
+      .catch((err) => {});
+    // 获取客户列表
+    this.axios.get("/api/custom_list").then((res) => {
+      this.customList = res.data.data;
+    });
+    this.initModal();
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted () {
-    this.init()
+  mounted() {
+    this.init();
   },
   methods: {
-    init () {
-      (this.custom_id) &&
-        this.axios.get('/api/custom_product_detail', { params: { custom_id: this.custom_id } }).then(res => {
-          this.tableData = res.data.list.data
-          this.formData = JSON.parse(JSON.stringify(res.data))
-          delete this.formData.list
-          this.formData.custom_id = this.formData.id
-          this.fax = res.data.fax
-          // this.formData.lockState = this.formData.lock == 1 ? true : false
-          this.tableData.forEach(element => {
-            element.discount_price = (element.price * element.fax / 100).toFixed(2)
+    init() {
+      this.custom_id &&
+        this.axios
+          .get("/api/custom_product_detail", {
+            params: { custom_id: this.custom_id },
+          })
+          .then((res) => {
+            this.tableData = res.data.list.data;
+            this.formData = JSON.parse(JSON.stringify(res.data));
+            delete this.formData.list;
+            this.formData.custom_id = this.formData.id;
+            this.fax = res.data.fax;
+            // this.formData.lockState = this.formData.lock == 1 ? true : false
+            this.tableData.forEach((element) => {
+              element.discount_price = (
+                (element.price * element.fax) /
+                100
+              ).toFixed(2);
+            });
+          })
+          .catch((err) => {
+            console.error(err);
           });
-        }).catch(err => {
-          console.error(err);
-        })
     },
-    goBack () { this.$router.go(-1) },
-    handleSet (row, index, type) {
-      this.tableData.splice(index, 1)
+    goBack() {
+      this.$router.go(-1);
     },
-    postData () {
+    handleSet(row, index, type) {
+      let obj 
+      // 4删除5复制
+      switch (type) {
+        case 4:
+          this.tableData.splice(index, 1);
+          break;
+        case 5:
+          obj= JSON.parse(JSON.stringify(row));
+          this.tableData.splice(index, 0, obj);
+          break;
+      }
+    },
+    postData() {
       this.axios({
-        method: 'post',
-        url: '/api/custom_product_edit',
+        method: "post",
+        url: "/api/custom_product_edit",
         data: {
           ...this.formData,
-          detail: this.tableData
-        }
-      }).then((res) => {
-        if (res.code == 200) {
-          this.$Message.success(res.msg)
-          this.goBack()
-        }
-      }).catch((err) => {
-
-      });
+          detail: this.tableData,
+        },
+      })
+        .then((res) => {
+          if (res.code == 200) {
+            this.$Message.success(res.msg);
+            this.goBack();
+          }
+        })
+        .catch((err) => {});
     },
-    handleCustomerChange (val) {
-      const row = this.customList.filter((item) => item.id == val)
-      this.fax = row[0].fax
-      this.tableData.forEach(element => {
+    handleCustomerChange(val) {
+      const row = this.customList.filter((item) => item.id == val);
+      this.fax = row[0].fax;
+      this.tableData.forEach((element) => {
         element.fax = this.fax || 100;
-        (element.price) && (element.discount_price = (element.price * element.fax / 100).toFixed(2))
+        element.price &&
+          (element.discount_price = (
+            (element.price * element.fax) /
+            100
+          ).toFixed(2));
       });
-      this.tableData = JSON.parse(JSON.stringify(this.tableData))
+      this.tableData = JSON.parse(JSON.stringify(this.tableData));
     },
-    handleRuleAdd () {
-      const obj = { min: null, max: null, formula: null }
-      this.tableData.push({})
+    handleRuleAdd() {
+      const obj = { min: null, max: null, formula: null };
+      this.tableData.push({});
     },
-    handleSelectedDele (row, index) {
-      this.modalData.selectedData.splice(index, 1)
+    handleSelectedDele(row, index) {
+      this.modalData.selectedData.splice(index, 1);
     },
-    changeProduct (row, index) {
-      this.axios.get('/api/get_part_by_basic_product', { params: { basic_product_id: row.basic_product_id } })
-        .then(res => {
-          this.partsList = res.data
-        }).catch(err => { console.error(err); })
+    changeProduct(row, index) {
+      this.axios
+        .get("/api/get_part_by_basic_product", {
+          params: { basic_product_id: row.basic_product_id },
+        })
+        .then((res) => {
+          this.partsList = res.data;
+        })
+        .catch((err) => {
+          console.error(err);
+        });
     },
-    handleSelect () {
-      this.modalData.selectedData.forEach(element => {
-        element.product_id = element.id
-        element.type_title = element.type_name
-        element.fax = this.fax || 100
+    handleSelect() {
+      this.modalData.selectedData.forEach((element) => {
+        element.product_id = element.id;
+        element.type_title = element.type_name;
+        element.fax = this.fax || 100;
       });
-      this.tableData.splice((this.tableData.length - 1), 0, ...this.modalData.selectedData)
+      this.tableData.splice(
+        this.tableData.length - 1,
+        0,
+        ...this.modalData.selectedData
+      );
     },
-    handleTreeSlect (array, row) {
-      row.id && this.axios({
-        method: 'get',
-        url: '/api/product',
-        params: {
-          page_index: this.modal_page_index,
-          page_size: this.modal_page_size,
-          type_id: row.id
-        }
-      }).then((res) => {
-        this.modal_total = res.data.total
-        this.modalData.tableData = res.data.data
-      }).catch((err) => { });
+    handleTreeSlect(array, row) {
+      row.id &&
+        this.axios({
+          method: "get",
+          url: "/api/product",
+          params: {
+            page_index: this.modal_page_index,
+            page_size: this.modal_page_size,
+            type_id: row.id,
+          },
+        }).then((res) => {
+          this.modal_total = res.data.total;
+          this.modalData.tableData = res.data.data;
+        });
     },
-    initModal () {
+    initModal() {
       this.axios({
-        method: 'get',
-        url: '/api/product',
+        method: "get",
+        url: "/api/product",
         params: {
           page_index: this.modal_page_index,
           page_size: this.modal_page_size,
           title: this.modalData.title,
-          type_title: this.modalData.type_title
-        }
-      }).then((res) => {
-        this.modal_total = res.data.total
-        this.modalData.tableData = res.data.data
-        this.reselection()
-      }).catch((err) => { });
+          type_title: this.modalData.type_title,
+        },
+      })
+        .then((res) => {
+          this.modal_total = res.data.total;
+          this.modalData.tableData = res.data.data;
+          this.reselection();
+        })
+        .catch((err) => {});
     },
-    changeModalSize (e) {
+    changeModalSize(e) {
       this.modal_page_size = e;
-      this.initModal()
+      this.initModal();
     },
-    changeModalPage (e) {
+    changeModalPage(e) {
       this.modal_page_index = e;
-      this.initModal()
+      this.initModal();
     },
-    handleSelectionAll (selection) {
-      this.modalData.selectedData = this.modalData.selectedData.concat(selection)
+    handleSelectionAll(selection) {
+      this.modalData.selectedData = this.modalData.selectedData.concat(
+        selection
+      );
     },
-    handleSelectionAllCancel () {
-      this.modalData.tableData.forEach(element => {
-        this.modalData.selectedData = this.modalData.selectedData.filter((x) => {
-          return x.material_detail_id != element.material_detail_id
-        })
+    handleSelectionAllCancel() {
+      this.modalData.tableData.forEach((element) => {
+        this.modalData.selectedData = this.modalData.selectedData.filter(
+          (x) => {
+            return x.material_detail_id != element.material_detail_id;
+          }
+        );
       });
     },
-    handleSelection (selection, row) {
-      this.modalData.selectedData.push(row)
+    handleSelection(selection, row) {
+      this.modalData.selectedData.push(row);
     },
-    handleSelectionCancel (selection, row) {
+    handleSelectionCancel(selection, row) {
       this.modalData.selectedData.forEach((element, index) => {
         if (element.material_detail_id == row.material_detail_id) {
-          this.modalData.selectedData.splice(index, 1)
+          this.modalData.selectedData.splice(index, 1);
         }
       });
     },
@@ -439,17 +559,17 @@ export default {
   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>
 .top_search {
   padding: 20px 0;
   width: 100%;

+ 18 - 2
src/views/BasicSettings/OverStandardPrice/detail.vue

@@ -121,6 +121,12 @@
       <template slot="set" slot-scope="{ index }">
         <a
           style="margin:0 5px"
+          :disabled="isChecked"
+          @click="handleSet(tableData[index], index, 5)"
+          >复制</a
+        >
+        <a
+          style="margin:0 5px"
           v-show="!isChecked"
           @click="handleSet(tableData[index], index, 4)"
           >删除</a
@@ -250,7 +256,7 @@ export default {
           slot: "priceSet",
           minWidth: 140,
         },
-        { title: "操作", key: "", align: "center", slot: "set", width: 100 },
+        { title: "操作", key: "", align: "center", slot: "set", width: 120 },
       ],
       partsList: [],
       measureList: [],
@@ -321,7 +327,17 @@ export default {
       this.$router.go(-1);
     },
     handleSet(row, index, type) {
-      this.tableData.splice(index, 1);
+      let obj;
+      // 4删除5复制
+      switch (type) {
+        case 4:
+          this.tableData.splice(index, 1);
+          break;
+        case 5:
+          obj = JSON.parse(JSON.stringify(row));
+          this.tableData.splice(index, 0, obj);
+          break;
+      }
     },
     postData() {
       this.axios({

+ 116 - 20
src/views/BidSystem/ContractList/edit.vue

@@ -487,6 +487,18 @@
               </div>
             </div>
           </FormItem>
+          <FormItem label="左右式">
+            <Select
+              v-model="tempItem.left_right_mode"
+              placeholder="请选择"
+              style="width: 120px"
+              size="small"
+            >
+              <Option :value="1" label="左式" />
+              <Option :value="2" label="右式" />
+            </Select>
+          </FormItem>
+
           <FormItem label="产品分类">
             <Select
               v-model="tempItem.type_id"
@@ -571,8 +583,9 @@
           >
             <span>属性{{ _index + 1 }}</span>
             <Select
-              :value="_item.id"
+              v-model="_item.id"
               size="small"
+              transfer
               @on-change="
                 (value) => handleAddPDTAttrChange(_item, _index, value)
               "
@@ -587,15 +600,16 @@
               </Option>
             </Select>
             <Select
-              :value="_item.process_detail"
+              v-model="_item.process_detail"
               filterable
               clearable
+              transfer
               label-in-value
               @on-change="
                 (value) => handleAddPDTAttrDetailChange(_item, _index, value)
               "
               size="small"
-              style="width: 80px"
+              style="width: 140px"
             >
               <Option
                 v-for="__item in _item.PDTProcessAttrDetailList"
@@ -713,6 +727,17 @@
               </div>
             </div>
           </FormItem>
+          <FormItem label="左右式">
+            <Select
+              v-model="PDTEdit.left_right_mode"
+              placeholder="请选择"
+              style="width: 120px"
+              size="small"
+            >
+              <Option :value="1" label="左式" />
+              <Option :value="2" label="右式" />
+            </Select>
+          </FormItem>
           <FormItem label="产品分类">
             <Select
               v-model="PDTEdit.type_id"
@@ -812,8 +837,9 @@
           >
             <span>属性{{ _index + 1 }}</span>
             <Select
-              :value="_item.id"
+              v-model="_item.id"
               size="small"
+              transfer
               @on-change="
                 (value) => handleAddPDTAttrChange(_item, _index, value)
               "
@@ -828,15 +854,16 @@
               </Option>
             </Select>
             <Select
-              :value="_item.process_detail"
+              v-model="_item.process_detail"
               filterable
               clearable
               label-in-value
+              transfer
               @on-change="
                 (value) => handleAddPDTAttrDetailChange(_item, _index, value)
               "
               size="small"
-              style="width: 80px"
+              style="width: 140px"
             >
               <Option
                 v-for="__item in _item.PDTProcessAttrDetailList"
@@ -977,7 +1004,7 @@
         </Form> -->
       </div>
       <div class="modal-footer" slot="footer">
-        <Button @click="showAddInputModal = false">取消</Button>
+        <Button @click="showAddInputModal = false">返回</Button>
         <Button type="primary" @click="handleAddInputConfirm">确认</Button>
       </div>
     </Modal>
@@ -1094,6 +1121,24 @@ export default {
           },
         },
         {
+          title: "左右式",
+          key: "left_right_mode",
+          align: "center",
+          tooltip: true,
+          minWidth: 80,
+          render: (h, params) => {
+            return h(
+              "span",
+              {},
+              params.row.left_right_mode == 1
+                ? "左式"
+                : params.row.left_right_mode == 2
+                ? "右式"
+                : ""
+            );
+          },
+        },
+        {
           title: "图号",
           key: "url_number",
           align: "center",
@@ -1237,6 +1282,7 @@ export default {
         url: "/api/order_area_list",
         params: {
           order_no,
+          type: 1,
         },
       }).then((res) => {
         this.formData = res.data;
@@ -1345,6 +1391,24 @@ export default {
             },
           },
           {
+            title: "左右式",
+            key: "left_right_mode",
+            align: "center",
+            tooltip: true,
+            minWidth: 80,
+            render: (h, params) => {
+              return h(
+                "span",
+                {},
+                params.row.left_right_mode == 1
+                  ? "左式"
+                  : params.row.left_right_mode == 2
+                  ? "右式"
+                  : ""
+              );
+            },
+          },
+          {
             title: "图号",
             key: "url_number",
             align: "center",
@@ -1394,6 +1458,7 @@ export default {
                   params: {
                     order_no: this.$route.query.order_no,
                     area_id: element.id,
+                    type: 1,
                   },
                 })
                 .then((res) => {
@@ -1478,6 +1543,7 @@ export default {
           .post("/api/order_area_product_edit", {
             order_no: this.$route.query.order_no,
             area_id: curObj.id || "",
+            type: 1,
             // num:curObj.num,
             // title:curObj.title,
             // unit:curObj.unit,
@@ -1766,6 +1832,7 @@ export default {
             order_no: this.$route.query.order_no,
             area_id: preObj[0].id || "",
             product: preObj[0].product,
+            type: 1,
           })
           .then((result) => {
             if (result.code == 200) {
@@ -1785,6 +1852,7 @@ export default {
                   params: {
                     order_no: this.$route.query.order_no,
                     area_id: item.id,
+                    type: 1,
                   },
                 })
                 .then((res) => {
@@ -1817,7 +1885,11 @@ export default {
         item.isCurrencyArea = true;
         this.axios
           .get("/api/order_area_list_product", {
-            params: { order_no: this.$route.query.order_no, area_id: item.id },
+            params: {
+              order_no: this.$route.query.order_no,
+              area_id: item.id,
+              type: 1,
+            },
           })
           .then((res) => {
             if (res.code == 200) {
@@ -1929,21 +2001,27 @@ export default {
       this.formData.special = JSON.parse(
         JSON.stringify(this.contactSpecValueList)
       );
-      this.formData.list.forEach((element) => {
-        element.special = JSON.parse(JSON.stringify(this.areaSpecValueList));
-        element.product.forEach((ele) => {
-          ele.special = JSON.parse(JSON.stringify(this.productSpecValueList));
+      this.formData.list.length > 0 &&
+        this.formData.list.forEach((element) => {
+          element.special = JSON.parse(JSON.stringify(this.areaSpecValueList));
+          element.product &&
+            element.product.length > 0 &&
+            element.product.forEach((ele) => {
+              ele.special = JSON.parse(
+                JSON.stringify(this.productSpecValueList)
+              );
+            });
         });
-      });
       let arr = [];
-      this.productSpecValueList.forEach((element) => {
-        arr.push({
-          title: element.key,
-          key: element.key,
-          align: "center",
-          minWidth: 80,
+      this.productSpecValueList.length > 0 &&
+        this.productSpecValueList.forEach((element) => {
+          arr.push({
+            title: element.key,
+            key: element.key,
+            align: "center",
+            minWidth: 80,
+          });
         });
-      });
       this.tableColumns = [
         { title: "序号", key: "index", align: "center", minWidth: 80 },
         {
@@ -2004,6 +2082,24 @@ export default {
           },
         },
         {
+          title: "左右式",
+          key: "left_right_mode",
+          align: "center",
+          tooltip: true,
+          minWidth: 80,
+          render: (h, params) => {
+            return h(
+              "span",
+              {},
+              params.row.left_right_mode == 1
+                ? "左式"
+                : params.row.left_right_mode == 2
+                ? "右式"
+                : ""
+            );
+          },
+        },
+        {
           title: "图号",
           key: "url_number",
           align: "center",

+ 67 - 6
src/views/BidSystem/ContractList/info.vue

@@ -152,6 +152,7 @@
               @click="handleOpenModal"
               size="small"
               type="primary"
+              style="margin-right:10px"
               v-show="areaItem.product && areaItem.product.length > 0"
               >下深化</Button
             >
@@ -704,6 +705,24 @@ export default {
           },
         },
         {
+          title: "左右式",
+          key: "left_right_mode",
+          align: "center",
+          tooltip: true,
+          minWidth: 80,
+          render: (h, params) => {
+            return h(
+              "span",
+              {},
+              params.row.left_right_mode == 1
+                ? "左式"
+                : params.row.left_right_mode == 2
+                ? "右式"
+                : ""
+            );
+          },
+        },
+        {
           title: "图号",
           key: "url_number",
           align: "center",
@@ -802,7 +821,12 @@ export default {
             });
           },
         },
-        { title: "左右式", key: "title", align: "center", minWidth: 100 },
+        {
+          title: "左右式",
+          key: "left_right_mode",
+          align: "center",
+          minWidth: 100,
+        },
         { title: "图号", key: "url_number", align: "center", minWidth: 100 },
         { title: "备注", key: "remark", align: "center", minWidth: 100 },
         { title: "备注", key: "remark", align: "center", minWidth: 100 },
@@ -915,6 +939,7 @@ export default {
         url: "/api/order_area_list",
         params: {
           order_no,
+          type: 1,
         },
       }).then((res) => {
         if (res.code == 200) {
@@ -1024,6 +1049,24 @@ export default {
               },
             },
             {
+              title: "左右式",
+              key: "left_right_mode",
+              align: "center",
+              tooltip: true,
+              minWidth: 80,
+              render: (h, params) => {
+                return h(
+                  "span",
+                  {},
+                  params.row.left_right_mode == 1
+                    ? "左式"
+                    : params.row.left_right_mode == 2
+                    ? "右式"
+                    : ""
+                );
+              },
+            },
+            {
               title: "图号",
               key: "url_number",
               align: "center",
@@ -1079,7 +1122,7 @@ export default {
             //       .get("/api/order_area_list_product", {
             //         params: {
             //           order_no: this.$route.query.order_no,
-            //           area_id: element.id,
+            //           area_id: element.id,type:1
             //         },
             //       })
             //       .then((res) => {
@@ -1239,6 +1282,24 @@ export default {
           },
         },
         {
+          title: "左右式",
+          key: "left_right_mode",
+          align: "center",
+          tooltip: true,
+          minWidth: 80,
+          render: (h, params) => {
+            return h(
+              "span",
+              {},
+              params.row.left_right_mode == 1
+                ? "左式"
+                : params.row.left_right_mode == 2
+                ? "右式"
+                : ""
+            );
+          },
+        },
+        {
           title: "图号",
           key: "url_number",
           align: "center",
@@ -1297,7 +1358,7 @@ export default {
     getListData() {
       this.axios
         .get("/api/order_area_detail_list?", {
-          params: { order_no: this.$route.query.order_no, ...this.searchData },
+          params: { order_no: this.$route.query.order_no, ...this.searchData,type:1},
         })
         .then((res) => {
           this.listTableData = res.data.data;
@@ -1370,8 +1431,7 @@ export default {
       this.getListData();
     },
     handleHiddenCurrencyArea(item, index) {
-      console.log("item :>> ", item);
-      item.product = [];
+      item.isCurrencyArea = false
       this.$forceUpdate();
     },
     // 展示区域产品
@@ -1392,6 +1452,7 @@ export default {
             params: {
               order_no: this.$route.query.order_no,
               area_id: item.id,
+                    type: 1,
             },
           })
           .then((res) => {
@@ -1428,7 +1489,7 @@ export default {
         item.isCurrencyArea = true;
         this.axios
           .get("/api/order_area_list_product", {
-            params: { order_no: this.$route.query.order_no, area_id: item.id },
+            params: { order_no: this.$route.query.order_no, area_id: item.id ,type:1},
           })
           .then((res) => {
             if (res.code == 200) {

+ 66 - 24
src/views/BidSystem/ContractList/list.vue

@@ -257,17 +257,44 @@ export default {
           align: "center",
           key: "state",
           minWidth: 100,
+          // { label: "安装", value: 16 },
           render: (h, params) =>
             h(
               "span",
               {},
-              params.row.state == 0
-                ? "待审核"
-                : params.row.state == 1
-                ? "待拆单"
+              params.row.state == 1
+                ? "订单未审核"
                 : params.row.state == 2
-                ? "待生产"
-                : "已完成"
+                ? "订单审核中"
+                : params.row.state == 3
+                ? "订单通过"
+                : params.row.state == 4
+                ? "深化未审核"
+                : params.row.state == 5
+                ? "深化审核中"
+                : params.row.state == 6
+                ? "深化通过"
+                : params.row.state == 7
+                ? "拆单未审核"
+                : params.row.state == 8
+                ? "拆单审核中"
+                : params.row.state == 9
+                ? "拆单通过"
+                : params.row.state == 10
+                ? "生产未审核"
+                : params.row.state == 11
+                ? "生产审核中"
+                : params.row.state == 12
+                ? "到生产计划"
+                : params.row.state == 13
+                ? "派工"
+                : params.row.state == 14
+                ? "包装"
+                : params.row.state == 15
+                ? "发货"
+                : params.row.state == 16
+                ? "安装"
+                : ""
             ),
         },
         {
@@ -604,22 +631,25 @@ export default {
         this.loading = false;
         this.tableData = res.data.data;
         this.total = res.data.total;
-        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)
-        );
+        this.handleSetHeader(res);
       });
     },
+    handleSetHeader(res) {
+      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)
+      );
+    },
     setupTableHeader() {
       this.showModal = true;
       return;
@@ -743,10 +773,22 @@ export default {
           serverName: "state",
           value: "",
           option: [
-            { label: "待审核", value: 0 },
-            { label: "待拆单", value: 1 },
-            { label: "待生产", value: 2 },
-            { label: "已完成", value: 3 },
+            { label: "订单未审核", value: 1 },
+            { label: "订单审核中", value: 2 },
+            { label: "订单通过", value: 3 },
+            { label: "深化未审核", value: 4 },
+            { label: "深化审核中", value: 5 },
+            { label: "深化通过", value: 6 },
+            { label: "拆单未审核", value: 7 },
+            { label: "拆单审核中", value: 8 },
+            { label: "拆单通过", value: 9 },
+            { label: "生产未审核", value: 10 },
+            { label: "生产审核中", value: 11 },
+            { label: "到生产计划", value: 12 },
+            { label: "派工", value: 13 },
+            { label: "包装", value: 14 },
+            { label: "发货", value: 15 },
+            { label: "安装", value: 16 },
           ],
         },
         {

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 625 - 246
src/views/BidSystem/DeepeningOrder/detail.vue


+ 223 - 174
src/views/BidSystem/DeepeningOrder/edit.vue

@@ -1,16 +1,22 @@
 <template>
   <div class="BidSystemDeepeningOrderEdit">
-    <Toptitle title="深化单详情">
+    <Toptitle :title="type == 1 ? '深化单深化编辑' : '深化单深化详情'">
       <slot name="titleButton">
-        <Button @click="goback()"
-                type="primary"
-                ghost
-                style="margin-right: 10px">取消</Button>
-        <Button @click="postData()"
-                type="primary"
-                ghost
-                :disabled="isCheck"
-                style="margin-right: 10px">保存</Button>
+        <Button
+          @click="goback()"
+          type="primary"
+          ghost
+          style="margin-right: 10px"
+          >返回</Button
+        >
+        <Button
+          @click="postData()"
+          type="primary"
+          ghost
+          v-show="type == 1"
+          style="margin-right: 10px"
+          >保存</Button
+        >
       </slot>
     </Toptitle>
     <div class="top_search">
@@ -24,14 +30,16 @@
       <div>
         <span>图纸:</span>
         <div>
-          <span v-for="item in formData.url"
-                :key="item"
-                @click="checkImg(formData.url)">
-            <img :src="$store.state.ip + item"
-                 alt="" />
+          <span
+            v-for="item in formData.url"
+            :key="item"
+            @click="checkImg(formData.url)"
+          >
+            <img :src="$store.state.ip + item" alt="" />
           </span>
         </div>
       </div>
+      <div><span>左右式:</span>{{ formData.left_right_mode }}</div>
       <div><span>价格:</span>{{ formData.price }}</div>
       <div><span>备注:</span>{{ formData.remark }}</div>
     </div>
@@ -50,10 +58,13 @@
                     :disabled="isCheck"
                     style="margin-right: 10px">导入</Button>
           </Upload> -->
-          <Button type="primary"
-                  @click="handleAddList"
-                  :disabled="isCheck"
-                  style="margin-right: 10px">新增</Button>
+          <Button
+            type="primary"
+            @click="handleAddList"
+            v-show="type == 1"
+            style="margin-right: 10px"
+            >新增</Button
+          >
         </div>
       </div>
       <div class="table-data-content">
@@ -154,139 +165,172 @@
             </template>
           </vxe-table-column>
         </vxe-table> -->
-        <Table :columns="tableColumns"
-               :data="tableData"
-               border>
-          <template slot="houseSet"
-                    slot-scope="{ index }">
-            <Input type="text"
-                   size="small"
-                   :disabled="isCheck"
-                   v-model="tableData[index].house"
-                   placeholder="楼栋" />
+        <Table :columns="tableColumns" :data="tableData" border>
+          <template slot="houseSet" slot-scope="{ index }">
+            <Input
+              type="text"
+              size="small"
+              v-if="type == 1"
+              v-model="tableData[index].house"
+              placeholder="楼栋"
+            />
+            <span v-else>{{ tableData[index].house }}</span>
           </template>
-          <template slot="unitSet"
-                    slot-scope="{ index }">
-            <Input type="text"
-                   size="small"
-                   :disabled="isCheck"
-                   v-model="tableData[index].unit"
-                   placeholder="单元" />
+          <template slot="unitSet" slot-scope="{ index }">
+            <Input
+              type="text"
+              size="small"
+              v-if="type == 1"
+              v-model="tableData[index].unit"
+              placeholder="单元"
+            />
+            <span v-else>{{ tableData[index].unit }}</span>
           </template>
-          <template slot="layerSet"
-                    slot-scope="{ index }">
-            <Input type="text"
-                   size="small"
-                   :disabled="isCheck"
-                   v-model="tableData[index].layer"
-                   placeholder="楼层" />
+          <template slot="layerSet" slot-scope="{ index }">
+            <Input
+              type="text"
+              size="small"
+              v-if="type == 1"
+              v-model="tableData[index].layer"
+              placeholder="楼层"
+            />
+            <span v-else>{{ tableData[index].layer }}</span>
           </template>
-          <template slot="numberSet"
-                    slot-scope="{ index }">
-            <Input type="text"
-                   size="small"
-                   :disabled="isCheck"
-                   v-model="tableData[index].number"
-                   placeholder="房间号" />
+          <template slot="numberSet" slot-scope="{ index }">
+            <Input
+              type="text"
+              size="small"
+              :disabled="isCheck"
+              v-if="type == 1"
+              v-model="tableData[index].number"
+              placeholder="房间号"
+            />
+            <span v-else>{{ tableData[index].number }}</span>
           </template>
-          <template slot="titleSet"
-                    slot-scope="{ index }">
-            <Input type="text"
-                   size="small"
-                   :disabled="isCheck"
-                   v-model="tableData[index].title"
-                   placeholder="产品" />
+          <template slot="titleSet" slot-scope="{ index }">
+            <Input
+              type="text"
+              size="small"
+              :disabled="isCheck"
+              v-if="type == 1"
+              v-model="tableData[index].title"
+              placeholder="产品"
+            />
+            <span v-else>{{ tableData[index].title }}</span>
           </template>
-          <template slot="priceSet"
+          <!-- <template slot="priceSet"
                     slot-scope="{ index }">
             <Input type="text"
                    size="small"
                    :disabled="isCheck"
                    v-model="tableData[index].price"
                    placeholder="价格" />
+          </template> -->
+          <template slot="product_unitSet" slot-scope="{ index }">
+            <Input
+              type="text"
+              size="small"
+              :disabled="isCheck"
+              v-if="type == 1"
+              v-model="tableData[index].product_unit"
+              placeholder="单位"
+            />
+            <span v-else>{{ tableData[index].product_unit }}</span>
           </template>
-          <template slot="product_unitSet"
-                    slot-scope="{ index }">
-            <Input type="text"
-                   size="small"
-                   :disabled="isCheck"
-                   v-model="tableData[index].product_unit"
-                   placeholder="单位" />
-          </template>
-          <template slot="positionSet"
-                    slot-scope="{ index }">
-            <Input type="text"
-                   size="small"
-                   :disabled="isCheck"
-                   v-model="tableData[index].position"
-                   placeholder="位置" />
+          <template slot="positionSet" slot-scope="{ index }">
+            <Input
+              type="text"
+              size="small"
+              :disabled="isCheck"
+              v-if="type == 1"
+              v-model="tableData[index].position"
+              placeholder="位置"
+            />
+            <span v-else>{{ tableData[index].position }}</span>
           </template>
-          <template slot="urlSet"
-                    slot-scope="{ index }">
+          <template slot="urlSet" slot-scope="{ index }">
             <!-- <Input type="text"
                    size="small"
                    v-model="row.url"
                    placeholder="图纸" /> -->
             <div class="product-img">
               <div class="product-add">
-                <div class="items"
-                     v-for="(_item, _index) of tableData[index].url"
-                     :key="_index">
-                  <img @click="looks(_item)"
-                       v-for="(el, idx) in tableData[index].url"
-                       :key="idx"
-                       :src="$store.state.ip + el"
-                       alt="" />
-                  <Icon size="20"
-                        @click="delItems(_index, tableData[index].url)"
-                        class="delete-img"
-                        type="ios-close-circle" />
+                <div
+                  class="items"
+                  v-for="(_item, _index) of tableData[index].url"
+                  :key="_index"
+                >
+                  <img
+                    @click="looks(_item)"
+                    v-for="(el, idx) in tableData[index].url"
+                    :key="idx"
+                    :src="$store.state.ip + el"
+                    alt=""
+                  />
+                  <Icon
+                    size="20"
+                    v-show="type == 1"
+                    @click="delItems(_index, tableData[index].url)"
+                    class="delete-img"
+                    type="ios-close-circle"
+                  />
                 </div>
-                <div class="add-items">
+                <div class="add-items" v-if="type == 1">
                   <div class="_item">
-                    <Icon size="50"
-                          type="ios-add" />
+                    <Icon size="50" type="ios-add" />
                   </div>
-                  <input @change="changeIpt($event, tableData[index])"
-                         :disabled="isCheck"
-                         type="file"
-                         class="ipt" />
+                  <input
+                    @change="changeIpt($event, tableData[index])"
+                    type="file"
+                    class="ipt"
+                  />
                 </div>
               </div>
             </div>
           </template>
-          <template slot="url_numberSet"
-                    slot-scope="{ index }">
-            <Input type="text"
-                   size="small"
-                   :disabled="isCheck"
-                   v-model="tableData[index].url_number"
-                   placeholder="图号" />
+          <template slot="url_numberSet" slot-scope="{ index }">
+            <Input
+              type="text"
+              size="small"
+              v-if="type == 1"
+              v-model="tableData[index].url_number"
+              placeholder="图号"
+            />
+            <span v-else>{{ tableData[index].url_number }}</span>
           </template>
-          <template slot="modelSet"
-                    slot-scope="{ index }">
-            <Input type="text"
-                   size="small"
-                   :disabled="isCheck"
-                   v-model="tableData[index].model"
-                   placeholder="型号" />
+          <template slot="modelSet" slot-scope="{ index }">
+            <Input
+              type="text"
+              size="small"
+              v-if="type == 1"
+              v-model="tableData[index].model"
+              placeholder="型号"
+            />
+            <span v-else>{{ tableData[index].model }}</span>
           </template>
-          <template slot="set"
-                    slot-scope="{ index }">
-            <a style="margin: 0 5px; color: red"
-               v-show="type!=2"
-               @click="handleSet(tableData[index], index)">删除</a>
+          <template slot="set" slot-scope="{ index }">
+            <a
+              style="margin: 0 5px; color: red"
+              v-show="type != 2"
+              @click="handleSet(tableData[index], index)"
+              >删除</a
+            >
           </template>
-          <div v-for="item in measureList"
-               :key="item.e_title"
-               :slot="'formula_'+item.e_title"
-               slot-scope="{ index }">
+          <div
+            v-for="item in measureList"
+            :key="item.e_title"
+            :slot="'formula_' + item.e_title"
+            slot-scope="{ index }"
+          >
             <div>
-              <Input :disabled="type == 2"
-                     @on-focus="openKey(index, item.e_title)"
-                     clearable
-                     :placeholder='item.title'
-                     v-model="tableData[index][item.e_title]"></Input>
+              <Input
+                v-if="type == 1"
+                @on-focus="openKey(index, item.e_title)"
+                clearable
+                :placeholder="item.title"
+                v-model="tableData[index][item.e_title]"
+              />
+              <span v-else>{{ tableData[index][item.e_title]}}</span>
             </div>
           </div>
           <!-- <div slot="formula_H"
@@ -322,15 +366,19 @@
         </Table>
       </div>
     </div>
-    <Modal v-model="showKey"
-           :width="1250"
-           :mask-closable="false"
-           :closable="false">
+    <Modal
+      v-model="showKey"
+      :width="1250"
+      :mask-closable="false"
+      :closable="false"
+    >
       <div>
-        <KeyBoard :rightData="measureList"
-                  @cancel="cancelKey"
-                  @success="successKey"
-                  class="key-co" />
+        <KeyBoard
+          :rightData="measureList"
+          @cancel="cancelKey"
+          @success="successKey"
+          class="key-co"
+        />
       </div>
       <div slot="footer"></div>
     </Modal>
@@ -348,7 +396,7 @@ export default {
   },
   props: {},
   // import引入的组件需要注入到对象中才能使用
-  data () {
+  data() {
     // 这里存放数据
     return {
       headers: { Authorization: localStorage.getItem("token") },
@@ -390,13 +438,13 @@ export default {
           minWidth: 100,
           slot: "titleSet",
         },
-        {
-          title: "价格",
-          key: "price",
-          align: "center",
-          minWidth: 100,
-          slot: "priceSet",
-        },
+        // {
+        //   title: "价格",
+        //   key: "price",
+        //   align: "center",
+        //   minWidth: 100,
+        //   slot: "priceSet",
+        // },
         {
           title: "计量单位",
           key: "product_unit",
@@ -432,6 +480,7 @@ export default {
           minWidth: 120,
           slot: "modelSet",
         },
+        this.$route.query.type==1?
         {
           title: "操作",
           key: "set",
@@ -439,10 +488,10 @@ export default {
           minWidth: 120,
           fixed: "right",
           slot: "set",
-        },
+        }:{width:1},
       ],
       tableData: [],
-      type: "",
+      type: this.$route.query.type,
       isCheck: false,
       order_no: "",
       order_area_id: "",
@@ -453,7 +502,7 @@ export default {
     };
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
-  created () {
+  created() {
     this.type = this.$route.query.type;
     this.$route.query.type == 1
       ? (this.isCheck = false)
@@ -468,28 +517,28 @@ export default {
     );
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
-  mounted () { },
+  mounted() {},
   methods: {
-    successKey (str) {
+    successKey(str) {
       // this.$nextTick(()=>{
       //   console.log(this.tableData[this.attrindex])
       //   this.tableData[this.attrindex][this.attrName] = str;
       // })
-      let tableData = JSON.parse(JSON.stringify(this.tableData))
+      let tableData = JSON.parse(JSON.stringify(this.tableData));
       tableData[this.attrindex][this.attrName] = str;
-      this.tableData = tableData
+      this.tableData = tableData;
       this.showKey = false;
     },
-    cancelKey () {
+    cancelKey() {
       this.showKey = false;
     },
-    openKey (row, attr) {
-      console.log(row, attr)
+    openKey(row, attr) {
+      console.log(row, attr);
       this.showKey = true;
       this.attrindex = row;
       this.attrName = attr;
     },
-    checkImg (item) {
+    checkImg(item) {
       let list = [];
       item.forEach((el) => {
         list.push({ img_url: el });
@@ -505,8 +554,8 @@ export default {
       // }
       // })
     },
-    handleUpLoad () { },
-    handleAddList () {
+    handleUpLoad() {},
+    handleAddList() {
       this.tableData.push({
         house: "",
         unit: "",
@@ -525,7 +574,7 @@ export default {
         el.index = index + 1;
       });
     },
-    initData (order_no, order_area_id, order_area_product_id) {
+    initData(order_no, order_area_id, order_area_product_id) {
       this.axios({
         method: "get",
         url: "/api/order_area_product_list",
@@ -540,9 +589,9 @@ export default {
           this.tableData = res.data.detail;
           this.tableData.forEach((el, index) => {
             el.index = index + 1;
-            let tempM = el.measure.split('*')
-            tempM.forEach(item => {
-              el[item.substring(0, 1)] = item.substring(1)
+            let tempM = el.measure.split("*");
+            tempM.forEach((item) => {
+              el[item.substring(0, 1)] = item.substring(1);
             });
           });
           let tempArr = [];
@@ -559,12 +608,12 @@ export default {
           });
           this.tableColumns = [...this.tableColumns, ...tempArr];
         })
-        .catch((err) => { });
+        .catch((err) => {});
     },
-    goback () {
+    goback() {
       this.$router.go(-1);
     },
-    postData () {
+    postData() {
       this.tableData.forEach((element) => {
         let measure = "";
         for (const key in element) {
@@ -591,13 +640,13 @@ export default {
           this.$Message.success(res.msg);
           this.goback();
         })
-        .catch((err) => { });
+        .catch((err) => {});
     },
-    uploadError (err) {
+    uploadError(err) {
       this.$Message.error(err.msg || "上传失败");
     },
     //导入成功
-    uploadSuccess (res) {
+    uploadSuccess(res) {
       if (res.code == 200) {
         this.$Message.success(res.msg || "上传成功");
         // const temp = res.data;
@@ -606,13 +655,13 @@ export default {
         this.$Message.warning(res.msg || "上传失败");
       }
     },
-    handleSet (row, index) {
+    handleSet(row, index) {
       this.tableData.splice(index, 1);
       this.tableData.forEach((el, index) => {
         el.index = index + 1;
       });
     },
-    looks (img) {
+    looks(img) {
       const array = [{ img_url: img }];
       this.$previewImg({
         list: array,
@@ -621,15 +670,15 @@ export default {
         baseTitleField: "",
       });
     },
-    delItems (n, arr) {
+    delItems(n, arr) {
       arr.splice(n, 1);
     },
-    changeIpt (e, row) {
+    changeIpt(e, row) {
       let file = e.target.files[0];
       this.postImg(file, row);
       e.target.value = null;
     },
-    postImg (file, row) {
+    postImg(file, row) {
       let formData = new FormData();
       formData.append("file", file);
       this.axios.post("/api/upload_pic", formData).then((res) => {
@@ -641,17 +690,17 @@ export default {
   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>
 .BidSystemDeepeningOrderEdit {
   position: relative;
   .top_search {

+ 24 - 11
src/views/BidSystem/DeepeningOrder/info.vue

@@ -10,7 +10,6 @@
         >
         <Button
           @click="showSupModal = true"
-          v-show="!isChecked"
           type="primary"
           style="margin-right: 10px"
           >项目辅料</Button
@@ -57,6 +56,7 @@
               v-for="_item in warningList"
               :key="_item.id"
               v-show="_item.id == formData.warning_state"
+              :style="{ color: _item.color }"
               style="font-weight:bold"
               >{{ _item.title }}</span
             >
@@ -374,18 +374,19 @@
     <Modal title="项目辅料" v-model="showSupModal" :width="400">
       <div>
         <div class="supModalBtn">
-          <Button @click="handleAddSup" type="primary">新增</Button>
+          <!-- <Button @click="handleAddSup" type="primary">新增</Button> -->
         </div>
         <Table :columns="supTableColumns" :data="supTableData" border>
           <template slot="combine" slot-scope="{ row }">
-            <Select v-model="row.order_no" size="small">
+            {{row.order_no}}
+            <!-- <Select v-model="row.order_no" size="small">
               <Option
                 v-for="item in combineList"
                 :value="item.id"
                 :key="item.id"
                 >{{ item.title }}</Option
               >
-            </Select>
+            </Select> -->
           </template>
           <template slot="supSet" slot-scope="{ row, index }">
             <a
@@ -397,7 +398,7 @@
         </Table>
       </div>
       <div class="modal-footer" slot="footer">
-        <Button @click="showSupModal = false">取消</Button>
+        <!-- <Button @click="showSupModal = false">取消</Button> -->
         <Button type="primary" @click="showSupModal = false">确认</Button>
       </div>
     </Modal>
@@ -696,7 +697,7 @@ export default {
           ],
         },
       ],
-      supTableData: [{}],
+      supTableData: [],
       showPDTModal: false,
       showSupModal: false,
       formData: {
@@ -790,9 +791,15 @@ export default {
       ],
       productDetail: {},
       supTableColumns: [
-        { title: "序号", key: "name", align: "center" },
-        { title: "组合名称", key: "name", align: "center", slot: "combine" },
-        { title: "操作", key: "name", align: "center", slot: "supSet" },
+        { title: "序号", type: "index", align: "center" },
+        {
+          title: "辅料名称",
+          key: "title",
+          align: "center",
+          slot: "combine",
+          minWidth: 60,
+        },
+        { title: "操作", key: "set", align: "center", slot: "supSet" },
       ],
       listTableColumns: [
         { type: "selection", align: "center", minWidth: 100 },
@@ -960,6 +967,7 @@ export default {
         url: "/api/order_area_list",
         params: {
           order_no,
+          type: 2,
         },
       }).then((res) => {
         this.formData = res.data;
@@ -1090,7 +1098,7 @@ export default {
           //       .get("/api/order_area_list_product", {
           //         params: {
           //           order_no: this.$route.query.order_no,
-          //           area_id: element.id,
+          //           area_id: element.id,type:1
           //         },
           //       })
           //       .then((res) => {
@@ -1423,6 +1431,7 @@ export default {
             params: {
               order_no: this.$route.query.order_no,
               area_id: item.id,
+              type: 2,
             },
           })
           .then((res) => {
@@ -1453,7 +1462,11 @@ export default {
         item.isCurrencyArea = true;
         this.axios
           .get("/api/order_area_list_product", {
-            params: { order_no: this.$route.query.order_no, area_id: item.id },
+            params: {
+              order_no: this.$route.query.order_no,
+              area_id: item.id,
+              type: 2,
+            },
           })
           .then((res) => {
             if (res.code == 200) {

+ 13 - 12
src/views/BidSystem/DeepeningOrder/list.vue

@@ -64,9 +64,9 @@
             @click="handleSet(row, index, 1)"
             >下拆单</a
           >
+            <!-- :disabled="row.sub_status != 1" -->
           <a
             style="margin: 0 5px"
-            :disabled="row.sub_status != 1"
             @click="handleSet(row, index, 2)"
             >编辑</a
           >
@@ -102,7 +102,7 @@
         </div>
       </template>
     </FullPage>
-    <Modal v-model="processModal" title="确认?">
+    <Modal v-model="processModal" title="下拆单">
       <div>
         <div class="process_modal">
           <span>拆单人员:</span>
@@ -225,13 +225,13 @@ export default {
             h(
               "span",
               {},
-              params.row.state == 0
-                ? "待审核"
-                : params.row.state == 1
-                ? "待拆单"
+              params.row.state == 1
+                ? "未深化"
                 : params.row.state == 2
-                ? "待生产"
-                : "已完成"
+                ? "深化中"
+                : params.row.state == 3
+                ? "深化完成"
+                : ""
             ),
         },
         {
@@ -302,6 +302,7 @@ export default {
           },
         }).then((res) => {
           this.$Message.success(res.msg);
+          this.processModal = false
           this.getData(this.proxyObj);
         });
       } else {
@@ -459,10 +460,10 @@ export default {
           serverName: "state",
           value: "",
           option: [
-            { label: "待审核", value: 0 },
-            { label: "待拆单", value: 1 },
-            { label: "待生产", value: 2 },
-            { label: "完成", value: 3 },
+            { label: "全部", value: 0 },
+            { label: "未深化", value: 1 },
+            { label: "深化中", value: 2 },
+            { label: "深化完成", value: 3 },
           ],
         },
         {

+ 1 - 0
src/views/MeasurementOrderMannage/list.vue

@@ -66,6 +66,7 @@
              @click="goPage(row,1)">查看</a>
           <a v-if='persimissionData["下生产"]||persimissionData.all'
              style="margin:0 5px"
+             v-show="row.state<3"
              @click="openModal(row)">下生产</a>
         </div>
       </template>

+ 1 - 1
src/views/OrderMannage/BusinessOrderlist/Decorationlist.vue

@@ -230,7 +230,7 @@ export default {
       this.dowmMeasurement({
         params: this.postInfo,
         title: '测量',
-        url: 'orders_set_measure',
+        url: '/api/orders_set_measure',
         then: () => {
           this.postInfo = {};
           this.selectIds = [];

+ 1 - 1
src/views/OrderMannage/BusinessOrderlist/details.vue

@@ -294,7 +294,7 @@ export default {
       this.dowmMeasurement({
         params: this.postInfo,
         title: '测量',
-        url: 'orders_set_measure',
+        url: '/api/orders_set_measure',
         then: () => {
           this.postInfo = {};
           this.selectIds = [];

+ 48 - 128
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -2005,7 +2005,6 @@
                   </FormItem>
                   <FormItem>
                     <a
-                      v-show="isCheck"
                       style="color: red"
                       @click="
                         handleExtraDele(modalData.metalArray, element, idx)
@@ -2081,7 +2080,6 @@
                   <FormItem>
                     <a
                       style="color: red"
-                      v-show="isCheck"
                       @click="handleExtraDele(modalData.extArray, element, idx)"
                       >删除</a
                     >
@@ -2978,6 +2976,7 @@ export default {
     },
     handleExtraDele(array, row, index) {
       array.splice(index, 1);
+      this.$forceUpdate()
     },
     getCoumstList() {
       this.axios("/api/bpp_list").then((res) => {
@@ -4196,144 +4195,18 @@ export default {
               element.high = JSON.parse(JSON.stringify(element.high));
             } else {
               element.high = eval(element.high);
-              // 修改超标单价
-              product.overdraft.forEach((item) => {
-                //  type 1 高 2 宽 3 厚
-                if (item.type == 3) {
-                  if (item.part_id == element.part_id) {
-                    if (element.high > item.min && element.high < item.max) {
-                      if (!item.formula_value) {
-                        item.formula_value = "";
-                      }
-                      try {
-                        item.formula_value = eval(item.formula);
-                      } catch (error) {
-                        if (item.formula.indexOf(cur_measure) != -1) {
-                          if (!item.formula_temp) {
-                            item.formula_temp = JSON.parse(
-                              JSON.stringify(item.formula)
-                            );
-                          }
-                          item.formula_temp = item.formula.replace(
-                            new RegExp(cur_measure, "g"),
-                            element.high || ""
-                          );
-                          // 判断是否还存在字母
-                          let flag_formula = true;
-                          product.measure.forEach((_measure) => {
-                            if (
-                              item.formula_temp.indexOf(_measure.e_title) != -1
-                            ) {
-                              flag_formula = false;
-                            }
-                          });
-                          if (flag_formula) {
-                            item.formula_value = eval(item.formula_temp);
-                          }
-                        }
-                      }
-                      product.over_price =
-                        product.over_price + (item.formula_value * 1 || 0);
-                    }
-                  }
-                }
-              });
               element.high += "";
             }
             if (flag_long) {
               element.long = JSON.parse(JSON.stringify(element.long));
             } else {
               element.long = eval(element.long);
-              // 修改超标单价
-              product.overdraft.forEach((item) => {
-                //  type 1 高 2 宽 3 厚
-                if (item.type == 1) {
-                  if (item.part_id == element.part_id) {
-                    if (element.long > item.min && element.long < item.max) {
-                      if (!item.formula_value) {
-                        item.formula_value = "";
-                      }
-                      try {
-                        item.formula_value = eval(item.formula);
-                      } catch (error) {
-                        if (item.formula.indexOf(cur_measure) != -1) {
-                          if (!item.formula_temp) {
-                            item.formula_temp = JSON.parse(
-                              JSON.stringify(item.formula)
-                            );
-                          }
-                          item.formula_temp = item.formula.replace(
-                            new RegExp(cur_measure, "g"),
-                            element.long || ""
-                          );
-                          // 判断是否还存在字母
-                          let flag_formula = true;
-                          product.measure.forEach((_measure) => {
-                            if (
-                              item.formula_temp.indexOf(_measure.e_title) != -1
-                            ) {
-                              flag_formula = false;
-                            }
-                          });
-                          if (flag_formula) {
-                            item.formula_value = eval(item.formula_temp);
-                          }
-                        }
-                      }
-                      product.over_price =
-                        product.over_price + (item.formula_value * 1 || 0);
-                    }
-                  }
-                }
-              });
               element.long += "";
             }
             if (flag_wide) {
               element.wide = JSON.parse(JSON.stringify(element.wide));
             } else {
               element.wide = eval(element.wide);
-              // 修改超标单价
-              product.overdraft.forEach((item) => {
-                //  type 1 高 2 宽 3 厚
-                if (item.type == 2) {
-                  if (item.part_id == element.part_id) {
-                    if (element.wide > item.min && element.wide < item.max) {
-                      if (!item.formula_value) {
-                        item.formula_value = "";
-                      }
-                      try {
-                        item.formula_value = eval(item.formula);
-                      } catch (error) {
-                        if (item.formula.indexOf(cur_measure) != -1) {
-                          if (!item.formula_temp) {
-                            item.formula_temp = JSON.parse(
-                              JSON.stringify(item.formula)
-                            );
-                          }
-                          item.formula_temp = item.formula.replace(
-                            new RegExp(cur_measure, "g"),
-                            element.wide || ""
-                          );
-                          // 判断是否还存在字母
-                          let flag_formula = true;
-                          product.measure.forEach((_measure) => {
-                            if (
-                              item.formula_temp.indexOf(_measure.e_title) != -1
-                            ) {
-                              flag_formula = false;
-                            }
-                          });
-                          if (flag_formula) {
-                            item.formula_value = eval(item.formula_temp);
-                          }
-                        }
-                      }
-                      product.over_price =
-                        product.over_price + (item.formula_value * 1 || 0);
-                    }
-                  }
-                }
-              });
               element.wide += "";
             }
             element.part_detail.forEach((elem) => {
@@ -4405,6 +4278,52 @@ export default {
             });
           }
         });
+        product.part.map((item) => {
+          const cur_part = product.overdraft.filter(
+            (v) => v.part_id == item.part_id
+          );
+          cur_part.length > 0 &&
+            cur_part.map((element) => {
+              // 1 高 2 宽 3 厚
+              if (
+                element.type == 1 &&
+                item.long > element.min &&
+                item.long < element.max
+              ) {
+                item.formula_temp = JSON.parse(JSON.stringify(element.formula));
+                item.formula_temp = item.formula_temp.replace(/H/g, item.long);
+                item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
+                item.formula_temp = item.formula_temp.replace(/T/g, item.high);
+                item.formula_value = eval(item.formula_temp);
+                product.over_price += item.formula_value * 1 || 0;
+              }
+              if (
+                element.type == 2 &&
+                item.wide > element.min &&
+                item.wide < element.max
+              ) {
+                item.formula_temp = JSON.parse(JSON.stringify(element.formula));
+                item.formula_temp = item.formula_temp.replace(/H/g, item.long);
+                item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
+                item.formula_temp = item.formula_temp.replace(/T/g, item.high);
+                item.formula_value = eval(item.formula_temp);
+                product.over_price += item.formula_value * 1 || 0;
+              }
+              if (
+                element.type == 3 &&
+                item.high > element.min &&
+                item.high < element.max
+              ) {
+                item.formula_temp = JSON.parse(JSON.stringify(element.formula));
+                item.formula_temp = item.formula_temp.replace(/H/g, item.long);
+                item.formula_temp = item.formula_temp.replace(/W/g, item.wide);
+                item.formula_temp = item.formula_temp.replace(/T/g, item.high);
+                item.formula_value = eval(item.formula_temp);
+                product.over_price += item.formula_value * 1 || 0;
+              }
+            });
+        });
+
         //修改核算数量
         // 如果没有核算数量公式,核算数量取产品数量
         if (product.num_formula == "") {
@@ -4430,6 +4349,7 @@ export default {
             (product.ext_price * 1 || 0);
           product.price = product.price.toFixed(2);
         }
+
         this.$forceUpdate();
       }
     },

+ 39 - 20
src/views/OrderMannage/BusinessOrderlist/list.vue

@@ -47,14 +47,14 @@
           v-if="persimissionData['批量下测量'] || persimissionData.all"
           type="primary"
           style="margin-right: 10px"
-          @click="openLower(selectIds, '测量', 'orders_set_measure')"
+          @click="openLower(selectIds, '测量', '/api/orders_set_measure')"
           ghost
           >批量下测量</Button
         >
         <Button
           v-if="persimissionData['批量下生产'] || persimissionData.all"
           type="primary"
-          @click="openLower(selectIds, '生产', 'order_oa_people')"
+          @click="openLower(selectIds, '生产', '/api/order_oa_people')"
           ghost
           >批量下生产</Button
         >
@@ -102,14 +102,14 @@
         <div>
           <a
             v-if="persimissionData['收款'] || persimissionData.all"
-            @click="handleOpenCharge(row, '收款', 'orders_set_measure')"
+            @click="handleOpenCharge(row, '收款', '/api/orders_set_measure')"
             style="margin: 0 5px"
             >收款</a
           >
           <a
             v-if="persimissionData['下生产'] || persimissionData.all"
-            v-show="row.state<4"
-            @click="openLower(row, '生产', 'order_oa_people')"
+            v-show="row.state < 4"
+            @click="openLower(row, '生产', '/api/order_oa_people')"
             style="margin: 0 5px"
             >下生产</a
           >
@@ -917,12 +917,12 @@ export default {
     } else {
       this.$route.meta.keepAlive = true;
     }
-    next()
+    next();
   },
   beforeRouteEnter(to, from, next) {
-    next(vm=>{
-      vm.getData(vm.proxyObj)
-    })
+    next((vm) => {
+      vm.getData(vm.proxyObj);
+    });
   },
   methods: {
     init(row) {
@@ -1023,19 +1023,38 @@ export default {
       this.postInfo.order_no = Array.isArray(row)
         ? row.join(",")
         : row.order_no;
-      this.dowmMeasurement({
-        url,
-        title,
-        params: this.postInfo,
-        then: () => {
-          this.selectIds = [];
-          this.postInfo = {};
-          this.getData(this.proxyObj);
-        },
-        cancel: () => {
-          this.postInfo = {};
+      this.$Modal.confirm({
+        title: "确认下生产?",
+        content: "确认",
+        onOk: () => {
+          this.axios({
+            method: "post",
+            url,
+            data: {
+              order_no:this.postInfo.order_no
+            },
+          }).then((res) => {
+            if (res.code == 200) {
+              this.$Message.success(res.msg);
+              this.getData(this.proxyObj);
+            }
+          });
         },
+        onCancel: () => {},
       });
+      // this.dowmMeasurement({
+      //   url,
+      //   title,
+      //   params: this.postInfo,
+      //   then: () => {
+      //     this.selectIds = [];
+      //     this.postInfo = {};
+      //     this.getData(this.proxyObj);
+      //   },
+      //   cancel: () => {
+      //     this.postInfo = {};
+      //   },
+      // });
     },
     selectTable(e) {
       let result = [];

+ 3 - 3
src/views/OrderMannage/BusinessOrderlist/listcopy.vue

@@ -37,11 +37,11 @@
         <Button v-if='persimissionData["批量下测量"]||persimissionData.all'
                 type="primary"
                 style="margin-right:10px;"
-                @click="openLower(selectIds,'测量','orders_set_measure')"
+                @click="openLower(selectIds,'测量','/api/orders_set_measure')"
                 ghost>批量下测量</Button>
         <Button v-if='persimissionData["批量下生产"]||persimissionData.all'
                 type="primary"
-                @click="openLower(selectIds,'生产','order_oa_people')"
+                @click="openLower(selectIds,'生产','/api/order_oa_people')"
                 ghost>批量下生产</Button>
       </div>
 
@@ -64,7 +64,7 @@
                 slot-scope='{row}'>
         <div>
           <a v-if='persimissionData["下测量"]||persimissionData.all'
-             @click="openLower(row,'测量','orders_set_measure')"
+             @click="openLower(row,'测量','/api/orders_set_measure')"
              style="margin:0 5px">下测量</a>
           <a v-if='(persimissionData["编辑"]||persimissionData.all)&&row.state == 0'
              style="margin:0 5px"

+ 183 - 147
src/views/ProcessMannage/index.vue

@@ -1,100 +1,116 @@
 <template>
   <div>
-    <FullPage :title='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">
-        <Button v-if='persimissionData["新增"]||persimissionData.all'
-                @click="addItems"
-                type="primary"
-                ghost
-                icon='md-add'>新增{{title}}</Button>
+    <FullPage
+      :title="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">
+        <Button
+          v-if="persimissionData['新增'] || persimissionData.all"
+          @click="addItems"
+          type="primary"
+          ghost
+          icon="md-add"
+          >新增{{ title }}</Button
+        >
       </div>
-      <div slot='navButton'>
-      </div>
-      <template slot='set'
-                slot-scope='{row}'>
+      <div slot="navButton"></div>
+      <template slot="set" slot-scope="{ row }">
         <div class="table-set">
-          <svg v-if='persimissionData["编辑"]||persimissionData.all'
-               style="font-size:20px"
-               color='#3764FF'
-               @click="addItems(row)"
-               class="icon icon-nav"
-               aria-hidden="true">
+          <svg
+            v-if="persimissionData['编辑'] || persimissionData.all"
+            style="font-size:20px"
+            color="#3764FF"
+            @click="addItems(row)"
+            class="icon icon-nav"
+            aria-hidden="true"
+          >
             <use xlink:href="#iconbianji"></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>
 
       <div>
-        <Modal class-name="vertical-center-modal"
-               :title="showType == 1 ? '新增'+title: '编辑'+title"
-               v-model="showModal"
-               :width="480"
-               @on-visible-change='vivibleModal'>
+        <Modal
+          class-name="vertical-center-modal"
+          :title="showType == 1 ? '新增' + title : '编辑' + title"
+          v-model="showModal"
+          :width="480"
+          @on-visible-change="vivibleModal"
+        >
           <Form :label-width="90">
             <FormItem label="ID:">
-              <Input disabled
-                     placeholder="ID自动生成"
-                     v-model="classInfo.id" />
+              <Input disabled placeholder="ID自动生成" v-model="classInfo.id" />
             </FormItem>
-            <span v-if="repeatFlag"
-                  style="color:red;margin-left:8px;">以下属性重复</span>
-            <FormItem label="属性名称:">
+            <span v-if="repeatFlag" style="color:red;margin-left:8px;"
+              >以下属性重复</span
+            >
+            <FormItem label="属性名称:">
               <div v-if="showType == 1">
-                <div class="item-attr"
-                     v-for="(item,index) of attribute"
-                     :key="index">
-                  <Input :placeholder='"请输入"+title+"名称"'
-                         v-model="item.title" />
-                  <Icon @click="add(attribute)"
-                        style="'margin:0 10px"
-                        color='#32C800'
-                        size='20'
-                        type="ios-add-circle" />
-                  <Icon v-if="attribute.length!=1"
-                        @click="remove(attribute,index)"
-                        style="'margin:0 10px"
-                        color='#FF5E5C'
-                        size='20'
-                        type="md-remove-circle" />
+                <div
+                  class="item-attr"
+                  v-for="(item, index) of attribute"
+                  :key="index"
+                >
+                  <Input
+                    :placeholder="'请输入' + title + '名称'"
+                    v-model="item.title"
+                  />
+                  <Icon
+                    @click="add(attribute)"
+                    style="'margin:0 10px"
+                    color="#32C800"
+                    size="20"
+                    type="ios-add-circle"
+                  />
+                  <Icon
+                    v-if="attribute.length != 1"
+                    @click="remove(attribute, index)"
+                    style="'margin:0 10px"
+                    color="#FF5E5C"
+                    size="20"
+                    type="md-remove-circle"
+                  />
                   <!-- <Icon @click="addAttr(index)" style="'margin:0 10px" :color='index == attribute.length-1 ? "#32C800" : "#FF5E5C"' size='20' :type="index == attribute.length-1 ? 'ios-add-circle' : 'md-remove-circle'" /> -->
                 </div>
               </div>
 
-              <Input v-if="showType == 2"
-                     :placeholder='"请输入"+title+"名称"'
-                     v-model="classInfo.title" />
-
+              <Input
+                v-if="showType == 2"
+                :placeholder="'请输入' + title + '名称'"
+                v-model="classInfo.title"
+              />
             </FormItem>
             <FormItem label="属性分类:">
-              <Input placeholder="请输入属性分类"
-                     v-model="classInfo.type_title" />
+              <Input
+                placeholder="请输入属性分类"
+                v-model="classInfo.type_title"
+              />
             </FormItem>
           </Form>
-          <div slot="footer"
-               class="modal-footer">
+          <div slot="footer" class="modal-footer">
             <Button @click="showModal = false">取消</Button>
-            <Button type="primary"
-                    @click="postInfo">确定</Button>
+            <Button type="primary" @click="postInfo">确定</Button>
           </div>
         </Modal>
       </div>
@@ -103,18 +119,30 @@
 </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: [
-        { title: '序号', type: 'index', align: 'center', key: 'id', width: '100' },
-        { title: `颜色`, align: 'center', key: 'title' },
-        { title: `分类`, align: 'center', key: 'type_title' },
-        { title: '操作', align: 'center', slot: 'set', width: '150' },
+        {
+          title: "序号",
+          type: "index",
+          align: "center",
+          key: "id",
+          width: "100",
+        },
+        { title: `颜色`, align: "center", key: "title" },
+        { title: `分类`, align: "center", key: "type_title" },
+        { title: "操作", align: "center", slot: "set", width: "150" },
       ],
       tableData: [],
       pageIndex: 1,
@@ -123,146 +151,154 @@ export default {
       showModal: false,
       showType: 1,
       classInfo: {},
-      attribute: [{ title: '' }],
-      title: '',
+      attribute: [{ title: "" }],
+      title: "",
       id: null,
       proxyObj: {},
       loading: false,
       repeatFlag: false,
-    }
+    };
   },
-  mounted () {
-    this.title = this.$route.query.title
+  mounted() {
+    this.title = this.$route.query.title;
     if (this.$route.query.id) {
       this.proxyObj.id = this.$route.query.id;
       this.list[0].title = `${this.title}名称`;
-      this.list[0].placeholder = `请输入${this.title}名称`
-      this.tableColums[1].title = this.title
-      this.getData(this.proxyObj)
+      this.list[0].placeholder = `请输入${this.title}名称`;
+      this.tableColums[1].title = this.title;
+      this.getData(this.proxyObj);
     }
   },
   computed: {
-    ...mapState(['persimissionData']),
+    ...mapState(["persimissionData"]),
   },
   watch: {
-    $route (to) {
+    $route(to) {
       this.title = to.query.title;
       this.id = to.query.id;
-      this.proxyObj.id = this.id
+      this.proxyObj.id = this.id;
       this.list[0].title = `${this.title}名称`;
-      this.list[0].value = '';
-      this.list[0].placeholder = `请输入${this.title}名称`
-      this.tableColums[1].title = this.title
-      this.proxyObj.title = ''
-      this.getData(this.proxyObj)
+      this.list[0].value = "";
+      this.list[0].placeholder = `请输入${this.title}名称`;
+      this.tableColums[1].title = this.title;
+      this.proxyObj.title = "";
+      this.getData(this.proxyObj);
       this.classInfo.id = this.id;
-    }
+    },
   },
   methods: {
-    init (row) {
-      this.pageIndex = 1
+    init(row) {
+      this.pageIndex = 1;
       row.page_index = this.pageIndex;
       row.page_size = this.pageSize;
       this.proxyObj = row;
       this.proxyObj.id = this.$route.query.id;
-      this.getData(this.proxyObj)
+      this.getData(this.proxyObj);
     },
-    addItems (obj) {
-      this.classInfo.id = '';
-      this.classInfo.type_title = '';
-      this.classInfo.title = '';
+    addItems(obj) {
       this.showModal = true;
+      this.repeatFlag = false
       if (obj.id) {
-        this.showType = 2
+        this.showType = 2;
         this.classInfo.id = obj.id;
         this.classInfo.type_title = obj.type_title;
         this.classInfo.title = obj.title;
       } else {
         //新增
-        this.showType = 1
+        this.showType = 1;
       }
     },
-    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);
     },
-    vivibleModal (e) {
+    vivibleModal(e) {
       // if (!e) {
       //   this.showType == 1 ? this.attribute = [{ title: '' }] : this.classInfo = {}
       //   this.repeatFlag = false
       //   this.getData(this.proxyObj)
       // }
     },
-    postInfo () {
+    postInfo() {
       let post_url, post_data;
       if (this.showType == 1) {
-        post_url = '/api/properties_add';
-        let result = []
-        this.attribute.map(v => result.push(v.title))
+        post_url = "/api/properties_add";
+        let result = [];
+        this.attribute.map((v) => result.push(v.title));
         post_data = {
           id: this.$route.query.id,
-          title: result.join(',')
-        }
+          title: result.join(","),
+        };
       } else {
-        post_url = '/api/properties_edit'
+        post_url = "/api/properties_edit";
         post_data = this.classInfo;
       }
-      this.axios.post(post_url, post_data).then(res => {
+      this.axios.post(post_url, post_data).then((res) => {
         if (res.code == 200) {
-          this.$Message.success(res.msg)
-          this.showModal = false
-          this.getData(this.proxyObj)
+          this.$Message.success(res.msg);
+          this.showModal = false;
+          this.getData(this.proxyObj);
+          this.classInfo.id = "";
+          this.classInfo.type_title = "";
+          this.classInfo.title = "";
+          this.attribute = [{ title: "" }];
         } else {
           if (Array.isArray(res.data)) {
             this.repeatFlag = true;
             let result = [];
-            res.data.map(v => {
+            res.data.map((v) => {
               let obj = {};
-              v ? obj.title = v : ''
-              obj.title ? result.push(obj) : ''
-            })
+              v ? (obj.title = v) : "";
+              obj.title ? result.push(obj) : "";
+            });
             this.attribute = result;
-            this.getData(this.proxyObj)
+            this.getData(this.proxyObj);
           }
         }
-      })
+      });
+    },
+    addAttr(n) {
+      n == this.attribute.length - 1
+        ? this.attribute.push({ title: "" })
+        : this.attribute.splice(n, 1);
     },
-    addAttr (n) {
-      n == this.attribute.length - 1 ? this.attribute.push({ title: '' }) : this.attribute.splice(n, 1)
+    add(array) {
+      array.push({ title: "" });
     },
-    add (array) {
-      array.push({ title: '' })
+    remove(array, n) {
+      array.splice(n, 1);
     },
-    remove (array, n) { array.splice(n, 1) },
-    getData (row) {
+    getData(row) {
       this.loading = true;
-      this.axios('/api/properties_index', { params: row }).then(res => {
+      this.axios("/api/properties_index", { params: row }).then((res) => {
         this.loading = false;
         this.tableData = res.data.data;
         this.total = res.data.total;
-      })
+      });
     },
-    delItems (row) {
+    delItems(row) {
       this.confirmDelete({
-        content: '确认删除么?',
+        content: "确认删除么?",
         then: () => {
-          this.axios.post('/api/properties_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/properties_del", { id: row.id, state: 0 })
+            .then((res) => {
+              if (res.code == 200) {
+                this.$Message.success(res.msg);
+                this.getData(this.proxyObj);
+              }
+            });
+        },
+      });
     },
-  }
-}
+  },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -276,4 +312,4 @@ export default {
   align-items: center;
   margin-bottom: 10px;
 }
-</style>
+</style>

+ 307 - 266
src/views/ProcessRoute/edit.vue

@@ -1,67 +1,66 @@
 <template>
   <div>
-    <Toptitle :title='setTip'>
-      <Button @click="back"
-              type='primary'
-              ghost
-              style="margin-right:10px;">返回</Button>
-      <Button v-if="type!=3"
-              @click="handleSubmit('Info')">保存</Button>
+    <Toptitle :title="setTip">
+      <Button @click="back" type="primary" ghost style="margin-right:10px;"
+        >返回</Button
+      >
+      <Button v-if="type != 3" @click="handleSubmit('Info')">保存</Button>
     </Toptitle>
 
     <div class="page-edit">
-      <Form inline
-            ref='Info'
-            :model="info"
-            :rules='rules'>
+      <Form inline ref="Info" :model="info" :rules="rules">
         <FormItem label="ID">
-          <Input v-model="info.id"
-                 disabled
-                 placeholder="自动生成"></Input>
+          <Input v-model="info.id" disabled placeholder="自动生成"></Input>
         </FormItem>
-        <FormItem label="部件名称"
-                  prop='parts_id'>
-          <Select :disabled='type == 3'
-                  filterable
-                  clearable
-                  v-model="info.parts_id"
-                  style="width:186px;">
-            <Option v-for="item of partsList"
-                    :key="item.id"
-                    :value="item.id"
-                    :label="item.title"></Option>
+        <FormItem label="部件名称" prop="parts_id">
+          <Select
+            :disabled="type == 3"
+            filterable
+            clearable
+            v-model="info.parts_id"
+            style="width:186px;"
+          >
+            <Option
+              v-for="item of partsList"
+              :key="item.id"
+              :value="item.id"
+              :label="item.title"
+            ></Option>
           </Select>
         </FormItem>
 
-        <FormItem label="工艺组合名称"
-                  prop='title'>
-          <Input :disabled='type == 3'
-                 v-model="info.title"
-                 placeholder="请输入工艺组合名称"></Input>
+        <FormItem label="工艺组合名称" prop="title">
+          <Input
+            :disabled="type == 3"
+            v-model="info.title"
+            placeholder="请输入工艺组合名称"
+          ></Input>
         </FormItem>
-        <FormItem label="价格"
-                  prop='price'>
-          <Input :disabled='type == 3'
-                 type="number"
-                 v-model="info.price"
-                 placeholder="请输入价格"></Input>
+        <FormItem label="价格" prop="price">
+          <Input
+            :disabled="type == 3"
+            type="number"
+            v-model="info.price"
+            placeholder="请输入价格"
+          ></Input>
         </FormItem>
       </Form>
 
-      <div class="hierarchy"
-           v-for="item of info.list"
-           :key="item.name">
-        <span>{{item.name||item.title}}(多选):</span>
-        <div v-for="_item in item.cld"
-             class="radio-g"
-             :key="_item.type_title">
-          <span :class="['box-us',_item.show ? 'box-us-foc' : '']"
-                @click="setBoxChange(item,_item)">{{_item.type_title}}</span>
-          <div :class="['radio-us',__item.show ? 'radio-us-foc' : '']"
-               v-for="__item in _item.list"
-               @click="setRadioChange(_item,__item)"
-               :key="__item.id">
-            {{__item.title}}
+      <div class="hierarchy" v-for="item of info.list" :key="item.name">
+        <span>{{ item.name || item.title }}(多选):</span>
+        <div v-for="_item in item.cld" class="radio-g" :key="_item.type_title">
+          <span
+            :class="['box-us', _item.show ? 'box-us-foc' : '']"
+            @click="setBoxChange(item, _item)"
+            >{{ _item.type_title }}</span
+          >
+          <div
+            :class="['radio-us', __item.show ? 'radio-us-foc' : '']"
+            v-for="__item in _item.list"
+            @click="setRadioChange(_item, __item)"
+            :key="__item.id"
+          >
+            {{ __item.title }}
           </div>
         </div>
         <!-- <div class="radio-g">
@@ -73,45 +72,57 @@
       </div>
       <div style="padding:10px 0;">
         <span>工艺路线:</span>
-        <Button :disabled='type == 3'
-                @click="editRouter()">{{type == 1 ? '选择工艺路线' : '选择工艺路线'}}</Button>
+        <Button :disabled="type == 3" @click="editRouter()">{{
+          type == 1 ? "选择工艺路线" : "选择工艺路线"
+        }}</Button>
+        {{ process_name }}
       </div>
 
-      <Table border
-             :columns="tableColumns"
-             :data="tableData"></Table>
+      <Table border :columns="tableColumns" :data="tableData"></Table>
     </div>
-    <Modal class-name="vertical-center-modal"
-           v-model="show_add"
-           title="选择工艺路线">
+    <Modal
+      class-name="vertical-center-modal"
+      v-model="show_add"
+      title="选择工艺路线"
+    >
       <div class="modal_process_route">
         <div class="modal_process_route_top">
-          <div><span>工艺路线名称:</span>
-            <Input :disabled='type == 3'
-                   v-model="tempProcessLine.title"
-                   style="width:120px"
-                   placeholder="请输入"></Input>
+          <div>
+            <span>工艺路线名称:</span>
+            <Input
+              :disabled="type == 3"
+              v-model="tempProcessLine.title"
+              style="width:120px"
+              placeholder="请输入"
+            ></Input>
           </div>
-          <Button type="primary"
-                  @click="handleSearchProcessLine(tempProcessLine.title)">搜索</Button>
+          <Button
+            type="primary"
+            @click="handleSearchProcessLine(tempProcessLine.title)"
+            >搜索</Button
+          >
         </div>
         <div class="modal_process_route_content">
-          <Table border
-                 :columns="processLineColumns"
-                 :data="processLineTableData">
-            <template slot="processLineSet"
-                      slot-scope="{row,index}">
-              <a style="margin:0 5px"
-                 @click="handleProcessLineSet(row,index)">选择</a>
+          <Table
+            border
+            :columns="processLineColumns"
+            :data="processLineTableData"
+          >
+            <template slot="processLineSet" slot-scope="{ row, index }">
+              <a style="margin:0 5px" @click="handleProcessLineSet(row, index)"
+                >选择</a
+              >
             </template>
           </Table>
         </div>
       </div>
     </Modal>
-    <Modal class-name="vertical-center-modal"
-           v-model="show_add_detail"
-           title="工艺路线"
-           @on-ok="saveTableData">
+    <Modal
+      class-name="vertical-center-modal"
+      v-model="show_add_detail"
+      title="工艺路线"
+      @on-ok="saveTableData"
+    >
       <!-- <div class="modal_process_route">
         <div>id: <Input v-model="processRouteId"
                  disabled
@@ -126,42 +137,53 @@
       <span>已选:</span>
       <Form>
         <FormItem>
-          <SlickList :distance="10"
-                     :lockToContainerEdges="true"
-                     axis="x,y,xy"
-                     lockAxis="xy"
-                     v-model="selectTags"
-                     class="SortableList"
-                     @input="getChangeLists">
-            <SlickItem style="z-index:9999"
-                       v-for="(item,key) of selectTags"
-                       :key="key"
-                       class="SortableItem"
-                       :index="key">
+          <SlickList
+            :distance="10"
+            :lockToContainerEdges="true"
+            axis="x,y,xy"
+            lockAxis="xy"
+            v-model="selectTags"
+            class="SortableList"
+            @input="getChangeLists"
+          >
+            <SlickItem
+              style="z-index:9999"
+              v-for="(item, key) of selectTags"
+              :key="key"
+              class="SortableItem"
+              :index="key"
+            >
               <div class="tag-modal">
-                <div class="before">{{key+1}}</div>
-                <Tag @on-close='closeTag(key,selectTags,item)'
-                     color="primary"
-                     type="border"
-                     closable>{{item.title}}</Tag>
+                <div class="before">{{ key + 1 }}</div>
+                <Tag
+                  @on-close="closeTag(key, selectTags, item)"
+                  color="primary"
+                  type="border"
+                  closable
+                  >{{ item.title }}</Tag
+                >
               </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'>
+        <FormItem
+          v-for="(item, index) of info.bps"
+          :key="index"
+          :label="item.title"
+        >
+          <Tooltip v-for="(_item, _index) of item.cld" :key="_index">
             <!-- todo -->
-            <div slot='content'>
-              <p>工时:{{_item.time}}</p>
-              <p>工价:{{_item.wages}}</p>
-              <p>产能:{{_item.capacity}}</p>
+            <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"
-                      style="padding:0px 5px;">{{_item.title}}</Checkbox>
+            <Checkbox
+              @on-change="changeCheck($event, _item, selectTags)"
+              v-model="_item.show"
+              style="padding:0px 5px;"
+              >{{ _item.title }}</Checkbox
+            >
           </Tooltip>
         </FormItem>
       </Form>
@@ -170,20 +192,18 @@
 </template>
 
 <script>
-
-import { SlickList, SlickItem } from 'vue-slicksort'
+import { SlickList, SlickItem } from "vue-slicksort";
 export default {
-  data () {
+  data() {
     return {
       tempProcessLine: {
-        title: ''
+        title: "",
       },
       processLineColumns: [
-        { title: '序号', type: 'index', align: 'center', key: '' },
+        { title: "序号", type: "index", align: "center", key: "" },
         // { title: 'ID', align: 'center', key: 'id' },
-        { title: '工艺路线名称', align: 'center', key: 'title' },
-        { title: '操作', align: 'center', key: 'id', slot: 'processLineSet' },
-
+        { title: "工艺路线名称", align: "center", key: "title" },
+        { title: "操作", align: "center", key: "id", slot: "processLineSet" },
       ],
       processLineTableData: [],
       type: 1,
@@ -191,224 +211,245 @@ export default {
       partsList: [],
       show_add: false,
       show_add_detail: false,
-      selectTags: [],//已选列表
+      selectTags: [], //已选列表
       info: {
-        title: '',
-        price: '',
-        parts_id: '',
+        title: "",
+        price: "",
+        parts_id: "",
         id: null,
-        properties: [],//工序号
-        procedure: [],//工艺属性id
+        properties: [], //工序号
+        procedure: [], //工艺属性id
         list: [],
         bps: [],
       },
       rules: {
-        title: [
-          { required: true, message: ' ', trigger: 'blur' }
-        ],
-        parts_id: [
-          { required: true, message: ' ' }
-        ],
-        price: [
-          { required: true, message: ' ', trigger: 'blur' }
-        ],
+        title: [{ required: true, message: " ", trigger: "blur" }],
+        parts_id: [{ required: true, message: " " }],
+        price: [{ required: true, message: " ", trigger: "blur" }],
       },
       tableColumns: [
-        { title: '序号', type: 'index', align: 'center', key: '' },
+        { title: "序号", type: "index", align: "center", key: "" },
         // { title: 'ID', align: 'center', key: 'id' },
-        { title: '工序名称', align: 'center', key: 'title' },
-        { title: '工时', align: 'center', key: 'time' },
-        { title: '工价', align: 'center', key: 'wages' },
-        { title: '产能', align: 'center', key: 'capacity' },
+        { title: "工序名称", align: "center", key: "title" },
+        { title: "工时", align: "center", key: "time" },
+        { title: "工价", align: "center", key: "wages" },
+        { title: "产能", align: "center", key: "capacity" },
       ],
       tableData: [],
-      processRouteId: '',
-      processRouteName: ''
-
-    }
+      processRouteId: "",
+      processRouteName: "",
+      process_name: "",
+    };
   },
   computed: {
-    setTip () {
-      const { type } = this.$route.query
-      const inner = type == 1 ? '新增工艺' : (type == 2 ? '编辑工艺' : (type == 3 ? '查看工艺' : '拷贝工艺'))
-      return inner
-    }
+    setTip() {
+      const { type } = this.$route.query;
+      const inner =
+        type == 1
+          ? "新增工艺"
+          : type == 2
+          ? "编辑工艺"
+          : type == 3
+          ? "查看工艺"
+          : "拷贝工艺";
+      return inner;
+    },
   },
-  mounted () {
+  mounted() {
     this.type = this.$route.query.type;
     this.id = this.$route.query.id;
     if (this.id) {
-      this.getData(this.id)
+      this.getData(this.id);
     }
     if (this.type == 1) {
-      this.axios('/api/bp_list').then(res => {
+      this.axios("/api/bp_list").then((res) => {
         this.info.bps = res.data;
       });
-      this.axios('/api/bpp_list_new').then(res => {
-        res.data.map(v => {
+      this.axios("/api/bpp_list_new").then((res) => {
+        res.data.map((v) => {
           if (v.select) {
-            v.cld.map(z => {
-              v.select.map(k => {
-                z.show = k == z.id ? true : false
-              })
-            })
+            v.cld.map((z) => {
+              v.select.map((k) => {
+                z.show = k == z.id ? true : false;
+              });
+            });
           } else {
-            v.cld.map(v => v.show = false)
+            v.cld.map((v) => (v.show = false));
           }
-        })
+        });
         this.info.list = res.data;
-      })
+      });
     }
-    this.getParts()
+    this.getParts();
   },
   methods: {
-    handleProcessLineSet (row, index) {
+    handleProcessLineSet(row, index) {
       this.info.id = row.id;
+      this.process_name = row.title
       // this.info.title = row.title;
-      this.info.procedure_id = row.procedure_id
-      this.selectTags = []
-      const arr = this.info.procedure_id ? this.info.procedure_id.split(',') : []
+      this.info.procedure_id = row.procedure_id;
+      this.selectTags = [];
+      const arr = this.info.procedure_id
+        ? this.info.procedure_id.split(",")
+        : [];
       for (const key in this.info.bps) {
         const element = this.info.bps[key];
-        element.cld.forEach(z => {
-          z.show = arr.includes(z.id + '')
-          if (arr.includes(z.id + '')) {
-            this.selectTags.push(z)
+        element.cld.forEach((z) => {
+          z.show = arr.includes(z.id + "");
+          if (arr.includes(z.id + "")) {
+            this.selectTags.push(z);
           }
-        })
+        });
       }
-      this.show_add_detail = true
-      this.show_add = false
+      this.show_add_detail = true;
+      this.show_add = false;
     },
-    handleSearchProcessLine (title) {
+    handleSearchProcessLine(title) {
       this.axios({
-        method: 'get',
-        url: '/api/technological_route',
+        method: "get",
+        url: "/api/technological_route",
         params: {
-          title
-        }
-      }).then((res) => {
-        this.processLineTableData = res.data.data
-      }).catch((err) => { });
+          title,
+        },
+      })
+        .then((res) => {
+          this.processLineTableData = res.data.data;
+        })
+        .catch((err) => {});
     },
-    back () {
-      this.$router.go(-1)
+    back() {
+      this.$router.go(-1);
     },
-    getChangeLists (e) { },
-    postData () {
-      const { type } = this.$route.query
-      this.info.op = (type == 1 || type == 4) ? 'add' : 'edit'
-      let data = JSON.parse(JSON.stringify(this.info))
-      type == 4 ? data.id = '' : ''
-      let properties = [], procedure = [];
-      data.list.forEach(element => {
-        element.cld.forEach(elem => {
-          elem.list.forEach(el => {
+    getChangeLists(e) {},
+    postData() {
+      const { type } = this.$route.query;
+      this.info.op = type == 1 || type == 4 ? "add" : "edit";
+      let data = JSON.parse(JSON.stringify(this.info));
+      type == 4 ? (data.id = "") : "";
+      let properties = [],
+        procedure = [];
+      data.list.forEach((element) => {
+        element.cld.forEach((elem) => {
+          elem.list.forEach((el) => {
             if (el.show) {
-              properties.push(el.id)
+              properties.push(el.id);
             }
           });
         });
       });
-      this.selectTags.map(v => { procedure.push(v.id) })
-      delete data.list
-      delete data.bps
-      this.type == 1 ? delete data.id : '';
-      data.properties = properties
-      data.procedure = procedure.join(',')
-      this.axios.post('/api/process_route_save', data).then(res => {
+      this.selectTags.map((v) => {
+        procedure.push(v.id);
+      });
+      delete data.list;
+      delete data.bps;
+      this.type == 1 ? delete data.id : "";
+      data.properties = properties;
+      data.procedure = procedure.join(",");
+      this.axios.post("/api/process_route_save", data).then((res) => {
         if (res.code == 200) {
-          this.$Message.success(res.msg)
-          setTimeout(() => { this.back() }, 500)
+          this.$Message.success(res.msg);
+          setTimeout(() => {
+            this.back();
+          }, 500);
         }
-      })
+      });
     },
-    getData (row) {
-      this.axios('/api/process_route_detail', { params: { id: row } }).then(res => {
-        this.info = res.data
-        this.selectTags = res.data.produce_list;
-        const selectTagsId = this.selectTags.map(item => item.id)
-        this.info.bps.forEach(v => {
-          v.cld.forEach(z => {
-            z.show = selectTagsId.includes(z.id)
-          })
-
-        })
-        // this.info.bps.map(v=>{
-        //     if(v.select&&v.select.length>0){
-        //         v.cld.map(z=>{
-        //             v.select.map(k=>{
-        //                 if(!z.show){
-        //                     z.show = k == z.id ? true : false
-        //                     z.show ? this.selectTags.push(z) : ''
-        //                 }
+    getData(row) {
+      this.axios("/api/process_route_detail", { params: { id: row } }).then(
+        (res) => {
+          this.info = res.data;
+          this.selectTags = res.data.produce_list;
+          const selectTagsId = this.selectTags.map((item) => item.id);
+          this.process_name = res.data.process_name
+          this.info.bps.forEach((v) => {
+            v.cld.forEach((z) => {
+              z.show = selectTagsId.includes(z.id);
+            });
+          });
+          // this.info.bps.map(v=>{
+          //     if(v.select&&v.select.length>0){
+          //         v.cld.map(z=>{
+          //             v.select.map(k=>{
+          //                 if(!z.show){
+          //                     z.show = k == z.id ? true : false
+          //                     z.show ? this.selectTags.push(z) : ''
+          //                 }
 
-        //             })
-        //         })
-        //     }else{
-        //         v.cld.map(v=>v.show = false)
-        //     }
-        // })
-        this.tableData = JSON.parse(JSON.stringify(this.selectTags));
-      })
+          //             })
+          //         })
+          //     }else{
+          //         v.cld.map(v=>v.show = false)
+          //     }
+          // })
+          this.tableData = JSON.parse(JSON.stringify(this.selectTags));
+        }
+      );
     },
-    getParts () {
-      this.axios('/api/parts_index').then(res => { this.partsList = res.data.data })
+    getParts() {
+      this.axios("/api/parts_index").then((res) => {
+        this.partsList = res.data.data;
+      });
     },
-    editRouter () {
+    editRouter() {
       this.show_add = true;
-      this.handleSearchProcessLine(this.tempProcessLine.title)
+      this.handleSearchProcessLine(this.tempProcessLine.title);
     },
-    changeCheck (e, item, selectArray) {//复选框选中与非选中同时同步tag标签跟随操作
+    changeCheck(e, item, selectArray) {
+      //复选框选中与非选中同时同步tag标签跟随操作
       item.show = e;
       if (e) {
-        selectArray.push(item)
+        selectArray.push(item);
       } else {
         let id = item.id;
-        let id_index = selectArray.findIndex(v => v.id == id)
-        selectArray.splice(id_index, 1)
+        let id_index = selectArray.findIndex((v) => v.id == id);
+        selectArray.splice(id_index, 1);
       }
     },
-    closeTag (key, arr, row) {//取消tag标签展示操作并同步下方的复选框ui同步
-      arr.splice(key, 1)
-      console.log(this.info)
-      this.info.bps.map(v => {
-        v.cld.map(p => {
-          p.id == row.id ? p.show = false : ''
-          console.log(p)
-        })
-      })
+    closeTag(key, arr, row) {
+      //取消tag标签展示操作并同步下方的复选框ui同步
+      arr.splice(key, 1);
+      console.log(this.info);
+      this.info.bps.map((v) => {
+        v.cld.map((p) => {
+          p.id == row.id ? (p.show = false) : "";
+          console.log(p);
+        });
+      });
     },
-    saveTableData () {
+    saveTableData() {
       this.tableData = JSON.parse(JSON.stringify(this.selectTags));
     },
-    handleSubmit (name) {
+    handleSubmit(name) {
       this.$refs[name].validate((valid) => {
         if (valid) {
-          this.postData()
+          this.postData();
         }
-      })
+      });
     },
-    changeRadio (e) { },
-    setBoxChange (parent, child) {
-      const { type } = this.$route.query
-      if (type == 3) { return }
-      child.show = !child.show
-      child.list.forEach(element => {
-        element.show = child.show
+    changeRadio(e) {},
+    setBoxChange(parent, child) {
+      const { type } = this.$route.query;
+      if (type == 3) {
+        return;
+      }
+      child.show = !child.show;
+      child.list.forEach((element) => {
+        element.show = child.show;
       });
     },
-    setRadioChange (parent, child) {
-      const { type } = this.$route.query
-      if (type == 3) { return }
-      child.show = !child.show
-      let flag = true
-      parent.list.forEach(element => {
+    setRadioChange(parent, child) {
+      const { type } = this.$route.query;
+      if (type == 3) {
+        return;
+      }
+      child.show = !child.show;
+      let flag = true;
+      parent.list.forEach((element) => {
         if (!element.show) {
-          flag = false
+          flag = false;
         }
       });
-      parent.show = flag
+      parent.show = flag;
       // parent.cld.map(v=>v.show = false)
       // if(parent.select == child.id){
       //     child.show = false;
@@ -417,11 +458,11 @@ export default {
       //     parent.select = child.id;
       //     child.show = true;
       // }
-      this.$forceUpdate()
-    }
+      this.$forceUpdate();
+    },
   },
-  components: { SlickList, SlickItem }
-}
+  components: { SlickList, SlickItem },
+};
 </script>
 
 <style lang="scss" scoped>
@@ -526,4 +567,4 @@ export default {
 .ivu-tooltip-popper {
   z-index: 999999 !important;
 }
-</style>
+</style>

+ 6 - 6
src/views/ProductMannage/index.vue

@@ -490,12 +490,14 @@ export default {
     } else {
       this.$route.meta.keepAlive = false;
     }
-    console.log("this.$route.meta.keepAlive :>> ", this.$route.meta.keepAlive);
     next();
   },
+  beforeRouteEnter(to, from, next) {
+    next((vm) => {
+      vm.getData(vm.proxyObj);
+    });
+  },
   created() {
-    console.log("1 :>> ", 1);
-    console.log("this.$route :>> ", this.$route);
     // 获取部件列表
     this.axios("/api/parts_index").then((res) => {
       this.partsList = res.data.data;
@@ -564,9 +566,7 @@ export default {
         },
       });
     },
-    handleProductAllClick(product){
-      
-    },
+    handleProductAllClick(product) {},
     handleProductClick(product, type) {
       product.isSelect = !product.isSelect;
       this.currentProductList = product;

+ 1 - 1
src/views/ProductionOrderList/Dispatchlist/confirm.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <FullPage
-      title="派工单详情列表"
+      title="派工单详情"
       :list="list"
       @init="init"
       @searchData="init"

+ 4 - 4
src/views/ProductionOrderList/Dispatchlist/details.vue

@@ -1,7 +1,7 @@
 <template>
     <div>
         <FullPage 
-        title='派工单详情' 
+        title='查看详情' 
         :showTopSearch='false' 
         :logList='logList'
         @selectTable='selectTable'
@@ -51,9 +51,9 @@ export default {
                 {title:'部件是否贴标签',align:'center',minWidth:150,
                     render:(h,params)=>h('span',{},params.row.label == '1' ? '是' : '否')
                 },
-                // {title:'贴标签零部件',align:'center',minWidth:150,key:'sub_part'},
-                // {title:'工序分类',align:'center',minWidth:150,key:'basic_title'},
-                // {title:'工序',align:'center',minWidth:150,key:'procedure_title'},
+                {title:'贴标签零部件',align:'center',minWidth:150,key:'sub_part'},
+                {title:'工序分类',align:'center',minWidth:150,key:'basic_title'},
+                {title:'工序',align:'center',minWidth:150,key:'procedure_title'},
                 {title:'测量尺寸',align:'center',minWidth:150,key:'measure'},
                 {title:'单位',align:'center',minWidth:100,key:'company'},
                 {title:'芯片编号',align:'center',minWidth:150,key:'chip'},

+ 1 - 1
vue.config.js

@@ -1,6 +1,6 @@
 const axios_default_ip =
     process.env.NODE_ENV == 'dev' ?
-    'http://124.71.176.88:882' :
+    'http://121.41.102.225:82' :
     process.env.NODE_ENV == 'test-prd' ?
     'http://121.41.102.225:82' //测试服
     :

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä