Browse Source

辅助选址默认数值设置

lkk 1 năm trước cách đây
mục cha
commit
3c457026d7
1 tập tin đã thay đổi với 26 bổ sung19 xóa
  1. 26 19
      src/views/siteselection/components/fzxz.vue

+ 26 - 19
src/views/siteselection/components/fzxz.vue

@@ -86,9 +86,9 @@
           <el-checkbox v-model="ruleForm.useLandType">
             是否与控规用地性质一致</el-checkbox
           >
-          <el-checkbox v-model="ruleForm.useMultiple"
+          <!-- <el-checkbox v-model="ruleForm.useMultiple"
             >是否允许选出多个分散地块。</el-checkbox
-          >
+          > -->
           <div v-if="ruleForm.useMultiple">
             请输入地块间最大距离
             <el-input
@@ -119,12 +119,9 @@
           </template>
         </el-table-column>
 
-        <el-table-column
-          label="约束值(m/°)"
-          show-overflow-tooltip
-        >
-        <template slot-scope="scope">
-            <span>{{scope.row.conditionInfo.defaultValue }}</span>
+        <el-table-column label="约束值(m/°)" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <span>{{ scope.row.conditionInfo.defaultValue }}</span>
           </template>
         </el-table-column>
       </el-table>
@@ -162,10 +159,10 @@ export default {
       checkbox_data: 0,
       ruleForm: {
         xzmj: 0,
-        xmmc: "",
-        jsdw: "",
+        xmmc: "规划选址项目_" + this.getCurrentDateTime(),
+        jsdw: "建设单位",
         // xmlx: "",
-        ydlx: "",
+        ydlx: ["07", "0701"],//默认为城镇住宅用地
         ydmjbegin: "", //用地面积开始
         ydmjend: "", //用地面积结束
         sjy: "", //数据源
@@ -180,7 +177,7 @@ export default {
           { required: true, message: "请输入项目名称", trigger: "blur" },
           { min: 3, max: 10, message: "长度在 3 到 5 个字符", trigger: "blur" },
         ],
-        jsdw: [{ required: true, message: "请输入建设单位", trigger: "blur" }],
+        // jsdw: [{ required: true, message: "请输入建设单位", trigger: "blur" }],
         // xmlx: [{ required: true, message: "请输入项目类型", trigger: "blur" }],
         ydlx: [{ required: true, message: "请输入用地类型", trigger: "blur" }],
         ydmjbegin: [
@@ -198,7 +195,7 @@ export default {
       value: [],
       cascaderOptions: [], //用地性质数据存储数组
       sjyBSM: "",
-      ydlxBSM: "",
+      ydlxBSM: "0701",
       checkList: [
         {
           key: "是否与控规用地性质一致",
@@ -243,6 +240,19 @@ export default {
     });
   },
   methods: {
+    getCurrentDateTime() {
+      const now = new Date();
+      const year = now.getFullYear();
+      const month = this.padNumber(now.getMonth() + 1); // 月份是从0开始的
+      const day = this.padNumber(now.getDate());
+      const hours = this.padNumber(now.getHours());
+      const minutes = this.padNumber(now.getMinutes());
+      const seconds = this.padNumber(now.getSeconds());
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+    },
+    padNumber(num) {
+      return num < 10 ? "0" + num : num;
+    },
     changeCheckBox(val) {
       console.log(val, "杰卡斯到货时间啊肯定会刷卡机很大");
       if (val.value == 1) {
@@ -299,12 +309,10 @@ export default {
       // }
     },
     handleChange2(value) {
-      // console.log(value);
       // const obj = this.$refs['Cascader'].getCheckedNodes()
       this.sjyBSM = value;
     },
     submitData() {
-      console.log(this.ruleForm, "this.ruleForm");
       //更新范围
       var _temp = this.$refs.range.getRange();
       // this.ruleForm.xzfw = _temp.xzfw;
@@ -327,7 +335,6 @@ export default {
             useLandType: this.ruleForm.useLandType, //是否与控规用地性质一致
             multipleDistance: this.ruleForm.multipleDistance, //多地块最大距离
           };
-          // console.log(obj, "objobj");
           AddFzxz(obj).then((res) => {
             const loading = this.$loading({
               lock: true,
@@ -355,10 +362,10 @@ export default {
     },
     reset() {
       (this.ruleForm = {
-        xmmc: "",
-        jsdw: "",
+        xmmc: "规划选址项目_" + this.getCurrentDateTime(),
+        jsdw: "建设单位",
         // xmlx: "",
-        ydlx: "",
+        ydlx: ["07", "0701"],
         ydmjbegin: "", //用地面积开始
         ydmjend: "", //用地面积结束
         sjy: this.options[0].sjymc, //数据源