Bläddra i källkod

Merge remote-tracking branch 'origin/develop' into develop

FengChaoYu 3 år sedan
förälder
incheckning
60cb589531

+ 9 - 0
src/api/common.js

@@ -79,4 +79,13 @@ export function checkOrder(params) {
     method: 'get',
     params
   })
+}
+
+// 获取业务员列表
+export function getSalesmanList(params) {
+  return request({
+    url: "/admin/user/list",
+    method: "get",
+    params,
+  });
 }

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

@@ -27,6 +27,15 @@ export function examineApply(params) {
   })
 }
 
+// 零售发货申请单 - 弃审
+export function abandonApply(params) {
+  return request({
+    url: '/invoice/giveUp',
+    method: 'post',
+    params
+  })
+}
+
 // 获取仓位列表
 export function getPositionList(params) {
   return request({
@@ -84,7 +93,7 @@ export function editApply(params) {
 // 获取仓库列表
 export function getWarehouseList(params) {
   return request({
-    url: '/stock/listStock',
+    url: '/stock/manager/listStock',
     method: 'get',
     params
   })
@@ -173,6 +182,15 @@ export function examineEngin(params) {
   })
 }
 
+// 工程发货申请单 - 弃审
+export function abandonEngin(params) {
+  return request({
+    url: '/invoice/projectGiveUp',
+    method: 'post',
+    params
+  })
+}
+
 // 工程发货申请单 - 申请/撤回
 export function submitEngin(params) {
   return request({

+ 49 - 0
src/api/supply/commercial_list.js

@@ -0,0 +1,49 @@
+import request from "@/utils/request";
+
+// 删除
+export function getBusPriceDelete(params) {
+  return request({
+    url: "/bus/price/delete",
+    method: "post",
+    params,
+  });
+}
+// 详情
+export function getBusPriceDetail(params) {
+  return request({
+    url: "/bus/price/detail",
+    method: "get",
+    params,
+  });
+}
+// 下载商用工程产品价格模板
+export function getBusPriceDownload() {
+  return request({
+    url: "/bus/price/download",
+    method: "get",
+  });
+}
+// 商用工程产品价格-导出
+export function getBusPriceExport(params) {
+  return request({
+    url: "/bus/price/export",
+    method: "get",
+    params,
+  });
+}
+// 商用工程产品价格列表
+export function getBusPriceList(params) {
+  return request({
+    url: "/bus/price/list",
+    method: "get",
+    params,
+  });
+}
+// 修改
+export function getBusPriceUpdate(data) {
+  return request({
+    url: "/bus/price/update",
+    method: "post",
+    data,
+  });
+}

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

@@ -421,7 +421,7 @@ export function returnCom(params) {
 // 获取仓库列表
 export function getWarehouseList(params) {
   return request({
-    url: '/stock/listStock',
+    url: '/stock/manager/listStock',
     method: 'get',
     params
   })

+ 1 - 1
src/api/supply/pickup.js

@@ -21,7 +21,7 @@ export function getDetail(params) {
 // 获取仓库列表
 export function getWarehouseList(params) {
   return request({
-    url: '/stock/listStock',
+    url: '/stock/manager/listStock',
     method: 'get',
     params
   })

+ 1 - 1
src/api/supply/policy.js

@@ -102,7 +102,7 @@ export function getWalletList(params) {
 // 获取仓库列表
 export function getWarehouseList(params) {
   return request({
-    url: '/stock/listStock',
+    url: '/stock/manager/listStock',
     method: 'get',
     params
   })

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

@@ -70,4 +70,13 @@ export function checkMaterialList(params) {
     method: 'get',
     params
   })
+}
+
+// 获取仓库列表
+export function getWarehouseList(params) {
+  return request({
+    url: '/stock/manager/listStock',
+    method: 'get',
+    params
+  })
 }

+ 1 - 1
src/api/supply/retail.js

@@ -119,7 +119,7 @@ export function getWalletList(params) {
 // 获取仓库列表
 export function getWarehouseList(params) {
   return request({
-    url: "/stock/listStock",
+    url: "/stock/manager/listStock",
     method: "get",
     params,
   });

+ 7 - 0
src/styles/index.scss

@@ -234,9 +234,16 @@ div:focus {
 }
 
 .el-menu-item, .el-submenu__title {
+  height: 50px;
+  line-height: 50px;
   font-weight: 600 !important;
 }
 
+.el-submenu .el-menu-item {
+  height: 50px;
+  line-height: 50px;
+}
+
 .page-footer {
   height: 70px;
   .footer {

+ 5 - 5
src/views/engin_deposit/components/refund_list-detail.vue

@@ -75,7 +75,7 @@
           <div class="label">使用单位</div>
           <div class="value">{{ detailList.refUseUnit }}</div>
         </el-col>
-        <el-col :xs="24" :sm="24" :lg="8" class="item">
+        <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">寄厂日期</div>
           <div class="value">
             <el-date-picker
@@ -90,7 +90,7 @@
             >
             </el-date-picker>
           </div>
-        </el-col>
+        </el-col> -->
         <!-- <el-col :xs="24" :sm="24" :lg="8" class="item">
           <div class="label">提货日期</div>
           <div class="value">{{detailList.}}</div>
@@ -324,9 +324,9 @@
             min-width="160"
             show-overflow-tooltip
           >
-          <template slot-scope="scope">
-            {{'资料_'+scope.row.fileName}}
-          </template>
+            <template slot-scope="scope">
+              {{ "资料_" + scope.row.fileName }}
+            </template>
           </el-table-column>
           <el-table-column
             align="center"

+ 341 - 0
src/views/sales/price/commercial_list.vue

@@ -0,0 +1,341 @@
+<template>
+  <div class="app-container">
+    <!-- 筛选条件 -->
+    <div>
+      <el-form
+        ref="searchForm"
+        :model="searchForm"
+        label-width="70px"
+        size="small"
+        label-position="left"
+      >
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="产品品类" prop="categoryId">
+              <el-input
+                v-model="searchForm.categoryId"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="物料名称" prop="materialName">
+              <el-input
+                v-model="searchForm.materialName"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="物料编码" prop="materialNumber">
+              <el-input
+                v-model="searchForm.materialNumber"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="销售类型" prop="saleTypeId">
+              <el-input
+                v-model="searchForm.saleTypeId"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="6">
+            <el-form-item label="规格" prop="specification">
+              <el-input
+                v-model="searchForm.specification"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="12" :lg="18" class="tr">
+            <el-form-item label="">
+              <el-button size="small" @click="clearFn">清空</el-button>
+              <el-button size="small" type="primary" @click="searchFormFn"
+                >搜索</el-button
+              >
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <!-- 按钮 -->
+    <div class="btn-group clearfix">
+      <div class="fr">
+        <el-button type="primary" size="small" @click="downLoadFn"
+          >模板</el-button
+        >
+        <ExportButton
+          class="import-btn"
+          :exUrl="'/bus/price/export'"
+          :exParams="exParams"
+        />
+        <el-upload
+          class="import-btn"
+          action=""
+          :http-request="handleImport"
+          :file-list="importFileList"
+          :show-file-list="false"
+        >
+          <el-button type="primary" size="small">批量导入</el-button>
+        </el-upload>
+      </div>
+    </div>
+    <!-- 列表 -->
+    <div class="mymain-container">
+      <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="productCode"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="零售价格"
+            prop="retailPrice"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="批发价格"
+            prop="batchPrice"
+            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="saleTypeName"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+
+          <el-table-column
+            align="center"
+            label="金蝶物料ID"
+            prop="materialId"
+            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="materialName"
+            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="是否促销价"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-tag type="success" v-if="scope.row.isPromote">是</el-tag>
+              <el-tag type="danger" v-else>否</el-tag>
+            </template>
+          </el-table-column>
+          <el-table-column
+            align="center"
+            label="是否促作废"
+            min-width="160"
+            show-overflow-tooltip
+          >
+            <template slot-scope="scope">
+              <el-tag type="success" v-if="scope.row.isRevoke">是</el-tag>
+              <el-tag type="danger" v-else>否</el-tag>
+            </template>
+          </el-table-column>
+
+          <el-table-column
+            align="center"
+            label="格力折扣价"
+            prop="discAmount"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            label="备注"
+            prop="remark"
+            min-width="160"
+            show-overflow-tooltip
+          ></el-table-column>
+
+          <el-table-column
+            align="center"
+            label="操作"
+            prop="caozuo"
+            min-width="160"
+            show-overflow-tooltip
+            fixed="right"
+          >
+            <template slot-scope="scope"
+              ><el-button
+                type="text"
+                class="textColor"
+                @click="seeFn(scope.row)"
+                >查看</el-button
+              >
+              <el-popconfirm
+                @onConfirm="deleFn(scope.row.id)"
+                v-if="$checkBtnRole('del', $route.meta.roles)"
+                title="这是一段内容确定删除吗?"
+              >
+                <el-button type="text" class="textColor" slot="reference"
+                  >删除</el-button
+                >
+              </el-popconfirm>
+              <el-button
+                type="text"
+                class="textColor"
+                @click="stopFn(scope.row.id)"
+                >修改</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <!-- 分页 -->
+      <div class="fr">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="currentPage"
+          :page-sizes="[10, 20, 30, 50]"
+          :page-size="10"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="listTotal"
+        >
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { getBusPriceList } from "@/api/supply/commercial_list";
+import { downloadFiles, handleImport } from "@/utils/util";
+export default {
+  data() {
+    return {
+      listLoading: false, // 列表加载loading
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      dataList: [],
+      importFileList: [],
+      searchForm: {
+        categoryId: "",
+        materialName: "",
+        materialNumber: "",
+        saleTypeId: "",
+        specification: "",
+      },
+    };
+  },
+  computed: {
+    exParams() {
+      return {};
+    },
+  },
+  created() {
+    this.getDataList();
+  },
+  methods: {
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.getDataList();
+    },
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getDataList();
+    },
+    //清除
+    clearFn() {
+      this.$refs.searchForm.resetFields();
+    },
+    //搜索
+    searchFormFn() {
+      this.getDataList();
+    },
+    //导入
+    async handleImport(param) {
+      const file = param.file;
+      const formData = new FormData();
+      formData.append("file", file);
+      let result = await handleImport("/bus/price/import", formData);
+      //   console.log(result);
+      this.importFileList = [];
+      if (result.code == 200) {
+        this.$message.success("导入成功");
+      } else {
+        this.$message.error(result.message);
+      }
+    },
+    //下载模板
+    downLoadFn() {
+      downloadFiles("/bus/price/download");
+    },
+    //获取列表数据
+    async getDataList() {
+      let params = {
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        categoryId: this.searchForm.categoryId,
+        materialName: this.searchForm.materialName,
+        materialNumber: this.searchForm.materialNumber,
+        saleTypeId: this.searchForm.saleTypeId,
+        specification: this.searchForm.specification,
+      };
+      let res = await getBusPriceList(params);
+      this.dataList = res.data.records;
+      this.listTotal = res.data.total;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.import-btn {
+  display: inline-block;
+  margin-left: 10px;
+}
+</style>

+ 26 - 3
src/views/supply/apply/apply_list.vue

@@ -101,12 +101,27 @@
             </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.id, 'WAIT')" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
+                <el-popconfirm
+                  style="margin-right: 10px;" 
+                  title="确定申请吗?" 
+                  @onConfirm="handleSubmit(scope.row.id, 'WAIT')" 
+                  v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
                   <el-button slot="reference" type="text">申请</el-button>
                 </el-popconfirm>
-                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleSubmit(scope.row.id, 'SAVE')" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
+                <el-popconfirm
+                  style="margin-right: 10px;" 
+                  title="确定撤回吗?" 
+                  @onConfirm="handleSubmit(scope.row.id, 'SAVE')"
+                  v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
                   <el-button slot="reference" type="text">撤回</el-button>
                 </el-popconfirm>
+                <el-popconfirm 
+                  style="margin-right: 10px;" 
+                  title="确定弃审吗?" 
+                  @onConfirm="handleAbandon(scope.row.id)" 
+                  v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                  <el-button slot="reference" type="text">弃审</el-button>
+                </el-popconfirm>
                 <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
                 <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审单</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
@@ -141,7 +156,7 @@
 </template>
 
 <script>
-import { getApplyList, submitApply, deleteApply } from "@/api/supply/apply";
+import { getApplyList, submitApply, deleteApply, abandonApply } from "@/api/supply/apply";
 import ApplyDetail from "@/views/supply/apply/components/apply_detail";
 import ApplyExamine from "@/views/supply/apply/components/apply_examine";
 import ApplyForm from "@/views/supply/apply/components/apply_form";
@@ -314,6 +329,14 @@ export default {
         this.getList();
       })
     },
+
+    // 弃审
+    handleAbandon(id) {
+      abandonApply({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
   }
 }
 </script>

+ 26 - 3
src/views/supply/apply/engin_list.vue

@@ -103,12 +103,27 @@
             </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.id, 'WAIT')" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
+                <el-popconfirm
+                  style="margin-right: 10px;" 
+                  title="确定申请吗?" 
+                  @onConfirm="handleSubmit(scope.row.id, 'WAIT')" 
+                  v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" >
                   <el-button slot="reference" type="text">申请</el-button>
                 </el-popconfirm>
-                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleSubmit(scope.row.id, 'SAVE')" v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
+                <el-popconfirm
+                  style="margin-right: 10px;" 
+                  title="确定撤回吗?" 
+                  @onConfirm="handleSubmit(scope.row.id, 'SAVE')" 
+                  v-if="$checkBtnRole('apply', $route.meta.roles) && scope.row.examineStatus === 'WAIT'" >
                   <el-button slot="reference" type="text">撤回</el-button>
                 </el-popconfirm>
+                <el-popconfirm 
+                  style="margin-right: 10px;" 
+                  title="确定弃审吗?" 
+                  @onConfirm="handleAbandon(scope.row.id)" 
+                  v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                  <el-button slot="reference" type="text">弃审</el-button>
+                </el-popconfirm>
                 <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
                 <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审单</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
@@ -143,7 +158,7 @@
 </template>
 
 <script>
-import { getEnginList, submitEngin, deleteEngin } from "@/api/supply/apply";
+import { getEnginList, submitEngin, deleteEngin, abandonEngin } from "@/api/supply/apply";
 import EnginDetail from "@/views/supply/apply/components/engin_detail";
 import EnginExamine from "@/views/supply/apply/components/engin_examine";
 import EnginForm from "@/views/supply/apply/components/engin_form";
@@ -316,6 +331,14 @@ export default {
         this.getList();
       })
     },
+
+    // 弃审
+    handleAbandon(id) {
+      abandonEngin({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
   }
 }
 </script>

+ 6 - 3
src/views/supply/engin/components/commerce_detail.vue

@@ -200,9 +200,9 @@
         <div class="footer">
           <el-button type="success" @click="toCheckOrder">联查单据</el-button>
           <el-button type="danger" @click="closeData" v-if="detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT'">关闭订单</el-button>
-          <el-button type="primary" @click="openDirectDialog">提前开票</el-button>
-          <el-button type="primary" @click="overData">直调完结</el-button>
-          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus">直调发货</el-button>
+          <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button>
+          <el-button type="primary" @click="overData" v-if="!isDealer">直调完结</el-button>
+          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus" v-if="!isDealer">直调发货</el-button>
           <el-button @click="goBack">返回</el-button>
         </div>
       </div>
@@ -422,6 +422,9 @@ export default {
     isExamine() {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
     },
+    isDealer() {
+      return JSON.parse(localStorage.getItem("supply_user")).isCustomer
+    },
   },
 
   created() {

+ 65 - 4
src/views/supply/engin/components/commerce_form.vue

@@ -72,8 +72,18 @@
             <el-input v-model="mainForm.company" placeholder="请输入使用单位" disabled></el-input>
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row :gutter="20">
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="业务员" prop="salesMan">
+            <el-select v-model="mainForm.salesMan" placeholder="选择业务员" size="small" clearable style="width: 100%">
+              <el-option
+                v-for="item in outSalesmanList"
+                :key="item.adminUserId"
+                :label="item.nickName"
+                :value="item.adminUserId">
+              </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="请输入联系人" disabled></el-input>
@@ -239,6 +249,20 @@
             <div>{{ status2Filter(scope.row) }}</div>
           </template>
         </el-table-column>
+
+        <el-table-column align="center" label="业务员" prop="serviceId" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.serviceId" placeholder="选择业务员" size="small" clearable>
+              <el-option
+                v-for="item in salesmanList"
+                :key="item.adminUserId"
+                :label="item.nickName"
+                :value="item.adminUserId">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+
         <el-table-column align="center" label="操作" width="100" fixed="right">
           <template slot-scope="scope">
             <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
@@ -327,7 +351,7 @@
 
 <script>
 import { getOrderDetail, getComLoginList, getComLoginDetail, getWarehouseList, addCom, editCom, submitCom, checkStock, getWalletList } from "@/api/supply/engin";
-import { getDictList, getTypeList } from '@/api/common'
+import { getDictList, getTypeList, getSalesmanList } from '@/api/common'
 
 let that
 export default {
@@ -372,6 +396,7 @@ export default {
         createMan: '',
         createDate: '',
         fileNum: '',
+        salesMan: '',
       },
       mainFormRules: {
         // orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
@@ -404,12 +429,33 @@ export default {
 
       warehouseList: [],
       warehouseValue: '',
+
+      isFirst: true,
+      salesmanList: [],
     }
   },
   
   computed: {
     isDealer() {
       return JSON.parse(localStorage.getItem("supply_user")).isCustomer
+    },
+
+    outSalesmanList() {
+      let list = [];
+      if(this.goodsList && this.goodsList.length) {
+        this.goodsList.forEach(item => {
+          if(item.serviceId) {
+            let obj = this.salesmanList.find(o => o.adminUserId == item.serviceId);
+            list.push(obj);
+          }
+        })
+        if(this.isFirst) {
+          this.isFirst = false;
+        }else {
+          this.mainForm.salesMan = this.goodsList[0].serviceId;
+        }
+      }
+      return list
     }
   },
 
@@ -417,7 +463,8 @@ export default {
     that = this;
   },
 
-  created() {
+  async created() {
+    await this.getSalesmanList();
     this.getDictList();
     this.getWarehouseList();
 
@@ -474,6 +521,16 @@ export default {
       })
     },
 
+    async getSalesmanList() {
+      const res = await getSalesmanList({
+        pageNum: 1,
+        pageSize: -1,
+        isCustomer: 0,
+        status: true,
+      });
+      this.salesmanList = res.data.records;
+    },
+
     // 获取详情
     getDetail() {
       getOrderDetail({id: this.editId}).then(res => {
@@ -499,6 +556,7 @@ export default {
         this.mainForm.createMan = data.createName;
         this.mainForm.createDate = data.createTime;
         this.mainForm.fileNum = data.fileNo;
+        this.mainForm.salesMan = data.serviceId;
 
         data.items.forEach(item => {
           item.status1 = '';
@@ -697,6 +755,7 @@ export default {
             delete item.wallets;
           })
 
+          let saleManItem = this.mainForm.salesMan ? this.mainForm.salesManthis.outSalesmanList.find(o => o.adminUserId == this.mainForm.salesMan) : '';
           let params = {
             enginOrderId: this.mainForm.orderNum,
             // orderDate: this.mainForm.orderDate,
@@ -714,6 +773,8 @@ export default {
             note1: this.mainForm.greeReply || '',
             remark: this.mainForm.remark || '',
             fileNo: this.mainForm.fileNum || '',
+            serviceId: this.mainForm.salesMan,
+            serviceName: saleManItem.nickName,
             items: goodsList,
           }
           if(type === 1) {

+ 6 - 3
src/views/supply/engin/components/home_detail.vue

@@ -200,9 +200,9 @@
         <div class="footer">
           <el-button type="success" @click="toCheckOrder">联查单据</el-button>
           <el-button type="danger" @click="closeData" v-if="detailData.examineStatus === 'SAVE' || detailData.examineStatus === 'WAIT'">关闭订单</el-button>
-          <el-button type="primary" @click="openDirectDialog">提前开票</el-button>
-          <el-button type="primary" @click="overData">直调完结</el-button>
-          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus">直调发货</el-button>
+          <el-button type="primary" @click="openDirectDialog" v-if="!isDealer">提前开票</el-button>
+          <el-button type="primary" @click="overData" v-if="!isDealer">直调完结</el-button>
+          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.directTransferStatus" v-if="!isDealer">直调发货</el-button>
           <el-button @click="goBack">返回</el-button>
         </div>
       </div>
@@ -411,6 +411,9 @@ export default {
     isExamine() {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
     },
+    isDealer() {
+      return JSON.parse(localStorage.getItem("supply_user")).isCustomer
+    },
   },
 
   created() {

+ 66 - 3
src/views/supply/engin/components/home_form.vue

@@ -79,6 +79,18 @@
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="业务员" prop="salesMan">
+            <el-select v-model="mainForm.salesMan" placeholder="选择业务员" size="small" clearable style="width: 100%">
+              <el-option
+                v-for="item in outSalesmanList"
+                :key="item.adminUserId"
+                :label="item.nickName"
+                :value="item.adminUserId">
+              </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="请输入联系人" disabled></el-input>
           </el-form-item>
@@ -245,6 +257,20 @@
             <div>{{ status2Filter(scope.row) }}</div>
           </template>
         </el-table-column>
+
+        <el-table-column align="center" label="业务员" prop="serviceId" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.serviceId" placeholder="选择业务员" size="small" clearable disabled>
+              <el-option
+                v-for="item in salesmanList"
+                :key="item.adminUserId"
+                :label="item.nickName"
+                :value="item.adminUserId">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+
         <el-table-column align="center" label="操作" width="100" fixed="right">
           <template slot-scope="scope">
             <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
@@ -414,7 +440,7 @@
 
 <script>
 import { getOrderDetail, getHomeLoginList, getHomeLoginDetail, getWarehouseList, addHome, editHome, submitHome, checkStock, getRetailProductList } from "@/api/supply/engin";
-import { getDictList, getTypeList } from '@/api/common'
+import { getDictList, getTypeList, getSalesmanList } from '@/api/common'
 
 let that
 export default {
@@ -460,7 +486,8 @@ export default {
         createMan: '',
         createDate: '',
         fileNum: '',
-        loginUserId: ''
+        loginUserId: '',
+        salesMan: '',
       },
       mainFormRules: {
         // orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
@@ -514,12 +541,33 @@ export default {
       rightSelection: [],
 
       formLoading: false,
+
+      isFirst: true,
+      salesmanList: [],
     }
   },
 
   computed: {
     isDealer() {
       return JSON.parse(localStorage.getItem("supply_user")).isCustomer
+    },
+
+    outSalesmanList() {
+      let list = [];
+      if(this.goodsList && this.goodsList.length) {
+        this.goodsList.forEach(item => {
+          if(item.serviceId) {
+            let obj = this.salesmanList.find(o => o.adminUserId == item.serviceId);
+            list.push(obj);
+          }
+        })
+        if(this.isFirst) {
+          this.isFirst = false;
+        }else {
+          this.mainForm.salesMan = this.goodsList[0].serviceId;
+        }
+      }
+      return list
     }
   },
 
@@ -527,7 +575,8 @@ export default {
     that = this;
   },
 
-  created() {
+  async created() {
+    await this.getSalesmanList();
     this.getDictList();
     this.getSalesTypeList();
     this.getWarehouseList();
@@ -595,6 +644,16 @@ export default {
       })
     },
 
+    async getSalesmanList() {
+      const res = await getSalesmanList({
+        pageNum: 1,
+        pageSize: -1,
+        isCustomer: 0,
+        status: true,
+      });
+      this.salesmanList = res.data.records;
+    },
+
     // 工程登录列表 - 获取列表
     getHomeLoginList() {
       getHomeLoginList({
@@ -764,6 +823,7 @@ export default {
         this.mainForm.createMan = data.createName;
         this.mainForm.createDate = data.createTime;
         this.mainForm.fileNum = data.fileNo;
+        this.mainForm.salesMan = data.serviceId;
 
         data.items.forEach(item => {
           item.status1 = '';
@@ -982,6 +1042,7 @@ export default {
           })
 
           let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
+          let saleManItem = this.mainForm.salesMan ? this.mainForm.salesManthis.outSalesmanList.find(o => o.adminUserId == this.mainForm.salesMan) : '';
           let params = {
             enginOrderId: this.mainForm.orderNum,
             // orderDate: this.mainForm.orderDate,
@@ -1003,6 +1064,8 @@ export default {
             note1: this.mainForm.greeReply || '',
             remark: this.mainForm.remark || '',
             fileNo: this.mainForm.fileNum || '',
+            serviceId: this.mainForm.salesMan,
+            serviceName: saleManItem.nickName,
             items: goodsList,
           }
 

+ 1 - 0
src/views/supply/reserve/components/reserve_detail.vue

@@ -59,6 +59,7 @@
           <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="预留数量" prop="reservedNum" 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="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="备注" prop="reservedRemark" min-width="160" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="修改人" prop="updateBy" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="修改时间" prop="updateTime" min-width="160" show-overflow-tooltip></el-table-column>

+ 32 - 2
src/views/supply/reserve/components/reserve_form.vue

@@ -123,6 +123,15 @@
           </template>
         </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="correspondId" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.correspondId" placeholder="选择预留仓库" size="small" clearable @change="changeWarehouse(scope.$index)">
+              <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+
         <el-table-column align="center" label="备注" prop="reservedRemark" min-width="160" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="状态" prop="status" min-width="100" show-overflow-tooltip>
           <template slot-scope="scope">
@@ -259,7 +268,7 @@
 </template>
 
 <script>
-import { getDetail, getGoodsList, addData, editData, checkDealerList, checkMaterialList } from "@/api/supply/reserve";
+import { getDetail, getGoodsList, addData, editData, checkDealerList, checkMaterialList, getWarehouseList } from "@/api/supply/reserve";
 import { getDictList } from '@/api/common'
 
 let that
@@ -323,6 +332,7 @@ export default {
 
       dealerList: [],
       materialList: [],
+      warehouseList: [],
     }
   },
 
@@ -330,7 +340,8 @@ export default {
     that = this;
   },
 
-  created() {
+  async created() {
+    await this.getWarehouseList();
     if(this.listItem) {
       this.getDetail();
     }else {
@@ -362,6 +373,15 @@ export default {
       })
     },
 
+    // 获取仓库列表
+    async getWarehouseList() {
+      const res = await getWarehouseList({
+        pageNum: 1,
+        pageSize: -1,
+      });
+      this.warehouseList = res.data.records;
+    },
+
     // 返回列表
     goBack() {
       this.$emit('backListFormDetail');
@@ -571,6 +591,16 @@ export default {
       }
     },
 
+    // 修改仓库
+    changeWarehouse(index) {
+      if(this.goodsList[index].correspondId) {
+        let obj = this.warehouseList.find(o => o.id == this.goodsList[index].correspondId);
+        this.goodsList[index].correspondName = obj.name;
+      }else {
+        this.goodsList[index].correspondName = '';
+      }
+    },
+
     // 提交
     clickSubmitForm() {
       this.$refs.mainForm.validate((valid) => {

+ 3 - 3
src/views/supply/retail/components/retail_detail.vue

@@ -150,9 +150,9 @@
       <div class="page-footer">
         <div class="footer">
           <el-button type="success" @click="toCheckOrder">联查单据</el-button>
-          <el-button type="primary" @click="openDirectDialog" :disabled="detailData.examineStatus !== 'OK'">提前开票</el-button>
-          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK' || detailData.directTransferStatus === true">直调发货</el-button>
-          <el-button type="primary" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK'" v-if="isDealer">直调完成</el-button>
+          <el-button type="primary" @click="openDirectDialog" :disabled="detailData.examineStatus !== 'OK'" v-if="!isDealer">提前开票</el-button>
+          <el-button type="primary" @click="openDeliverDialog" :disabled="detailData.examineStatus !== 'OK' || detailData.directTransferStatus === true" v-if="!isDealer">直调发货</el-button>
+          <el-button type="primary" @click="handleFinish" :disabled="detailData.examineStatus !== 'OK'" v-if="!isDealer">直调完成</el-button>
           <el-button @click="goBack">关 闭</el-button>
         </div>
       </div>

+ 64 - 11
src/views/supply/retail/components/retail_form.vue

@@ -25,13 +25,18 @@
             </el-date-picker>
           </el-form-item>
         </el-col>
-        <!-- <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="产品大类" prop="type">
-            <el-select v-model="mainForm.type" placeholder="选择产品大类" style="width: 100%" :disabled="goodsList.length > 0">
-              <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="业务员" prop="salesMan">
+            <el-select v-model="mainForm.salesMan" placeholder="选择业务员" size="small" clearable style="width: 100%">
+              <el-option
+                v-for="item in outSalesmanList"
+                :key="item.adminUserId"
+                :label="item.nickName"
+                :value="item.adminUserId">
+              </el-option>
             </el-select>
           </el-form-item>
-        </el-col> -->
+        </el-col>
       </el-row>
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="8">
@@ -154,6 +159,20 @@
             <div>{{ status2Filter(scope.row) }}</div>
           </template>
         </el-table-column>
+
+        <el-table-column align="center" label="业务员" prop="serviceId" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.serviceId" placeholder="选择业务员" size="small" clearable disabled>
+              <el-option
+                v-for="item in salesmanList"
+                :key="item.adminUserId"
+                :label="item.nickName"
+                :value="item.adminUserId">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+
         <el-table-column align="center" label="操作" width="100" fixed="right">
           <template slot-scope="scope">
             <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
@@ -270,7 +289,7 @@
 
 <script>
 import { getDetail, addData, editData, getSalesTypeList, getGoodsList, getWarehouseList, checkStock } from "@/api/supply/retail";
-import { getDictList } from '@/api/common'
+import { getDictList, getSalesmanList } from '@/api/common'
 
 let that
 export default {
@@ -299,8 +318,8 @@ export default {
         // type: '',
         jxsNum: '',
         jxsName: '',
-        serviceName: '',
         remark: '',
+        salesMan: '',
       },
       mainFormRules: {
         // date: [
@@ -335,12 +354,33 @@ export default {
 
       leftSelection: [],
       rightSelection: [],
+
+      isFirst: true,
+      salesmanList: [],
     }
   },
 
   computed: {
     isDealer() {
-      return JSON.parse(localStorage.getItem("supply_user")).isCustomer
+      return JSON.parse(localStorage.getItem("supply_user")).isCustomer;
+    },
+
+    outSalesmanList() {
+      let list = [];
+      if(this.goodsList && this.goodsList.length) {
+        this.goodsList.forEach(item => {
+          if(item.serviceId) {
+            let obj = this.salesmanList.find(o => o.adminUserId == item.serviceId);
+            list.push(obj);
+          }
+        })
+        if(this.isFirst) {
+          this.isFirst = false;
+        }else {
+          this.mainForm.salesMan = this.goodsList[0].serviceId;
+        }
+      }
+      return list
     }
   },
 
@@ -348,7 +388,8 @@ export default {
     that = this;
   },
 
-  created() {
+  async created() {
+    await this.getSalesmanList();
     this.getDictList();
     this.getWarehouseList();
     if(this.listItem) {
@@ -371,7 +412,7 @@ export default {
         let data = res.data;
         this.mainForm.orderNum = data.id;
         this.mainForm.date = data.theTime.slice(0, 10);
-        // this.mainForm.type = data.mainId;
+        this.mainForm.salesMan = data.k3ServiceId;
         this.mainForm.jxsNum = data.customerNumber;
         this.mainForm.jxsName = data.customerName;
         this.mainForm.remark = data.remark;
@@ -412,6 +453,16 @@ export default {
       })
     },
 
+    async getSalesmanList() {
+      const res = await getSalesmanList({
+        pageNum: 1,
+        pageSize: -1,
+        isCustomer: 0,
+        status: true,
+      });
+      this.salesmanList = res.data.records;
+    },
+
     // 获取商品列表
     getGoodsList() {
       getGoodsList({
@@ -630,11 +681,13 @@ export default {
             delete item.wallets;
           })
 
-          // let mainName = this.typeList[findElem(this.typeList, 'dictCode', this.mainForm.type)].dictValue;
+          let saleManItem = this.mainForm.salesMan ? this.mainForm.salesManthis.outSalesmanList.find(o => o.adminUserId == this.mainForm.salesMan) : '';
           let params = {
             // theTime: this.mainForm.date + ' 00:00:00',
             // mainId: this.mainForm.type,
             // mainName,
+            k3ServiceId: this.mainForm.salesMan,
+            k3ServiceName: saleManItem.nickName,
             remark: this.mainForm.remark,
             type: 1, // 1:普通零售单,2:政策零售单
             retailOrderItemList: goodsList