浏览代码

Merge branch 'feature/Feature-basic_data' of https://gogs.zfire.top/zfire-front/supply-front into feature/Feature-basic_data

chen 3 年之前
父节点
当前提交
55739a7735

+ 66 - 0
src/components/Common/edit-date-dialog.vue

@@ -0,0 +1,66 @@
+<template>
+  <div>
+    <el-dialog title="修改订单日期" :visible.sync="isShow" :show-close="false" width="400px" :close-on-click-modal="false">
+      <el-form ref="dateForm" :model="dateForm" :rules="dateFormRules" label-position="left" label-width="80px">
+        <el-form-item label="选择日期" prop="date">
+          <el-date-picker
+            v-model="dateForm.date"
+            type="date"
+            value-format="yyyy-MM-dd"
+            style="width: 100%;"
+            placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cancelDateForm">取 消</el-button>
+        <el-button type="primary" @click="submitDateForm">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+
+export default {
+  name: 'EditDateDialog',
+  props: {
+    isShow: {
+      type: Boolean,
+      default: false
+    },
+    dateForm: {
+      type: Object,
+      default: {
+        date: '',
+      }
+    }
+  },
+  data() {
+    return {
+      dateFormRules: {
+        date: [
+          { required: true, message: '请选择订单日期', trigger: 'change' }
+        ],
+      },
+    }
+  },
+  methods: {
+    cancelDateForm() {
+      this.$emit('update:isShow', false);
+    },
+
+    submitDateForm() {
+      this.$refs.dateForm.validate((valid) => {
+        if (valid) {
+          this.$parent.submitDateForm();
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style>
+
+</style>

+ 3 - 0
src/layout/components/Navbar.vue

@@ -103,6 +103,8 @@ export default {
     this.timer = setInterval(function () {
       that.initNotice()
     }, 3000)
+  },
+  created() {
     this.userInfo = JSON.parse(localStorage.getItem("supply_user"))
   },
   beforeDestroy() {
@@ -177,6 +179,7 @@ export default {
             if (res.code === 200) {
               this.$successMsg("绑定成功,正在打开工程机系统")
               this.$store.dispatch('user/getInfo').then(() => {
+                this.userInfo.bindEngin = true
                 this.userInfo.enginUserName = this.engineForm.account
                 this.userInfo.enginPassword = this.engineForm.password
                 this.$refs.engineSubmit.click()

+ 32 - 15
src/views/basic_data/material/components/modify_list-apply.vue

@@ -99,7 +99,7 @@
                 <el-button
                   type="text"
                   class="textColor"
-                  @click="hanleDeleInd(scope.$index)"
+                  @click="hanleDeleInd(scope.$index,scope.row.cid)"
                   >删除</el-button
                 >
               </template>
@@ -195,7 +195,7 @@
             >
               <template slot-scope="scope">
                 <el-form-item>
-                  <el-input v-model="scope.row.unit"></el-input>
+                  <el-input disabled  v-model="scope.row.unit"></el-input>
                 </el-form-item>
               </template>
             </el-table-column>
@@ -915,21 +915,23 @@ export default {
   },
   methods: {
     handleSale(e, index,saleTypes) {
+
+      let saleArr = []
       this.rebateList = this.rebateList.filter((k) => {
-        return (
-          this.typeList.filter((i) => {
-               console.log(k,i);
+
+          saleArr = saleTypes.filter((i) => {
             return e == i.mainId;
+          })
+          return saleArr[0].id === k.saleTypeId
 
-          })[0].id === k.saleTypeId
-        );
       });
 
-      this.items[index].mainId = saleArr.mainId
-      this.items[index].mainName = saleArr.mainName
-      this.items[index].saleTypeId = saleArr.id
-      this.items[index].saleTypeName = saleName
-      this.$set(this.items[index], "rebateWallets", this.rebateList);
+      this.items[index].mainId = saleArr[0].mainId
+      this.items[index].mainName = saleArr[0].mainName
+      this.items[index].saleTypeId = saleArr[0].id
+      this.items[index].saleTypeName = saleArr[0].saleName
+      this.$set(this.items[index], "rebateList", this.rebateList);
+      console.log(this.rebateList,this.items[index]);
       this.fang = false;
     },
     // xua
@@ -1013,7 +1015,20 @@ export default {
     indexMethod(index) {
       console.log(index);
     },
-    hanleDeleInd(index) {
+    hanleDeleInd(index,id) {
+        if (id) {
+          const dataArr = JSON.parse(JSON.stringify(this.dataList))
+          for (let j = 0; j < dataArr.length; j++) {
+             if (id== dataArr[j].id) {
+
+                  dataArr[j].disabled = false
+                 this.$set(dataArr[j],'disabled',false)
+            }}
+
+            this.dataList = dataArr
+
+        }
+
       this.items.splice(index, 1);
     },
     handleDetermine() {
@@ -1027,7 +1042,7 @@ export default {
           this.items.push({
             baseUnitId: "",
             batchPrice: "",
-            unit: "",
+            unit: this.selectData[i].baseUnitId,
             billId: "",
             endDate: "",
             isPromote: "",
@@ -1130,8 +1145,10 @@ export default {
      */
     selectable: function (row, index) {
       // row.disabled == undefined 才能被选中
-      if (row.disabled == undefined) {
+      if (row.disabled == undefined || row.disabled == false) {
         return true;
+      }else{
+        return false
       }
       // 函数必须有返回值且是布尔值
       // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)

+ 52 - 29
src/views/sales_policy/components/AddCondition.vue

@@ -532,6 +532,8 @@ export default {
     },
     handleSubmit() {
       var tableData = [];
+
+      this.newConditionBox.push(JSON.parse(JSON.stringify(this.conditionBox)));
       for (let i = 0; i < this.conditionBox.length; i++) {
         for (let j = 0; j < this.conditionBox[i].length; j++) {
           this.conditionBox[i][j].popType = i + 1;
@@ -541,6 +543,7 @@ export default {
         }
         tableData = [...tableData, ...this.conditionBox[i]];
       }
+
       if (!tableData.length) {
         this.$errorMsg("请选择机型");
         return;
@@ -559,7 +562,7 @@ export default {
       };
       addPoliyCondition(params).then((res) => {
         this.$successMsg("添加成功");
-        this.newConditionBox.push(this.conditionBox)
+
         this.conditionBox = [[], []];
         this.conditionBoxs = [];
         this.limit = "";
@@ -584,15 +587,15 @@ export default {
       console.log(this.ids);
     },
     handleDeleteRow(index) {
-        if (this.arrIndex == index && this.ids.length) {
-          var arr=[];
-          for(var i = 0; i < this.conditionBox[index].length; i++){
-                if(this.ids.indexOf(this.conditionBox[index][i].id) == -1){
-                    arr.push(this.conditionBox[index][i]);
-                }
-            }
-        this.conditionBox[index] = []
-        this.$set(this.conditionBox,index,arr)
+      if (this.arrIndex == index && this.ids.length) {
+        var arr = [];
+        for (var i = 0; i < this.conditionBox[index].length; i++) {
+          if (this.ids.indexOf(this.conditionBox[index][i].id) == -1) {
+            arr.push(this.conditionBox[index][i]);
+          }
+        }
+        this.conditionBox[index] = [];
+        this.$set(this.conditionBox, index, arr);
       }
     },
     // 更改每页数量
@@ -623,27 +626,47 @@ export default {
         for (let j = 0; j < this.conditionBox.length; j++) {
           datas = [...datas, ...this.conditionBox[j]];
         }
-
-          console.log(this.newConditionBox);
-          if (this.newConditionBox.length) {
-                 console.log(this.newConditionBox);
-                 this.conditList=[]
-          } else {
-        const newData = datas
-        if (newData.length) {
-          for (let i = 0; i < res.data.records.length; i++) {
-            for (let k = 0; k < newData.length; k++) {
-              if (newData[k].id == res.data.records[i].id) {
-                res.data.records[i].disabled = true;
+    /**
+     * @value newConditionBox 首页保存的所有选中者,即条件1
+     * @value res.data.records,this.conditList 每次点击添加获取的最新数据
+     * @value disabled 添加条件都进行比较上一个条件或者所有条件当中的限定机型和配提机型,
+     * 如:上一个或者所有条件中已经存在disabled
+     */
+        if (this.newConditionBox.length) {
+          this.conditList = res.data.records;
+          for (let j = 0; j < this.newConditionBox.length; j++) {
+            for (let o = 0; o < this.newConditionBox[j].length; o++) {
+              if (o == index) {
+                console.log(this.newConditionBox[j][o], "dier");
+                for (let i = 0; i < res.data.records.length; i++) {
+                  for (let k = 0; k < this.newConditionBox[j][o].length; k++) {
+                    if (
+                      this.newConditionBox[j][o][k].id == res.data.records[i].id
+                    ) {
+                      res.data.records[i].disabled = true;
+                    }
+                  }
+                }
+              } else {
+                this.conditList = res.data.records;
               }
             }
           }
-        }
-        this.conditList = res.data.records;
-        this.listTotal = res.data.total;
+          this.conditList = res.data.records;
+        } else {
+          const newData = datas;
+          if (newData.length) {
+            for (let i = 0; i < res.data.records.length; i++) {
+              for (let k = 0; k < newData.length; k++) {
+                if (newData[k].id == res.data.records[i].id) {
+                  res.data.records[i].disabled = true;
+                }
+              }
+            }
           }
-
-
+          this.conditList = res.data.records;
+          this.listTotal = res.data.total;
+        }
       });
     },
     handleSelectionAllChange(e) {
@@ -674,11 +697,11 @@ export default {
     },
     //去掉相同数据
     resArr(arr1, arr2) {
-      return arr1.filter((v) => arr2.every((val) => val.id!= v.id));
+      return arr1.filter((v) => arr2.every((val) => val.id != v.id));
     },
     handleDelete() {
       if (this.type == 2) {
-        this.conditList2 = this.resArr(this.conditList2,this.rightData)
+        this.conditList2 = this.resArr(this.conditList2, this.rightData);
         this.rightData = [];
       }
     },

+ 10 - 16
src/views/sales_policy/components/AddPolicy.vue

@@ -14,7 +14,7 @@
           <el-divider></el-divider>
           <el-form
             :model="searchForm"
-            :rules="rules"
+
             ref="searchForm"
             label-width="120px"
             size="small"
@@ -22,7 +22,7 @@
           >
             <el-row>
               <el-col :xs="24" :ms="12" :lg="12">
-                <el-form-item label="销售政策编号" prop="code">
+                <el-form-item label="销售政策编号" >
                   <el-input
                     disabled
                     v-model="searchForm.code"
@@ -67,7 +67,7 @@
                     <el-option
                       v-for="item in dictList"
                       :label="item.dictValue"
-                      :value="item.sysDictId"
+                      :value="item.dictCode"
                     ></el-option>
                   </el-select>
                 </el-form-item>
@@ -103,7 +103,7 @@
                 </el-form-item>
               </el-col>
               <el-col :xs="24" :ms="24" :lg="24">
-                <el-form-item label="政策封面图" prop="imgSrc">
+                <el-form-item label="政策封面图" >
                   <ImageUpload :fileList="fileList" :multiple="false" />
                 </el-form-item>
               </el-col>
@@ -357,12 +357,7 @@ export default {
         type: "",
       },
       listLoading: false,
-      rules: {
-        name: [
-          { required: true, message: "", trigger: "click" },
-          { min: 3, max: 5, message: "", trigger: "click" },
-        ],
-      },
+
       importFileList: [],
       fileList: [],
       options: {},
@@ -537,13 +532,12 @@ export default {
     },
     // 提交审核
     handleAddPolicy(policyCustomers) {
-      if (!this.conditionList.length) {
-           this.$errorMsg("请添加条件信息 ");
-           return
-      }
+      // if (!this.conditionList.length) {
+      //      this.$errorMsg("请添加条件信息 ");
+      //      return
+      // }
       if (policyCustomers.length) {
         var arr = [];
-
         policyCustomers.forEach((el) => {
           arr.push({
             customerId: el.id,
@@ -558,7 +552,7 @@ export default {
           });
         });
         this.dictList.forEach((k) => {
-          if (k.sysDictId == this.searchForm.mainId) {
+          if (k.dictCode == this.searchForm.mainId) {
             this.searchForm.mainName = k.dictValue;
           }
         });

+ 3 - 3
src/views/setting/role.vue

@@ -328,8 +328,8 @@ export default {
 }
 </script>
 
-<style lang="scss">
-  .tree-dialog {
+<style lang="scss" scoped>
+  ::v-deep .tree-dialog {
     .el-dialog__body {
       padding: 20px;
       .el-tree {
@@ -345,7 +345,7 @@ export default {
       }
     }
   }
-  .custom-tree-node {
+  ::v-deep .custom-tree-node {
     flex: 1;
     display: flex;
     align-items: center;

+ 39 - 4
src/views/supply/engin/commerce_list.vue

@@ -91,9 +91,16 @@
               </template>
             </el-table-column>
             <el-table-column align="center" label="工程订单号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单日期" prop="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <div>
+                  <span>{{scope.row.orderDate | dateToDayFilter}}</span>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" ></el-button>
+                </div>
+              </template>
+            </el-table-column>
             <el-table-column align="center" label="工程编码" prop="refProjectNo" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="工程登录单号" prop="refEnginRecordNo" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="工程登录单号" prop="refEnginRecordNo" min-width="200" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单类型" prop="enginOrderType" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.enginOrderType | typeFilter}}
@@ -101,7 +108,7 @@
             </el-table-column>
             <el-table-column align="center" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程名称" prop="refProjectName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="销售类型" prop="saleTypeName" 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>
@@ -156,6 +163,8 @@
         </div>
       </div>
     </div>
+
+    <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
     
     <CommerceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <CommerceForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
@@ -166,11 +175,12 @@
 </template>
 
 <script>
-import { getOrderList, applyCom, withdrawCom, deleteCom } from "@/api/supply/engin";
+import { getOrderList, applyCom, withdrawCom, deleteCom, editCom } from "@/api/supply/engin";
 import CommerceDetail from "@/views/supply/engin/components/commerce_detail";
 import CommerceForm from "@/views/supply/engin/components/commerce_form";
 import CommerceExamine from "@/views/supply/engin/components/commerce_examine";
 import CommerceReturn from "@/views/supply/engin/components/commerce_return";
+import EditDateDialog from "@/components/Common/edit-date-dialog";
 
 let that
 export default {
@@ -179,6 +189,7 @@ export default {
     CommerceForm,
     CommerceExamine,
     CommerceReturn,
+    EditDateDialog,
   },
   filters: {
     statusFilter(val) {
@@ -226,6 +237,12 @@ export default {
       isShowForm: false,
       isShowExamine: false,
       isShowReturn: false,
+
+      editId: null,
+      isShowEditDateDialog: false,
+      dateForm: {
+        date: '',
+      },
     }
   },
 
@@ -394,6 +411,24 @@ export default {
       this.multipleSelection = val;
     },
 
+    // 打开 修改订单日期
+    editDate(item) {
+      this.editId = item.parentId;
+      this.dateForm.date = item.orderDate.slice(0, 10);
+      this.isShowEditDateDialog = true;
+    },
+
+    // 提交 修改订单日期
+    submitDateForm() {
+      editCom({
+        enginOrderId: this.editId,
+        orderDate: this.dateForm.date + ' 00:00:00',
+      }).then(res => {
+        this.isShowEditDateDialog = false;
+        this.getList();
+        this.$successMsg('修改成功');
+      })
+    },
 
   }
 }

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

@@ -17,10 +17,11 @@
           <el-form-item label="单据日期" prop="orderDate">
             <el-date-picker
               v-model="mainForm.orderDate"
+              disabled
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
-              placeholder="选择日期">
+              placeholder="系统自动生成">
             </el-date-picker>
           </el-form-item>
         </el-col>
@@ -361,7 +362,7 @@ export default {
         fileNum: '',
       },
       mainFormRules: {
-        orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
+        // orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
         jxsNum: [{ required: true, message: '请输入经销商编码', trigger: 'blur' }],
         jxsName: [{ required: true, message: '请输入经销商名称', trigger: 'blur' }],
         enginNum: [{ required: true, message: '请输入工程登录编号', trigger: 'blur' }],
@@ -678,7 +679,7 @@ export default {
 
           let params = {
             enginOrderId: this.mainForm.orderNum,
-            orderDate: this.mainForm.orderDate,
+            // orderDate: this.mainForm.orderDate,
             mainId: this.mainForm.type || '',
             refEnginRecordNo: this.mainForm.enginNum || '',
             refFactoryNo: this.mainForm.factoryNum || '',

+ 5 - 4
src/views/supply/engin/components/engin_form.vue

@@ -6,7 +6,7 @@
       <div class="title">工程信息单</div>
     </div>
 
-    <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="100px" size="small" label-position="left">
+    <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="100px" size="small" label-position="right">
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="工程信息单" prop="orderNum">
@@ -17,10 +17,11 @@
           <el-form-item label="单据日期" prop="orderDate">
             <el-date-picker
               v-model="mainForm.orderDate"
+              disabled
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
-              placeholder="选择日期">
+              placeholder="系统自动生成">
             </el-date-picker>
           </el-form-item>
         </el-col>
@@ -239,7 +240,7 @@ export default {
         contractDate: '',
       },
       mainFormRules: {
-        orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
+        // orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
         jxsNum: [{ required: true, message: '请输入经销商编码', trigger: 'blur' }],
         enginName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
         jxsName: [{ required: true, message: '请输入经销商名称', trigger: 'blur' }],
@@ -415,7 +416,7 @@ export default {
           }
 
           let params = {
-            orderDate: this.mainForm.orderDate + ' 00:00:00',
+            // orderDate: this.mainForm.orderDate + ' 00:00:00',
             mainId: this.mainForm.mainId,
             projectName: this.mainForm.enginName,
             orderType: this.mainForm.orderType,

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

@@ -17,10 +17,11 @@
           <el-form-item label="单据日期" prop="orderDate">
             <el-date-picker
               v-model="mainForm.orderDate"
+              disabled
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
-              placeholder="选择日期">
+              placeholder="系统自动生成">
             </el-date-picker>
           </el-form-item>
         </el-col>
@@ -369,7 +370,7 @@ export default {
         loginUserId: ''
       },
       mainFormRules: {
-        orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
+        // orderDate: [{ required: true, message: '请选择单据日期', trigger: 'change' }],
         jxsNum: [{ required: true, message: '请输入经销商编码', trigger: 'blur' }],
         jxsName: [{ required: true, message: '请输入经销商名称', trigger: 'blur' }],
         loginNum: [{ required: true, message: '请输入工程登录编号', trigger: 'blur' }],
@@ -712,7 +713,7 @@ export default {
           let saleTypeItem = this.salesTypeList.find(o => o.id == this.mainForm.saleType);
           let params = {
             enginOrderId: this.mainForm.orderNum,
-            orderDate: this.mainForm.orderDate,
+            // orderDate: this.mainForm.orderDate,
             mainId: this.mainForm.type || '',
             loginUserId: this.mainForm.loginUserId,
             refEnginRecordNo: this.mainForm.loginNum || '',

+ 39 - 3
src/views/supply/engin/engin_list.vue

@@ -89,7 +89,14 @@
         <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="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <div>
+                  <span>{{scope.row.orderDate | dateToDayFilter}}</span>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" ></el-button>
+                </div>
+              </template>
+            </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>
@@ -142,6 +149,8 @@
         </div>
       </div>
     </div>
+    
+    <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
 
     <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
@@ -151,10 +160,11 @@
 </template>
 
 <script>
-import { getEnginList, applyEngin, withdrawEngin, deleteEngin } from "@/api/supply/engin";
+import { getEnginList, applyEngin, withdrawEngin, deleteEngin, editEngin } 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";
+import EditDateDialog from "@/components/Common/edit-date-dialog";
 
 let that
 export default {
@@ -162,6 +172,7 @@ export default {
     EnginDetail,
     EnginForm,
     EnginExamine,
+    EditDateDialog,
   },
   filters: {
     statusFilter(val) {
@@ -200,6 +211,12 @@ export default {
       isShowDetail: false,
       isShowForm: false,
       isShowExamine: false,
+
+      editId: null,
+      isShowEditDateDialog: false,
+      dateForm: {
+        date: '',
+      },
     }
   },
 
@@ -329,7 +346,26 @@ export default {
         this.$successMsg();
         this.getList();
       })
-    }
+    },
+
+    // 打开 修改订单日期
+    editDate(item) {
+      this.editId = item.enginInfoId;
+      this.dateForm.date = item.orderDate.slice(0, 10);
+      this.isShowEditDateDialog = true;
+    },
+
+    // 提交 修改订单日期
+    submitDateForm() {
+      editEngin({
+        enginInfoId: this.editId,
+        orderDate: this.dateForm.date + ' 00:00:00',
+      }).then(res => {
+        this.isShowEditDateDialog = false;
+        this.getList();
+        this.$successMsg('修改成功');
+      })
+    },
   }
 }
 </script>

+ 39 - 4
src/views/supply/engin/home_list.vue

@@ -91,8 +91,15 @@
               </template>
             </el-table-column>
             <el-table-column align="center" label="工程订单号" prop="enginOrderNo" min-width="200" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单日期" prop="orderDate" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="工程编码" prop="refProjectNo" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单日期" prop="orderDate" min-width="120" show-overflow-tooltip>
+              <template slot-scope="scope">
+                <div>
+                  <span>{{scope.row.orderDate | dateToDayFilter}}</span>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" ></el-button>
+                </div>
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="工程编码" prop="refProjectNo" min-width="120" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程登录单号" prop="refEnginRecordNo" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="订单类型" prop="enginOrderType" min-width="160" show-overflow-tooltip>
               <template slot-scope="scope">
@@ -101,7 +108,7 @@
             </el-table-column>
             <el-table-column align="center" label="使用单位" prop="refUseUnit" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="工程名称" prop="refProjectName" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="销售类型" prop="saleTypeName" 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>
@@ -156,6 +163,8 @@
         </div>
       </div>
     </div>
+
+    <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
     
     <HomeDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <HomeForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
@@ -166,11 +175,12 @@
 </template>
 
 <script>
-import { getOrderList, applyHome, withdrawHome, deleteHome } from "@/api/supply/engin";
+import { getOrderList, applyHome, withdrawHome, deleteHome, editHome } from "@/api/supply/engin";
 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
 export default {
@@ -179,6 +189,7 @@ export default {
     HomeForm,
     HomeExamine,
     HomeReturn,
+    EditDateDialog,
   },
   filters: {
     statusFilter(val) {
@@ -226,6 +237,12 @@ export default {
       isShowForm: false,
       isShowExamine: false,
       isShowReturn: false,
+
+      editId: null,
+      isShowEditDateDialog: false,
+      dateForm: {
+        date: '',
+      },
     }
   },
 
@@ -387,7 +404,25 @@ export default {
     handleSelectionChange(val) {
       this.multipleSelection = val;
     },
+    
+    // 打开 修改订单日期
+    editDate(item) {
+      this.editId = item.parentId;
+      this.dateForm.date = item.orderDate.slice(0, 10);
+      this.isShowEditDateDialog = true;
+    },
 
+    // 提交 修改订单日期
+    submitDateForm() {
+      editHome({
+        enginOrderId: this.editId,
+        orderDate: this.dateForm.date + ' 00:00:00',
+      }).then(res => {
+        this.isShowEditDateDialog = false;
+        this.getList();
+        this.$successMsg('修改成功');
+      })
+    },
 
   }
 }

+ 3 - 1
src/views/supply/policy/components/retail_examine.vue

@@ -18,7 +18,7 @@
              <el-date-picker
             v-model="detailData.theTime"
             type="datetime"
-            value-format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
             style="width: 100%"
             placeholder="选择日期"
           >
@@ -298,6 +298,7 @@ export default {
       mainForm: {
         status: true,
         remark: "",
+        theTime:''
       },
     };
   },
@@ -338,6 +339,7 @@ export default {
         id: this.listItem.id,
         examineStatus: this.mainForm.status ? "OK" : "FAIL",
         examineRemark: this.mainForm.remark,
+        theTime:this.detailData.theTime
       })
         .then((res) => {
           this.$successMsg("审批成功");

+ 177 - 99
src/views/supply/policy/components/retail_form2.vue

@@ -199,7 +199,7 @@
               size="small"
               @change="changeWallet(scope.$index)"
             >
-              <el-option label="全部" value=""></el-option>
+
               <el-option
                 v-for="item in scope.row.rebateWallets"
                 :key="item.customerWalletId"
@@ -253,7 +253,7 @@
               placeholder="选择现金钱包"
               size="small"
             >
-              <el-option label="全部" value=""></el-option>
+
               <el-option
                 v-for="item in scope.row.wallets"
                 :key="item.customerWalletId"
@@ -368,7 +368,7 @@
           <el-date-picker
             v-model="mainForm.date"
             type="datetime"
-            value-format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
             style="width: 100%"
             placeholder="选择日期"
           >
@@ -455,7 +455,7 @@
                   placeholder="选择销售类型"
                   style="width: 100%"
                 >
-                  <el-option label="全部" value=""></el-option>
+
                   <el-option
                     v-for="item in ztypeList"
                     :key="item.id"
@@ -476,93 +476,172 @@
             </el-col>
           </el-row>
         </el-form>
-        <el-row :gutter="20" style="margin: 10px 0">
-          {{ cusIndex > 0 ? "选择配提机型" : "选择限定机型" }}
-          {{ "(" + pop + ")" }}
-        </el-row>
-        <el-table
-          v-loading="listLoading"
-          :data="popDataArr[cusIndex]"
-          element-loading-text="Loading"
-          border
-          fit
-          highlight-current-row
-          @select-all="handleSelectionChange"
-          @selection-change="handleSelectionChange"
-          stripe
-        >
-          <el-table-column
-            align="center"
-            type="selection"
-            :selectable="selectable"
-            width="55"
+        <template v-if="!dataList.length">
+          <el-row :gutter="20" style="margin: 10px 0">
+            {{ cusIndex > 0 ? "选择配提机型" : "选择限定机型" }}
+            {{ "(" + pop + ")" }}
+          </el-row>
+          <el-table
+            v-loading="listLoading"
+            :data="popDataArr[cusIndex]"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+            @select-all="handleSelectionChange"
+            @selection-change="handleSelectionChange"
+            stripe
           >
-          </el-table-column>
-          <template v-for="col in columns">
             <el-table-column
-              v-if="col.num"
               align="center"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
+              type="selection"
+              :selectable="selectable"
+              width="55"
             >
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.qty" size="small"></el-input>
-              </template>
             </el-table-column>
-            <el-table-column
-              v-else-if="col.jie"
-              align="center"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
+            <template v-for="col in columns">
+              <el-table-column
+                v-if="col.num"
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <el-input v-model="scope.row.qty" size="small"></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-else-if="col.jie"
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  {{ scope.row.qty * scope.row.price || 0 }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-else
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+            </template>
+          </el-table>
+          <div style="margin: 10px 0">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[10]"
+              :page-size="10"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="total"
             >
-              <template slot-scope="scope">
-                {{ scope.row.qty * scope.row.price || 0 }}
-              </template>
-            </el-table-column>
-            <el-table-column
-              v-else
+            </el-pagination>
+          </div>
+          <span slot="footer" class="dialog-footer">
+            <el-button type="primary" v-if="cusIndex > 0" @click="handleShang"
+              >上一步</el-button
+            >
+            <el-button
+              type="primary"
+              @click="handleCondition"
+              v-if="popArr.length != cusIndex + 1"
+              >下一步</el-button
+            >
+            <el-button
+              type="primary"
+              @click="hanlePopData"
+              v-if="popArr.length == cusIndex + 1"
+              >完成</el-button
+            >
+          </span>
+        </template>
+        <template v-else>
+          <el-table
+            v-loading="listLoading"
+            :data="dataList"
+            element-loading-text="Loading"
+            border
+            fit
+            highlight-current-row
+              @select-all="handleSelectionChange"
+            @selection-change="handleSelectionChange"
+            stripe
+          >
+              <el-table-column
               align="center"
-              :label="col.lable"
-              :prop="col.prop"
-              :min-width="col.widht"
-              show-overflow-tooltip
+              type="selection"
+              :selectable="selectable"
+              width="55"
             >
             </el-table-column>
-          </template>
-        </el-table>
-        <div style="margin: 10px 0">
-          <el-pagination
-            @size-change="handleSizeChange"
-            @current-change="handleCurrentChange"
-            :current-page="currentPage"
-            :page-sizes="[10]"
-            :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="total"
-          >
-          </el-pagination>
-        </div>
-        <span slot="footer" class="dialog-footer">
-          <el-button type="primary" v-if="cusIndex > 0" @click="handleShang"
-            >上一步</el-button
-          >
-          <el-button
-            type="primary"
-            @click="handleCondition"
-            v-if="popArr.length != cusIndex + 1"
-            >下一步</el-button
-          >
-          <el-button
-            type="primary"
-            @click="hanlePopData"
-            v-if="popArr.length == cusIndex + 1"
-            >完成</el-button
-          >
-        </span>
+            <template v-for="col in columns">
+              <el-table-column
+                v-if="col.num"
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  <el-input v-model="scope.row.qty" size="small"></el-input>
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-else-if="col.jie"
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+                <template slot-scope="scope">
+                  {{ scope.row.qty * scope.row.price || 0 }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                v-else
+                align="center"
+                :label="col.lable"
+                :prop="col.prop"
+                :min-width="col.widht"
+                show-overflow-tooltip
+              >
+              </el-table-column>
+            </template>
+          </el-table>
+          <div style="margin: 10px 0">
+            <el-pagination
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+              :current-page="currentPage"
+              :page-sizes="[10]"
+              :page-size="10"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="total"
+            >
+            </el-pagination>
+          </div>
+            <span slot="footer" class="dialog-footer">
+
+            <el-button
+              type="primary"
+              @click="hanlePopData"
+
+              >完成</el-button
+            >
+          </span>
+        </template>
       </template>
     </el-dialog>
   </div>
@@ -774,20 +853,21 @@ export default {
       });
     },
     hendleEdit(val, index) {
-      let params = {
-        id: this.cid,
-        theTime: this.mainForm.date,
-        mainId: this.mainForm.type,
-        mainName: this.mainForm.mainName,
-        remark: this.mainForm.remark,
-        type: 2,
-        retailOrderItemList: this.goodsList,
-        policyId: this.policyId,
-      };
-      editData(params).then((res) => {
-        this.$successMsg("编辑成功");
-        this.getDetail();
-      });
+      this.dialogVisible = false
+      // let params = {
+      //   id: this.cid,
+      //   theTime: this.mainForm.date,
+      //   mainId: this.mainForm.type,
+      //   mainName: this.mainForm.mainName,
+      //   remark: this.mainForm.remark,
+      //   type: 2,
+      //   retailOrderItemList: this.goodsList,
+      //   policyId: this.policyId,
+      // };
+      // editData(params).then((res) => {
+      //   this.$successMsg("编辑成功");
+      //   this.getDetail();
+      // });
     },
     //获取条件相对应的比列
     handleFactor(e) {
@@ -806,7 +886,7 @@ export default {
       if (this.screenForm.factorId) {
         this.getConditionList(this.policyConditionId, this.cusIndex + 1);
       } else {
-        this.$errorMsg("必须要条件");
+        this.getpolicyTypeList();
       }
     },
     // 获取某一个比例下的数据 ,查询popType 当前 this.cusIndex+1
@@ -996,7 +1076,6 @@ export default {
         type: "COMMONLY",
       }).then((res) => {
         this.xjWalletList = res.data;
-        console.log(res.data, "xxxxx");
       });
 
       getWalletList({
@@ -1004,7 +1083,6 @@ export default {
         type: "REBATE",
       }).then((res) => {
         this.flWalletList = res.data;
-        console.log(this.flWalletList, "xxccc");
       });
     },
 

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

@@ -21,7 +21,7 @@
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">订单日期</div>
-          <div class="value">{{detailData.theTime}}</div>
+          <div class="value">{{detailData.theTime | dateToDayFilter}}</div>
         </el-col>
         <el-col :span="8" class="item">
           <div class="label">单据状态</div>

+ 10 - 9
src/views/supply/retail/components/retail_form.vue

@@ -10,17 +10,18 @@
       <el-row :gutter="20">
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="订单号" prop="orderNum">
-            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" readonly></el-input>
+            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" disabled></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-date-picker
               v-model="mainForm.date"
+              disabled
               type="date"
               value-format="yyyy-MM-dd"
               style="width: 100%;"
-              placeholder="选择日期">
+              placeholder="系统自动生成">
             </el-date-picker>
           </el-form-item>
         </el-col>
@@ -33,12 +34,12 @@
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="经销商编码" prop="jxsNum">
-            <el-input v-model="mainForm.jxsNum" placeholder="请输入经销商编码" readonly></el-input>
+            <el-input v-model="mainForm.jxsNum" placeholder="请输入经销商编码" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="16">
           <el-form-item label="经销商名称" prop="jxsName">
-            <el-input v-model="mainForm.jxsName" placeholder="请输入经销商名称" readonly></el-input>
+            <el-input v-model="mainForm.jxsName" placeholder="请输入经销商名称" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="24" :lg="24">
@@ -291,9 +292,9 @@ export default {
         remark: '',
       },
       mainFormRules: {
-        date: [
-          { required: true, message: '请选择单据日期', trigger: 'change' }
-        ],
+        // date: [
+        //   { required: true, message: '请选择单据日期', trigger: 'change' }
+        // ],
         type: [
           { required: true, message: '请选择品类', trigger: 'change' }
         ],
@@ -364,7 +365,7 @@ export default {
       getDetail({id: this.listItem.id}).then(res => {
         let data = res.data;
         this.mainForm.orderNum = data.id;
-        this.mainForm.date = data.theTime;
+        this.mainForm.date = data.theTime.slice(0, 10);
         this.mainForm.type = data.mainId;
         this.mainForm.jxsNum = data.customerId;
         this.mainForm.jxsName = data.customerName;
@@ -624,7 +625,7 @@ export default {
 
           let mainName = this.typeList[findElem(this.typeList, 'dictCode', this.mainForm.type)].dictValue;
           let params = {
-            theTime: this.mainForm.date + ' 00:00:00',
+            // theTime: this.mainForm.date + ' 00:00:00',
             mainId: this.mainForm.type,
             mainName,
             remark: this.mainForm.remark,

+ 37 - 5
src/views/supply/retail/retail_list.vue

@@ -93,10 +93,13 @@
                 {{scope.row.isInvoicing ? '已开票':'未开票'}}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="订单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="订单日期" prop="theTime" min-width="100" show-overflow-tooltip>
+            <el-table-column align="center" label="订单号" prop="id" min-width="200" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="订单日期" prop="theTime" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
-                {{scope.row.theTime | dateToDayFilter}}
+                <div>
+                  <span>{{scope.row.theTime | dateToDayFilter}}</span>
+                  <el-button type="text" icon="el-icon-edit" style="padding: 0; margin-left: 6px" @click="editDate(scope.row)" ></el-button>
+                </div>
               </template>
             </el-table-column>
             <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
@@ -126,7 +129,7 @@
             <el-table-column align="center" label="制表日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="审核人" prop="examineName" min-width="100" show-overflow-tooltip></el-table-column>
             <el-table-column align="center" label="审核日期" prop="examineTime" min-width="160" show-overflow-tooltip></el-table-column>
-            <el-table-column align="center" label="操作" width="220" fixed="right">
+            <el-table-column align="center" label="操作" width="180" fixed="right">
               <template slot-scope="scope">
                 <el-button type="text" @click="toForm(scope.row)" v-if="$checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus === 'SAVE'">编辑</el-button>
                 <el-button type="text" @click="toExamine(scope.row)" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'WAIT'">审批</el-button>
@@ -157,6 +160,8 @@
         </div>
       </div>
     </div>
+
+    <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
     
     <RetailDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
     <RetailForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
@@ -167,11 +172,12 @@
 </template>
 
 <script>
-import { getList, closeData, submitData } from "@/api/supply/retail";
+import { getList, closeData, submitData, editData } from "@/api/supply/retail";
 import RetailDetail from "@/views/supply/retail/components/retail_detail";
 import RetailForm from "@/views/supply/retail/components/retail_form";
 import RetailExamine from "@/views/supply/retail/components/retail_examine";
 import RetailReturn from "@/views/supply/retail/components/retail_return";
+import EditDateDialog from "@/components/Common/edit-date-dialog";
 
 let that
 export default {
@@ -180,6 +186,7 @@ export default {
     RetailForm,
     RetailExamine,
     RetailReturn,
+    EditDateDialog,
   },
   filters: {
     statusFilter(val) {
@@ -216,6 +223,12 @@ export default {
       isShowForm: false,
       isShowExamine: false,
       isShowReturn: false,
+
+      editId: null,
+      isShowEditDateDialog: false,
+      dateForm: {
+        date: '',
+      },
     }
   },
 
@@ -346,6 +359,25 @@ export default {
         this.getList();
       })
     },
+
+    // 打开 修改订单日期
+    editDate(item) {
+      this.editId = item.id;
+      this.dateForm.date = item.theTime.slice(0, 10);
+      this.isShowEditDateDialog = true;
+    },
+
+    // 提交 修改订单日期
+    submitDateForm() {
+      editData({
+        id: this.editId,
+        theTime: this.dateForm.date + ' 00:00:00',
+      }).then(res => {
+        this.isShowEditDateDialog = false;
+        this.getList();
+        this.$successMsg('修改成功');
+      })
+    },
   }
 }
 </script>