Переглянути джерело

【新增】调整工程信息单

莫绍宝 3 роки тому
батько
коміт
9820450840

+ 9 - 0
src/api/supply/engin.js

@@ -72,6 +72,15 @@ export function editEngin(params) {
   })
 }
 
+// 工程信息单 - 编辑日期
+export function editDateEngin(params) {
+  return request({
+    url: '/engin-info-order/upd-date',
+    method: 'post',
+    data: params
+  })
+}
+
 // 工程信息单 - 提交审核
 export function submitEngin(params) {
   return request({

+ 4 - 4
src/views/setting/account.vue

@@ -132,7 +132,7 @@
           <el-input v-model="AccountForm.nickName" autocomplete="off" placeholder="请输入用户名"></el-input>
         </el-form-item>
         <el-form-item label="角色组" prop="role">
-          <el-select v-model="AccountForm.role" placeholder="请选择角色组" style="width: 100%;">
+          <el-select v-model="AccountForm.role" placeholder="请选择角色组" style="width: 100%;" filterable>
             <el-option :label="item.name" :value="item.adminRoleId" v-for="(item, index) in roleList" :key="index"></el-option>
           </el-select>
         </el-form-item>
@@ -148,12 +148,12 @@
           </el-tree>
         </el-form-item>
         <el-form-item label="经销商" prop="dealer" v-show="roleObj.type === 0 && roleObj.name === '经销商'">
-          <el-select v-model="AccountForm.dealer" placeholder="请选择经销商" style="width: 100%;">
+          <el-select v-model="AccountForm.dealer" placeholder="请选择经销商" style="width: 100%;" filterable>
             <el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item label="商户" prop="merchant" v-show="roleObj.type === 1 || roleObj.type === 2">
-          <el-select v-model="AccountForm.merchant" placeholder="请选择商户" style="width: 100%;">
+          <el-select v-model="AccountForm.merchant" placeholder="请选择商户" style="width: 100%;" filterable>
             <el-option :label="item.adminCompanyName" :value="item.adminCompanyId" v-for="(item, index) in merchantList" :key="index"></el-option>
           </el-select>
         </el-form-item>
@@ -164,7 +164,7 @@
           </el-radio-group>
         </el-form-item>
         <el-form-item label="所属集团" prop="company" v-show="roleObj.type === 0 && roleObj.name === '经销商' && !AccountForm.isGroup">
-          <el-select v-model="AccountForm.company" placeholder="请选择所属集团" style="width: 100%;">
+          <el-select v-model="AccountForm.company" placeholder="请选择所属集团" style="width: 100%;" filterable>
             <el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
           </el-select>
         </el-form-item>

+ 1 - 1
src/views/supply/engin/commerce_list.vue

@@ -95,7 +95,7 @@
               <template slot-scope="scope">
                 <div>
                   <span>{{scope.row.orderDate | dateToDayFilter}}</span>
-                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" ></el-button>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" v-if="scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT'" ></el-button>
                 </div>
               </template>
             </el-table-column>

+ 1 - 10
src/views/supply/engin/components/commerce_detail.vue

@@ -166,7 +166,7 @@
     </div>
 
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="danger" @click="closeData">关闭订单</el-button>
         <el-button type="primary" @click="openDirectDialog">提前开票</el-button>
         <el-button type="primary" @click="overData">直调完结</el-button>
@@ -377,15 +377,6 @@ export default {
   },
 
   computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
     isExamine() {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
     },

+ 1 - 13
src/views/supply/engin/components/commerce_examine.vue

@@ -170,7 +170,7 @@
     </div>
 
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm(1)">审批通过</el-button>
         <el-button type="warning" @click="clickSubmitForm(0)">审批驳回</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
@@ -214,18 +214,6 @@ export default {
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },

+ 1 - 13
src/views/supply/engin/components/commerce_return.vue

@@ -168,7 +168,7 @@
     </div>
 
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm()">确定退订</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
@@ -211,18 +211,6 @@ export default {
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },

+ 5 - 14
src/views/supply/engin/components/engin_detail.vue

@@ -76,14 +76,14 @@
           <div class="label">合同有效期</div>
           <div class="value">{{detailData.contractExpireDate}}</div>
         </el-col>
-        <el-col :span="16" class="item">
-          <div class="label">备注</div>
-          <div class="value">{{detailData.remark}}</div>
-        </el-col>
         <el-col :span="8" class="item">
           <div class="label">业务员</div>
           <div class="value">{{detailData.serviceName}}</div>
         </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">备注</div>
+          <div class="value">{{detailData.remark}}</div>
+        </el-col>
       </el-row>
     </div>
 
@@ -130,7 +130,7 @@
     </div>
 
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button @click="goBack">关 闭</el-button>
       </div>
     </div>
@@ -165,15 +165,6 @@ export default {
   },
 
   computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
     isExamine() {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
     },

+ 1 - 13
src/views/supply/engin/components/engin_examine.vue

@@ -190,7 +190,7 @@
     </div>
 
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
         <el-popconfirm
           title="确定关闭吗?"
@@ -243,18 +243,6 @@ export default {
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
     this.getTypeList();

+ 36 - 36
src/views/supply/engin/components/engin_form.vue

@@ -25,13 +25,15 @@
             </el-date-picker>
           </el-form-item>
         </el-col>
-        <el-col :xs="24" :sm="12" :lg="8">
+        <!-- <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="产品大类" prop="mainId">
             <el-select v-model="mainForm.mainId" placeholder="选择产品大类" style="width: 100%">
               <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
             </el-select>
           </el-form-item>
-        </el-col>
+        </el-col> -->
+      </el-row>
+      <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="经销商编码" prop="jxsNum">
             <el-input v-model="mainForm.jxsNum" placeholder="请输入经销商编码" disabled></el-input>
@@ -154,9 +156,9 @@
         </el-table-column>
         <el-table-column align="center" label="产品名称" prop="materialNumber" min-width="160" show-overflow-tooltip>
           <template slot-scope="scope">
-            <el-select v-model="scope.row.materialNumber" placeholder="选择产品" size="small" @change="changeGoods(scope.$index)">
+            <el-select v-model="scope.row.materialNumber" placeholder="选择产品" size="small" @change="changeGoods(scope.$index)" :disabled="!scope.row.saleTypeId">
               <el-option
-                v-for="item in retailProductList"
+                v-for="item in scope.row.productList"
                 :key="item.number"
                 :label="item.name"
                 :value="item.number">
@@ -194,7 +196,7 @@
     </div>
 
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm(1)">保 存</el-button>
         <el-button type="primary" @click="clickSubmitForm(2)">提交审核</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
@@ -220,7 +222,7 @@ export default {
       mainForm: {
         orderNum: '',
         orderDate: '',
-        mainId: '102',
+        // mainId: '102',
         jxsNum: '',
         enginName: '',
         orderType: '',
@@ -254,23 +256,9 @@ export default {
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-
-  },
-
   created() {
     this.getDictList();
     this.getTypeList();
-    this.getRetailProductList();
     if(this.listItem) {
       this.getDetail();
     }else {
@@ -310,7 +298,7 @@ export default {
         let data = res.data;
         this.mainForm.orderNum = data.enginInfoNo;
         this.mainForm.orderDate = data.orderDate;
-        this.mainForm.mainId = data.productCategoryId;
+        // this.mainForm.mainId = data.productCategoryId;
         this.mainForm.jxsNum = data.customerId;
         this.mainForm.enginName = data.projectName;
         this.mainForm.orderType = data.orderType;
@@ -330,6 +318,10 @@ export default {
         this.mainForm.contractDate = data.contractExpireDate;
 
         this.goodsList = data.items;
+
+        for (let i = 0; i < this.goodsList.length; i++) {
+          this.getRetailProductList(i);
+        }
       })
     },
 
@@ -351,12 +343,15 @@ export default {
     },
 
     // 获取商品列表
-    getRetailProductList() {
+    getRetailProductList(index) {
       getRetailProductList({
         pageNum: 1,
         pageSize: -1,
+        saleId: this.goodsList[index].saleTypeId
       }).then(res => {
-        this.retailProductList = res.data.records;
+        let item = this.goodsList[index];
+        item.productList = res.data.records;
+        this.$set(this.goodsList, index, item);
       })
     },
 
@@ -367,19 +362,28 @@ export default {
         this.goodsList[index].saleTypeName = obj.saleName;
         this.goodsList[index].saleTypeCode = obj.saleCode;
       }
+      this.goodsList[index].materialNumber = '';
+      this.goodsList[index].materialName = '';
+      this.goodsList[index].materialId = '';
+      this.goodsList[index].specification = '';
+      this.goodsList[index].unit = '';
+      this.goodsList[index].price = '';
+      this.goodsList[index].taxRate = '';
+      this.getRetailProductList(index);
     },
 
     // 修改产品
     changeGoods(index) {
       if(this.goodsList[index].materialNumber) {
-        let obj = this.retailProductList.find(o => o.number == this.goodsList[index].materialNumber);
-        this.goodsList[index].materialName = obj.name;
-        this.goodsList[index].materialId = obj.materialId;
-        this.goodsList[index].specification = obj.specification;
-        this.goodsList[index].baseUnitId = obj.baseUnit;
-        this.goodsList[index].price = obj.batchPrice;
-        this.goodsList[index].taxRate = obj.taxRate;
-        this.goodsList[index].mainId = obj.mainId;
+        let obj = this.goodsList[index].productList.find(o => o.number == this.goodsList[index].materialNumber);
+        let item = this.goodsList[index];
+        item.materialName = obj.name;
+        item.materialId = obj.materialId;
+        item.specification = obj.specification;
+        item.unit = obj.unit;
+        item.price = obj.batchPrice;
+        item.taxRate = obj.taxRate;
+        this.$set(this.goodsList, index, item);
       }
     },
 
@@ -401,14 +405,10 @@ export default {
               this.$errorMsg('请选择销售类型');
               return;
             }
-          }
-          for(let i=0; i<this.goodsList.length; i++) {
             if(!this.goodsList[i].materialNumber) {
               this.$errorMsg('请选择产品');
               return;
             }
-          }
-          for(let i=0; i<this.goodsList.length; i++) {
             if(!this.goodsList[i].qty) {
               this.$errorMsg('请输入数量');
               return;
@@ -417,7 +417,7 @@ export default {
 
           let params = {
             // orderDate: this.mainForm.orderDate + ' 00:00:00',
-            mainId: this.mainForm.mainId,
+            // mainId: this.mainForm.mainId,
             projectName: this.mainForm.enginName,
             orderType: this.mainForm.orderType,
             useUnit: this.mainForm.company,

+ 7 - 12
src/views/supply/engin/components/home_detail.vue

@@ -143,7 +143,11 @@
           <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ (scope.row.qty*100 - scope.row.directTransferQty*100 - scope.row.retiredQty*100) / 100 }}
+            </template>
+          </el-table-column>
           <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
@@ -156,7 +160,7 @@
             </template>
           </el-table-column>
           <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="原订单数量" prop="enginNum" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="原订单数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
         </el-table>
@@ -165,7 +169,7 @@
     </div>
 
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="danger" @click="closeData">关闭订单</el-button>
         <el-button type="primary" @click="openDirectDialog">提前开票</el-button>
         <el-button type="primary" @click="overData">直调完结</el-button>
@@ -376,15 +380,6 @@ export default {
   },
 
   computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
     isExamine() {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
     },

+ 6 - 15
src/views/supply/engin/components/home_examine.vue

@@ -129,7 +129,11 @@
         <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="工程登录数量" prop="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{ (scope.row.qty*100 - scope.row.directTransferQty*100 - scope.row.retiredQty*100) / 100 }}
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="返利类型" prop="customerWalletName2" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
@@ -143,7 +147,6 @@
         </el-table-column>
         <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="已发货数量" prop="hasSendQty" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="已退数量" prop="retiredQty" min-width="100" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
       </el-table>
@@ -170,7 +173,7 @@
     </div>
 
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm(1)">审批通过</el-button>
         <el-button type="warning" @click="clickSubmitForm(0)">审批驳回</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
@@ -214,18 +217,6 @@ export default {
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },

+ 1 - 13
src/views/supply/engin/components/home_return.vue

@@ -168,7 +168,7 @@
     </div>
 
     <div class="page-footer">
-      <div class="footer" :class="classObj">
+      <div class="footer">
         <el-button type="primary" @click="clickSubmitForm()">确定退订</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
@@ -211,18 +211,6 @@ export default {
     }
   },
 
-  computed: {
-    sidebar() {
-      return this.$store.state.app.sidebar
-    },
-    classObj() {
-      return {
-        hideSidebar: !this.sidebar.opened,
-        openSidebar: this.sidebar.opened
-      }
-    },
-  },
-
   created() {
     this.getDetail();
   },

+ 3 - 3
src/views/supply/engin/engin_list.vue

@@ -93,7 +93,7 @@
               <template slot-scope="scope">
                 <div>
                   <span>{{scope.row.orderDate | dateToDayFilter}}</span>
-                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" ></el-button>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" v-if="scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT'" ></el-button>
                 </div>
               </template>
             </el-table-column>
@@ -160,7 +160,7 @@
 </template>
 
 <script>
-import { getEnginList, applyEngin, withdrawEngin, deleteEngin, editEngin } from "@/api/supply/engin";
+import { getEnginList, applyEngin, withdrawEngin, deleteEngin, editDateEngin } from "@/api/supply/engin";
 import EnginDetail from "@/views/supply/engin/components/engin_detail";
 import EnginForm from "@/views/supply/engin/components/engin_form";
 import EnginExamine from "@/views/supply/engin/components/engin_examine";
@@ -357,7 +357,7 @@ export default {
 
     // 提交 修改订单日期
     submitDateForm() {
-      editEngin({
+      editDateEngin({
         enginInfoId: this.editId,
         orderDate: this.dateForm.date + ' 00:00:00',
       }).then(res => {

+ 1 - 1
src/views/supply/engin/home_list.vue

@@ -95,7 +95,7 @@
               <template slot-scope="scope">
                 <div>
                   <span>{{scope.row.orderDate | dateToDayFilter}}</span>
-                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" ></el-button>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" v-if="scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT'" ></el-button>
                 </div>
               </template>
             </el-table-column>