Bläddra i källkod

feat: 一键延期

zh 2 år sedan
förälder
incheckning
d3dee28312
1 ändrade filer med 36 tillägg och 1 borttagningar
  1. 36 1
      src/views/sales_policy/components/delayRecordForm.vue

+ 36 - 1
src/views/sales_policy/components/delayRecordForm.vue

@@ -3,6 +3,7 @@
     <div>
       <h4>政策延期</h4>
       <el-divider />
+      <el-button class="btn" type="primary" size="mini" @click="delayVisible = true">一键延期</el-button>
       <zj-table
         :table-attributes="tableAttributes"
         :is-drop="true"
@@ -14,6 +15,28 @@
       <el-button type="primary" size="mini" @click="onClose">取消</el-button>
       <el-button type="primary" size="mini" @click="onSubmit">确定</el-button>
     </div>
+    <el-dialog
+      title="延期日期"
+      :visible.sync="delayVisible"
+      width="30%"
+      :append-to-body="true"
+      :close-on-click-modal="false"
+      :before-close="handleClose"
+    >
+      <el-date-picker
+        v-model="delayTime"
+        style="width:100%"
+        type="datetime"
+        size="mini"
+        default-time="00:00:00"
+        value-format="yyyy-MM-dd HH:mm:ss"
+        placeholder="选择日期"
+      />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="delayVisible = false">取 消</el-button>
+        <el-button type="primary" @click="handleOneTouch">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -28,6 +51,8 @@ export default {
   },
   data() {
     return {
+      delayTime: null,
+      delayVisible: false,
       tableData: [],
       tableAttributes: {}
     }
@@ -153,12 +178,22 @@ export default {
     },
     onClose() {
       this.$emit('close')
+    },
+    handleOneTouch() {
+      this.tableData.forEach(k => {
+        k.date = this.delayTime
+      })
+      this.delayTime = null
+      this.delayVisible = false
     }
   }
 }
 </script>
 
   <style lang="scss" scoped>
-
+.btn{
+  float:right;
+  margin-bottom: 20px;
+}
   </style>