浏览代码

Merge branch 'feature/Feature-supply' into develop

莫绍宝 3 年之前
父节点
当前提交
6efdc0d98a

+ 1 - 1
src/api/common.js

@@ -10,7 +10,7 @@ export function getDictList(params) {
 }
 
 // 销售列表
-export function getTypeList() {
+export function getTypeList(params) {
   return request({
     url: '/sale/type/list',
     method: 'get',

+ 19 - 1
src/api/supply/engin.js

@@ -3,7 +3,7 @@ import request from '@/utils/request'
 // 获取列表
 export function getList(params) {
   return request({
-    url: '/retail/list',
+    url: '/engin-info-order/list',
     method: 'get',
     params
   })
@@ -16,4 +16,22 @@ export function getDetail(params) {
     method: 'get',
     params
   })
+}
+
+// 获取列表
+export function getEnginList(params) {
+  return request({
+    url: '/engin-info-order/list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取详情
+export function getEnginDetail(params) {
+  return request({
+    url: '/engin-info-order/detail',
+    method: 'get',
+    params
+  })
 }

+ 115 - 196
src/views/supply/engin/components/engin_detail.vue

@@ -2,104 +2,104 @@
   <div class="detail-container">
     <el-page-header @back="goBack" content="详情"></el-page-header>
 
-    <div id="printData">
-      <div class="main-title">
-        <div class="title">工程信息单</div>
-      </div>
+    <div class="main-title">
+      <div class="title">工程信息单</div>
+    </div>
 
-      <div class="diy-table-1">
-        <el-row>
-          <el-col :span="8" class="item">
-            <div class="label">工程订单号</div>
-            <div class="value">{{detailData.billNo}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">订单日期</div>
-            <div class="value">{{detailData.fdate}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">单据状态</div>
-            <div class="value">{{detailData.srcStockId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">经销商编码</div>
-            <div class="value">{{detailData.destStockId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">项目名称</div>
-            <div class="value">{{detailData.approveDate}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">单据类型</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">经销商名称</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">使用单位</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">安装地址</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">工程编号</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">厂工厂编码</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">工程登录类型</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">制单人</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">制单日期</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">合同有效期</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="16" class="item">
-            <div class="label">备注</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">业务员</div>
-            <div class="value">{{detailData.approverId}}</div>
-          </el-col>
-        </el-row>
-      </div>
+    <div class="diy-table-1">
+      <el-row>
+        <el-col :span="8" class="item">
+          <div class="label">工程订单号</div>
+          <div class="value">{{detailData.enginInfoNo}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">订单日期</div>
+          <div class="value">{{detailData.orderDate}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据状态</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商编码</div>
+          <div class="value">{{detailData.customerId}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">项目名称</div>
+          <div class="value">{{detailData.projectName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据类型</div>
+          <div class="value">{{detailData.orderType}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商名称</div>
+          <div class="value">{{detailData.customerName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">使用单位</div>
+          <div class="value">{{detailData.useUnit}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">安装地址</div>
+          <div class="value">{{detailData.installAddress}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">工程编号</div>
+          <div class="value">{{detailData.projectNo}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">厂工程编码</div>
+          <div class="value">{{detailData.enginFactoryNo}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">工程登录类型</div>
+          <div class="value">{{detailData.enginSignType}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">制单人</div>
+          <div class="value">{{detailData.createName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">制单日期</div>
+          <div class="value">{{detailData.createTime}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <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.serviceId}}</div>
+        </el-col>
+      </el-row>
+    </div>
 
-      <div class="main-title">
-        <div class="title">货品信息</div>
-      </div>
+    <div class="main-title">
+      <div class="title">货品信息</div>
+    </div>
 
-      <div class="table" style="margin-top: 20px">
-        <el-table :data="detailData.kingDeeTransferItems" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="销售类型" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编码" prop="model" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="baseUnitId" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="规格型号" prop="qty" min-width="160" 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></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></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></el-table-column>
-        </el-table>
-      </div>
+    <div class="table" style="margin-top: 20px">
+      <el-table :data="detailData.items" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单位" prop="baseUnitId" 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="qty" min-width="100" show-overflow-tooltip></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="remark" min-width="200" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="税率" prop="taxRate" min-width="100" show-overflow-tooltip></el-table-column>
+      </el-table>
+    </div>
 
+    <div v-if="isExamine">
       <div class="main-title">
         <div class="title">审批记录</div>
       </div>
@@ -107,121 +107,52 @@
         <el-row :gutter="0">
           <el-col :span="12" class="item">
             <div class="label">审批人</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.confirmName}}</div>
           </el-col>
           <el-col :span="12" class="item">
             <div class="label">审批结果</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.examineStatus | statusFilter}}</div>
           </el-col>
           <el-col :span="24" class="item">
             <div class="label">审批说明</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.examineNote}}</div>
           </el-col>
         </el-row>
       </div>
-      
     </div>
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button  type="primary" @click="openDeliverDialog">直调发货</el-button>
-        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
-          <el-button slot="reference">关 闭</el-button>
-        </el-popconfirm>
+        <el-button @click="goBack">关 闭</el-button>
       </div>
     </div>
 
-    <el-dialog
-      title="直调发货"
-      :visible.sync="isShowDeliverDialog"
-      width="80%">
-      <el-form ref="deliverForm" :model="deliverForm" label-width="70px" size="small" label-position="left">
-        <el-row :gutter="20">
-          <el-col :xs="24" :sm="8" :lg="8">
-            <el-form-item label="工程订单" prop="orderNum">
-              <el-input v-model="deliverForm.orderNum" placeholder="请输入工程订单"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="8" :lg="8" style="height: 51px;">
-            <el-form-item label="发货日期" prop="date">
-              <el-date-picker
-                v-model="deliverForm.date"
-                type="date"
-                value-format="yyyy-MM-dd"
-                style="width: 100%;"
-                placeholder="选择日期">
-              </el-date-picker>
-            </el-form-item>
-          </el-col>
-          <el-col :xs="24" :sm="8" :lg="8">
-            <el-form-item label="发货仓库" prop="warehouse">
-              <el-select v-model="deliverForm.warehouse" placeholder="请选择发货仓库">
-                <el-option
-                  v-for="item in warehouseList"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value">
-                </el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-
-      <div class="table" style="margin-top: 20px">
-        <el-table :data="detailData.kingDeeTransferItems" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="引用记录" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="销售类型" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品编码" prop="model" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="产品名称" prop="baseUnitId" min-width="160" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="规格型号" prop="qty" min-width="160" 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></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></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></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></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></el-table-column>
-          <el-table-column align="center" label="备注" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
-        </el-table>
-      </div>
-      <span slot="footer" class="dialog-footer">
-        <el-button @click="closeDeliverDialog">取 消</el-button>
-        <el-button type="primary" @click="submitDeliverForm">确 定</el-button>
-      </span>
-    </el-dialog>
-
   </div>
 </template>
 
 <script>
-import print from 'vue-print-nb'
-import { getDetail } from "@/api/supply/engin";
+import { getEnginDetail } from "@/api/supply/engin";
 
 export default {
   name: 'EnginDetail',
   componentName: 'EnginDetail',
   props: ['listItem'],
-  directives: {
-    print
+  filters: {
+    statusFilter(val) {
+      const statusList = [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ];
+      let obj = statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
   },
   data() {
     return {
-      printObj: {
-        id: 'printData'
-      },
       detailData: {},
-
-      isShowDeliverDialog: false,
-      deliverForm: {
-        orderNum: '',
-        date: '',
-      },
-      warehouseList: [],
     }
   },
 
@@ -235,6 +166,9 @@ export default {
         openSidebar: this.sidebar.opened
       }
     },
+    isExamine() {
+      return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
+    },
   },
 
   created() {
@@ -249,26 +183,11 @@ export default {
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
+      getEnginDetail({id: this.listItem.enginInfoId}).then(res => {
         this.detailData = res.data;
       })
     },
 
-    // 打开 直调发货
-    openDeliverDialog() {
-      this.isShowDeliverDialog = true;
-    },
-
-    // 关闭 直调发货
-    closeDeliverDialog() {
-      this.isShowDeliverDialog = false;
-    },
-
-    // 提交 直调发货
-    submitDeliverForm() {
-
-    },
-
   }
 }
 </script>

+ 89 - 31
src/views/supply/engin/components/engin_examine.vue

@@ -10,71 +10,71 @@
       <el-row>
         <el-col :span="8" class="item">
           <div class="label">工程订单号</div>
-          <div class="value">{{detailData.billNo}}</div>
+          <div class="value">{{detailData.enginInfoNo}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">订单日期</div>
-          <div class="value">{{detailData.fdate}}</div>
+          <div class="value">{{detailData.orderDate}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据状态</div>
-          <div class="value">{{detailData.srcStockId}}</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">经销商编码</div>
-          <div class="value">{{detailData.destStockId}}</div>
+          <div class="value">{{detailData.customerId}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">项目名称</div>
-          <div class="value">{{detailData.approveDate}}</div>
+          <div class="value">{{detailData.projectName}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据类型</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="value">{{detailData.orderType}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">经销商名称</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="value">{{detailData.customerName}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">使用单位</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="value">{{detailData.useUnit}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">安装地址</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="value">{{detailData.installAddress}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">工程编号</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="value">{{detailData.projectNo}}</div>
         </el-col>
         <el-col :span="8" class="item">
-          <div class="label">厂工编码</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="label">厂工编码</div>
+          <div class="value">{{detailData.enginFactoryNo}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">工程登录类型</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="value">{{detailData.enginSignType}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">制单人</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="value">{{detailData.createName}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">制单日期</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="value">{{detailData.createTime}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">合同有效期</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="value">{{detailData.contractExpireDate}}</div>
         </el-col>
         <el-col :span="16" class="item">
           <div class="label">备注</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="value">{{detailData.remark}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">业务员</div>
-          <div class="value">{{detailData.approverId}}</div>
+          <div class="value">{{detailData.serviceId}}</div>
         </el-col>
       </el-row>
     </div>
@@ -84,18 +84,39 @@
     </div>
 
     <div class="table" style="margin-top: 20px">
-      <el-table :data="detailData.kingDeeTransferItems" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+      <el-table :data="detailData.items" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
         <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-        <el-table-column align="center" label="销售类型" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="产品编码" prop="model" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="产品名称" prop="baseUnitId" min-width="160" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="规格型号" prop="qty" min-width="160" 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></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeId" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.saleTypeId" placeholder="选择销售类型" size="small" @change="changeWallet(scope.$index)">
+              <el-option
+                v-for="item in salesTypeList"
+                :key="item.id"
+                :label="item.saleName"
+                :value="item.id">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip>
+          
+        </el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单位" prop="baseUnitId" 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="qty" 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="qty" 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="订单金额" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{scope.row.price * scope.row.qty}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="200" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remark" size="small"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="税率" prop="taxRate" min-width="100" show-overflow-tooltip></el-table-column>
       </el-table>
     </div>
 
@@ -141,12 +162,26 @@
 </template>
 
 <script>
-import { getDetail } from "@/api/supply/engin";
+import { getEnginDetail } from "@/api/supply/engin";
+import { getTypeList } from "@/api/common";
 
 export default {
   name: 'EnginExamine',
   componentName: 'EnginExamine',
   props: ['listItem'],
+  filters: {
+    statusFilter(val) {
+      const statusList = [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ];
+      let obj = statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
   data() {
     return {
       detailData: {},
@@ -156,7 +191,9 @@ export default {
       examineForm: {
         status: true,
         remark: '',
-      }
+      },
+
+      salesTypeList: [],
     }
   },
 
@@ -174,6 +211,7 @@ export default {
 
   created() {
     this.getDetail();
+    this.getTypeList();
   },
 
   methods: {
@@ -184,11 +222,31 @@ export default {
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
+      getEnginDetail({id: this.listItem.enginInfoId}).then(res => {
         this.detailData = res.data;
       })
     },
 
+    // 获取销售类型列表
+    getTypeList() {
+      getTypeList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then((res) => {
+        this.salesTypeList = res.data.records;
+      });
+    },
+
+    // 修改返利钱包
+    changeWallet(index) {
+      if(this.goodsList[index].customerWalletId2) {
+        let obj = this.flWalletList.find(o => o.customerWalletId == this.goodsList[index].customerWalletId2);
+        this.goodsList[index].rebateRate = obj.rebateRate;
+      }else {
+        this.goodsList[index].rebateRate = '';
+      }
+    },
+
     clickSubmitForm() {
 
     },

+ 100 - 59
src/views/supply/engin/engin_list.vue

@@ -1,17 +1,15 @@
 <template>
   <div class="app-container">
-    <div v-show="!isShowDetail && !isShowForm">
+    <div v-show="!isShowDetail && !isShowForm && !isShowExamine">
       <!-- 筛选条件 -->
       <div class="screen-container">
         <el-form ref="screenForm" :model="screenForm" label-width="100px" size="small" label-position="left">
           <el-row :gutter="20">
             <el-col :xs="24" :sm="24" :lg="24">
-              <el-form-item prop="orderNum" label-width="0">
-                <el-radio-group v-model="screenForm.status" size="medium">
-                  <el-radio-button label="1">全部</el-radio-button>
-                  <el-radio-button label="2">已保存</el-radio-button>
-                  <el-radio-button label="3">待审核</el-radio-button>
-                  <el-radio-button label="3">已审核</el-radio-button>
+              <el-form-item prop="status" label-width="0">
+                <el-radio-group v-model="screenForm.status" size="medium" @change="getList()">
+                  <el-radio-button label="">全部</el-radio-button>
+                  <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
                 </el-radio-group>
               </el-form-item>
             </el-col>
@@ -21,18 +19,18 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="工程编码" prop="orderNum">
-                <el-input v-model="screenForm.orderNum" placeholder="请输入工程编码"></el-input>
+              <el-form-item label="工程编码" prop="enginNum">
+                <el-input v-model="screenForm.enginNum" placeholder="请输入工程编码"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="工程登录单号" prop="jxsName">
-                <el-input v-model="screenForm.jxsName" placeholder="请输入工程登录单号"></el-input>
+              <el-form-item label="工程登录单号" prop="loginNum">
+                <el-input v-model="screenForm.loginNum" placeholder="请输入工程登录单号"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="工程名称" prop="jxsNum">
-                <el-input v-model="screenForm.jxsNum" placeholder="请输入工程名称"></el-input>
+              <el-form-item label="工程名称" prop="enginName">
+                <el-input v-model="screenForm.enginName" placeholder="请输入工程名称"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -49,23 +47,23 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="经销商" prop="chName">
-                <el-input v-model="screenForm.chName" placeholder="请输入经销商"></el-input>
+              <el-form-item label="经销商" prop="dealer">
+                <el-input v-model="screenForm.dealer" placeholder="请输入经销商"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="使用单位" prop="model">
-                <el-input v-model="screenForm.model" placeholder="请输入使用单位"></el-input>
+              <el-form-item label="使用单位" prop="company">
+                <el-input v-model="screenForm.company" placeholder="请输入使用单位"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="制表人" prop="model">
-                <el-input v-model="screenForm.model" placeholder="请输入制表人"></el-input>
+              <el-form-item label="制表人" prop="createMan">
+                <el-input v-model="screenForm.createMan" placeholder="请输入制表人"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="审核人" prop="model">
-                <el-input v-model="screenForm.model" placeholder="请输入审核人"></el-input>
+              <el-form-item label="审核人" prop="examineMan">
+                <el-input v-model="screenForm.examineMan" placeholder="请输入审核人"></el-input>
               </el-form-item>
             </el-col>
             
@@ -90,25 +88,30 @@
         </div>
         <div class="table">
           <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-            <el-table-column align="center" label="工程信息单" prop="shipOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单据日期" prop="shipTime" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="经销商编码" prop="stockName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="经销商名称" prop="projectNumber" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="工程信息单" prop="enginInfoNo" min-width="200" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="单据日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程名称" prop="projectName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="安装地址" prop="unit" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="产品名称" prop="unit" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="规格型号" prop="number" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单位" prop="number" min-width="160" 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="customerNumber" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="制表人" prop="createTime" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="制表日期" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核人" prop="aaa" min-width="200" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核日期" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核状态" prop="aaa" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="安装地址" prop="installAddress" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="单位" prop="baseUnitId" 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="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制表人" prop="createName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核人" prop="confirmName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.examineStatus | statusFilter}}
+              </template>
+            </el-table-column>
             <el-table-column align="center" label="操作" width="160" fixed="right">
               <template slot-scope="scope">
-                <el-button type="text" @click="toForm(scope.row)">编辑</el-button>
+                <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">审批</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
                 <el-popconfirm v-if="scope.row.status" style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" >
                   <el-button slot="reference" type="text">删除</el-button>
@@ -135,19 +138,29 @@
     
     <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
+    <EnginExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
 
   </div>
 </template>
 
 <script>
-import { getList } from "@/api/supply/engin";
+import { getEnginList } 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";
 
+let that
 export default {
   components: {
     EnginDetail,
     EnginForm,
+    EnginExamine,
+  },
+  filters: {
+    statusFilter(val) {
+      let obj = that.statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
   },
   data() {
     return {
@@ -158,35 +171,53 @@ export default {
       listLoading: false, // 列表加载loading
       screenForm: { // 筛选表单数据
         orderNum: '',
-        jxsName: '',
-        chName: '',
-        model: '',
+        enginNum: '',
+        loginNum: '',
+        enginName: '',
         date: '',
-        jxsNum: '',
+        dealer: '',
+        company: '',
+        createMan: '',
+        examineMan: '',
         status: '',
       },
+      statusList: [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ],
 
       queryItem: {},
       isShowDetail: false,
       isShowForm: false,
+      isShowExamine: false,
     }
   },
 
   computed: {
     exParams() {
       return {
-        retreatOrderNo: this.screenForm.orderNum,
-        customerNumber: this.screenForm.jxsNum,
-        customerName: this.screenForm.jxsName,
-        productName: this.screenForm.chName,
-        specification: this.screenForm.model,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: 2, // 1:发货单,2:工程发货单
+        enginInfoNo: this.screenForm.orderNum,
+        projectNo: this.screenForm.enginNum,
+        enginSignType: this.screenForm.loginNum,
+        projectName: this.screenForm.enginName,
+        startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
+        endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
+        customerKeyWord: this.screenForm.dealer,
+        useUnit: this.screenForm.company,
+        createName: this.screenForm.createMan,
+        confirmName: this.screenForm.examineMan,
+        status: this.screenForm.status,
       }
     },
   },
 
+  beforeCreate() {
+    that = this;
+  },
+
   created() {
     this.getList();
   },
@@ -208,16 +239,19 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        retreatOrderNo: this.screenForm.orderNum,
-        customerNumber: this.screenForm.jxsNum,
-        customerName: this.screenForm.jxsName,
-        productName: this.screenForm.chName,
-        specification: this.screenForm.model,
-        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
-        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: 2, // 1:发货单,2:工程发货单
+        enginInfoNo: this.screenForm.orderNum,
+        projectNo: this.screenForm.enginNum,
+        enginSignType: this.screenForm.loginNum,
+        projectName: this.screenForm.enginName,
+        startContractExpireDate: this.screenForm.date ? this.screenForm.date[0] : '',
+        endContractExpireDate: this.screenForm.date ? this.screenForm.date[1] : '',
+        customerKeyWord: this.screenForm.dealer,
+        useUnit: this.screenForm.company,
+        createName: this.screenForm.createMan,
+        confirmName: this.screenForm.examineMan,
+        status: this.screenForm.status,
       };
-      getList(params).then((res) => {
+      getEnginList(params).then((res) => {
         this.dataList = res.data.records;
         this.listTotal = res.data.total;
         this.listLoading = false;
@@ -256,6 +290,12 @@ export default {
       this.isShowForm = true;
     },
 
+    // 进入审批
+    toExamine(item) {
+      this.queryItem = item;
+      this.isShowExamine = true;
+    },
+
     // 进入详情
     toDetail(item) {
       this.queryItem = item;
@@ -266,6 +306,7 @@ export default {
       this.queryItem = {};
       this.isShowDetail = false;
       this.isShowForm = false;
+      this.isShowExamine = false;
     },
 
     handleDelete(id) {