Prechádzať zdrojové kódy

Merge branch 'feature/列表日期可修改'

chenqilong 2 rokov pred
rodič
commit
e5750f1fd7

+ 2 - 1
src/components/Common/edit-date-dialog.vue

@@ -57,7 +57,8 @@ export default {
     submitDateForm() {
       this.$refs.dateForm.validate(valid => {
         if (valid) {
-          this.$parent.submitDateForm()
+          // this.$parent.submitDateForm()
+          this.$emit('submit')
         }
       })
     }

+ 25 - 2
src/views/supply/engin/commerce_list.vue

@@ -11,7 +11,7 @@
     :fieldBeansHook="fieldBeansHook"
     :operationColumnWidth="200"
   >
-    <!-- <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" /> -->
+    <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" @submit="submitDateForm" />
     <Popu v-if="isShowDetail || isShowForm || isShowExamine || isShowReturn">
       <CommerceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
       <CommerceForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
@@ -210,6 +210,28 @@ export default {
     exportList: v2EnginOrderTradeListExport,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
+      if (item.colName === 'order_date') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div class="dateClass">
+              <span>{row.orderDate}</span>
+              {this.$checkBtnRole('date', this.$route.meta.roles) &&
+              !this.isCustomer &&
+              row.examineStatus !== '保存' ? (
+                <el-button
+                  type="text"
+                  icon="el-icon-edit"
+                  style="padding: 0; margin-left: 6px"
+                  onClick={() => this.editDate(row)}
+                />
+              ) : (
+                ''
+              )}
+            </div>
+          )
+        }
+      }
+
       return defaultData
     },
     // 监听勾选变化
@@ -548,7 +570,8 @@ export default {
         orderDate: this.dateForm.date + ' 00:00:00'
       }).then(res => {
         this.isShowEditDateDialog = false
-        this.getList()
+        // this.getList()
+        this.$refs.pageRef.refreshList()
         this.$successMsg('修改成功')
       })
     }

+ 26 - 2
src/views/supply/engin/home_list.vue

@@ -35,7 +35,7 @@
         </div>
       </div>
     </div>
-    <!-- <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" /> -->
+    <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" @submit="submitDateForm" />
     <Popu v-if="isShowDetail || isShowForm || isShowExamine || isShowReturn">
       <HomeDetail v-if="isShowDetail" :list-item="queryItem" @backListFormDetail="backList" />
       <HomeForm v-if="isShowForm" :list-item="queryItem" @backListFormDetail="backList" />
@@ -344,6 +344,29 @@ export default {
     exportList: v2EnginOrderHomeListExport,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
+      // console.log(item)
+      if (item.colName === 'order_date') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div class="dateClass">
+              <span>{row.orderDate}</span>
+              {this.$checkBtnRole('date', this.$route.meta.roles) &&
+              !this.isCustomer &&
+              row.examineStatus !== '保存' ? (
+                <el-button
+                  type="text"
+                  icon="el-icon-edit"
+                  style="padding: 0; margin-left: 6px"
+                  onClick={() => this.editDate(row)}
+                />
+              ) : (
+                ''
+              )}
+            </div>
+          )
+        }
+      }
+
       return defaultData
     },
     // 监听勾选变化
@@ -738,7 +761,8 @@ export default {
         refEnginRecordNo: this.screenForm.loginNum
       }).then(res => {
         this.isShowEditDateDialog = false
-        this.getList()
+        // this.getList()
+        this.$refs.pageRef.refreshList()
         this.$successMsg('修改成功')
       })
     }

+ 22 - 2
src/views/supply/policy/policy_list.vue

@@ -10,7 +10,7 @@
     :tableAttributes="tableAttributes"
   >
     <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" @submit="submitExamineForm" />
-    <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" />
+    <EditDateDialog :is-show.sync="isShowEditDateDialog" :date-form.sync="dateForm" @submit="submitDateForm" />
 
     <Popu v-if="isShowDetail || isShowForm || isShowExamine || isShowReturn">
       <RetailDetail v-if="isShowDetail" :list-item="queryItem" @backListFormDetail="backList" />
@@ -176,6 +176,26 @@ export default {
     exportList: exportRetailListV2,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
+      if (item.colName === 'the_time') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div class="dateClass">
+              <span>{row.theTime}</span>
+              {this.$checkBtnRole('date', this.$route.meta.roles) ? (
+                <el-button
+                  type="text"
+                  icon="el-icon-edit"
+                  style="padding: 0; margin-left: 6px"
+                  onClick={() => this.editDate(row)}
+                />
+              ) : (
+                ''
+              )}
+            </div>
+          )
+        }
+      }
+
       return defaultData
     },
     // 监听勾选变化
@@ -207,7 +227,7 @@ export default {
               </el-popconfirm>
             ) : null}
             {row.examineStatus === statusData['SAVE'] && this.$checkBtnRole('edit', this.$route.meta.roles) ? (
-              <el-button type="text" onClick={()=>this.toForm(row)}>
+              <el-button type="text" onClick={() => this.toForm(row)}>
                 编辑
               </el-button>
             ) : null}

+ 21 - 2
src/views/supply/retail/retail_list.vue

@@ -7,10 +7,9 @@
     :optionsEvensGroup="optionsEvensGroup"
     :columnParsing="columnParsing"
     :operationColumnWidth="200"
-
   >
+    <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" @submit="submitDateForm" />
     <Popu v-if="isShowDetail || isShowForm || isShowExamine || isShowReturn">
-      <EditDateDialog :isShow.sync="isShowEditDateDialog" :dateForm.sync="dateForm" />
       <RetailDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
       <RetailForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
       <RetailExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
@@ -127,6 +126,26 @@ export default {
     exportList: exportRetaillListV2,
     // 表格列解析渲染数据更改
     columnParsing(item, defaultData) {
+      if (item.colName === 'the_time') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div class="dateClass">
+              <span>{row.theTime}</span>
+              {this.$checkBtnRole('date', this.$route.meta.roles) ? (
+                <el-button
+                  type="text"
+                  icon="el-icon-edit"
+                  style="padding: 0; margin-left: 6px"
+                  onClick={() => this.editDate(row)}
+                />
+              ) : (
+                ''
+              )}
+            </div>
+          )
+        }
+      }
+
       return defaultData
     },
     // 监听勾选变化