Ver Fonte

【新增】
1.家用工程订单
2.销售出库单

莫绍宝 há 3 anos atrás
pai
commit
6b11e9a02c

+ 121 - 2
src/api/supply/engin.js

@@ -126,6 +126,20 @@ export function getOrderDetail(params) {
   })
 }
 
+// 工程订单 - 直调完结
+export function overOrder(params) {
+  return request({
+    url: '/engin-order/end-direct-transfer',
+    method: 'post',
+    params
+  })
+}
+
+
+
+
+
+
 // 家用工程订单 - 获取工程登录列表
 export function getHomeLoginList(params) {
   return request({
@@ -162,6 +176,53 @@ export function editHome(params) {
   })
 }
 
+// 家用工程订单 - 提交审核
+export function submitHome(params) {
+  return request({
+    url: '/engin-order/home-submit',
+    method: 'post',
+    data: params
+  })
+}
+
+// 家用工程订单 - 申请
+export function applyHome(params) {
+  return request({
+    url: '/engin-order/home-submit-on-list',
+    method: 'post',
+    params
+  })
+}
+
+// 家用工程订单 - 撤回
+export function withdrawHome(params) {
+  return request({
+    url: '/engin-order/home-revoke',
+    method: 'post',
+    params
+  })
+}
+
+// 家用工程订单 - 删除
+export function deleteHome(params) {
+  return request({
+    url: '/engin-order/home-del',
+    method: 'post',
+    params
+  })
+}
+
+// 家用工程订单 - 关闭订单
+export function closeHome(params) {
+  return request({
+    url: '/engin-order/home-close',
+    method: 'post',
+    params
+  })
+}
+
+
+
 
 
 // 商用工程订单 - 获取工程登录列表
@@ -185,7 +246,7 @@ export function getComLoginDetail(params) {
 // 商用工程订单 - 新增
 export function addCom(params) {
   return request({
-    url: '/engin-order/home-add',
+    url: '/engin-order/trade-add',
     method: 'post',
     data: params
   })
@@ -194,12 +255,61 @@ export function addCom(params) {
 // 商用工程订单 - 编辑
 export function editCom(params) {
   return request({
-    url: '/engin-order/home-edit',
+    url: '/engin-order/trade-edit',
     method: 'post',
     data: params
   })
 }
 
+// 商用工程订单 - 提交审核
+export function submitCom(params) {
+  return request({
+    url: '/engin-order/trade-submit',
+    method: 'post',
+    data: params
+  })
+}
+
+// 商用工程订单 - 申请
+export function applyCom(params) {
+  return request({
+    url: '/engin-order/trade-submit-on-list',
+    method: 'post',
+    params
+  })
+}
+
+// 商用工程订单 - 撤回
+export function withdrawCom(params) {
+  return request({
+    url: '/engin-order/trade-revoke',
+    method: 'post',
+    params
+  })
+}
+
+// 商用工程订单 - 删除
+export function deleteCom(params) {
+  return request({
+    url: '/engin-order/trade-del',
+    method: 'post',
+    params
+  })
+}
+
+// 商用工程订单 - 关闭订单
+export function closeCom(params) {
+  return request({
+    url: '/engin-order/trade-close',
+    method: 'post',
+    params
+  })
+}
+
+
+
+
+
 // 获取仓库列表
 export function getWarehouseList(params) {
   return request({
@@ -216,4 +326,13 @@ export function checkStock(params) {
     method: 'get',
     params
   })
+}
+
+// 获取钱包列表
+export function getWalletList(params) {
+  return request({
+    url: '/wallet/customer/list',
+    method: 'get',
+    params
+  })
 }

+ 20 - 3
src/api/supply/sales.js

@@ -1,11 +1,28 @@
 import request from '@/utils/request'
 
-
-// 销售政策
+// 获取列表
 export function getList(params) {
   return request({
-    url: '/policy/list',
+    url: '/sale/order/list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取详情
+export function getDetail(params) {
+  return request({
+    url: '/sale/order/detail',
     method: 'get',
     params
   })
 }
+
+// 审批
+export function examineData(params) {
+  return request({
+    url: '/sale/order/approval',
+    method: 'post',
+    data: params
+  })
+}

+ 140 - 79
src/views/supply/engin/components/home_detail.vue

@@ -10,92 +10,120 @@
       <div class="diy-table-1">
         <el-row>
           <el-col :span="8" class="item">
-            <div class="label">订单号</div>
-            <div class="value">{{detailData.billNo}}</div>
+            <div class="label">工程订单号</div>
+            <div class="value">{{detailData.enginOrderId}}</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="label">经销商编码</div>
+            <div class="value">{{detailData.customerId}}</div>
+          </el-col>
+          <el-col :span="16" 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.approveDate}}</div>
+            <div class="label">工程信息编号</div>
+            <div class="value">{{detailData.refEnginRecordNo}}</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.refProjectName}}</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.refPromiseStatus}}</div>
+          </el-col>
+          <el-col :span="8" class="item">
+            <div class="label">厂工程编码</div>
+            <div class="value">{{detailData.refFactoryNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">使用单位</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.refUseUnit}}</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.saleTypeName}}</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.aaa}}</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.aaa}}</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.aaa}}</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.takeDeposit ? '是':'否'}}</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.fileNo}}</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.serviceName}}</div>
           </el-col>
           <el-col :span="24" class="item">
             <div class="label">格力回复</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.note1}}</div>
           </el-col>
           <el-col :span="24" class="item">
             <div class="label">格力内部备注</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.note2}}</div>
+          </el-col>
+          <el-col :span="24" class="item">
+            <div class="label">备注</div>
+            <div class="value">{{detailData.remark}}</div>
+          </el-col>
+          <el-col :span="6" class="item">
+            <div class="label">制单人</div>
+            <div class="value">{{detailData.createName}}</div>
+          </el-col>
+          <el-col :span="6" class="item">
+            <div class="label">制单日期</div>
+            <div class="value">{{detailData.createTime}}</div>
           </el-col>
           <el-col :span="6" class="item">
             <div class="label">审核人</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.confirmName}}</div>
           </el-col>
           <el-col :span="6" class="item">
             <div class="label">审核日期</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.confirmTime}}</div>
+          </el-col>
+          <el-col :span="6" class="item">
+            <div class="label">最后更新人</div>
+            <div class="value">{{detailData.updateName}}</div>
+          </el-col>
+          <el-col :span="6" class="item">
+            <div class="label">最后更新日期</div>
+            <div class="value">{{detailData.updateTime}}</div>
           </el-col>
           <el-col :span="6" class="item">
             <div class="label">关闭人</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.closeName}}</div>
           </el-col>
           <el-col :span="6" class="item">
             <div class="label">关闭日期</div>
-            <div class="value">{{detailData.approverId}}</div>
+            <div class="value">{{detailData.closeTime}}</div>
           </el-col>
-          <el-col :span="24" class="item">
-            <div class="label">备注</div>
-            <div class="value">{{detailData.approverId}}</div>
+          <el-col :span="24" class="item" v-if="isExamine">
+            <div class="label">审批说明</div>
+            <div class="value">{{detailData.examineNote}}</div>
           </el-col>
         </el-row>
       </div>
@@ -105,55 +133,44 @@
       </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="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-column align="center" label="销售类型" prop="saleTypeName" min-width="160" 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="materialOldNumber" 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="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="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>
+          <el-table-column align="center" label="格力折扣" prop="discAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="现金钱包" prop="customerWalletName" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{ scope.row.isDirectTransfer ? '是' : '否' }}
+            </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="hasSendQty" 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>
       </div>
-
-      <div class="main-title">
-        <div class="title">审批记录</div>
-      </div>
-      <div class="diy-table-1">
-        <el-row :gutter="0">
-          <el-col :span="12" class="item">
-            <div class="label">审批人</div>
-            <div class="value">2022123233435342</div>
-          </el-col>
-          <el-col :span="12" class="item">
-            <div class="label">审批结果</div>
-            <div class="value">2022123233435342</div>
-          </el-col>
-          <el-col :span="24" class="item">
-            <div class="label">审批说明</div>
-            <div class="value">2022123233435342</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 type="danger" @click="closeData">关闭订单</el-button>
+        <el-button type="primary" @click="openDeliverDialog">提前开票</el-button>
+        <el-button type="primary" @click="overData">直调完结</el-button>
+        <el-button type="primary" @click="openDeliverDialog">直调发货</el-button>
+        <el-button @click="goBack">返回</el-button>
       </div>
     </div>
 
@@ -226,7 +243,7 @@
 
 <script>
 import print from 'vue-print-nb'
-import { getDetail } from "@/api/supply/engin";
+import { getOrderDetail, closeHome, overOrder } from "@/api/supply/engin";
 
 export default {
   name: 'HomeDetail',
@@ -235,6 +252,19 @@ export default {
   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: {
@@ -261,6 +291,9 @@ export default {
         openSidebar: this.sidebar.opened
       }
     },
+    isExamine() {
+      return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
+    },
   },
 
   created() {
@@ -275,11 +308,39 @@ export default {
 
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
+      getOrderDetail({id: this.listItem.parentId}).then(res => {
         this.detailData = res.data;
       })
     },
 
+    // 关闭订单
+    closeData() {
+      this.$confirm('此操作将关闭订单, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        closeHome({id: this.listItem.parentId}).then(res => {
+          this.$successMsg();
+          this.getDetail();
+        })
+      }).catch(() => {});
+    },
+
+    // 直调完结
+    overData() {
+      this.$confirm('此操作将直调完结订单, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        overOrder({id: this.listItem.parentId}).then(res => {
+          this.$successMsg();
+          this.getDetail();
+        })
+      }).catch(() => {});
+    },
+
     // 打开 直调发货
     openDeliverDialog() {
       this.isShowDeliverDialog = true;

+ 215 - 41
src/views/supply/engin/components/home_form.vue

@@ -51,12 +51,12 @@
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="工程项目名称" prop="enginName">
-            <el-input v-model="mainForm.enginName" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.enginName" placeholder="请输入工程项目名称"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="工程登录类型" prop="loginType">
-            <el-input v-model="mainForm.loginType" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.loginType" placeholder="请输入工程登录类型"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
@@ -66,34 +66,34 @@
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="使用单位" prop="company">
-            <el-input v-model="mainForm.company" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.company" placeholder="请输入使用单位"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="销售类型" prop="saleType">
-            <el-select v-model="mainForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable>
+            <el-select v-model="mainForm.saleType" placeholder="选择销售类型" style="width: 100%" clearable @change="changeSaleType">
               <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
             </el-select>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="联系人" prop="contactMan">
-            <el-input v-model="mainForm.contactMan" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.contactMan" placeholder="请输入联系人"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="固定电话" prop="tel">
-            <el-input v-model="mainForm.tel" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.tel" placeholder="请输入固定电话"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="移动电话" prop="phone">
-            <el-input v-model="mainForm.phone" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.phone" placeholder="请输入移动电话"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24">
           <el-form-item label="安装地址" prop="address">
-            <el-input v-model="mainForm.address" placeholder="请选择工程登录" readonly></el-input>
+            <el-input v-model="mainForm.address" placeholder="请输入安装地址"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24">
@@ -149,27 +149,77 @@
     <div class="table" style="margin-top: 20px">
       <el-table :data="goodsList" 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="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="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></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-column align="center" label="税率" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="引用记录" prop="useRefCount" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="120" 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="materialOldNumber" 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="enginNum" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.qty" size="small"></el-input>
+          </template>
+        </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="customerWalletId2" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.customerWalletId2" placeholder="选择返利钱包" size="small" clearable @change="changeFlWallet(scope.$index)">
+              <el-option
+                v-for="item in flWalletList"
+                :key="item.customerWalletId"
+                :label="item.name"
+                :value="item.customerWalletId">
+              </el-option>
+            </el-select>
+          </template>
+        </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 * (scope.row.rebateRate * 100)) / 100}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="格力折扣" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{scope.row.qty * scope.row.discAmount}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="现金钱包" prop="customerWalletId" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.customerWalletId" placeholder="选择现金钱包" size="small" clearable @change="changeXjWallet(scope.$index)">
+              <el-option
+                v-for="item in xjWalletList"
+                :key="item.customerWalletId"
+                :label="item.name"
+                :value="item.customerWalletId">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{((scope.row.price * scope.row.qty) * 100 - ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 - ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) / 100}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100">
+          <template slot-scope="scope">
+            <el-checkbox v-model="scope.row.isDirectTransfer"></el-checkbox>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.directTransferQty" size="small"></el-input>
+          </template>
+        </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="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-column align="center" label="总仓库" prop="status1" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
             <div>{{ scope.row.status1 | status1Filter }}</div>
@@ -190,8 +240,8 @@
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
-        <el-button type="primary" @click="clickSubmitForm">提交审核</el-button>
+        <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;">
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
@@ -267,7 +317,7 @@
 </template>
 
 <script>
-import { getOrderDetail, getHomeLoginList, getWarehouseList, addHome, editHome, checkStock } from "@/api/supply/engin";
+import { getOrderDetail, getHomeLoginList, getWarehouseList, addHome, editHome, submitHome, checkStock, getWalletList } from "@/api/supply/engin";
 import { getDictList, getTypeList } from '@/api/common'
 
 export default {
@@ -285,7 +335,7 @@ export default {
   },
   data() {
     return {
-      detailData: {},
+      editId: '',
       mainForm: {
         orderNum: '',
         orderDate: '',
@@ -317,9 +367,10 @@ export default {
         enginName: [{ required: true, message: '请输入工程项目名称', trigger: 'blur' }],
         loginType: [{ required: true, message: '请输入工程登录类型', trigger: 'blur' }],
         company: [{ required: true, message: '请输入使用单位', trigger: 'blur' }],
-        contactMan: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
-        tel: [{ required: true, message: '请输入固定电话', trigger: 'blur' }],
-        phone: [{ required: true, message: '请输入移动电话', trigger: 'blur' }],
+        saleType: [{ required: true, message: '请选择销售类型', trigger: 'change' }],
+        // contactMan: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
+        // tel: [{ required: true, message: '请输入固定电话', trigger: 'blur' }],
+        // phone: [{ required: true, message: '请输入移动电话', trigger: 'blur' }],
         address: [{ required: true, message: '请输入安装地址', trigger: 'blur' }],
       },
       salesTypeList: [],
@@ -340,6 +391,9 @@ export default {
 
       warehouseList: [],
       warehouseValue: '',
+
+      xjWalletList: [],
+      flWalletList: [],
     }
   },
 
@@ -357,10 +411,12 @@ export default {
 
   created() {
     this.getDictList();
+    this.getWalletList();
     this.getSalesTypeList();
     this.getWarehouseList();
 
     if(this.listItem) {
+      this.editId = this.listItem.parentId;
       this.getDetail();
     }else {
       this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerId;
@@ -392,6 +448,22 @@ export default {
       return currentdate;
     },
 
+    // 获取钱包列表
+    getWalletList() {
+      getWalletList({
+        customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
+        type: 'COMMONLY'
+      }).then(res => {
+        this.xjWalletList = res.data;
+      })
+      getWalletList({
+        customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
+        type: 'REBATE'
+      }).then(res => {
+        this.flWalletList = res.data;
+      })
+    },
+
     // 获取产品大类列表
     getDictList() {
       getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
@@ -421,8 +493,35 @@ export default {
 
     // 获取详情
     getDetail() {
-      getOrderDetail({id: this.listItem.id}).then(res => {
-        this.detailData = res.data;
+      getOrderDetail({id: this.editId}).then(res => {
+        let data = res.data;
+        this.mainForm.orderNum = data.enginOrderId;
+        this.mainForm.orderDate = data.orderDate;
+        this.mainForm.type = data.refProductCategory;
+        this.mainForm.jxsNum = data.customerId;
+        this.mainForm.jxsName = data.customerName;
+        this.mainForm.loginNum = data.refEnginRecordNo;
+        this.mainForm.enginName = data.refProjectName;
+        this.mainForm.loginType = data.refPromiseStatus;
+        this.mainForm.factoryNum = data.refFactoryNo;
+        this.mainForm.company = data.refUseUnit;
+        this.mainForm.saleType = data.saleTypeId;
+        this.mainForm.contactMan = data.aaa;
+        this.mainForm.tel = data.aaa;
+        this.mainForm.phone = data.aaa;
+        this.mainForm.address = data.refInstallAddress;
+        this.mainForm.greeRemark = data.note2;
+        this.mainForm.greeReply = data.note1;
+        this.mainForm.remark = data.remark;
+        this.mainForm.createMan = data.createName;
+        this.mainForm.createDate = data.createTime;
+        this.mainForm.fileNum = data.fileNo;
+
+        data.items.forEach(item => {
+          item.status1 = '';
+          item.status2 = '';
+        })
+        this.goodsList = data.items;
       })
     },
 
@@ -471,6 +570,18 @@ export default {
     chooseItem(id) {
       addHome({refEnginRecordNo: id}).then(res => {
         this.isShowDialog = false;
+        this.editId = res.data;
+        this.getDetail();
+      })
+    },
+
+    // 选择销售类型
+    changeSaleType() {
+      let obj = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
+      this.goodsList.forEach(item => {
+        item.saleTypeId = obj.id;
+        item.saleTypeCode= obj.saleCode;
+        item.saleTypeName = obj.saleName;
       })
     },
 
@@ -479,6 +590,28 @@ export default {
       this.goodsList.splice(index, 1);
     },
 
+    // 修改返利钱包
+    changeFlWallet(index) {
+      if(this.goodsList[index].customerWalletId2) {
+        let obj = this.flWalletList.find(o => o.customerWalletId == this.goodsList[index].customerWalletId2);
+        this.goodsList[index].rebateRate = obj.rebateRate;
+        this.goodsList[index].customerWalletName2 = obj.name;
+      }else {
+        this.goodsList[index].rebateRate = '';
+        this.goodsList[index].customerWalletName2 = '';
+      }
+    },
+
+    // 修改现金钱包
+    changeXjWallet(index) {
+      if(this.goodsList[index].customerWalletId) {
+        let obj = this.xjWalletList.find(o => o.customerWalletId == this.goodsList[index].customerWalletId);
+        this.goodsList[index].customerWalletName = obj.name;
+      }else {
+        this.goodsList[index].customerWalletName = '';
+      }
+    },
+
     // 检查库存
     checkStock() {
       if(!this.warehouseValue) {
@@ -510,9 +643,50 @@ export default {
       else return '短缺';
     },
 
-
-    clickSubmitForm() {
-
+    // 保存 / 提交审核
+    clickSubmitForm(type) {
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
+          let params = {
+            enginOrderId: this.mainForm.orderNum,
+            orderDate: this.mainForm.orderDate,
+            refProductCategory: this.mainForm.type || '',
+            // customerId: this.mainForm.jxsNum,
+            // customerName: this.mainForm.jxsName,
+            refEnginRecordNo: this.mainForm.loginNum || '',
+            refProjectName: this.mainForm.enginName || '',
+            refPromiseStatus: this.mainForm.loginType || '',
+            refFactoryNo: this.mainForm.factoryNum || '',
+            refUseUnit: this.mainForm.company || '',
+            saleTypeId: this.mainForm.saleType,
+            saleTypeCode: saleTypeItem.saleCode,
+            saleTypeName: saleTypeItem.saleName,
+            // aaa: this.mainForm.contactMan,
+            // aaa: this.mainForm.tel,
+            // aaa: this.mainForm.phone,
+            refInstallAddress: this.mainForm.address || '',
+            note2: this.mainForm.greeRemark || '',
+            note1: this.mainForm.greeReply || '',
+            remark: this.mainForm.remark || '',
+            fileNo: this.mainForm.fileNum || '',
+            items: this.goodsList,
+          }
+          if(type === 1) {
+            editHome(params).then(res => {
+              this.$successMsg('编辑成功');
+              this.goBack();
+              this.$parent.getList();
+            })
+          }else if(type === 2) {
+            submitHome(params).then(res => {
+              this.$successMsg('提交审核成功');
+              this.goBack();
+              this.$parent.getList();
+            })
+          }
+        }
+      })
     },
   }
 }

+ 70 - 17
src/views/supply/engin/home_list.vue

@@ -76,19 +76,21 @@
         <div class="btn-group clearfix">
           <div class="fl">
             <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
+            <el-button size="small" type="danger" icon="el-icon-minus" :disabled="multipleSelection.length < 1" @click="batchDelete()">批量删除</el-button>
           </div>
           <div class="fr">
             <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
           </div>
         </div>
         <div class="table">
-          <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="handleSelectionChange">
+            <el-table-column align="center" type="selection" width="55"></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="工程订单号" prop="enginOrderNo" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="工程订单号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单日期" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程登录单号" prop="refEnginRecordNo" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单类型" prop="enginOrderType" min-width="160" show-overflow-tooltip>
@@ -100,29 +102,35 @@
             <el-table-column align="center" label="销售类型" prop="saleTypeId" 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="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="isDirectTransfer" min-width="160" show-overflow-tooltip>
+            <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="isDirectTransfer" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.isDirectTransfer ? '是':'否'}}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="出库数量" prop="hasSendQty" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单价" prop="enginPrice" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="金额" prop="enginTotality" min-width="160" show-overflow-tooltip></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="enginPrice" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="金额" prop="enginTotality" 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="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="使用返利金额" prop="rebateAmount" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="业务员" prop="aaa" min-width="160" 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="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核人" prop="confirmName" min-width="200" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核日期" prop="confirmTime" min-width="100" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="操作" width="160" fixed="right">
+            <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="操作" width="180" fixed="right">
               <template slot-scope="scope">
+                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.parentId)" v-if="scope.row.examineStatus === 'SAVE'" >
+                  <el-button slot="reference" type="text">申请</el-button>
+                </el-popconfirm>
+                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.parentId)" v-if="scope.row.examineStatus === 'WAIT'" >
+                  <el-button slot="reference" type="text">撤回</el-button>
+                </el-popconfirm>
                 <el-button type="text" @click="toForm(scope.row)">编辑</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-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" >
                   <el-button slot="reference" type="text">删除</el-button>
                 </el-popconfirm>
               </template>
@@ -152,7 +160,7 @@
 </template>
 
 <script>
-import { getOrderList } from "@/api/supply/engin";
+import { getOrderList, applyHome, withdrawHome, deleteHome } from "@/api/supply/engin";
 import HomeDetail from "@/views/supply/engin/components/home_detail";
 import HomeForm from "@/views/supply/engin/components/home_form";
 
@@ -200,6 +208,8 @@ export default {
         { label: '已关闭', value: 'CLOSE' },
       ],
 
+      multipleSelection: [],
+
       queryItem: {},
       isShowDetail: false,
       isShowForm: false,
@@ -310,9 +320,52 @@ export default {
       this.isShowForm = false;
     },
 
+    // 申请
+    handleSubmit(id) {
+      applyHome({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
+    // 撤回
+    handleWithdraw(id) {
+      withdrawHome({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
+    // 删除
     handleDelete(id) {
+      deleteHome({ids: id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
+    // 批量删除
+    batchDelete() {
+      this.$confirm('此操作将永久删除, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        let ids = this.multipleSelection.map(item => {
+          return item.parentId;
+        });
+        deleteHome({ids: ids.join(',')}).then(res => {
+          this.$successMsg();
+          this.getList();
+        })
+      }).catch(() => {});
+    },
+
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+
 
-    }
   }
 }
 </script>

+ 7 - 1
src/views/supply/retail/retail_list.vue

@@ -99,7 +99,13 @@
             <el-table-column align="center" label="单价" prop="price" 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="rebateRate" min-width="110" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="返利" prop="rebateAmount" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="返利金额" prop="rebateAmount" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <div>{{scope.row.rebateAmount}}</div>
+                <div>(实际:{{scope.row.payRebateAmount}})</div>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="格力折扣" prop="discAmount" 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="examineName" min-width="100" show-overflow-tooltip></el-table-column>

+ 43 - 47
src/views/supply/sales/components/sales_detail.vue

@@ -5,37 +5,36 @@
     <div id="printMe">
       <div class="main-title">
         <div class="title">出库单信息</div>
-        <el-button size="small" type="primary" icon="el-icon-printer" v-print="printObj">打印单据</el-button>
       </div>
       <div class="diy-table-1">
         <el-row :gutter="0">
           <el-col :span="8" class="item">
             <div class="label">出库单号</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.retailOrderId}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">单据日期</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.orderTime}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">单据状态</div>
-            <div class="value">2022123233435342</div>
+          <div class="value">{{detailData.status | statusFilter}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">仓库</div>
-            <div class="value">万豪仓</div>
+            <div class="value">{{detailData.correspondName}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">发货单号</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.orderNo}}</div>
           </el-col>
           <el-col :span="8" class="item">
             <div class="label">经销商</div>
-            <div class="value">广州格匠机电有限公司</div>
+            <div class="value">{{detailData.customerName}}</div>
           </el-col>
           <el-col :xs="24" :sm="24" :lg="24" class="item">
             <div class="label">备注</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.remark}}</div>
           </el-col>
         </el-row>
       </div>
@@ -43,36 +42,17 @@
       <div class="main-title">
         <div class="title">货品信息</div>
       </div>
-      <div class="diy-table-2">
-        <div class="head">
-          <el-row :gutter="20">
-            <el-col :span="2">序号</el-col>
-            <el-col :span="4">产品编号</el-col>
-            <el-col :span="8">产品名称</el-col>
-            <el-col :span="2">规格型号</el-col>
-            <el-col :span="2">内机编码</el-col>
-            <el-col :span="2">外机编码</el-col>
-            <el-col :span="2">单位</el-col>
-            <el-col :span="2">数量</el-col>
-          </el-row>
-        </div>
-        <div class="body">
-          <el-row v-for="(item, index) in goodsList" :key="item.goodsId" :gutter="20">
-            <el-col :span="2">{{ index + 1 }}</el-col>
-            <el-col :span="4">{{ item.goodsId || 0 }}</el-col>
-            <el-col :span="8">{{ item.goodsName || 0 }}</el-col>
-            <el-col :span="2">{{ item.salesUnit || 0 }}</el-col>
-            <el-col :span="2">{{ item.price || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleQty || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-            <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-          </el-row>
-        </div>
-        <div class="foot">
-          <el-row :gutter="20">
-            <el-col :span="24">合计</el-col>
-          </el-row>
-        </div>
+      <div class="table">
+        <el-table :data="detailData.saleOrderData" element-loading-text="Loading" border fit highlight-current-row stripe>
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" label="产品编号" prop="materialCode" 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="unit" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="数量" prop="approvalNumber" 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="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+        </el-table>
       </div>
 
       <div class="main-title">
@@ -82,19 +62,19 @@
         <el-row :gutter="0">
           <el-col :xs="12" :sm="8" :lg="8" class="item">
             <div class="label">审批人</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.approvalName}}</div>
           </el-col>
           <el-col :xs="12" :sm="8" :lg="8" class="item">
             <div class="label">审批结果</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.status | statusFilter}}</div>
           </el-col>
           <el-col :xs="12" :sm="8" :lg="8" class="item">
             <div class="label">审批时间</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.approvalTime}}</div>
           </el-col>
           <el-col :xs="24" :sm="24" :lg="24" class="item">
             <div class="label">审批说明</div>
-            <div class="value">2022123233435342</div>
+            <div class="value">{{detailData.approvalRemark}}</div>
           </el-col>
         </el-row>
       </div>
@@ -107,7 +87,7 @@
 
 <script>
 import print from 'vue-print-nb'
-import { getList } from "@/api/supply/sales";
+import { getDetail } from "@/api/supply/sales";
 
 export default {
   name: 'SalesDetail',
@@ -116,19 +96,28 @@ export default {
   directives: {
     print
   },
+  filters: {
+    statusFilter(val) {
+      const statusList = [
+        { label: '待审核', value: 1 },
+        { label: '审核通过', value: 2 },
+        { label: '审核驳回', value: 3 },
+      ];
+      let obj = statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
   data() {
     return {
       printObj: {
         id: 'printMe'
       },
-      goodsList: [{
-        goodsId: 1,
-      }]
+      detailData: {},
     }
   },
 
   created() {
-
+    this.getDetail();
   },
 
   methods: {
@@ -136,6 +125,13 @@ export default {
     goBack() {
       this.$emit('backListFormDetail');
     },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+      })
+    },
   }
 }
 </script>

+ 43 - 44
src/views/supply/sales/components/sales_examine.vue

@@ -9,31 +9,31 @@
       <el-row :gutter="0">
         <el-col :span="8" class="item">
           <div class="label">出库单号</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{detailData.retailOrderId}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据日期</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{detailData.orderTime}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据状态</div>
-          <div class="value">2022123233435342</div>
+        <div class="value">{{detailData.status | statusFilter}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">仓库</div>
-          <div class="value">万豪仓</div>
+          <div class="value">{{detailData.correspondName}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">发货单号</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{detailData.orderNo}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">经销商</div>
-          <div class="value">广州格匠机电有限公司</div>
+          <div class="value">{{detailData.customerName}}</div>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24" class="item">
           <div class="label">备注</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{detailData.remark}}</div>
         </el-col>
       </el-row>
     </div>
@@ -41,36 +41,17 @@
     <div class="main-title">
       <div class="title">货品信息</div>
     </div>
-    <div class="diy-table-2">
-      <div class="head">
-        <el-row :gutter="20">
-          <el-col :span="2">序号</el-col>
-          <el-col :span="4">产品编号</el-col>
-          <el-col :span="8">产品名称</el-col>
-          <el-col :span="2">规格型号</el-col>
-          <el-col :span="2">内机编码</el-col>
-          <el-col :span="2">外机编码</el-col>
-          <el-col :span="2">单位</el-col>
-          <el-col :span="2">数量</el-col>
-        </el-row>
-      </div>
-      <div class="body">
-        <el-row v-for="(item, index) in goodsList" :key="item.goodsId" :gutter="20">
-          <el-col :span="2">{{ index + 1 }}</el-col>
-          <el-col :span="4">{{ item.goodsId || 0 }}</el-col>
-          <el-col :span="8">{{ item.goodsName || 0 }}</el-col>
-          <el-col :span="2">{{ item.salesUnit || 0 }}</el-col>
-          <el-col :span="2">{{ item.price || 0 }}</el-col>
-          <el-col :span="2">{{ item.saleQty || 0 }}</el-col>
-          <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-          <el-col :span="2">{{ item.saleValue || 0 }}</el-col>
-        </el-row>
-      </div>
-      <div class="foot">
-        <el-row :gutter="20">
-          <el-col :span="24">合计</el-col>
-        </el-row>
-      </div>
+    <div class="table">
+      <el-table :data="detailData.saleOrderData" element-loading-text="Loading" border fit highlight-current-row stripe>
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="产品编号" prop="materialCode" 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="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="数量" prop="approvalNumber" 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="totalAmount" min-width="100" show-overflow-tooltip></el-table-column>
+      </el-table>
     </div>
 
     <div class="main-title">
@@ -80,7 +61,7 @@
       <el-row :gutter="0">
         <el-col :span="12" class="item">
           <div class="label">审批人</div>
-          <div class="value">2022123233435342</div>
+          <div class="value">{{userName}}</div>
         </el-col>
         <el-col :span="12" class="item">
           <div class="label">审批结果</div>
@@ -117,7 +98,7 @@
 </template>
 
 <script>
-import { getList } from "@/api/supply/sales";
+import { getDetail, examineData } from "@/api/supply/sales";
 
 export default {
   name: 'SalesDetail',
@@ -125,9 +106,8 @@ export default {
   props: ['listItem'],
   data() {
     return {
-      goodsList: [{
-        goodsId: 1,
-      }],
+      userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
+      detailData: {},
       formLoading: false,
       examineForm: {
         status: true,
@@ -149,7 +129,7 @@ export default {
   },
 
   created() {
-
+    this.getDetail();
   },
 
   methods: {
@@ -158,8 +138,27 @@ export default {
       this.$emit('backListFormExamine');
     },
 
-    clickSubmitForm() {
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+      })
+    },
 
+    // 提交审批
+    clickSubmitForm() {
+      this.formLoading = true;
+      examineData({
+        id: this.listItem.id,
+        status: this.examineForm.status ? 2 : 3,
+        approvalRemark: this.examineForm.remark,
+      }).then(res => {
+        this.$successMsg('审批成功');
+        this.goBack();
+        this.$parent.getList();
+      }).finally(res => {
+        this.formLoading = false;
+      })
     },
   }
 }

+ 82 - 56
src/views/supply/sales/sales_list.vue

@@ -7,11 +7,9 @@
           <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="4">审核驳回</el-radio-button>
+                <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>
@@ -26,6 +24,11 @@
               </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>
+            </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>
@@ -48,21 +51,8 @@
                 </el-date-picker>
               </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>
-            </el-col>
-            <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="状态" prop="status">
-                <el-select v-model="screenForm.status" placeholder="全部">
-                  <el-option label="全部" value=""></el-option>
-                  <el-option :label="item.label" :value="item.value" v-for="(item, index) in select_status" :key="index"></el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
             
-            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+            <el-col :xs="24" :sm="12" :lg="12" class="tr">
               <el-form-item label="">
                 <el-button size="small" @click="resetScreenForm">清空</el-button>
                 <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
@@ -75,7 +65,7 @@
       <div class="mymain-container">
         <div class="btn-group clearfix">
           <div class="fl">
-            <el-button size="small" type="warning" icon="el-icon-close">退单</el-button>
+            <!-- <el-button size="small" type="warning" icon="el-icon-close">退单</el-button> -->
           </div>
           <div class="fr">
             <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
@@ -83,21 +73,31 @@
         </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="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="发货单号" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="仓库" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="经销商" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="产品名称" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="规格型号" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="内急条码" prop="aaa" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="外机条码" prop="aaa" min-width="160" 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="aaa" min-width="200" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="状态" prop="status" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.status | statusFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="开票状态" prop="billStatus" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.billStatus | billStatusFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="出库单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="发货单号" prop="orderNo" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="仓库" prop="correspondName" min-width="160" 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="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="unit" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="单价" prop="price" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单金额" prop="totalAmount" min-width="160" 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="操作" width="120" fixed="right">
               <template slot-scope="scope">
-                <el-button type="text" @click="toDetail('detail', scope.row)">详情</el-button>
-                <el-button type="text" @click="toDetail('examine', scope.row)">审批</el-button>
+                <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
+                <el-button type="text" @click="toExamine(scope.row)">审批</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -125,16 +125,29 @@
 </template>
 
 <script>
-import { COMMON_SELECT } from '@/utils/select_data'
 import { getList } from "@/api/supply/sales";
 import SalesDetail from "@/views/supply/sales/components/sales_detail";
 import SalesExamine from "@/views/supply/sales/components/sales_examine";
 
+let that
 export default {
   components: {
     SalesDetail,
     SalesExamine,
   },
+  filters: {
+    statusFilter(val) {
+      let obj = that.statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    },
+    billStatusFilter(val) {
+      const MAP = {
+        1: '已开票',
+        0: '未开票',
+      }
+      return MAP[val];
+    }
+  },
   data() {
     return {
       currentPage: 1, // 当前页码
@@ -145,38 +158,41 @@ export default {
       screenForm: { // 筛选表单数据
         orderNum: '',
         jxsName: '',
+        jxsNum: '',
         chName: '',
         model: '',
         date: '',
-        jxsNum: '',
         status: '',
       },
-      select_status: [ // 筛选字段 - 状态
-        { label: '正常', value: true },
-        { label: '冻结', value: false }
+      statusList: [
+        { label: '待审核', value: 1 },
+        { label: '审核通过', value: 2 },
+        { label: '审核驳回', value: 3 },
       ],
 
-      jumpType: '',
       queryItem: {},
+      isShowDetail: false,
+      isShowExamine: false,
     }
   },
 
   computed: {
     exParams() {
       return {
-        userName: this.screenForm.account,
-        nickName: this.screenForm.nickName,
-        linkPhone: this.screenForm.phone,
-        email: this.screenForm.email,
         status: this.screenForm.status,
+        orderNo: this.screenForm.orderNum,
+        customerName: this.screenForm.jxsName,
+        customerNumber: this.screenForm.jxsNum,
+        materialName: this.screenForm.chName,
+        specification: this.screenForm.model,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       }
     },
-    isShowDetail() {
-      return this.queryItem.hasOwnProperty('adminUserId') && this.jumpType == 'detail';
-    },
-    isShowExamine() {
-      return this.queryItem.hasOwnProperty('adminUserId') && this.jumpType == 'examine';
-    },
+  },
+
+  beforeCreate() {
+    that = this;
   },
 
   created() {
@@ -200,11 +216,14 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        userName: this.screenForm.account,
-        nickName: this.screenForm.nickName,
-        linkPhone: this.screenForm.phone,
-        email: this.screenForm.email,
         status: this.screenForm.status,
+        orderNo: this.screenForm.orderNum,
+        customerName: this.screenForm.jxsName,
+        customerNumber: this.screenForm.jxsNum,
+        materialName: this.screenForm.chName,
+        specification: this.screenForm.model,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
       };
       getList(params).then((res) => {
         this.dataList = res.data.records;
@@ -240,14 +259,21 @@ export default {
     },
 
     // 进入详情
-    toDetail(type, item) {
-      this.jumpType = type;
+    toDetail(item) {
+      this.queryItem = item;
+      this.isShowDetail = true;
+    },
+
+    // 进入审批
+    toExamine(item) {
       this.queryItem = item;
+      this.isShowExamine = true;
     },
 
     backList() {
-      this.jumpType = '';
       this.queryItem = {};
+      this.isShowDetail = false;
+      this.isShowExamine = false;
     },
   }
 }