瀏覽代碼

Merge branch 'dev' of git.echepei.com:caojunjie/Smart_platform_ui into dev

caojunjie 3 年之前
父節點
當前提交
6959fcb471

+ 9 - 2
src/api/standAlone/saleLeads.js

@@ -14,7 +14,7 @@ export function deleteList(data) {
     url: '/api/trade-purchase/leads/remove',
     method: 'post',
     params: {
-      ids:data
+      ids: data
     }
   })
 }
@@ -47,8 +47,15 @@ export function removeGoods(data) {
 // 请核
 export function pleaseCheck(data) {
   return request({
-    url: '/api/trade-purchase/office-order/check-order',
+    url: '/api/trade-purchase/leads/saveExamine',
     method: 'post',
     data: data
   })
 }
+// 获取服务项目
+export function getGoodsDescList() {
+  return request({
+    url: '/api/blade-client/affairsdesc/getGoodsDescList',
+    method: 'get',
+  })
+}

+ 14 - 0
src/api/statisticAnalysis/purchaseReconciliation.js

@@ -0,0 +1,14 @@
+import request from '@/router/axios';
+
+// 查询销售明细
+export function getList(current, size, params) {
+    return request({
+        url: '/api/blade-purchase-sales/exportOrder/purchaseReconciliation',
+        method: 'get',
+        params: {
+            ...params,
+            current,
+            size
+        }
+    })
+}

+ 52 - 0
src/router/views/index.js

@@ -445,6 +445,58 @@ export default [{
     component: () => import( /* webpackChunkName: "views" */ '@/views/businessManagement/salesOrder/index')
   }]
 },
+{
+  path: '/businessManagement/proxyOrder/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/businessManagement/proxyOrder/index',
+    name: '代理订单(N)',
+    meta: {
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/businessManagement/proxyOrder/index')
+  }]
+},
+{
+  path: '/statisticAnalysis/packFeeRecon/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/statisticAnalysis/packFeeRecon/index',
+    name: '包装费用对账(N)',
+    meta: {
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/statisticAnalysis/packFeeRecon/index')
+  }]
+},
+{
+  path: '/statisticAnalysis/purchaseReconciliation/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/statisticAnalysis/purchaseReconciliation/index',
+    name: '品牌采购对账(N)',
+    meta: {
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/statisticAnalysis/purchaseReconciliation/index')
+  }]
+},
+{
+  path: '/statisticAnalysis/salesProfitN/index',
+  component: Layout,
+  hidden: true,
+  children: [{
+    path: '/statisticAnalysis/salesProfitN/index',
+    name: '销售利润(N)',
+    meta: {
+      keepAlive: true,
+    },
+    component: () => import( /* webpackChunkName: "views" */ '@/views/statisticAnalysis/salesProfitN/index')
+  }]
+},
 //发货通知详情页
 {
   path: '/businessManagement/deliveryNotice/index',

+ 8 - 1
src/views/saleLeads/config/customerContact.json

@@ -8,7 +8,7 @@
   "addBtn": false,
   "delBtn": false,
   "align": "center",
-  "menuWidth": 120,
+  "menuWidth": 130,
   "refreshBtn": false,
   "showSummary": true,
   "summaryText": "合计",
@@ -23,6 +23,13 @@
       "overHidden": true
     },
     {
+      "label": "服务项目",
+      "prop": "spId",
+      "index": 1,
+      "width": 200,
+      "overHidden": true
+    },
+    {
       "label": "内容",
       "prop": "bizContent",
       "index": 2,

+ 186 - 163
src/views/saleLeads/detail.vue

@@ -2,179 +2,120 @@
   <div class="borderless" v-loading="pageLoading">
     <div class="customer-head">
       <div class="customer-back">
-        <el-button
-          type="danger"
-          style="border: none;background: none;color: red"
-          icon="el-icon-arrow-left"
-          @click="backToList"
-          :loading="btnLoading"
-        >返回列表</el-button>
+        <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
+          @click="backToList" :loading="btnLoading">返回列表</el-button>
       </div>
       <div class="add-customer-btn">
-        <el-button
-          type="primary"
-          size="small"
-          class="el-button--small-yh"
-          @click.stop="openEdit"
-          v-if="disabled"
-        >编 辑</el-button>
-        <el-button
-          type="success"
-          :disabled="!form.id"
-          size="small"
-          @click="copyDoc"
-          :loading="btnLoading"
-          v-if="false"
-        >复制单据</el-button>
-        <el-button
-          type="primary"
-          @click="editCustomer"
-          size="small"
-          :loading="btnLoading"
-        >保存数据</el-button>
+        <el-button type="primary" size="small" class="el-button--small-yh" @click.stop="openEdit"
+          v-if="disabled && !approvalStatus">编 辑
+        </el-button>
+        <el-button type="primary" size="small" class="el-button--small-yh" @click.stop="submit" v-if="form.status == 1">
+          提交
+        </el-button>
+        <el-dropdown style="margin-right: 8px;margin-left: 8px;">
+          <el-button type="primary" size="small">
+            审核处理<i class="el-icon-arrow-down el-icon--right"></i>
+          </el-button>
+          <el-dropdown-menu slot="dropdown">
+            <el-dropdown-item :disabled="form.status > 0 || approvalStatus" @click.native="pleaseCheck">请核数据
+            </el-dropdown-item>
+            <el-dropdown-item :disabled="!form.approvalStatus"
+              @click.native="checkScheduleDialog = true, checkId = form.id">审核进度</el-dropdown-item>
+            <el-dropdown-item disabled>撤销请核</el-dropdown-item>
+            <el-dropdown-item v-if="checkDisabled && form.approvalStatus == 'S'" @click.native="openCheckDialog">审批
+            </el-dropdown-item>
+          </el-dropdown-menu>
+        </el-dropdown>
+        <el-button type="success" :disabled="!form.id" size="small" @click="copyDoc" :loading="btnLoading" v-if="false">
+          复制单据</el-button>
+        <el-button type="primary" @click="editCustomer" size="small" :loading="btnLoading">保存数据</el-button>
       </div>
     </div>
     <div class="customer-main">
-      <containerTitle title="基础信息"/>
+      <containerTitle title="基础信息" />
       <basic-container :showBtn="true">
-        <avue-form
-          ref="form"
-          class="trading-form"
-          v-model="form"
-          :option="option"
-        >
-          <template slot="corpId">
-            <crop-select
-              v-model="form.corpId"
-              @getCorpData="getKHData"
-              corpType="KH"
-            />
+        <avue-form ref="form" class="trading-form" v-model="form" :option="option">
+          <template slot-scope="{}" slot="corpNameLabel">
+            <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit">客户名称:</span>
           </template>
+          <!-- <template slot-scope="{row,index}" slot="corpName">
+            <warehous-Kh v-model="form.corpName" :zhKey="true" :disabled="disabled || approvalStatus"
+              @getCropId="getCropId"></warehous-Kh>
+          </template> -->
           <template slot="fromUser">
-            <el-select
-              v-model="form.fromUser"
-              filterable
-              clearable
-              size="small"
-              :disabled="disabled"
-            >
-              <el-option
-                v-for="(item,index) in userList"
-                :key="index"
-                :label="item.realName"
-                :value="item.id"
-              ></el-option>
+            <el-select v-model="form.fromUser" filterable clearable size="small" :disabled="disabled || approvalStatus">
+              <el-option v-for="(item, index) in userList" :key="index" :label="item.realName" :value="item.id">
+              </el-option>
             </el-select>
           </template>
           <template slot="toUser">
-            <el-select
-              v-model="form.toUser"
-              filterable
-              clearable
-              size="small"
-              :disabled="disabled"
-            >
-              <el-option
-                v-for="(item,index) in userList"
-                :key="index"
-                :label="item.realName"
-                :value="item.id"
-              ></el-option>
+            <el-select v-model="form.toUser" filterable clearable size="small" :disabled="disabled || approvalStatus">
+              <el-option v-for="(item, index) in userList" :key="index" :label="item.realName" :value="item.id">
+              </el-option>
             </el-select>
           </template>
         </avue-form>
       </basic-container>
-      <containerTitle title="沟通记录"/>
+      <containerTitle title="沟通记录" />
       <basic-container>
-        <avue-crud
-          ref="crud"
-          :data="dataList"
-          :option="tableOption"
-          :cell-style="cellStyle"
-          @saveColumn="saveColumn"
-          @resetColumn="resetColumn"
-        >
+        <avue-crud ref="crud" :data="dataList" :option="tableOption" :cell-style="cellStyle" @saveColumn="saveColumn"
+          @resetColumn="resetColumn">
           <template slot="menuLeft">
-            <el-button
-              type="primary"
-              icon="el-icon-plus"
-              size="small"
-              @click.stop="newDetails"
-              :disabled="disabled"
-            >录入明细</el-button>
-            <el-button
-              type="info"
-              icon="el-icon-printer"
-              size="small"
-              v-if="false"
-            >报表打印</el-button>
+            <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newDetails"
+              :disabled="disabled || approvalStatus">
+              录入明细</el-button>
+            <el-button type="info" icon="el-icon-printer" size="small" v-if="false">报表打印</el-button>
           </template>
           <template slot="menu" slot-scope="{ row, index }">
-            <el-button
-              size="small"
-              icon="el-icon-edit"
-              type="text"
-              @click="rowCell(row, index)"
-              :disabled="disabled"
-            >{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
-            <el-button
-              size="small"
-              icon="el-icon-delete"
-              type="text"
-              @click="rowDel(row, index)"
-              :disabled="disabled"
-            >删除</el-button>
+            <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
+              :disabled="disabled || approvalStatus">{{
+                  row.$cellEdit ? "保存" : "修改"
+              }}</el-button>
+            <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
+              :disabled="disabled || approvalStatus">
+              删除</el-button>
           </template>
           <template slot="bizDate" slot-scope="{ row, index }">
-            <el-date-picker
-              v-if="row.$cellEdit"
-              v-model="row.bizDate"
-              type="date"
-              placeholder="选择日期"
-              size="small"
-              style="width: 100%"
-              format="yyyy-MM-dd"
-              valueFormat="yyyy-MM-dd"
-            ></el-date-picker>
-            <span v-else>{{row.bizDate}}</span>
+            <el-date-picker v-if="row.$cellEdit" v-model="row.bizDate" type="date" placeholder="选择日期" size="small"
+              style="width: 100%" format="yyyy-MM-dd" valueFormat="yyyy-MM-dd"></el-date-picker>
+            <span v-else>{{ row.bizDate }}</span>
+          </template>
+          <template slot="spId" slot-scope="{ row, index }">
+            <el-select v-if="row.$cellEdit" v-model="row.spId" filterable clearable size="small" :disabled="disabled"
+              @change="spIdChange(row)">
+              <el-option v-for="(item, index) in goodsDescList" :key="index" :label="item.cname" :value="item.id">
+              </el-option>
+            </el-select>
+            <span v-else>{{ row.serviceProjectName }}</span>
           </template>
           <template slot="bizContent" slot-scope="{ row, index }">
-            <el-input
-              v-if="row.$cellEdit"
-              v-model="row.bizContent"
-              size="small"
-              placeholder="输入内容"
-            />
-            <span v-else>{{row.bizContent}}</span>
+            <el-input v-if="row.$cellEdit" v-model="row.bizContent" size="small" placeholder="输入内容" />
+            <span v-else>{{ row.bizContent }}</span>
           </template>
           <template slot="contacts" slot-scope="{ row, index }">
-            <el-input
-              v-if="row.$cellEdit"
-              v-model="row.contacts"
-              size="small"
-              placeholder="输入客户联系人"
-            />
-            <span v-else>{{row.contacts}}</span>
+            <el-input v-if="row.$cellEdit" v-model="row.contacts" size="small" placeholder="输入客户联系人" />
+            <span v-else>{{ row.contacts }}</span>
           </template>
           <template slot="tel" slot-scope="{ row, index }">
-            <el-input
-              v-if="row.$cellEdit"
-              v-model="row.tel"
-              size="small"
-              placeholder="输入联系方式"
-            />
-            <span v-else>{{row.tel}}</span>
+            <el-input v-if="row.$cellEdit" v-model="row.tel" size="small" placeholder="输入联系方式" />
+            <span v-else>{{ row.tel }}</span>
           </template>
           <template slot="approval" slot-scope="{ row, index }">
-            <el-switch
-              v-model="row.approval"
-              :disabled="!row.$cellEdit"
-              :inactive-value="0"
-              :active-value="1"
-            ></el-switch>
+            <el-switch v-model="row.approval" :disabled="!row.$cellEdit" :inactive-value="0" :active-value="1">
+            </el-switch>
           </template>
         </avue-crud>
       </basic-container>
+      <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
+        :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
+        <check :checkData="checkData" :checkDetail="false" :idList="[]" @choceCheckFun="choceCheckFun">
+        </check>
+      </el-dialog>
+      <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
+        :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
+        <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun">
+        </check-schedule>
+      </el-dialog>
     </div>
   </div>
 </template>
@@ -188,12 +129,13 @@ import {
   IntegerFormat
 } from "@/util/validate";
 import { gainUser } from "@/api/basicData/customerInquiry";
-import {getUserInfo} from "@/api/system/user";
-import {getDeptTree} from "@/api/system/dept";
+import { getUserInfo } from "@/api/system/user";
+import { getDeptTree } from "@/api/system/dept";
 import { getCurrentDate } from "@/util/date";
-import {dataDetail, typeSave, removeGoods, pleaseCheck} from "@/api/standAlone/saleLeads";
+import { dataDetail, typeSave, removeGoods, pleaseCheck, getGoodsDescList } from "@/api/standAlone/saleLeads";
 import { contrastObj, contrastList } from "@/util/contrastData";
-
+import check from "@/components/check/check";
+import checkSchedule from "@/components/check/checkSchedule";
 export default {
   name: "detail",
   props: {
@@ -201,6 +143,10 @@ export default {
       type: Object
     }
   },
+  components: {
+    check,
+    checkSchedule,
+  },
   data() {
     const validateRemark = (rule, value, callback) => {
       if (this.form.status == 2 && !this.form.remarks) {
@@ -210,6 +156,12 @@ export default {
       }
     }
     return {
+      checkData: {},
+      checkDialog: false,
+      batchNo: '',
+      checkId: '',
+      checkScheduleDialog: false,
+      approvalStatus: false,
       disabled: false,
       checkDisabled: false,
       pageLoading: false,
@@ -324,9 +276,9 @@ export default {
             span: 8,
             type: 'select',
             dicData: [
-              {label: '沟通中', value: 0},
-              {label: '成交', value: 1},
-              {label: '未成交', value: 2},
+              { label: '沟通中', value: 0 },
+              { label: '成交', value: 1, disabled: true },
+              { label: '未成交', value: 2 },
             ],
             rules: [
               {
@@ -343,7 +295,7 @@ export default {
             minRows: 2,
             span: 24,
             rules: [
-              {validator: validateRemark, trigger: 'blur'}
+              { validator: validateRemark, trigger: 'blur' }
             ]
           },
         ],
@@ -364,6 +316,7 @@ export default {
       loginUserId: null,
       oldForm: {},
       oldDataList: [],
+      goodsDescList: []
     }
   },
   async created() {
@@ -384,6 +337,9 @@ export default {
     getDeptTree().then(res => {
       this.dic = res.data.data
     })
+    getGoodsDescList().then(res => {
+      this.goodsDescList = res.data.data
+    })
     this.getWorkDicts('unit').then(res => {
       this.unitOption = res.data.data;
     })
@@ -397,6 +353,14 @@ export default {
       this.checker = true;
       this.batchNo = this.detailData.check.batchNo
       this.queryData(this.detailData.id);
+    } else if (this.detailData.check) {
+      this.disabled = true;
+      this.checkDisabled = true;
+      this.batchNo = this.detailData.check.batchNo
+      this.option.column.map(e => {
+        this.$set(e, 'disabled', true)
+      })
+      this.queryData(this.detailData.check.billId);
     }
   },
   filters: {
@@ -408,16 +372,29 @@ export default {
     }
   },
   methods: {
+    openCheckDialog() {
+      this.checkData = this.detailData.check
+      this.checkDialog = true;
+    },
+    choceCheckFun() {
+      this.checkDialog = false;
+    },
+    choceScheduleFun() {
+      this.checkScheduleDialog = false
+    },
+    khEdit() {
+      this.$router.push('/basicData/customerInformation/index')
+    },
     // 查询
     queryData(id) {
       this.pageLoading = true;
-      dataDetail({id: id}).then(res => {
+      dataDetail({ id: id }).then(res => {
         this.form = res.data.data;
-        this.dataList = this.form.itemList? this.form.itemList: [];
+        this.dataList = this.form.itemList ? this.form.itemList : [];
         delete this.form.itemList;
-        this.oldForm = {...this.form};
+        this.oldForm = { ...this.form };
         this.oldDataList = [...this.dataList];
-        this.checkDisabled = this.form.status > 0? true: false;
+        this.approvalStatus = this.form.approvalStatus == "S" || this.form.approvalStatus == "A" ? true : false;
         if (this.form.status > 0) {
           this.option.column.map(e => {
             this.$set(e, 'disabled', true)
@@ -427,6 +404,41 @@ export default {
         this.pageLoading = false;
       })
     },
+    pleaseCheck() {
+      if (this.dataList.length == 0) {
+        return this.$message.error('沟通记录为空不能提交')
+      }
+      for (let i = 0; i < this.dataList.length; i++) {
+        if (!this.dataList[i].id) {
+          return this.$message.error('沟通记录未保存不能提交')
+        }
+      }
+      this.$confirm("您确定提交此次申请吗?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.btnLoading = true;
+        this.$set(this.form, 'itemList', this.dataList)
+        const data = {
+          ...this.form,
+          checkType: "xsjh",
+          url: "/saleLeads/index",
+          pageStatus: "this.$store.getters.xsjhStatus",
+          pageLabel: "销售机会"
+        };
+        pleaseCheck(data).then(res => {
+          this.$message({ type: "success", message: '请核成功' });
+          this.disabled = true;
+          this.option.column.map(e => {
+            this.$set(e, 'disabled', true)
+          })
+          this.queryData(this.form.id);
+        }).finally(() => {
+          this.btnLoading = false;
+        })
+      });
+    },
     //返回列表
     backToList() {
       this.$emit("goBack");
@@ -434,18 +446,24 @@ export default {
     // 编辑按钮触发
     openEdit() {
       this.disabled = false;
-      this.option.column.map(e => {
-        if (this.checkDisabled) {
-          this.$set(e, 'disabled', true)
-        } else {
-          this.$set(e, 'disabled', false)
-        }
-      })
     },
     // 复制
     copyDoc() {
       this.$emit("copyOrder", this.form.id);
     },
+    submit() {
+      let data = {
+        ...this.form,
+        itemList: this.dataList
+      }
+      this.$router.push({
+        path: '/workManagement/main-items/list',
+        query: { data: data }
+      });
+    },
+    getCropId(row) {
+      this.form.corpId = row
+    },
     //修改提交触发
     editCustomer(status) {
       this.$refs["form"].validate((valid, done) => {
@@ -454,7 +472,7 @@ export default {
           this.btnLoading = true;
           this.$set(this.form, 'itemList', this.dataList)
           typeSave(this.form).then(res => {
-            this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
+            this.$message({ type: "success", message: this.form.id ? "修改成功!" : "新增成功!" });
             this.queryData(res.data.data);
           }).finally(() => {
             this.btnLoading = false;
@@ -543,7 +561,13 @@ export default {
         }
       });
     },
-    getKHData(row) {},
+    spIdChange(row) {
+      console.log(row)
+      this.goodsDescList.forEach(e => {
+        row.serviceProjectName = e.cname
+        row.chargeProposal = e.remarks
+      });
+    },
     // 验证新旧值对比
     verification() {
       if (contrastObj(this.form, this.oldForm) ||
@@ -566,5 +590,4 @@ export default {
 </script>
 
 <style scoped>
-
 </style>

+ 58 - 87
src/views/saleLeads/index.vue

@@ -1,98 +1,47 @@
 <template>
   <div>
     <basic-container v-show="show" class="page-crad">
-      <avue-crud
-        ref="crud"
-        :option="option"
-        :data="dataList"
-        v-model="form"
-        :page.sync="page"
-        :search.sync="search"
-        :table-loading="loading"
-        :cell-style="cellStyle"
-        @selection-change="selectionChange"
-        @search-change="searchChange"
-        @current-change="currentChange"
-        @size-change="sizeChange"
-        @refresh-change="refreshChange"
-        @on-load="onLoad"
-        @search-criteria-switch="searchCriteriaSwitch"
-        @saveColumn="saveColumn"
-        @resetColumn="resetColumn"
-      >
+      <avue-crud ref="crud" :option="option" :data="dataList" v-model="form" :page.sync="page" :search.sync="search"
+        :table-loading="loading" :cell-style="cellStyle" @selection-change="selectionChange"
+        @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+        @refresh-change="refreshChange" @on-load="onLoad" @search-criteria-switch="searchCriteriaSwitch"
+        @saveColumn="saveColumn" @resetColumn="resetColumn">
         <template slot="menuLeft">
-          <el-button
-            type="primary"
-            icon="el-icon-plus"
-            size="small"
-            @click.stop="newAdd()"
-          >创建单据</el-button>
-          <el-button
-            type="success"
-            size="small"
-            icon="el-icon-plus"
-            @click.stop="copyDoc()"
-            :disabled="selection.length != 1"
-            v-if="false"
-          >复制单据</el-button>
+          <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newAdd()">创建单据</el-button>
+          <el-button type="success" size="small" icon="el-icon-plus" @click.stop="copyDoc()"
+            :disabled="selection.length != 1" v-if="false">复制单据</el-button>
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button
-            type="text"
-            icon="el-icon-delete"
-            size="small"
-            @click.stop="rowDel(scope.row, scope.index)"
-            :disabled="scope.row.status == 3"
-          >删除
+          <el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(scope.row, scope.index)"
+            :disabled="scope.row.status == 3">删除
           </el-button>
         </template>
-<!--        <template slot="corpNameSearch">-->
-<!--          <crop-select-->
-<!--            v-model="search.corpId"-->
-<!--            corpType="KH"-->
-<!--          ></crop-select>-->
-<!--        </template>-->
+        <!--        <template slot="corpNameSearch">-->
+        <!--          <crop-select-->
+        <!--            v-model="search.corpId"-->
+        <!--            corpType="KH"-->
+        <!--          ></crop-select>-->
+        <!--        </template>-->
         <template slot="fromUserNameSearch">
-          <el-select
-            v-model="search.fromUser"
-            filterable
-            clearable
-            placeholder="请选择 承揽人"
-          >
-            <el-option
-              v-for="(item, index) in contractorOption"
-              :key="index"
-              :value="item.id"
-              :label="item.realName"
-            ></el-option>
+          <el-select v-model="search.fromUser" filterable clearable placeholder="请选择 承揽人">
+            <el-option v-for="(item, index) in contractorOption" :key="index" :value="item.id" :label="item.realName">
+            </el-option>
           </el-select>
         </template>
         <template slot="toUserNameSearch">
-          <el-select
-            v-model="search.toUser"
-            filterable
-            clearable
-            placeholder="请选择 承揽人"
-          >
-            <el-option
-              v-for="(item, index) in oppositePersonOption"
-              :key="index"
-              :value="item.id"
-              :label="item.realName"
-            ></el-option>
+          <el-select v-model="search.toUser" filterable clearable placeholder="请选择 承揽人">
+            <el-option v-for="(item, index) in oppositePersonOption" :key="index" :value="item.id"
+              :label="item.realName"></el-option>
           </el-select>
         </template>
         <template slot="corpName" slot-scope="scope">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row,scope.index)">{{ scope.row.corpName }}</span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="beforeOpenPage(scope.row, scope.index)">{{
+              scope.row.corpName
+          }}</span>
         </template>
       </avue-crud>
     </basic-container>
-    <detail-page
-      @goBack="goBack"
-      @copyOrder="copyOrder"
-      :detailData="detailData"
-      v-if="!show"
-    />
+    <detail-page @goBack="goBack" @copyOrder="copyOrder" :detailData="detailData" v-if="!show" />
   </div>
 </template>
 
@@ -100,7 +49,7 @@
 import option from "./config/mainList.json";
 import detailPage from "./detail";
 import { gainUser } from "@/api/basicData/customerInquiry";
-import {getList, deleteList} from "@/api/standAlone/saleLeads";
+import { getList, deleteList } from "@/api/standAlone/saleLeads";
 
 export default {
   name: "index",
@@ -127,6 +76,27 @@ export default {
       oppositePersonOption: [],
     }
   },
+  activated() {
+    if (!this.show && !this.$store.getters.xsjhStatus) {
+      this.show = true;
+    }
+    setTimeout(() => {
+      if (this.$route.query.check && this.show) {
+        this.detailData = {
+          check: this.$route.query.check
+        }
+        this.show = false;
+        this.$store.commit("XSJH_IN_DETAIL");
+      } else if (this.$route.query.params) {
+        this.detailData = {
+          id: this.$route.query.params,
+          view: true,
+        }
+        this.show = false;
+        this.$store.commit("XSJH_IN_DETAIL");
+      }
+    }, 100);
+  },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(101), option);
     gainUser().then(res => {
@@ -137,7 +107,7 @@ export default {
     this.option.column.forEach(item => {
       if (item.search) i++
     })
-    if (i % 3 !== 0){
+    if (i % 3 !== 0) {
       const num = 3 - Number(i % 3)
       this.option.searchMenuSpan = num * 8;
       this.option.searchMenuPosition = "right";
@@ -145,15 +115,16 @@ export default {
   },
   methods: {
     searchCriteriaSwitch(type) {
-      if (type){
-        this.option.height =  this.option.height - 90
-      }else {
-        this.option.height =  this.option.height + 90
+      if (type) {
+        this.option.height = this.option.height - 90
+      } else {
+        this.option.height = this.option.height + 90
       }
       this.$refs.crud.getTableHeight()
     },
     newAdd() {
       this.show = false;
+      this.$store.commit("XSJH_IN_DETAIL");
     },
     onLoad(page, params) {
       // 重置掉展开
@@ -227,7 +198,7 @@ export default {
     cellStyle() {
       return "padding:0;height:40px;";
     },
-    copyDoc() {},
+    copyDoc() { },
     selectionChange(list) {
       this.selection = list;
     },
@@ -239,6 +210,7 @@ export default {
         });
       }
       this.detailData = this.$options.data().detailData;
+      this.$store.commit('XSJH_OUT_DETAIL');
       this.show = true;
       this.onLoad(this.page, this.search);
     },
@@ -253,12 +225,12 @@ export default {
       });
     },
     contractorRemoteMethod(name) {
-      gainUser({realName: name}).then(res => {
+      gainUser({ realName: name }).then(res => {
         this.contractorOption = res.data.data;
       })
     },
     oppositePersonRemoteMethod(name) {
-      gainUser({realName: name}).then(res => {
+      gainUser({ realName: name }).then(res => {
         this.oppositePerson = res.data.data;
       })
     },
@@ -293,5 +265,4 @@ export default {
 </script>
 
 <style scoped>
-
 </style>

+ 70 - 81
src/views/statisticAnalysis/purchaseReconciliation/index.vue

@@ -1,63 +1,32 @@
 <template>
   <div>
     <basic-container class="page-crad">
-      <avue-crud
-        ref="crud"
-        :option="option"
-        :data="dataList"
-        :page.sync="page"
-        :search.sync="search"
-        :cell-style="cellStyle"
-        @search-change="searchChange"
-        @current-change="currentChange"
-        @size-change="sizeChange"
-        @refresh-change="refreshChange"
-        @on-load="onLoad"
-        :table-loading="loading"
-        @saveColumn="saveColumn"
-        @resetColumn="resetColumn"
-        @search-criteria-switch="searchCriteriaSwitch"
-      >
+      <avue-crud ref="crud" :option="option" :data="dataList" :page.sync="page" :search.sync="search"
+        :cell-style="cellStyle" @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
+        @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
+        @resetColumn="resetColumn" @search-criteria-switch="searchCriteriaSwitch">
         <template slot="menuLeft">
-          <el-button
-            type="info"
-            icon="el-icon-printer"
-            size="small"
-            :loading="exportLoading"
-            @click.stop="statement"
-          >报表打印
-          </el-button>
+          <!-- <el-button type="info" icon="el-icon-printer" size="small" :loading="exportLoading" @click.stop="statement">
+            报表打印
+          </el-button> -->
+          <el-button type="info" size="small" @click="outExport" icon="el-icon-download">导出</el-button>
         </template>
         <template slot="brandSearch">
-          <el-select
-            v-model="search.brand"
-            filterable
-            clearable
-            multiple
-            collapse-tags
-          >
-            <el-option
-              v-for="(item, index) in brandOption"
-              :key="index"
-              :label="item.dictValue"
-              :value="item.dictValue"
-            />
+          <el-select v-model="search.brand" filterable clearable>
+            <el-option v-for="(item, index) in brandOption" :key="index" :label="item.dictValue"
+              :value="item.dictValue" />
           </el-select>
         </template>
       </avue-crud>
     </basic-container>
-    <report-dialog
-      :switchDialog="switchDialog"
-      :searchValue="statementData"
-      :reportName="'经销商-可用库存表'"
-      @onClose="onClose()"
-    />
+    <report-dialog :switchDialog="switchDialog" :searchValue="statementData" :reportName="'经销商-可用库存表'"
+      @onClose="onClose()" />
   </div>
 </template>
 
 <script>
 import { getToken } from "@/util/auth";
-import { getList, exportExcel } from "@/api/statisticAnalysis/salesReconciliation";
+import { getList } from "@/api/statisticAnalysis/purchaseReconciliation";
 import { micrometerFormat } from "@/util/validate";
 import _ from "lodash";
 import reportDialog from "@/components/report-dialog/main";
@@ -69,8 +38,8 @@ export default {
   },
   data() {
     return {
-      exportLoading:false,
-      switchDialog:false,
+      exportLoading: false,
+      switchDialog: false,
       statementData: {},
       form: {},
       search: {},
@@ -88,6 +57,7 @@ export default {
         searchShow: true,
         align: "center",
         searchSpan: 8,
+        searchMenuSpan: 8,
         border: true,
         index: true,
         addBtn: false,
@@ -119,7 +89,7 @@ export default {
           },
           {
             label: "制单日期",
-            prop: "createTime",
+            prop: "careteTime",
             search: true,
             type: 'date',
             format: "yyyy-MM-dd",
@@ -130,13 +100,13 @@ export default {
           },
           {
             label: "数量",
-            prop: "orderQuantity",
+            prop: "quantity",
             search: false,
             overHidden: true,
           },
           {
             label: "采购金额",
-            prop: "amount",
+            prop: "orderAmount",
             search: false,
             overHidden: true,
           },
@@ -169,15 +139,6 @@ export default {
     this.getWorkDicts('brand').then(res => {
       this.brandOption = res.data.data;
     })
-    let i = 0;
-    this.option.column.forEach(item => {
-      if (item.search) i++
-    })
-    if (i % 3 !== 0){
-      const num = 3 - Number(i % 3)
-      this.option.searchMenuSpan = num * 8;
-      this.option.searchMenuPosition = "right";
-    }
   },
   methods: {
     cellStyle() {
@@ -197,6 +158,39 @@ export default {
       this.onLoad(this.page, params);
       done();
     },
+    outExport() {
+      let params = { ...this.search }
+      if (!params.brand) this.$set(params, 'brand', '');
+      if (params.careteTime && params.careteTime.length > 0) {
+        params = {
+          ...params,
+          beginCreateTime: params.careteTime[0] + ' 00:00:00',
+          endCreateTime: params.careteTime[1] + ' 23:59:59',
+        }
+      } else {
+        params = {
+          ...params,
+          beginCreateTime: '',
+          endCreateTime: '',
+        }
+      }
+      console.log(params)
+      this.$confirm('是否导出数据明细?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        window.open(
+          `/api/blade-purchase-sales/exportOrder/selPurchaseExport?${this.website.tokenHeader
+          }=${getToken()}&brand=${params.brand}&beginCreateTime=${params.beginCreateTime}&endCreateTime=${params.endCreateTime}`
+        );
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消' //
+        });
+      })
+    },
     refreshChange() {
       delete this.search.corpName;
       delete this.search.storageName
@@ -210,30 +204,23 @@ export default {
       this.page.pageSize = val;
     },
     onLoad(page, params) {
-      this.loading = true;
-      this.dataList.forEach(item => {
-        this.$refs.crud.toggleRowExpansion(item, false);
-      });
-      let queryParams = Object.assign({}, params);
-      if (queryParams.businesDate && queryParams.businesDate.length > 0) {
-        queryParams = {
-          ...queryParams,
-          orderStartDate: queryParams.businesDate[0] + ' 00:00:00',
-          orderEndDate: queryParams.businesDate[1] + ' 23:59:59',
-        }
-        delete queryParams.businesDate;
+      console.log(this.search, params)
+      if (this.search.careteTime && this.search.careteTime.length > 0) {
+        params = {
+          ...params,
+          beginCreateTime: this.search.careteTime[0],
+          endCreateTime: this.search.careteTime[1]
+        };
       }
+      let queryParams = Object.assign({}, params);
+      delete queryParams.careteTime;
+      this.loading = true;
       getList(
         page.currentPage,
         page.pageSize,
         queryParams
       )
         .then(res => {
-          if (res.data.data.records) {
-            res.data.data.records.forEach(e => {
-              e.itemLoading = true;
-            });
-          }
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;
           if (this.page.total) {
@@ -262,11 +249,11 @@ export default {
       }
     },
     statement() {
-      this.statementData = {...this.search};
-      if (this.statementData.createTime && this.statementData.createTime.length > 0) {
-        this.statementData.createStartTime = this.statementData.createTime[0]+ " " + "00:00:00"
-        this.statementData.createEndTime = this.statementData.createTime[1]+ " " + "23:59:59"
-        delete this.statementData.createTime
+      this.statementData = { ...this.search };
+      if (this.statementData.careteTime && this.statementData.careteTime.length > 0) {
+        this.statementData.createStartTime = this.statementData.careteTime[0] + " " + "00:00:00"
+        this.statementData.createEndTime = this.statementData.careteTime[1] + " " + "23:59:59"
+        delete this.statementData.careteTime
       }
       this.switchDialog = !this.switchDialog;
     },
@@ -308,9 +295,11 @@ export default {
 .page-crad ::v-deep .basic-container__card {
   height: 94.2vh;
 }
+
 ::v-deep .el-table__expanded-cell[class*="cell"] {
   padding: 0px;
 }
+
 .itemTable ::v-deep .el-table {
   width: 100%;
 }

+ 3 - 11
src/views/statisticAnalysis/salesmanCommission/index.vue

@@ -155,11 +155,11 @@ export default {
       let params = { ...this.search }
       if (!params.brand) this.$set(params, 'brand', '');
       if (!params.salesName) this.$set(params, 'salesName', '');
-      if (params.createTime && params.createTime.length > 0) {
+      if (params.careteTime && params.careteTime.length > 0) {
         params = {
           ...params,
-          beginCreateTime: params.createTime[0] + ' 00:00:00',
-          endCreateTime: params.createTime[1] + ' 23:59:59',
+          beginCreateTime: params.careteTime[0] + ' 00:00:00',
+          endCreateTime: params.careteTime[1] + ' 23:59:59',
         }
       } else {
         params = {
@@ -220,9 +220,6 @@ export default {
       }
       let queryParams = Object.assign({}, params);
       delete queryParams.careteTime;
-      // this.dataList.forEach(item => {
-      //   this.$refs.crud.toggleRowExpansion(item, false);
-      // });
       this.loading = true;
       getList(
         page.currentPage,
@@ -230,11 +227,6 @@ export default {
         queryParams
       )
         .then(res => {
-          // if (res.data.data.records) {
-          //   res.data.data.records.forEach(e => {
-          //     e.itemLoading = true;
-          //   });
-          // }
           this.dataList = res.data.data.records ? res.data.data.records : [];
           this.page.total = res.data.data.total;
           if (this.page.total) {