Andy vor 3 Jahren
Ursprung
Commit
7053179205

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

@@ -118,7 +118,7 @@ export default {
     }
   },
   created () {
-    this.axios('/api/user').then(res => this.users = res.data.data)
+    this.axios('/api/employee_list').then(res => this.users = res.data)
     this.axios('/api/orders_plan_get_list', { params: this.params }).then(res => {
       if (res.code == 200) {
         this.info = res.data;

+ 3 - 1
src/untils/until.js

@@ -131,7 +131,9 @@ export default {
     computedForm(array, header) {
         const result = array.reduce((pre, cur) => {
             const data = header.filter(
-                (row) => (cur.is_show && row.serverName == cur.key) && (row.title = cur.title)
+                (row) => (cur.is_show && row.serverName == cur.key) && (
+                    row.title = cur.title, row.name == 'Input' ? row.placeholder = `请输入${cur.title}` : row.name == 'Select' ? row.placeholder = `请选择${cur.title}` : ''
+                )
             );
             if (data && data.length == 1) {
                 return pre.concat(data);

+ 99 - 54
src/views/OrderMannage/BusinessOrderlist/edit.vue

@@ -263,26 +263,33 @@
                     style="margin-right: 10px">上传附件</Button>
           </Upload> -->
         </FormItem>
-        <FormItem label="部件合计:">
-          <span v-if="parts_title_count.length < 1">无</span>
-          <span
-            v-else
-            v-for="(item, index) in parts_title_count"
-            :key="item.title + index"
-            >{{ item.title }}:{{ item.num }}{{ item.unit }}
-            <span v-show="index < parts_title_count.length - 1">,</span>
-          </span>
+        <FormItem label="线条:" style="width:100%">
+          <div style="font-size:20px">
+            <span v-if="wood_title_count.length < 1">无</span>
+            <span
+              v-else
+              v-for="(item, index) in wood_title_count"
+              :key="item.title + index"
+              >{{ item.title }}:
+              <span v-for="_item in item.measure_str" :key="_item.id"
+                >{{ _item._measure_str }}={{ _item.num }}{{ _item.unit }}</span
+              >
+              <span v-show="index < wood_title_count.length - 1">,</span>
+            </span>
+          </div>
         </FormItem>
-        <FormItem label="线条合计:">
-          <span v-if="wood_title_count.length < 1">无</span>
-          <span
-            v-else
-            v-for="(item, index) in wood_title_count"
-            :key="item.title + index"
-            >{{ item.title }}:{{ item.measure_str }},{{ item.num
-            }}{{ item.unit }}
-            <span v-show="index < wood_title_count.length - 1">,</span>
-          </span>
+        <FormItem label="合计:" style="width:100%">
+          <div style="font-size:20px">
+            <span v-if="parts_title_count.length < 1">无</span>
+            <span
+              v-else
+              v-for="(item, index) in parts_title_count"
+              :key="item.title + index"
+              v-show="item.title.indexOf('线条') == -1"
+              >{{ item.title }}:{{ item.num }}{{ item.unit }}
+              <span v-show="index < parts_title_count.length - 1">,</span>
+            </span>
+          </div>
         </FormItem>
       </Form>
       <!-- 户型选择 -->
@@ -777,13 +784,13 @@
                       ></Option>
                     </Select>
                   </FormItem>
-                  <FormItem label=":">
+                  <FormItem label=":">
                     <Input
                       size="small"
                       clearable
                       v-model="element.long"
                       style="width: 50px"
-                      placeholder="请输入"
+                      placeholder="请输入"
                     />
                   </FormItem>
                   <FormItem label="宽:">
@@ -876,12 +883,12 @@
                               <!-- </Tooltip> -->
                             </div>
                           </FormItem>
-                          <!-- <FormItem label="" :label-width="40">
+                          <!-- <FormItem label="" :label-width="40">
                             <Input
                               size="small"
                               v-model="ele.long"
                               style="width: 80px"
-                              placeholder="请输入"
+                              placeholder="请输入"
                             />
                           </FormItem> -->
                           <!-- <FormItem label="宽" :label-width="40">
@@ -922,14 +929,14 @@
                                 <!-- </Tooltip> -->
                               </div>
                             </FormItem>
-                            <FormItem label="" :label-width="40">
+                            <FormItem label="" :label-width="40">
                               <Select
                                 style="width: 80px"
                                 filterable
                                 clearable
                                 v-model="ele.material_detail_id"
                                 @on-change="(e) => handleMaterialChange(e, ele)"
-                                placeholder="请选择"
+                                placeholder="请选择"
                                 size="small"
                               >
                                 <Option
@@ -946,7 +953,7 @@
                                 filterable
                                 clearable
                                 v-model="ele.material_detail_id"
-                                placeholder="请选择"
+                                placeholder="请选择"
                                 size="small"
                               >
                                 <Option
@@ -963,7 +970,7 @@
                                 filterable
                                 clearable
                                 v-model="ele.material_detail_id"
-                                placeholder="请选择"
+                                placeholder="请选择"
                                 size="small"
                               >
                                 <Option
@@ -1656,19 +1663,21 @@ export default {
         this.modalArray[0].title = this.currencyForm.title;
         this.tableData.splice(this.currencyIndex, 1, this.modalArray[0]);
       }
-      // 部件合计 、 线条合计 统计价格
+      // 合计 、 线条 统计价格
       this.handleCalcCount();
       this.showProduct = false;
       this.$forceUpdate();
     },
-    // 部件合计 、 线条合计 统计价格
+    // 合计 、 线条 统计价格
     handleCalcCount() {
       let sum = 0;
       this.parts_title_count = [];
       this.wood_title_count = [];
+      let total_line_unit = "";
       this.tableData.forEach((element) => {
         sum += element.price * 1;
         element.part.forEach((elem) => {
+          // 统计部件
           const temp = this.parts_title_count.filter(
             (item) => item.title == elem.title
           );
@@ -1683,45 +1692,81 @@ export default {
               unit: elem.unit,
             });
           }
+          // 如果没有点开产品详情的话找不到 part_detail
           elem.part_detail ? "" : (elem.part_detail = elem.sub_part);
+          // 部件中要统计所有线条数量
           elem.part_detail.length > 0 &&
             elem.part_detail.forEach((el) => {
-              if (el.title.indexOf("线条") != -1) {
+              if (el.material_detail_title.indexOf("线条") != -1) {
                 const temp = this.wood_title_count.filter(
-                  (item) => item.title == el.title
-                );
-                const temp_detail = this.wood_title_count.filter(
                   (item) => item.title == el.material_detail_title
                 );
                 if (temp && temp.length > 0) {
-                  this.wood_title_count.map((v) => {
-                    v.title == el.title && v.num++;
-                  });
-                } else {
-                  this.wood_title_count.push({
-                    title: el.title,
-                    num: el.num,
-                    unit: el.unit,
-                    measure_str: `${el.long || 0}*${el.wide || 0}*${el.high}`,
-                  });
-                }
-                if (temp_detail && temp_detail.length > 0) {
-                  this.wood_title_count.map((v) => {
-                    v.title == el.material_detail_title && v.num++;
-                  });
+                  // 匹配规格是否已存在
+                  const _temp = temp[0].measure_str.filter(
+                    (item) => item.id == el.material_detail_id
+                  );
+                  if (_temp && _temp.length > 0) {
+                    this.wood_title_count.map((v) => {
+                      v.title == el.material_detail_title &&
+                        v.measure_str.map((item) => {
+                          item.id == el.material_detail_id && (item.num=item.num+el.num);
+                        });
+                    });
+                  } else {
+                    // 不存在一样规格
+                    const __temp = el.material_detail_list.filter(
+                      (item) => item.material_detail_id == el.material_detail_id
+                    );
+                    this.wood_title_count.map((v) => {
+                      v.title == el.material_detail_title &&
+                        v.measure_str.push({
+                          num: el.num,
+                          id: __temp[0].material_detail_id,
+                          _measure_str: `${__temp[0].long || 0}*${__temp[0]
+                            .wide || 0}*${__temp[0].high || 0}`,
+                          unit: __temp[0].unit,
+                        });
+                    });
+                  }
                 } else {
+                  // 不存在就新增
+                  const _temp = el.material_detail_list.filter(
+                    (item) => item.material_detail_id == el.material_detail_id
+                  );
+                  total_line_unit = _temp[0].unit;
                   this.wood_title_count.push({
                     title: el.material_detail_title,
-                    num: el.num,
                     unit: el.unit,
-                    measure_str: `${el.long || 0}*${el.wide || 0}*${el.high}`,
+                    measure_str: [
+                      {
+                        num: el.num,
+                        id: _temp[0].material_detail_id,
+                        _measure_str: `${_temp[0].long || 0}*${_temp[0].wide ||
+                          0}*${_temp[0].high || 0}`,
+                        unit: _temp[0].unit,
+                      },
+                    ],
                   });
                 }
               }
             });
         });
       });
-
+      // 数线条
+      let total_line = 0;
+      this.wood_title_count.map((v) => {
+        v.measure_str.map((w) => {
+          total_line += w.num;
+        });
+      });
+      // 线条合计放进统计
+      this.parts_title_count.push({
+        title: "线 条",
+        num: total_line,
+        unit: total_line_unit,
+      });
+      // 计算价格
       this.info.predict_price = sum.toFixed(2);
       this.info.order_price = (
         (this.info.predict_price * this.fax) /
@@ -2640,7 +2685,7 @@ export default {
           element.high = eval(element.high);
           // 修改超标单价
           product.overdraft.forEach((item) => {
-            //  type 1  2 宽 3 高
+            //  type 1  2 宽 3 高
             if (item.type == 3) {
               if (element.high > item.min && element.high < item.max) {
                 product.over_price =
@@ -2656,7 +2701,7 @@ export default {
           element.long = eval(element.long);
           // 修改超标单价
           product.overdraft.forEach((item) => {
-            //  type 1  2 宽 3 高
+            //  type 1  2 宽 3 高
             if (item.type == 1) {
               if (element.long > item.min && element.long < item.max) {
                 product.over_price =
@@ -2672,7 +2717,7 @@ export default {
           element.wide = eval(element.wide);
           // 修改超标单价
           product.overdraft.forEach((item) => {
-            //  type 1  2 宽 3 高
+            //  type 1  2 宽 3 高
             if (item.type == 2) {
               if (element.wide > item.min && element.wide < item.max) {
                 product.over_price =

+ 22 - 16
src/views/OrderMannage/BusinessOrderlist/list.vue

@@ -324,7 +324,6 @@ export default {
           minWidth: 150,
         },
         { title: "客户地址", align: "center", key: "address", minWidth: 200 },
-        { title: "审核人", align: "center", key: "crt_name", minWidth: 150 },
         {
           title: "紧急程度",
           align: "center",
@@ -437,6 +436,12 @@ export default {
             ),
         },
         {
+          title: "制单人",
+          align: "center",
+          minWidth: 180,
+          key: "crt_name",
+        },
+        {
           title: "订单创建时间",
           align: "center",
           minWidth: 180,
@@ -565,6 +570,7 @@ export default {
         { is_show: true, key: "address", value: "客户地址", title: "客户地址" },
         { is_show: true, key: "salesman", value: "业务员", title: "业务员" },
         { is_show: true, key: "state", value: "订单状态", title: "订单状态" },
+        { is_show: true, key: "crt_name", value: "制单人", title: "制单人" },
         {
           is_show: true,
           key: "warning_state",
@@ -652,7 +658,6 @@ export default {
           title: "客户姓名",
         },
         { is_show: true, key: "address", value: "客户地址", title: "客户地址" },
-        { is_show: true, key: "crt_name", value: "审核人", title: "审核人" },
         {
           is_show: true,
           key: "warning_state",
@@ -694,6 +699,7 @@ export default {
           title: "生产进度",
         },
         { is_show: true, key: "state", value: "订单状态", title: "订单状态" },
+        { is_show: true, key: "crt_name", value: "制单人", title: "制单人" },
         {
           is_show: true,
           key: "crt_time",
@@ -1019,20 +1025,20 @@ export default {
           }
           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.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)
+          // );
         }
       });
     },

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

@@ -41,7 +41,7 @@ export default {
                 {type:'selection',fixed:'left',width:'90',align:'center'},
                 {title:'工序分类',align:'center',minWidth:150,key:'basic_title'},
                 {title:'工序',align:'center',minWidth:150,key:'procedure_title'},
-                {title:'操作人员',align:'center',minWidth:150,key:'username'},
+                {title:'班组信息',align:'center',minWidth:150,key:'username'},
                 {title:'完工状态',align:'center',minWidth:100,
                     render:(h,params)=>h('span',{},params.row.state == 3 ? '已完工' : '未完工')
                 },
@@ -67,13 +67,13 @@ export default {
     },
     created(){
         this.axios('/api/procedure_index').then(res=>this.produces = res.data.data)
-        this.axios('/api/user').then(res=>this.users = res.data.data)
+        this.axios('/api/employee_list').then(res=>this.users = res.data)
     },
     computed:{
         list(){
             const array = [
                 {title:'工序',filterable:true,name:'Select',value:'',serverName:'produce_id',optionName:'title',optionValue:'id',option:this.produces},
-                {title:'操作人员',filterable:true,name:'Select',value:'',optionName:'nickname',optionValue:'id',serverName:'user_id',option:this.users},
+                {title:'班组信息',filterable:true,name:'Select',value:'',optionName:'nickname',optionValue:'id',serverName:'user_id',option:this.users},
                 {title:'完工状态',name:'Select',value:'',serverName:'produce',option:[
                     {label:'未完工',value:1},
                     {label:'已完工',value:3},