695593266@qq.com 9 месяцев назад
Родитель
Сommit
71cff993e2
2 измененных файлов с 32 добавлено и 3 удалено
  1. 30 1
      src/views/productionPlan/components/unpackDialog.vue
  2. 2 2
      vue.config.js

+ 30 - 1
src/views/productionPlan/components/unpackDialog.vue

@@ -145,6 +145,7 @@
                 v-model="scope.row.reqMoldTime"
                 v-model="scope.row.reqMoldTime"
                 type="date"
                 type="date"
                 value-format="yyyy-MM-dd"
                 value-format="yyyy-MM-dd"
+                @change="changeDateTime(scope.row.reqMoldTime, scope.$index)"
               ></el-date-picker>
               ></el-date-picker>
             </el-form-item>
             </el-form-item>
           </template>
           </template>
@@ -284,6 +285,7 @@
       open(row) {
       open(row) {
         this.visible = true;
         this.visible = true;
         this.formData = deepClone(row);
         this.formData = deepClone(row);
+        this.formData.reqMoldTime = this.formData.reqMoldTime.split(' ')[0];
         if (this.formData.splitBatch == 1) {
         if (this.formData.splitBatch == 1) {
           this.columns[2].label = '剩余数量';
           this.columns[2].label = '剩余数量';
           this.requiredFormingNum = this.formData.splitResidue;
           this.requiredFormingNum = this.formData.splitResidue;
@@ -354,11 +356,38 @@
           joinPlanCode: this.formData.code,
           joinPlanCode: this.formData.code,
           batchNo: batchNo,
           batchNo: batchNo,
           requiredFormingNum: '',
           requiredFormingNum: '',
-          reqMoldTime: ''
+          reqMoldTime: this.formData.reqMoldTime
         });
         });
         this.custom_code = this.custom_code + 1;
         this.custom_code = this.custom_code + 1;
       },
       },
 
 
+      changeDateTime(val, index) {
+        const d1 = new Date(this.formData.reqMoldTime);
+        const d2 = new Date(val);
+
+        if (d1.getTime() < d2.getTime()) {
+          this.$confirm('所选的完成时间超过要求完成时间, 是否继续?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              // this.$message({
+              //   type: 'success',
+              //   message: '删除成功!'
+              // });
+            })
+            .catch(() => {
+              this.form.unpackList[index].reqMoldTime =
+                this.formData.reqMoldTime;
+              // this.$message({
+              //   type: 'info',
+              //   message: '已取消删除'
+              // });
+            });
+        }
+      },
+
       changeNum(index) {
       changeNum(index) {
         let num =
         let num =
           this.formData.splitBatch == 1
           this.formData.splitBatch == 1

+ 2 - 2
vue.config.js

@@ -38,8 +38,8 @@ module.exports = {
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.211:18086',
         // target: 'http://192.168.1.211:18086',
-        target: 'http://192.168.1.251:18186',
-        // target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.251:18186',
+        target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.116:18086',
 
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域