Преглед на файлове

家用工程订单更改

chen преди 3 години
родител
ревизия
7561322ead
променени са 1 файла, в които са добавени 114 реда и са изтрити 157 реда
  1. 114 157
      src/views/supply/engin/home_list.vue

+ 114 - 157
src/views/supply/engin/home_list.vue

@@ -34,14 +34,7 @@
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="单据日期" prop="date">
-                <el-date-picker
-                  v-model="screenForm.date"
-                  type="datetimerange"
-                  range-separator="至"
-                  style="width: 100%;"
-                  value-format="yyyy-MM-dd HH:mm:ss"
-                  start-placeholder="开始日期"
-                  end-placeholder="结束日期">
+                <el-date-picker v-model="screenForm.date" type="datetimerange" range-separator="至" style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期" end-placeholder="结束日期">
                 </el-date-picker>
               </el-form-item>
             </el-col>
@@ -65,11 +58,7 @@
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="表头业务员" prop="salesMan">
                 <el-select v-model="screenForm.salesMan" placeholder="选择表头业务员" clearable filterable style="width: 100%">
-                  <el-option
-                    v-for="item in salesmanList"
-                    :key="item.adminUserId"
-                    :label="item.nickName"
-                    :value="item.adminUserId">
+                  <el-option v-for="item in salesmanList" :key="item.adminUserId" :label="item.nickName" :value="item.adminUserId">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -136,17 +125,7 @@
           </div>
         </div>
         <div class="table">
-          <el-table
-            v-loading="listLoading"
-            :data="dataList"
-            element-loading-text="Loading"
-            border
-            fit
-            highlight-current-row
-            stripe
-            @selection-change="handleSelectionChange"
-            show-summary
-            :summary-method="$getSummaries">
+          <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe @selection-change="handleSelectionChange" show-summary :summary-method="$getSummaries">
             <el-table-column align="center" type="selection" width="55"></el-table-column>
             <el-table-column align="left" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
@@ -163,7 +142,7 @@
               <template slot-scope="scope">
                 <div>
                   <span>{{scope.row.orderDate | dateToDayFilter}}</span>
-                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 4px" @click="editDate(scope.row)" v-if="$checkBtnRole('date', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT')" ></el-button>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 4px" @click="editDate(scope.row)" v-if="$checkBtnRole('date', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'WAIT')"></el-button>
                 </div>
               </template>
             </el-table-column>
@@ -179,9 +158,7 @@
               </template>
             </el-table-column>
             <el-table-column align="left" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="left" label="行业类别" prop="refTradeCategory" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column v-if="!isCustomer" align="left" label="格力内部备注" prop="geLiInerNote" min-width="160" show-overflow-tooltip></el-table-column>
+
             <el-table-column align="left" label="跨区厂编号" prop="refFactoryNo" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="left" label="物料编码" prop="materialNumber" min-width="120" show-overflow-tooltip>
@@ -217,6 +194,9 @@
             </el-table-column>
             <el-table-column align="right" label="直调数量" prop="directTransferQty" min-width="110" sortable show-overflow-tooltip></el-table-column>
             <el-table-column align="right" label="出库数量" prop="hasSendQty" min-width="110" sortable show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="行业类别" prop="refTradeCategory" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="left" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column v-if="!isCustomer" align="left" label="格力内部备注" prop="geLiInerNote" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="right" label="单价" prop="price" min-width="100" sortable show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.price | numToFixed}}
@@ -249,55 +229,28 @@
             <el-table-column align="left" label="审核日期" prop="confirmTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="操作" width="220" fixed="right">
               <template slot-scope="scope">
-                <el-popconfirm
-                  style="margin-right: 10px;"
-                  title="确定申请吗?"
-                  @onConfirm="handleSubmit(scope.row.parentId)"
-                  v-if="scope.row.examineStatus === 'SAVE'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定申请吗?" @onConfirm="handleSubmit(scope.row.parentId)" v-if="scope.row.examineStatus === 'SAVE'">
                   <el-button slot="reference" type="text">申请</el-button>
                 </el-popconfirm>
-                <el-popconfirm
-                  style="margin-right: 10px;"
-                  title="确定撤回吗?"
-                  @onConfirm="handleWithdraw(scope.row.parentId)"
-                  v-if="scope.row.examineStatus === 'WAIT'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定撤回吗?" @onConfirm="handleWithdraw(scope.row.parentId)" v-if="scope.row.examineStatus === 'WAIT'">
                   <el-button slot="reference" type="text">撤回</el-button>
                 </el-popconfirm>
-                <el-popconfirm
-                  style="margin-right: 10px;"
-                  title="确定弃审吗?"
-                  @onConfirm="handleAbandon(scope.row.parentId)"
-                  v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" >
+                <el-popconfirm style="margin-right: 10px;" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.parentId)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'">
                   <el-button slot="reference" type="text">弃审</el-button>
                 </el-popconfirm>
-                <el-button
-                  type="text"
-                  @click="toForm(scope.row)"
-                  v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL')">
+                <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && (scope.row.examineStatus === 'SAVE' || scope.row.examineStatus === 'FAIL')">
                   编辑
                 </el-button>
-                <el-button
-                  type="text"
-                  @click="toExamine(scope.row)"
-                  v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">
+                <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">
                   审批
                 </el-button>
-                <el-button
-                  type="text"
-                  @click="toReturn(scope.row)"
-                  v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus !== 'FAIL'">
+                <el-button type="text" @click="toReturn(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus !== 'FAIL'">
                   退订
                 </el-button>
-                <el-button
-                  type="text"
-                  @click="toDetail(scope.row)">
+                <el-button type="text" @click="toDetail(scope.row)">
                   详情
                 </el-button>
-                <el-popconfirm
-                  style="margin-left: 10px;"
-                  title="确定删除吗?"
-                  @onConfirm="handleDelete(scope.row.parentId)"
-                  v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'">
+                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.parentId)" v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus !== 'OK'">
                   <el-button slot="reference" type="text" style="color: #f56c6c;">删除</el-button>
                 </el-popconfirm>
               </template>
@@ -307,14 +260,7 @@
       </div>
       <div class="pagination clearfix">
         <div class="fr">
-          <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-sizes="[10, 20, 30, 50, 500]"
-            :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="listTotal">
+          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 20, 30, 50, 500]" :page-size="10" layout="total, sizes, prev, pager, next, jumper" :total="listTotal">
           </el-pagination>
         </div>
       </div>
@@ -331,15 +277,22 @@
 </template>
 
 <script>
-import { getOrderList, applyHome, withdrawHome, deleteHome, editDateHome, abandonHome } from "@/api/supply/engin";
-import { getSalesmanList, getTypeList } from '@/api/common'
+import {
+  getOrderList,
+  applyHome,
+  withdrawHome,
+  deleteHome,
+  editDateHome,
+  abandonHome,
+} from "@/api/supply/engin";
+import { getSalesmanList, getTypeList } from "@/api/common";
 import HomeDetail from "@/views/supply/engin/components/home_detail";
 import HomeForm from "@/views/supply/engin/components/home_form";
 import HomeExamine from "@/views/supply/engin/components/home_examine";
 import HomeReturn from "@/views/supply/engin/components/home_return";
 import EditDateDialog from "@/components/Common/edit-date-dialog";
 
-let that
+let that;
 export default {
   components: {
     HomeDetail,
@@ -350,16 +303,16 @@ export default {
   },
   filters: {
     statusFilter(val) {
-      let obj = that.statusList.find(o => o.value === val);
-      return obj ? obj.label : ''
+      let obj = that.statusList.find((o) => o.value === val);
+      return obj ? obj.label : "";
     },
     typeFilter(val) {
       const MAP = {
-        TRADE: '商用',
-        HOME: '家用',
-      }
+        TRADE: "商用",
+        HOME: "家用",
+      };
       return MAP[val];
-    }
+    },
   },
   data() {
     return {
@@ -368,32 +321,33 @@ export default {
       listTotal: 0, // 列表总数
       dataList: null, // 列表数据
       listLoading: false, // 列表加载loading
-      screenForm: { // 筛选表单数据
+      screenForm: {
+        // 筛选表单数据
         status: [],
-        orderNum: '',
-        enginNum: '',
-        loginNum: '',
-        refTradeCategory: '',
-        date: '',
-        saleType: '',
-        createMan: '',
-        examineMan: '',
-        salesMan: '',
-        refUseUnit: '',
-        materialOldNumber: '',
-        specification: '',
-        customerKeyword: '',
-        refRegionWork: '',
-        remark: '',
-        geLiInerNote: '',
-        refFactoryNo: ''
+        orderNum: "",
+        enginNum: "",
+        loginNum: "",
+        refTradeCategory: "",
+        date: "",
+        saleType: "",
+        createMan: "",
+        examineMan: "",
+        salesMan: "",
+        refUseUnit: "",
+        materialOldNumber: "",
+        specification: "",
+        customerKeyword: "",
+        refRegionWork: "",
+        remark: "",
+        geLiInerNote: "",
+        refFactoryNo: "",
       },
       statusList: [
-        { label: '已保存', value: 'SAVE' },
-        { label: '待审核', value: 'WAIT' },
-        { label: '审核通过', value: 'OK' },
+        { label: "已保存", value: "SAVE" },
+        { label: "待审核", value: "WAIT" },
+        { label: "审核通过", value: "OK" },
         //  // { label: '审核驳回', value: 'FAIL' },,
-        { label: '已关闭', value: 'CLOSE' },
+        { label: "已关闭", value: "CLOSE" },
       ],
       salesmanList: [],
 
@@ -408,25 +362,26 @@ export default {
       editId: null,
       isShowEditDateDialog: false,
       dateForm: {
-        date: '',
+        date: "",
       },
-      salesTypeList:[]
-    }
+      salesTypeList: [],
+    };
   },
 
   computed: {
     exParams() {
-      let ids = this.multipleSelection.map(item => {
+      let ids = this.multipleSelection.map((item) => {
         return item.enginOrderNo;
       });
       return {
-        examineStatus: this.screenForm.status.join(','),
-        enginOrderNo: (ids && ids.length) ? ids.join(',') : this.screenForm.orderNum,
+        examineStatus: this.screenForm.status.join(","),
+        enginOrderNo:
+          ids && ids.length ? ids.join(",") : this.screenForm.orderNum,
         refProjectNo: this.screenForm.enginNum,
         refEnginRecordNo: this.screenForm.loginNum,
         refTradeCategory: this.screenForm.refTradeCategory,
-        startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
-        endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        startCreateTime: this.screenForm.date ? this.screenForm.date[0] : "",
+        endCreateTime: this.screenForm.date ? this.screenForm.date[1] : "",
         saleTypeId: this.screenForm.saleType,
         createName: this.screenForm.createMan,
         confirmName: this.screenForm.examineMan,
@@ -439,12 +394,14 @@ export default {
         remark: this.screenForm.remark,
         geLiInerNote: this.screenForm.geLiInerNote,
         refFactoryNo: this.screenForm.refFactoryNo,
-        enginOrderType: 'HOME', // TRADE=商用 HOME=家用
-      }
+        enginOrderType: "HOME", // TRADE=商用 HOME=家用
+      };
     },
     isCustomer() {
-      return this.$store.getters.customerId && this.$store.getters.customerNumber
-    }
+      return (
+        this.$store.getters.customerId && this.$store.getters.customerNumber
+      );
+    },
   },
 
   beforeCreate() {
@@ -465,19 +422,19 @@ export default {
         pageSize: -1,
         isCustomer: 0,
         status: true,
-      }).then(res => {
+      }).then((res) => {
         this.salesmanList = res.data.records;
-      })
+      });
     },
 
     // 获取销售类型列表
     getSalesTypeList() {
       getTypeList({
         pageNum: 1,
-        pageSize: -1
+        pageSize: -1,
       }).then((res) => {
         this.salesTypeList = res.data.records;
-      })
+      });
     },
 
     // 查询列表
@@ -486,13 +443,13 @@ export default {
       let params = {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
-        examineStatus: this.screenForm.status.join(','),
+        examineStatus: this.screenForm.status.join(","),
         enginOrderNo: this.screenForm.orderNum,
         refProjectNo: this.screenForm.enginNum,
         refEnginRecordNo: this.screenForm.loginNum,
         refTradeCategory: this.screenForm.refTradeCategory,
-        startCreateTime: this.screenForm.date ? this.screenForm.date[0] : '',
-        endCreateTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        startCreateTime: this.screenForm.date ? this.screenForm.date[0] : "",
+        endCreateTime: this.screenForm.date ? this.screenForm.date[1] : "",
         saleTypeId: this.screenForm.saleType,
         createName: this.screenForm.createMan,
         confirmName: this.screenForm.examineMan,
@@ -505,17 +462,17 @@ export default {
         remark: this.screenForm.remark,
         geLiInerNote: this.screenForm.geLiInerNote,
         refFactoryNo: this.screenForm.refFactoryNo,
-        enginOrderType: 'HOME', // TRADE=商用 HOME=家用
+        enginOrderType: "HOME", // TRADE=商用 HOME=家用
       };
       getOrderList(params).then((res) => {
-        res.data.records.forEach(item => {
-          item.sums1 = ['qty', 'directTransferQty', 'hasSendQty'];
-          item.sums2 = ['price', 'payAmount', 'discAmount'];
-        })
+        res.data.records.forEach((item) => {
+          item.sums1 = ["qty", "directTransferQty", "hasSendQty"];
+          item.sums2 = ["price", "payAmount", "discAmount"];
+        });
         this.dataList = res.data.records;
         this.listTotal = res.data.total;
         this.listLoading = false;
-      })
+      });
     },
 
     // 提交筛选表单
@@ -564,8 +521,8 @@ export default {
 
     // 进入退订
     toReturn(item) {
-      if(item.refundableQty <= 0) {
-        return this.$errorMsg('可退数量为0');
+      if (item.refundableQty <= 0) {
+        return this.$errorMsg("可退数量为0");
       }
       this.queryItem = item;
       this.isShowReturn = true;
@@ -581,51 +538,53 @@ export default {
 
     // 申请
     handleSubmit(id) {
-      applyHome({id}).then(res => {
+      applyHome({ id }).then((res) => {
         this.$successMsg();
         this.getList();
-      })
+      });
     },
 
     // 撤回
     handleWithdraw(id) {
-      withdrawHome({id}).then(res => {
+      withdrawHome({ id }).then((res) => {
         this.$successMsg();
         this.getList();
-      })
+      });
     },
 
     // 弃审
     handleAbandon(id) {
-      abandonHome({id}).then(res => {
+      abandonHome({ id }).then((res) => {
         this.$successMsg();
         this.getList();
-      })
+      });
     },
 
     // 删除
     handleDelete(id) {
-      deleteHome({ids: id}).then(res => {
+      deleteHome({ ids: id }).then((res) => {
         this.$successMsg();
         this.getList();
-      })
+      });
     },
 
     // 批量删除
     batchDelete() {
-      this.$confirm('此操作将永久删除, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        let ids = this.multipleSelection.map(item => {
-          return item.parentId;
-        });
-        deleteHome({ids: ids.join(',')}).then(res => {
-          this.$successMsg();
-          this.getList();
+      this.$confirm("此操作将永久删除, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          let ids = this.multipleSelection.map((item) => {
+            return item.parentId;
+          });
+          deleteHome({ ids: ids.join(",") }).then((res) => {
+            this.$successMsg();
+            this.getList();
+          });
         })
-      }).catch(() => {});
+        .catch(() => {});
     },
 
     handleSelectionChange(val) {
@@ -643,18 +602,16 @@ export default {
     submitDateForm() {
       editDateHome({
         enginOrderId: this.editId,
-        orderDate: this.dateForm.date + ' 00:00:00',
-      }).then(res => {
+        orderDate: this.dateForm.date + " 00:00:00",
+      }).then((res) => {
         this.isShowEditDateDialog = false;
         this.getList();
-        this.$successMsg('修改成功');
-      })
+        this.$successMsg("修改成功");
+      });
     },
-
-  }
-}
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-
 </style>