howie hace 3 años
padre
commit
13e1a756ed

+ 11 - 0
src/api/basic_data/material.js

@@ -278,3 +278,14 @@ export function getProductCategoryAddSub(data) {
     data
   })
 }
+<<<<<<< HEAD
+=======
+//删除产品品类小类
+export function getProductCategoryDelSub(params) {
+  return request({
+    url:'/product-category/del-sub',
+    method: 'post',
+    params
+  })
+}
+>>>>>>> 73d73ce7045253536cd99e58c1eaf874422160b0

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

@@ -34,4 +34,76 @@ export function getEnginDetail(params) {
     method: 'get',
     params
   })
+}
+
+// 审批
+export function examineEngin(params) {
+  return request({
+    url: '/engin-info-order/examine',
+    method: 'post',
+    data: params
+  })
+}
+
+// 获取产品列表
+export function getRetailProductList(params) {
+  return request({
+    url: '/retail/product/list',
+    method: 'get',
+    params
+  })
+}
+
+// 新增
+export function addEngin(params) {
+  return request({
+    url: '/engin-info-order/add',
+    method: 'post',
+    data: params
+  })
+}
+
+// 编辑
+export function editEngin(params) {
+  return request({
+    url: '/engin-info-order/edit',
+    method: 'post',
+    data: params
+  })
+}
+
+// 提交审核
+export function submitEngin(params) {
+  return request({
+    url: '/engin-info-order/submit',
+    method: 'post',
+    data: params
+  })
+}
+
+// 申请
+export function applyEngin(params) {
+  return request({
+    url: '/engin-info-order/submit-on-list',
+    method: 'post',
+    params
+  })
+}
+
+// 撤回
+export function withdrawEngin(params) {
+  return request({
+    url: '/engin-info-order/revoke',
+    method: 'post',
+    params
+  })
+}
+
+// 删除
+export function deleteEngin(params) {
+  return request({
+    url: '/engin-info-order/del',
+    method: 'post',
+    params
+  })
 }

+ 2 - 1
src/store/getters.js

@@ -8,6 +8,7 @@ const getters = {
   phone: state => state.user.phone,
   name: state => state.user.name,
   menus: state => state.user.menus,
-  customerId: state => state.user.customerId
+  customerId: state => state.user.customerId,
+  customerName: state => state.user.customerName
 }
 export default getters

+ 7 - 2
src/store/modules/user.js

@@ -9,7 +9,8 @@ const getDefaultState = () => {
     name: '', // 用户名称
     phone: '', // 用户手机
     menus: "", // 菜单
-    customerId:''//经销商ID
+    customerId:'',//经销商ID
+    customerName:''//经销商名称
   }
 }
 
@@ -36,6 +37,9 @@ const mutations = {
   },
   SET_CUSTOMERID: (state, customerId) => {
     state.customerId = customerId
+  },
+  SET_CUSTOMERNAME: (state, customerName) => {
+    state.customerName = customerName
   }
 }
 
@@ -69,7 +73,7 @@ const actions = {
           return reject('Verification failed, please Login again.')
         }
         console.log(data);
-        const { nickName, userName ,customerId} = data
+        const { nickName, userName ,customerId,customerName} = data
         
         // 模拟请求数据
         // const menus = [
@@ -97,6 +101,7 @@ const actions = {
         // ]
         // menus.push({ path: '*', redirect: '/404', hidden: true })
         commit('SET_CUSTOMERID',customerId)
+        commit('SET_CUSTOMERNAME',customerName)
         commit('SET_NAME', nickName)
         commit('SET_PHONE', userName)
         // commit("SET_MENUS", menus) // 触发vuex SET_MENUS 保存路由表到vuex

+ 42 - 0
src/styles/index.scss

@@ -269,6 +269,48 @@ div:focus {
   .item {
     display: flex;
     border-bottom: 1px solid #EBEEF5;
+    &.file {
+      .label {
+        height: 100px;
+      }
+      .value {
+        height: 100px;
+      }
+      .file-list {
+        display: flex;
+        .file-item {
+          // margin-top: 10px;
+          margin-right: 10px;
+        }
+      }
+      .img {
+        width: 70px;
+        height: 70px;
+        display: block;
+        border: 1px solid #e4e7ed;
+      }
+      .box2 {
+        flex: 1;
+        display: flex;
+        padding: 10px;
+        align-items: center;
+        border: 1px solid #e4e7ed;
+        width: 240px;
+        height: 70px;
+        cursor: pointer;
+        img {
+          width: 40px;
+          height: 40px;
+          display: block;
+        }
+        .name {
+          flex: 1;
+          color: #222;
+          font-weight: 600;
+          margin-left: 10px;
+        }
+      }
+    }
     .label {
       width: 120px;
       height: 40px;

+ 28 - 28
src/views/basic_data/dealer/components/dealer_list-detail.vue

@@ -22,7 +22,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="客户编码" prop="takerName">
+              <el-form-item label="客户编码" prop="">
                 <el-input
                   v-model="infoList.number"
                   placeholder="请输入"
@@ -30,7 +30,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="使用组织" prop="telephone">
+              <el-form-item label="使用组织" prop="">
                 <el-input
                   v-model="infoList.useOrgName"
                   placeholder="请输入"
@@ -38,7 +38,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="简称" prop="telephone">
+              <el-form-item label="简称" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
@@ -62,7 +62,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="地区" prop="takerName">
+              <el-form-item label="地区" prop="">
                 <el-input
                   v-model="infoList.region"
                   placeholder="请输入"
@@ -70,7 +70,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="省份" prop="telephone">
+              <el-form-item label="省份" prop="">
                 <el-input
                   v-model="infoList.province"
                   placeholder="请输入"
@@ -78,7 +78,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="城市" prop="telephone">
+              <el-form-item label="城市" prop="">
                 <el-input
                   v-model="infoList.city"
                   placeholder="请输入"
@@ -86,27 +86,27 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="通信地址" prop="telephone">
+              <el-form-item label="通信地址" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="邮政编码" prop="telephone">
+              <el-form-item label="邮政编码" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="公司网址" prop="telephone">
+              <el-form-item label="公司网址" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="商城订单对应组织" prop="telephone">
+              <el-form-item label="商城订单对应组织" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="联系邮箱" prop="telephone">
+              <el-form-item label="联系邮箱" prop="">
                 <el-input
                   v-model="infoList.email"
                   placeholder="请输入"
@@ -130,22 +130,22 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="传真" prop="takerName">
+              <el-form-item label="传真" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="公司类别" prop="telephone">
+              <el-form-item label="公司类别" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="公司性质" prop="telephone">
+              <el-form-item label="公司性质" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="公司规模" prop="telephone">
+              <el-form-item label="公司规模" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
@@ -163,42 +163,42 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="对应集团客户" prop="takerName">
+              <el-form-item label="对应集团客户" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="客户类别" prop="telephone">
+              <el-form-item label="客户类别" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="客户分组" prop="telephone">
+              <el-form-item label="客户分组" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="集团客户" prop="telephone">
+              <el-form-item label="集团客户" prop="">
                 <el-checkbox></el-checkbox>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="默认付款方" prop="telephone">
+              <el-form-item label="默认付款方" prop="">
                 <el-checkbox></el-checkbox>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="不校验可发量" prop="telephone">
+              <el-form-item label="不校验可发量" prop="">
                 <el-checkbox></el-checkbox>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="对应组织" prop="telephone">
+              <el-form-item label="对应组织" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="备注" prop="telephone">
+              <el-form-item label="备注" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
@@ -216,12 +216,12 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="纳税登记号" prop="takerName">
+              <el-form-item label="纳税登记号" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="开户银行" prop="telephone">
+              <el-form-item label="开户银行" prop="">
                 <el-input
                   v-model="infoList.bank"
                   placeholder="请输入"
@@ -229,7 +229,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="银行账号" prop="telephone">
+              <el-form-item label="银行账号" prop="">
                 <el-input
                   v-model="infoList.bankAccount"
                   placeholder="请输入"
@@ -237,7 +237,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="开票联系电话" prop="telephone">
+              <el-form-item label="开票联系电话" prop="">
                 <el-input
                   v-model="infoList.invoicePhone"
                   placeholder="请输入"
@@ -245,7 +245,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="开票通讯地址" prop="telephone">
+              <el-form-item label="开票通讯地址" prop="">
                 <el-input
                   v-model="infoList.invoiceAddress"
                   placeholder="请输入"

+ 47 - 3
src/views/basic_data/dealer/dealer_deposit.vue

@@ -87,6 +87,27 @@
           />
           <el-table-column
             align="center"
+            label="押金"
+            prop="amount"
+            min-width="160"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            align="center"
+            label="开始时间"
+            prop="startTime"
+            min-width="160"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            align="center"
+            label="结束时间"
+            prop="endTime"
+            min-width="160"
+            show-overflow-tooltip
+          />
+          <el-table-column
+            align="center"
             label="备注"
             prop="remark"
             min-width="160"
@@ -180,6 +201,7 @@
             class="inputStyle"
             v-model="dialogForm.customerId"
             placeholder="请选择"
+            filterable
           >
             <el-option
               v-for="item in dealerList"
@@ -201,6 +223,15 @@
             <i class="el-input__icon" slot="suffix">% </i>
           </el-input>
         </el-form-item>
+        <el-form-item label="" prop="">
+          <el-slider
+            class="inputStyle"
+            v-model="dialogForm.rate"
+            :marks="marks"
+          >
+          </el-slider>
+        </el-form-item>
+
         <el-form-item label="押金定额金额" prop="amount">
           <el-input
             placeholder="请输入押金定额"
@@ -262,6 +293,19 @@ import { number } from "echarts";
 export default {
   data() {
     return {
+      marks: {
+        0: "0%",
+        20: "20%",
+        40: "40%",
+        60: "60%",
+        80: "80%",
+        100: {
+          style: {
+            width: "36px",
+          },
+          label: this.$createElement("div", "100%"),
+        },
+      },
       title: "",
       currentPage: 1, // 当前页码
       pageSize: 10, // 每页数量
@@ -336,7 +380,7 @@ export default {
   },
   async created() {
     await this.getList({ pageNum: 1, pageSize: 10 });
-    await this.getDealerDataList({ pageNum: 1, pageSize: 10 });
+    await this.getDealerDataList({ pageNum: 1, pageSize: -1 });
   },
 
   methods: {
@@ -370,7 +414,7 @@ export default {
     //编辑
     async editFn(id) {
       console.log(id);
-      this.title = "编辑经销商工程机配置";
+      this.title = "经销商工程机押金比例设置";
       const res = await infoDealerDeposit({ id });
       this.dialogForm = res.data;
       this.dialogForm.rate = parseInt(res.data.rate * 100);
@@ -467,7 +511,7 @@ export default {
       this.showDialog = false;
     },
     addFn() {
-      this.title = "新增经销商工程机配置";
+      this.title = "经销商工程机押金比例设置";
       this.showDialog = true;
     },
   },

+ 50 - 14
src/views/basic_data/material/classify_list.vue

@@ -34,9 +34,9 @@
                 <el-dropdown-item :command="['edit', v]"
                   >修改名称</el-dropdown-item
                 >
-                <el-dropdown-item :command="['del', v]"
+                <!-- <el-dropdown-item :command="['del', v]"
                   >删除分组</el-dropdown-item
-                >
+                > -->
               </el-dropdown-menu>
             </el-dropdown>
           </div>
@@ -46,27 +46,36 @@
         <!-- 筛选条件 -->
         <div>
           <el-form
-            ref="screenForm"
+            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="volume">
-                  <el-input placeholder="请输入"></el-input>
+                <el-form-item label="编码" prop="productCategoryNumber">
+                  <el-input
+                    v-model="searchForm.productCategoryNumber"
+                    placeholder="请输入"
+                  ></el-input>
                 </el-form-item>
               </el-col>
               <el-col :xs="24" :sm="12" :lg="6">
-                <el-form-item label="名称" prop="outsideName">
-                  <el-input placeholder="请输入"></el-input>
+                <el-form-item label="名称" prop="productCategoryName">
+                  <el-input
+                    v-model="searchForm.productCategoryName"
+                    placeholder="请输入"
+                  ></el-input>
                 </el-form-item>
               </el-col>
 
               <el-col :xs="24" :sm="24" :lg="12" class="tr">
                 <el-form-item label="">
-                  <el-button size="small">清空</el-button>
-                  <el-button size="small" type="primary">搜索</el-button>
+                  <el-button size="small" @click="clearFn">清空</el-button>
+                  <el-button size="small" type="primary" @click="searchFn"
+                    >搜索</el-button
+                  >
                 </el-form-item>
               </el-col>
             </el-row>
@@ -132,7 +141,7 @@
               </el-table-column>
             </el-table>
           </div>
-          <!-- 分页 -->
+          <!-- 分页
           <div class="fr">
             <el-pagination
               :current-page="currentPage"
@@ -142,7 +151,7 @@
               :total="listTotal"
             >
             </el-pagination>
-          </div>
+          </div> -->
         </div>
       </div>
     </div>
@@ -186,6 +195,7 @@
       :showAddSelect.sync="showAddSelect"
       :data="dataList"
       @updateList="updateListFn"
+      ref="updateDate"
     />
   </div>
 </template>
@@ -197,17 +207,22 @@ import {
   getProductCategorySubList,
   getProductCategoryAdd,
   getProductCategoryEdit,
+  getProductCategoryDelSub,
 } from "@/api/basic_data/material";
 export default {
   data() {
     return {
+      searchForm: {
+        productCategoryNumber: "",
+        productCategoryName: "",
+      },
       addGroupFormVisible: false,
       activeGroup: "",
       dataList: null, // 列表数据
       listLoading: false, // 列表加载loading
-      currentPage: 1, // 当前页码
-      pageSize: 10, // 每页数量
-      listTotal: 0, // 列表总数
+      // currentPage: 1, // 当前页码
+      // pageSize: 10, // 每页数量
+      // listTotal: 0, // 列表总数
       categoryList: [], //品类列表
       addGroupForm: {
         productCategoryName: "",
@@ -225,6 +240,26 @@ export default {
     this.getDataList();
   },
   methods: {
+    //清空
+    clearFn() {
+      this.$refs.searchForm.resetFields();
+    },
+    //搜索
+    searchFn() {
+      this.getDataList({ ...this.searchForm });
+    },
+    //删除
+    async hanleDelete(id) {
+      console.log(this.dataCategory);
+      let arr = [id];
+      let res = arr.toString();
+      await getProductCategoryDelSub({ ids: res });
+      const res2 = await getProductCategorySubList({
+        id: this.dataCategory.productCategoryId,
+      });
+      this.dataList = res2.data;
+      this.$message.success("删除成功");
+    },
     //更新列表
     async updateListFn(id) {
       const res = await getProductCategorySubList({ id });
@@ -232,6 +267,7 @@ export default {
     },
     //添加类别
     async addCategoryFn() {
+      await this.$refs.updateDate.getDataList();
       this.showAddSelect = true;
     },
     //取消

+ 1 - 1
src/views/basic_data/material/components/classify_list-small.vue

@@ -73,7 +73,7 @@ export default {
     };
   },
   created() {
-    this.getDataList();
+    // this.getDataList();
   },
   methods: {
     //获取选择的数据

+ 46 - 51
src/views/basic_data/supplier/components/supplier_list-detail.vue

@@ -164,7 +164,10 @@
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="注册资金" prop="telephone">
-                <el-input placeholder="请输入"></el-input>
+                <el-input
+                  v-model="infoList.registerFund"
+                  placeholder="请输入"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -216,12 +219,15 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="负责人" prop="takerName">
-                <el-input placeholder="请输入"></el-input>
+              <el-form-item label="负责人" prop="">
+                <el-input
+                  v-model="infoList.staffName"
+                  placeholder="请输入"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="供应商分类" prop="telephone">
+              <el-form-item label="供应商分类" prop="">
                 <el-input
                   v-model="infoList.supplierClassify"
                   placeholder="请输入"
@@ -229,17 +235,15 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="供应类别" prop="telephone">
-                <el-select
+              <el-form-item label="供应类别" prop="">
+                <el-input
                   v-model="infoList.supplyClassify"
-                  placeholder="请选择"
-                >
-                  <el-option> </el-option>
-                </el-select>
+                  placeholder="请输入"
+                ></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="供应商等级" prop="telephone">
+              <el-form-item label="供应商等级" prop="">
                 <el-input
                   v-model="infoList.supplierGrade"
                   placeholder="请输入"
@@ -247,7 +251,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="供应商分组" prop="telephone">
+              <el-form-item label="供应商分组" prop="">
                 <el-input
                   v-model="infoList.groupName"
                   placeholder="请输入"
@@ -255,7 +259,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="公司类别" prop="telephone">
+              <el-form-item label="公司类别" prop="">
                 <el-input
                   v-model="infoList.companyClassify"
                   placeholder="请输入"
@@ -263,7 +267,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="公司性质" prop="telephone">
+              <el-form-item label="公司性质" prop="">
                 <el-input
                   v-model="infoList.companyNature"
                   placeholder="请输入"
@@ -271,7 +275,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="公司规模" prop="telephone">
+              <el-form-item label="公司规模" prop="">
                 <el-input
                   v-model="infoList.companyScale"
                   placeholder="请输入"
@@ -279,7 +283,7 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="对应组织" prop="telephone">
+              <el-form-item label="对应组织" prop="">
                 <el-input
                   v-model="infoList.correspondOrgName"
                   placeholder="请输入"
@@ -304,49 +308,42 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="默认价目表" prop="takerName">
-                <el-input
-                  v-model="infoList.number"
-                  placeholder="请输入"
-                ></el-input>
+              <el-form-item label="默认价目表" prop="">
+                <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="业务状态" prop="telephone">
-                <el-select v-model="infoList.useOrgName" placeholder="请选择">
-                  <el-option> </el-option>
-                </el-select>
+              <el-form-item label="业务状态" prop="">
+                <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="默认折扣表" prop="telephone">
+              <el-form-item label="默认折扣表" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="冻结范围" prop="telephone">
-                <el-select placeholder="请选择">
-                  <el-option> </el-option>
-                </el-select>
+              <el-form-item label="冻结范围" prop="">
+                <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="供货方" prop="telephone">
+              <el-form-item label="供货方" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="冻结人" prop="telephone">
+              <el-form-item label="冻结人" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="VMI仓库" prop="telephone">
+              <el-form-item label="VMI仓库" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="冻结日期" prop="telephone">
+              <el-form-item label="冻结日期" prop="">
                 <el-date-picker
                   type="datetime"
                   placeholder="选择日期时间"
@@ -357,27 +354,27 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="VMI业务" prop="telephone">
+              <el-form-item label="VMI业务" prop="">
                 <el-checkbox></el-checkbox>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="启用供应商协同" prop="telephone">
+              <el-form-item label="启用供应商协同" prop="">
                 <el-checkbox></el-checkbox>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="汇总公司" prop="telephone">
+              <el-form-item label="汇总公司" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="保证金比例" prop="telephone">
+              <el-form-item label="保证金比例" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="默认联系人" prop="telephone">
+              <el-form-item label="默认联系人" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
@@ -399,49 +396,47 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="单次预付额度" prop="takerName">
+              <el-form-item label="单次预付额度" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="发票类型" prop="telephone">
-                <el-select placeholder="请选择">
-                  <el-option> </el-option>
-                </el-select>
+              <el-form-item label="发票类型" prop="">
+                <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="税分类" prop="telephone">
+              <el-form-item label="税分类" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="默认税率" prop="telephone">
+              <el-form-item label="默认税率" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="结算方式" prop="telephone">
+              <el-form-item label="结算方式" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="描述" prop="telephone">
+              <el-form-item label="描述" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="付款条件" prop="telephone">
+              <el-form-item label="付款条件" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="经营类型" prop="telephone">
+              <el-form-item label="经营类型" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="收款方" prop="telephone">
+              <el-form-item label="收款方" prop="">
                 <el-input placeholder="请输入"></el-input>
               </el-form-item>
             </el-col>

+ 54 - 33
src/views/basic_data/taker/taker_list.vue

@@ -210,7 +210,7 @@
         label-width="120px"
       >
         <el-form-item label="经销商名称" prop="customerId">
-          <el-select v-model="addForm.customerId" placeholder="名称">
+          <!-- <el-select v-model="addForm.customerId" placeholder="名称">
             <el-option
               v-for="item in dealerList"
               :key="item.id"
@@ -218,7 +218,8 @@
               :value="item.id"
             >
             </el-option>
-          </el-select>
+          </el-select> -->
+          <el-input disabled v-model="addForm.customerName"></el-input>
         </el-form-item>
         <el-row>
           <el-col :span="12">
@@ -236,9 +237,22 @@
               <el-input v-model="addForm.phone"></el-input> </el-form-item
           ></el-col>
           <el-col :span="12">
-            <el-form-item label="备用电话" prop="sparePhone">
-              <el-input v-model="addForm.sparePhone"></el-input> </el-form-item
-          ></el-col>
+            <el-form-item label="验证码" prop="code">
+              <el-row :gutter="6">
+                <el-col :span="14">
+                  <el-input v-model="addForm.code" />
+                </el-col>
+                <el-col :span="9">
+                  <el-button v-show="show" type="info" @click="getCodeFn"
+                    >获取验证码</el-button
+                  >
+                  <el-button v-show="!show" type="info"
+                    >{{ count }}s后重新获取</el-button
+                  >
+                </el-col>
+              </el-row>
+            </el-form-item></el-col
+          >
         </el-row>
         <el-row>
           <el-col :span="12">
@@ -253,19 +267,9 @@
               </el-date-picker> </el-form-item
           ></el-col>
           <el-col :span="12">
-            <el-form-item label="验证码" prop="code">
-              <el-row :gutter="6">
-                <el-col :span="14">
-                  <el-input v-model="addForm.code" />
-                </el-col>
-                <el-col :span="9">
-                  <el-button type="info" @click="getCodeFn"
-                    >获取验证码</el-button
-                  >
-                </el-col>
-              </el-row>
-            </el-form-item></el-col
-          >
+            <el-form-item label="备用电话" prop="sparePhone">
+              <el-input v-model="addForm.sparePhone"></el-input> </el-form-item
+          ></el-col>
         </el-row>
         <el-form-item label="上传提货人附件" prop="fileUrl">
           <fileUpload :fileList="fileList" />
@@ -282,6 +286,7 @@
 </template>
 
 <script>
+import { mapGetters } from "vuex";
 import {
   getList,
   addDataList,
@@ -296,6 +301,9 @@ export default {
   components: {
     fileUpload,
   },
+  computed: {
+    ...mapGetters(["customerId", "customerName"]),
+  },
   data() {
     return {
       baseURL: process.env.VUE_APP_BASE_API,
@@ -305,7 +313,7 @@ export default {
       pageSize: 10, // 每页数量
       listTotal: 0, // 列表总数
       addForm: {
-        customerId: "",
+        customerName: "",
         takerName: "",
         identity: "",
         phone: "",
@@ -314,10 +322,13 @@ export default {
         expireTime: "",
         code: "",
       },
+      show: true, //验证码
+      count: "",
+      timer: null,
 
       rules: {
         customerId: [
-          { required: true, message: "请选择经销商", trigger: "blur" },
+          { required: false, message: "请选择经销商", trigger: "blur" },
         ],
         takerName: [
           { required: true, message: "请输入提货人姓名", trigger: "blur" },
@@ -352,7 +363,7 @@ export default {
         ],
         sparePhone: [
           {
-            required: true,
+            required: false,
             pattern:
               /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/,
             message: "请输入备用电话",
@@ -379,7 +390,8 @@ export default {
   },
   async created() {
     await this.getDataList({ pageNum: 1, pageSize: 10 });
-    await this.getDealerDataList({ pageNum: 1, pageSize: 10 });
+
+    // await this.getDealerDataList({ pageNum: 1, pageSize: 10 });
   },
   methods: {
     //重建
@@ -387,7 +399,7 @@ export default {
       this.showOK = true;
       this.id = data.id;
       this.addForm = {
-        customerId: data.customerId,
+        customerName: data.customerName,
         takerName: data.takerName,
         identity: data.identity,
         phone: data.phone,
@@ -417,7 +429,6 @@ export default {
     cancelFn() {
       if (this.addForm.id) {
         this.addForm = {
-          customerId: "",
           takerName: "",
           identity: "",
           phone: "",
@@ -453,7 +464,18 @@ export default {
     //获取验证码
     async getCodeFn() {
       const res = await getCodeApi({ mobile: this.addForm.phone });
-      console.log(res);
+      const TIME_COUNT = 60; //倒计时的初始值
+      this.count = TIME_COUNT;
+      this.show = false;
+      this.timer = setInterval(() => {
+        if (this.count > 0 && this.count <= TIME_COUNT) {
+          this.count--;
+        } else {
+          this.show = true;
+          clearInterval(this.timer);
+          this.timer = null;
+        }
+      }, 1000);
     },
     //获取经销商数据
     async getDealerDataList(data) {
@@ -495,24 +517,23 @@ export default {
 
       await this.$refs.addForm.validate();
 
-      const res = this.dealerList.filter(
-        (v) => v.id === this.addForm.customerId
-      )[0];
-      console.log(res);
+      // const res = this.dealerList.filter(
+      //   (v) => v.id === this.addForm.customerId
+      // )[0];
+      // console.log(res);
 
       if (this.fileList.length == 1) {
         await addDataList({
           ...this.addForm,
-          orgNumber: res.useOrgNumber,
 
+          customerId: this.customerId,
           fileName: this.fileList[0].name,
           fileUrl: this.fileList[0].url,
         });
       } else {
         await addDataList({
           ...this.addForm,
-          orgNumber: res.useOrgNumber,
-
+          customerId: this.customerId,
           fileName: "",
           fileUrl: "",
         });
@@ -539,7 +560,7 @@ export default {
     },
     addFn() {
       this.addForm = {
-        customerId: "",
+        customerName: this.customerName,
         takerName: "",
         identity: "",
         phone: "",

+ 15 - 14
src/views/supply/apply/apply_list.vue

@@ -92,21 +92,21 @@
             <el-table-column align="center" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="审核人" prop="approvalName" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="审核日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="审核状态" prop="status" min-width="100" show-overflow-tooltip>
+            <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{scope.row.status | statusFilter}}
+                {{scope.row.examineStatus | statusFilter}}
               </template>
             </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, 2)" v-if="scope.row.status === 1" >
+                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.id, 'WAIT')" v-if="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, 1)" v-if="scope.row.status === 2" >
+                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleSubmit(scope.row.id, 'SAVE')" v-if="scope.row.examineStatus === 'WAIT'" >
                   <el-button slot="reference" type="text">撤回</el-button>
                 </el-popconfirm>
-                <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.status === 1">编辑</el-button>
-                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.status === 2">审单</el-button>
+                <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审单</el-button>
                 <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
                 <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" >
                   <el-button slot="reference" type="text">删除</el-button>
@@ -175,10 +175,11 @@ export default {
         status: '',
       },
       statusList: [
-        { label: '已保存', value: 1 },
-        { label: '待审核', value: 2 },
-        { label: '审核通过', value: 3 },
-        { label: '审核驳回', value: 4 },
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
       ],
 
       queryItem: {},
@@ -199,7 +200,7 @@ export default {
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: this.screenForm.status,
+        examineStatus: this.screenForm.status,
       }
     },
   },
@@ -237,7 +238,7 @@ export default {
         specification: this.screenForm.model,
         startTime: this.screenForm.date ? this.screenForm.date[0] : '',
         endTime: this.screenForm.date ? this.screenForm.date[1] : '',
-        status: this.screenForm.status,
+        examineStatus: this.screenForm.status,
       };
       getApplyList(params).then((res) => {
         this.dataList = res.data.records;
@@ -305,8 +306,8 @@ export default {
     },
 
     // 申请/撤回
-    handleSubmit(id, status) {
-      submitApply({id, status}).then(res => {
+    handleSubmit(id, examineStatus) {
+      submitApply({id, examineStatus}).then(res => {
         this.$successMsg();
         this.getList();
       })

+ 142 - 105
src/views/supply/apply/components/apply_detail.vue

@@ -2,56 +2,118 @@
   <div class="detail-container">
     <el-page-header @back="goBack" content="详情"></el-page-header>
 
-    <div id="printData">
+    <div class="main-title">
+      <div class="title">发货申请单信息</div>
+    </div>
+
+    <div class="diy-table-1">
+      <el-row>
+        <el-col :span="8" class="item">
+          <div class="label">发货申请单号</div>
+          <div class="value">{{detailData.id}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">申请日期</div>
+          <div class="value">{{detailData.createTime}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据状态</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商编号</div>
+          <div class="value">{{detailData.customerNumber}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商名称</div>
+          <div class="value">{{detailData.customerName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">仓库</div>
+          <div class="value">{{detailData.correspondName}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">备注</div>
+          <div class="value">{{detailData.remark}}</div>
+        </el-col>
+        <el-col :span="24" class="item file">
+          <div class="label">附件</div>
+          <div class="value">
+            <div class="file-list">
+              <div class="file-item">
+                <el-image v-if="checkFileType(detailData.fileUrl) == 'image'" class="img" :src="imageURL + detailData.fileUrl" :preview-src-list="[imageURL + detailData.fileUrl]"></el-image>
+                <div v-else class="box2" @click="openLink(detailData.fileUrl)">
+                  <img src="@/assets/common/word.png" v-if="checkFileType(detailData.fileUrl) == 'word'" />
+                  <img src="@/assets/common/excel.png" v-if="checkFileType(detailData.fileUrl) == 'excel'" />
+                  <img src="@/assets/common/ppt.png" v-if="checkFileType(detailData.fileUrl) == 'ppt'" />
+                  <img src="@/assets/common/pdf.png" v-if="checkFileType(detailData.fileUrl) == 'pdf'" />
+                  <div class="name ellipsis-3">{{ detailData.fileName }}</div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">制单人</div>
+          <div class="value">{{detailData.createBy}}</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.approvalName}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">审核日期</div>
+          <div class="value">{{detailData.approvalTime}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">审批说明</div>
+          <div class="value">{{detailData.approvalRemark}}</div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="main-title">
+      <div class="title">货品信息</div>
+    </div>
+
+    <div class="table" style="margin-top: 20px">
+      <el-table :data="detailData.orders" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></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="materialCode" min-width="120" 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="invoiceNum" 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="remark" min-width="160" show-overflow-tooltip></el-table-column>
+      </el-table>
+    </div>
+
+    <div v-if="isExamine">
       <div class="main-title">
-        <div class="title">发货申请单信息</div>
+        <div class="title">审批记录</div>
       </div>
-
       <div class="diy-table-1">
-        <el-row>
-          <el-col :span="8" class="item">
-            <div class="label">发货申请单号</div>
-            <div class="value">{{detailData.id}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">申请日期</div>
-            <div class="value">{{detailData.createTime}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">单据状态</div>
-            <div class="value">{{detailData.status | statusFilter}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">经销商编号</div>
-            <div class="value">{{detailData.customerNumber}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">经销商名称</div>
-            <div class="value">{{detailData.customerName}}</div>
-          </el-col>
-          <el-col :span="8" class="item">
-            <div class="label">仓库</div>
-            <div class="value">{{detailData.correspondName}}</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.createBy}}</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>
+        <el-row :gutter="0">
+          <el-col :span="12" class="item">
+            <div class="label">审批人</div>
             <div class="value">{{detailData.approvalName}}</div>
           </el-col>
-          <el-col :span="6" class="item">
-            <div class="label">审核日期</div>
-            <div class="value">{{detailData.approvalTime}}</div>
+          <el-col :span="12" class="item">
+            <div class="label">审批结果</div>
+            <div class="value">{{detailData.examineStatus | statusFilter}}</div>
           </el-col>
           <el-col :span="24" class="item">
             <div class="label">审批说明</div>
@@ -59,54 +121,6 @@
           </el-col>
         </el-row>
       </div>
-
-      <div class="main-title">
-        <div class="title">货品信息</div>
-      </div>
-
-      <div class="table" style="margin-top: 20px">
-        <el-table :data="detailData.orders" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
-          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
-          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
-            </template>
-          </el-table-column>
-          <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></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="materialCode" min-width="120" 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="invoiceNum" 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="remark" min-width="160" show-overflow-tooltip></el-table-column>
-        </el-table>
-      </div>
-
-      <div v-if="isExamine">
-        <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">{{detailData.approvalName}}</div>
-            </el-col>
-            <el-col :span="12" class="item">
-              <div class="label">审批结果</div>
-              <div class="value">{{detailData.status | statusFilter}}</div>
-            </el-col>
-            <el-col :span="24" class="item">
-              <div class="label">审批说明</div>
-              <div class="value">{{detailData.approvalRemark}}</div>
-            </el-col>
-          </el-row>
-        </div>
-      </div>
-      
     </div>
     
     <div class="page-footer">
@@ -185,23 +199,21 @@
 </template>
 
 <script>
-import print from 'vue-print-nb'
 import { getApplyDetail } from "@/api/supply/apply";
+import { getFileUrl } from '@/api/common';
 
 export default {
   name: 'ApplyDetail',
   componentName: 'ApplyDetail',
   props: ['listItem'],
-  directives: {
-    print
-  },
   filters: {
     statusFilter(val) {
       const statusList = [
-        { label: '已保存', value: 1 },
-        { label: '待审核', value: 2 },
-        { label: '审核通过', value: 3 },
-        { label: '审核驳回', value: 4 },
+        { 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 : ''
@@ -209,9 +221,7 @@ export default {
   },
   data() {
     return {
-      printObj: {
-        id: 'printData'
-      },
+      imageURL: this.$imageUrl,
       detailData: {},
 
       isShowDeliverDialog: false,
@@ -234,7 +244,7 @@ export default {
       }
     },
     isExamine() {
-      return this.detailData.status === 3 || this.detailData.status === 4
+      return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === "FAIL"
     },
   },
 
@@ -255,6 +265,33 @@ export default {
       })
     },
 
+    // 检查文件类型
+    checkFileType(url) {
+      if(!url) return '';
+			const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
+
+			if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
+				return 'image';
+			}else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
+				return 'word';
+			}else if(['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
+				return 'excel';
+			}else if(['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
+				return 'ppt';
+			}else if(['pdf'].includes(fileSuffix)) {
+				return 'pdf';
+			}else {
+        return '';
+      }
+		},
+
+    // 打开链接
+    openLink(url) {
+      getFileUrl({key: url}).then(res => {
+        window.open(res.data);
+      })
+    },
+
     // 打开 直调发货
     openDeliverDialog() {
       this.isShowDeliverDialog = true;

+ 7 - 6
src/views/supply/apply/components/apply_examine.vue

@@ -18,7 +18,7 @@
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据状态</div>
-          <div class="value">{{detailData.status | statusFilter}}</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">经销商编号</div>
@@ -137,10 +137,11 @@ export default {
   filters: {
     statusFilter(val) {
       const statusList = [
-        { label: '已保存', value: 1 },
-        { label: '待审核', value: 2 },
-        { label: '审核通过', value: 3 },
-        { label: '审核驳回', value: 4 },
+        { 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 : ''
@@ -248,7 +249,7 @@ export default {
       this.formLoading = true;
       examineApply({
         id: this.listItem.id,
-        status: this.examineForm.status ? 3 : 4,
+        examineStatus: this.examineForm.status ? 'OK' : 'FAIL',
         approvalRemark: this.examineForm.remark,
         orders: this.goodsList
       }).then(res => {

+ 29 - 39
src/views/supply/apply/components/apply_form.vue

@@ -8,9 +8,9 @@
 
     <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="90px" size="small" label-position="right">
       <el-row :gutter="20">
-        <el-col :xs="24" :sm="12" :lg="8" v-if="listItem">
+        <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="订单号" prop="id">
-            <el-input v-model="listItem.id" readonly></el-input>
+            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" readonly></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
@@ -24,23 +24,23 @@
             </el-date-picker>
           </el-form-item>
         </el-col>
-        <el-col :xs="24" :sm="12" :lg="8" v-if="listItem">
-          <el-form-item label="制单人" prop="serviceName">
-            <el-input v-model="listItem.serviceName" readonly></el-input>
-          </el-form-item>
-        </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="经销商" prop="dealer">
-            <el-select v-model="mainForm.dealer" placeholder="请选择经销商" style="width: 100%;">
-              <el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
-            </el-select>
+          <el-form-item label="制单人" prop="createMan">
+            <el-input v-model="mainForm.createMan" readonly></el-input>
           </el-form-item>
         </el-col>
-        <el-col :xs="24" :sm="24" :lg="24">
+        <el-col :xs="24" :sm="24" :lg="16">
           <el-form-item label="备注" prop="remark">
             <el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>
           </el-form-item>
         </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="经销商" prop="jxsNum">
+            <el-select v-model="mainForm.jxsNum" placeholder="请选择经销商" style="width: 100%;" disabled>
+              <el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
         <el-col :xs="24" :sm="8" :lg="8">
           <el-form-item label="附件" prop="fileUrl">
             <fileUpload :fileList="fileList" />
@@ -76,11 +76,7 @@
           </template>
         </el-table-column>
         <el-table-column align="center" label="已申请数量" prop="alreadyInvoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="未申请数量" min-width="100" show-overflow-tooltip>
-          <template slot-scope="scope">
-            {{scope.row.qty - scope.row.alreadyInvoiceNum}}
-          </template>
-        </el-table-column>
+        <el-table-column align="center" label="未申请数量" prop="refundableQty" min-width="100" show-overflow-tooltip> </el-table-column>
         <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
           <template slot-scope="scope">
             <el-input v-model="scope.row.remark" size="small"></el-input>
@@ -96,7 +92,8 @@
     
     <div class="page-footer">
       <div class="footer" :class="classObj">
-        <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
+        <el-button type="primary" @click="clickSubmitForm('SAVE')">保 存</el-button>
+        <el-button type="primary" @click="clickSubmitForm('WAIT')">提交审核</el-button>
         <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
           <el-button slot="reference">关 闭</el-button>
         </el-popconfirm>
@@ -149,21 +146,13 @@
             </template>
           </el-table-column>
           <el-table-column align="center" label="已申请数量" prop="alreadyInvoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
-          <el-table-column align="center" label="未申请数量" min-width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{scope.row.qty - scope.row.alreadyInvoiceNum}}
-            </template>
-          </el-table-column>
+          <el-table-column align="center" label="未申请数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
           <el-table-column align="center" label="总库存数量" prop="stockAdequate" min-width="100" show-overflow-tooltip>
             <template slot-scope="scope">
               {{scope.row.stockAdequate | stockFilter}}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="对应库存数量" prop="stockCorrespond" min-width="110" show-overflow-tooltip>
-            <template slot-scope="scope">
-              {{scope.row.stockCorrespond | stockFilter}}
-            </template>
-          </el-table-column>
+          <el-table-column align="center" label="对应库存数量" prop="stockCorrespond" min-width="110" show-overflow-tooltip></el-table-column>
         </el-table>
         <div class="pagination clearfix" style="margin-top: 10px">
           <div class="fr">
@@ -213,17 +202,16 @@ export default {
   data() {
     return {
       mainForm: {
+        orderNum: '',
         date: '',
-        dealer: '',
+        jxsNum: '',
         remark: '',
+        createMan: '',
       },
       mainFormRules: {
         date: [
           { required: true, message: '请选择单据日期', trigger: 'change' }
         ],
-        dealer: [
-          { required: true, message: '请选择经销商', trigger: 'change' }
-        ],
       },
       dealerList: [],
       fileList: [],
@@ -263,6 +251,9 @@ export default {
     this.getDealerList();
     if(this.listItem) {
       this.getDetail();
+    }else {
+      this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerId;
+      this.mainForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
     }
   },
 
@@ -277,7 +268,8 @@ export default {
       getApplyDetail({id: this.listItem.id}).then(res => {
         let data = res.data;
         this.mainForm.date = data.orderTime;
-        this.mainForm.dealer = data.customerNumber;
+        this.mainForm.jxsNum = data.customerNumber;
+        this.mainForm.createMan = data.createBy;
         this.mainForm.remark = data.remark;
         this.screenForm.warehouse = data.correspondId;
         this.fileList = data.fileUrl ? [{
@@ -342,6 +334,7 @@ export default {
             qty: item.qty,
             invoiceNum: item.invoiceNum,
             alreadyInvoiceNum: item.alreadyInvoiceNum,
+            refundableQty: item.refundableQty,
             stockAdequate: item.stockAdequate,
             stockCorrespond: item.stockCorrespond,
           })
@@ -467,7 +460,7 @@ export default {
     },
 
     // 保存
-    clickSubmitForm() {
+    clickSubmitForm(status) {
       this.$refs.mainForm.validate((valid) => {
         if (valid) {
           for(let i=0; i<this.goodsList.length; i++) {
@@ -483,12 +476,10 @@ export default {
             }
           }
 
-          let customerName = this.dealerList[findElem(this.dealerList, 'id', this.mainForm.dealer)].name;
           let correspondName = this.warehouseList[findElem(this.warehouseList, 'id', this.screenForm.warehouse)].name;
           let params = {
+            id: this.listItem ? this.listItem.id : '',
             orderTime: this.mainForm.date + ' 00:00:00',
-            customerNumber: this.mainForm.dealer,
-            customerName,
             remark: this.mainForm.remark,
             fileUrl: this.fileList && this.fileList.length > 0 ? this.fileList[0].url : '',
             fileName: this.fileList && this.fileList.length > 0 ? this.fileList[0].name : '',
@@ -496,10 +487,9 @@ export default {
             correspondId: this.screenForm.warehouse,
             correspondName,
             orders: this.goodsList,
-            status: 1, // 1保存 2待审核 3通过 4驳回
+            examineStatus: status,
           }
           if(this.listItem) {
-            params.id = this.listItem.id;
             editApply(params).then(res => {
               this.$successMsg('编辑成功');
               this.goBack();

+ 118 - 19
src/views/supply/engin/components/engin_examine.vue

@@ -66,7 +66,16 @@
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">合同有效期</div>
-          <div class="value">{{detailData.contractExpireDate}}</div>
+          <div class="value">
+            <el-date-picker
+              v-model="detailData.contractExpireDate"
+              type="date"
+              prefix-icon="none"
+              value-format="yyyy-MM-dd"
+              style="width: 100%;"
+              placeholder="选择日期">
+            </el-date-picker>
+          </div>
         </el-col>
         <el-col :span="16" class="item">
           <div class="label">备注</div>
@@ -84,11 +93,11 @@
     </div>
 
     <div class="table" style="margin-top: 20px">
-      <el-table :data="detailData.items" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+      <el-table :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="saleTypeId" min-width="160" show-overflow-tooltip>
           <template slot-scope="scope">
-            <el-select v-model="scope.row.saleTypeId" placeholder="选择销售类型" size="small" @change="changeWallet(scope.$index)">
+            <el-select v-model="scope.row.saleTypeId" placeholder="选择销售类型" size="small" @change="changeSaleType(scope.$index)">
               <el-option
                 v-for="item in salesTypeList"
                 :key="item.id"
@@ -98,17 +107,34 @@
             </el-select>
           </template>
         </el-table-column>
-        <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="160" show-overflow-tooltip>
-          
+        <el-table-column align="center" label="产品名称" prop="materialNumber" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.materialNumber" placeholder="选择产品" size="small" @change="changeGoods(scope.$index)">
+              <el-option
+                v-for="item in retailProductList"
+                :key="item.number"
+                :label="item.name"
+                :value="item.number">
+              </el-option>
+            </el-select>
+          </template>
         </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="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="200" show-overflow-tooltip></el-table-column>
         <el-table-column align="center" label="单位" prop="baseUnitId" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
-        <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.price" size="small" type="number"></el-input>
+          </template>
+        </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" type="number"></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}}
+            {{(scope.row.price || 0) * (scope.row.qty || 0)}}
           </template>
         </el-table-column>
         <el-table-column align="center" label="备注" prop="remark" min-width="200" show-overflow-tooltip>
@@ -117,7 +143,13 @@
           </template>
         </el-table-column>
         <el-table-column align="center" label="税率" prop="taxRate" min-width="100" show-overflow-tooltip></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>
+          </template>
+        </el-table-column>
       </el-table>
+      <div class="add"><el-button type="text" icon="el-icon-plus" @click="addGoods">添加产品</el-button></div>
     </div>
 
     <div class="main-title">
@@ -162,7 +194,7 @@
 </template>
 
 <script>
-import { getEnginDetail } from "@/api/supply/engin";
+import { getEnginDetail, getRetailProductList, examineEngin } from "@/api/supply/engin";
 import { getTypeList } from "@/api/common";
 
 export default {
@@ -185,6 +217,7 @@ export default {
   data() {
     return {
       detailData: {},
+      goodsList: [],
       userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
 
       formLoading: false,
@@ -194,6 +227,7 @@ export default {
       },
 
       salesTypeList: [],
+      retailProductList: [],
     }
   },
 
@@ -212,6 +246,7 @@ export default {
   created() {
     this.getDetail();
     this.getTypeList();
+    this.getRetailProductList();
   },
 
   methods: {
@@ -224,6 +259,7 @@ export default {
     getDetail() {
       getEnginDetail({id: this.listItem.enginInfoId}).then(res => {
         this.detailData = res.data;
+        this.goodsList = res.data.items;
       })
     },
 
@@ -237,18 +273,64 @@ export default {
       });
     },
 
-    // 修改返利钱包
-    changeWallet(index) {
-      if(this.goodsList[index].customerWalletId2) {
-        let obj = this.flWalletList.find(o => o.customerWalletId == this.goodsList[index].customerWalletId2);
-        this.goodsList[index].rebateRate = obj.rebateRate;
-      }else {
-        this.goodsList[index].rebateRate = '';
+    // 获取商品列表
+    getRetailProductList() {
+      getRetailProductList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then(res => {
+        this.retailProductList = res.data.records;
+      })
+    },
+
+    // 修改销售类型
+    changeSaleType(index) {
+      if(this.goodsList[index].saleTypeId) {
+        let obj = this.salesTypeList.find(o => o.id == this.goodsList[index].saleTypeId);
+        this.goodsList[index].saleTypeName = obj.saleName;
+        this.goodsList[index].saleTypeCode = obj.saleCode;
       }
     },
 
-    clickSubmitForm() {
+    // 修改产品
+    changeGoods(index) {
+      if(this.goodsList[index].materialNumber) {
+        let obj = this.retailProductList.find(o => o.number == this.goodsList[index].materialNumber);
+        this.goodsList[index].materialName = obj.name;
+        this.goodsList[index].materialId = obj.materialId;
+        this.goodsList[index].specification = obj.specification;
+        this.goodsList[index].baseUnitId = obj.baseUnit;
+        this.goodsList[index].price = obj.batchPrice;
+        this.goodsList[index].taxRate = obj.taxRate;
+        this.goodsList[index].mainId = obj.mainId;
+      }
+    },
+
+    // 添加产品
+    addGoods() {
+      this.goodsList.push({})
+    },
+
+    // 删除产品
+    deleteItem(index) {
+      this.goodsList.splice(index, 1);
+    },
 
+    clickSubmitForm() {
+      this.formLoading = true;
+      examineEngin({
+        enginInfoId: this.listItem.enginInfoId,
+        examineStatus: this.examineForm.status ? 'OK' : 'FAIL',
+        examineNote: this.examineForm.remark,
+        contractExpireDate: this.detailData.contractExpireDate,
+        items: this.goodsList,
+      }).then(res => {
+        this.$successMsg('审批成功');
+        this.goBack();
+        this.$parent.getList();
+      }).finally(res => {
+        this.formLoading = false;
+      })
     },
 
   }
@@ -274,4 +356,21 @@ export default {
       padding-left: 10px;
     }
   }
+
+  .add {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border: 1px solid #EBEEF5;
+    border-top: none;
+    height: 50px;
+  }
+
+  ::v-deep input::-webkit-outer-spin-button,
+  ::v-deep input::-webkit-inner-spin-button {
+    -webkit-appearance: none;
+  }
+  ::v-deep input[type='number'] {
+    -moz-appearance: textfield;
+  }
 </style>

+ 315 - 55
src/views/supply/engin/components/engin_form.vue

@@ -6,17 +6,17 @@
       <div class="title">工程信息单</div>
     </div>
 
-    <el-form ref="mainForm" :model="mainForm" label-width="100px" size="small" label-position="left">
+    <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="100px" size="small" label-position="left">
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="工程信息单" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入工程信息单"></el-input>
+          <el-form-item label="工程信息单" prop="orderNum">
+            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" readonly></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
-          <el-form-item label="单据日期" prop="date">
+          <el-form-item label="单据日期" prop="orderDate">
             <el-date-picker
-              v-model="mainForm.date"
+              v-model="mainForm.orderDate"
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
@@ -25,75 +25,78 @@
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="品类" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入品类"></el-input>
+          <el-form-item label="产品大类" prop="mainId">
+            <el-select v-model="mainForm.mainId" placeholder="选择产品大类" style="width: 100%">
+              <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
+            </el-select>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="经销商编码" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入经销商编码"></el-input>
+          <el-form-item label="经销商编码" prop="jxsNum">
+            <el-input v-model="mainForm.jxsNum" placeholder="请输入经销商编码" readonly></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="项目名称" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入项目名称"></el-input>
+          <el-form-item label="项目名称" prop="enginName">
+            <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="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入单据类型"></el-input>
+          <el-form-item label="单据类型" prop="orderType">
+            <el-input v-model="mainForm.orderType" placeholder="请输入单据类型"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="经销商名称" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入经销商名称"></el-input>
+          <el-form-item label="经销商名称" prop="jxsName">
+            <el-input v-model="mainForm.jxsName" placeholder="请输入经销商名称" readonly></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="使用单位" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入使用单位"></el-input>
+          <el-form-item label="使用单位" prop="company">
+            <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="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入安装地址"></el-input>
+          <el-form-item label="安装地址" prop="address">
+            <el-input v-model="mainForm.address" placeholder="请输入安装地址"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="工程编号" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入工程编号"></el-input>
+          <el-form-item label="工程编号" prop="enginNum">
+            <el-input v-model="mainForm.enginNum" placeholder="请输入工程编号"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="厂工程编码" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入厂工程编码"></el-input>
+          <el-form-item label="厂工程编码" prop="factoryNum">
+            <el-input v-model="mainForm.factoryNum" placeholder="请输入厂工程编码"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="工程登录类型" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入工程登录类型"></el-input>
+          <el-form-item label="工程登录类型" prop="loginType">
+            <el-input v-model="mainForm.loginType" placeholder="请输入工程登录类型"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="16">
-          <el-form-item label="备注" prop="warehouse">
+          <el-form-item label="备注" prop="remark">
             <el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="业务员" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入业务员"></el-input>
+          <el-form-item label="业务员" prop="salesMan">
+            <el-input v-model="mainForm.salesMan" placeholder="请输入业务员" readonly></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
-          <el-form-item label="制单人" prop="warehouse">
-            <el-input v-model="mainForm.remark" placeholder="请输入制单人"></el-input>
+          <el-form-item label="制单人" prop="createMan">
+            <el-input v-model="mainForm.createMan" placeholder="请输入制单人" readonly></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
-          <el-form-item label="制单日期" prop="date">
+          <el-form-item label="制单日期" prop="createDate">
             <el-date-picker
-              v-model="mainForm.date"
+              v-model="mainForm.createDate"
               type="date"
+              readonly
               value-format="yyyy-MM-dd"
               style="width: 100%;"
               placeholder="选择日期">
@@ -101,9 +104,9 @@
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
-          <el-form-item label="合同有效期" prop="date">
+          <el-form-item label="合同有效期" prop="contractDate">
             <el-date-picker
-              v-model="mainForm.date"
+              v-model="mainForm.contractDate"
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
@@ -116,29 +119,72 @@
 
     <div class="main-title">
       <div class="title">货品信息</div>
-      <el-button type="primary" size="small" icon="el-icon-plus">添加货品</el-button>
     </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="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="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="saleTypeId" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.saleTypeId" placeholder="选择销售类型" size="small" @change="changeSaleType(scope.$index)">
+              <el-option
+                v-for="item in salesTypeList"
+                :key="item.id"
+                :label="item.saleName"
+                :value="item.id">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialNumber" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.materialNumber" placeholder="选择产品" size="small" @change="changeGoods(scope.$index)">
+              <el-option
+                v-for="item in retailProductList"
+                :key="item.number"
+                :label="item.name"
+                :value="item.number">
+              </el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialNumber" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="200" 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>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.price" size="small" type="number"></el-input>
+          </template>
+        </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" type="number"></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 || 0) * (scope.row.qty || 0)}}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="200" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remark" size="small"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="税率" prop="taxRate" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="操作" width="100" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
+          </template>
+        </el-table-column>
       </el-table>
+      <div class="add"><el-button type="text" icon="el-icon-plus" @click="addGoods">添加产品</el-button></div>
     </div>
     
     <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>
@@ -149,7 +195,8 @@
 </template>
 
 <script>
-import { getDetail } from "@/api/supply/engin";
+import { getEnginDetail, getRetailProductList, addEngin, editEngin, submitEngin } from "@/api/supply/engin";
+import { getDictList, getTypeList } from '@/api/common'
 
 export default {
   name: 'EnginForm',
@@ -157,10 +204,38 @@ export default {
   props: ['listItem'],
   data() {
     return {
-      detailData: {},
+      goodsList: [],
       mainForm: {
-
+        orderNum: '',
+        orderDate: '',
+        mainId: '102',
+        jxsNum: '',
+        enginName: '',
+        orderType: '',
+        jxsName: '',
+        company: '',
+        address: '',
+        enginNum: '',
+        factoryNum: '',
+        loginType: '',
+        remark: '',
+        salesMan: '',
+        createMan: '',
+        createDate: '',
+        contractDate: '',
+      },
+      mainFormRules: {
+        orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
+        jxsNum: [{ required: true, message: '请输入经销商编码', trigger: 'blur' }],
+        enginName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
+        jxsName: [{ required: true, message: '请输入经销商名称', trigger: 'blur' }],
+        company: [{ required: true, message: '请输入使用单位', trigger: 'blur' }],
+        address: [{ required: true, message: '请输入安装地址', trigger: 'blur' }],
       },
+
+      typeList: [],
+      salesTypeList: [],
+      retailProductList: [],
     }
   },
 
@@ -174,10 +249,22 @@ export default {
         openSidebar: this.sidebar.opened
       }
     },
+    
   },
 
   created() {
-    this.getDetail();
+    this.getDictList();
+    this.getTypeList();
+    this.getRetailProductList();
+    if(this.listItem) {
+      this.getDetail();
+    }else {
+      this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerId;
+      this.mainForm.jxsName = JSON.parse(localStorage.getItem("supply_user")).customerName;
+      this.mainForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
+      this.mainForm.createDate = this.getDate(0);
+      this.mainForm.contractDate = this.getDate(1);
+    }
   },
 
   methods: {
@@ -186,15 +273,171 @@ export default {
       this.$emit('backListFormDetail');
     },
 
+    getDate(addYear) {
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear() + addYear;
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+          month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+          strDate = "0" + strDate;
+      }
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      return currentdate;
+    },
+
     // 获取详情
     getDetail() {
-      getDetail({id: this.listItem.id}).then(res => {
-        this.detailData = res.data;
+      getEnginDetail({id: this.listItem.enginInfoId}).then(res => {
+        let data = res.data;
+        this.mainForm.orderNum = data.enginInfoNo;
+        this.mainForm.orderDate = data.orderDate;
+        this.mainForm.mainId = data.productCategoryId;
+        this.mainForm.jxsNum = data.customerId;
+        this.mainForm.enginName = data.projectName;
+        this.mainForm.orderType = data.orderType;
+        this.mainForm.jxsName = data.customerName;
+        this.mainForm.company = data.useUnit;
+        this.mainForm.address = data.installAddress;
+        this.mainForm.enginNum = data.projectNo;
+        this.mainForm.factoryNum = data.enginFactoryNo;
+        this.mainForm.loginType = data.enginSignType;
+        this.mainForm.remark = data.remark;
+        this.mainForm.salesMan = data.serviceId;
+        this.mainForm.createMan = data.createName;
+        this.mainForm.createDate = data.createTime;
+        this.mainForm.contractDate = data.contractExpireDate;
+
+        this.goodsList = data.items;
+      })
+    },
+
+    // 获取产品大类列表
+    getDictList() {
+      getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
+        this.typeList = res.data;
+      })
+    },
+
+    // 获取销售类型列表
+    getTypeList() {
+      getTypeList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then((res) => {
+        this.salesTypeList = res.data.records;
+      });
+    },
+
+    // 获取商品列表
+    getRetailProductList() {
+      getRetailProductList({
+        pageNum: 1,
+        pageSize: -1,
+      }).then(res => {
+        this.retailProductList = res.data.records;
       })
     },
 
-    clickSubmitForm() {
+    // 修改销售类型
+    changeSaleType(index) {
+      if(this.goodsList[index].saleTypeId) {
+        let obj = this.salesTypeList.find(o => o.id == this.goodsList[index].saleTypeId);
+        this.goodsList[index].saleTypeName = obj.saleName;
+        this.goodsList[index].saleTypeCode = obj.saleCode;
+      }
+    },
+
+    // 修改产品
+    changeGoods(index) {
+      if(this.goodsList[index].materialNumber) {
+        let obj = this.retailProductList.find(o => o.number == this.goodsList[index].materialNumber);
+        this.goodsList[index].materialName = obj.name;
+        this.goodsList[index].materialId = obj.materialId;
+        this.goodsList[index].specification = obj.specification;
+        this.goodsList[index].baseUnitId = obj.baseUnit;
+        this.goodsList[index].price = obj.batchPrice;
+        this.goodsList[index].taxRate = obj.taxRate;
+        this.goodsList[index].mainId = obj.mainId;
+      }
+    },
+
+    // 添加产品
+    addGoods() {
+      this.goodsList.push({})
+    },
+
+    // 删除产品
+    deleteItem(index) {
+      this.goodsList.splice(index, 1);
+    },
 
+    clickSubmitForm(type) {
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          for(let i=0; i<this.goodsList.length; i++) {
+            if(!this.goodsList[i].saleTypeId) {
+              this.$errorMsg('请选择销售类型');
+              return;
+            }
+          }
+          for(let i=0; i<this.goodsList.length; i++) {
+            if(!this.goodsList[i].materialNumber) {
+              this.$errorMsg('请选择产品');
+              return;
+            }
+          }
+          for(let i=0; i<this.goodsList.length; i++) {
+            if(!this.goodsList[i].qty) {
+              this.$errorMsg('请输入数量');
+              return;
+            }
+          }
+
+          let params = {
+            orderDate: this.mainForm.orderDate + ' 00:00:00',
+            productCategoryId: this.mainForm.mainId,
+            projectName: this.mainForm.enginName,
+            orderType: this.mainForm.orderType,
+            useUnit: this.mainForm.company,
+            installAddress: this.mainForm.address,
+            projectNo: this.mainForm.enginNum,
+            enginFactoryNo: this.mainForm.factoryNum,
+            enginSignType: this.mainForm.loginType,
+            remark: this.mainForm.remark,
+            contractExpireDate: this.mainForm.contractDate,
+            items: this.goodsList
+          }
+          if(type === 1) {
+            if(this.listItem) {
+              params.enginInfoId = this.listItem.enginInfoId;
+              editEngin(params).then(res => {
+                this.$successMsg('编辑成功');
+                this.goBack();
+                this.$parent.getList();
+              })
+            }else {
+              addEngin(params).then(res => {
+                this.$successMsg('保存成功');
+                this.goBack();
+                this.$parent.getList();
+              })
+            }
+          }else {
+            if(this.listItem) {
+              params.enginInfoId = this.listItem.enginInfoId;
+            }
+            submitEngin(params).then(res => {
+              this.$successMsg('提交审核成功');
+              this.goBack();
+              this.$parent.getList();
+            })
+          }
+        }
+      })
     },
   }
 }
@@ -219,4 +462,21 @@ export default {
       padding-left: 10px;
     }
   }
+
+  .add {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    border: 1px solid #EBEEF5;
+    border-top: none;
+    height: 50px;
+  }
+
+  ::v-deep input::-webkit-outer-spin-button,
+  ::v-deep input::-webkit-inner-spin-button {
+    -webkit-appearance: none;
+  }
+  ::v-deep input[type='number'] {
+    -moz-appearance: textfield;
+  }
 </style>

+ 32 - 6
src/views/supply/engin/engin_list.vue

@@ -89,7 +89,7 @@
         <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="enginInfoNo" min-width="200" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="单据日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="单据日期" prop="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="经销商编码" prop="customerId" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程名称" prop="projectName" min-width="160" show-overflow-tooltip></el-table-column>
@@ -108,12 +108,18 @@
                 {{scope.row.examineStatus | statusFilter}}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="操作" width="160" fixed="right">
+            <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.enginInfoId)" 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.enginInfoId)" v-if="scope.row.examineStatus === 'WAIT'" >
+                  <el-button slot="reference" type="text">撤回</el-button>
+                </el-popconfirm>
                 <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
-                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">审批</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审批</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.enginInfoId)" >
                   <el-button slot="reference" type="text">删除</el-button>
                 </el-popconfirm>
               </template>
@@ -144,7 +150,7 @@
 </template>
 
 <script>
-import { getEnginList } from "@/api/supply/engin";
+import { getEnginList, applyEngin, withdrawEngin, deleteEngin } from "@/api/supply/engin";
 import EnginDetail from "@/views/supply/engin/components/engin_detail";
 import EnginForm from "@/views/supply/engin/components/engin_form";
 import EnginExamine from "@/views/supply/engin/components/engin_examine";
@@ -309,8 +315,28 @@ export default {
       this.isShowExamine = false;
     },
 
-    handleDelete(id) {
+    // 申请
+    handleSubmit(id) {
+      applyEngin({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
 
+    // 撤回
+    handleWithdraw(id) {
+      withdrawEngin({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
+    // 删除
+    handleDelete(id) {
+      deleteEngin({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
     }
   }
 }

+ 2 - 4
src/views/supply/retail/components/retail_form.vue

@@ -79,8 +79,7 @@
         </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" @change="changeWallet(scope.$index)">
-              <el-option label="不使用" value=""></el-option>
+            <el-select v-model="scope.row.customerWalletId2" placeholder="选择返利钱包" size="small" clearable @change="changeWallet(scope.$index)">
               <el-option
                 v-for="item in flWalletList"
                 :key="item.customerWalletId"
@@ -102,8 +101,7 @@
         </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">
-              <el-option label="不使用" value=""></el-option>
+            <el-select v-model="scope.row.customerWalletId" placeholder="选择现金钱包" size="small" clearable>
               <el-option
                 v-for="item in xjWalletList"
                 :key="item.customerWalletId"