javababay пре 2 година
родитељ
комит
b788fdbced

+ 182 - 50
src/views/energyOperationSupport/components/MaintenanceStopService/MaintenanceApplication.vue

@@ -10,22 +10,17 @@
           label-width="100px"
         >
           <el-row>
-            <el-col :span="7">
+            <el-col :span="5">
               <el-form-item label="申报日期">
-                <el-date-picker
+                <zj-timegran-date
                   v-model="filterForm.data.declaretime"
-                  value-format="yyyy-MM-dd"
-                  format="yyyy-MM-dd"
-                  :formatter="declaretime"
-                  type="daterange"
-                  range-separator="至"
-                  start-placeholder="开始日期"
-                  end-placeholder="结束日期"
-                  size="mini"
-                  unlink-panels
-                  :picker-options="pickerOptions"
-                >
-                </el-date-picker>
+                  style="width: 100%"
+                  :type="'daterange'"   
+                  :timegranId="filterForm.data.timegranid"
+                  :oneFoo="getselect"
+                  :defaultOffset="-1"
+                  :custom="1"
+                ></zj-timegran-date>
               </el-form-item>
             </el-col>
             <el-col :span="4">
@@ -94,8 +89,7 @@
             type="primary"
             size="mini"
             icon="el-icon-plus"
-            v-privilege="activeMenu + 'ADD'"
-            @click="but_add"
+            @click="datasavedioing()"
             >检修申请</el-button
           >
           <!--           <el-button
@@ -547,6 +541,157 @@
         >
       </span>
     </el-dialog>
+    <el-dialog
+      :title="'检修停复役申请单新增'"
+      :visible.sync="dialog.editorBox.shownew"
+      width="940px"
+      :close-on-click-modal="false"
+      :show-close="!loading"
+    >
+      <div>
+        <el-form
+          ref="dialog_form"
+          :model="dialog.editorBox.form.data"
+          :rules="dialog.editorBox.form.rules"
+          size="mini"
+          label-width="120px"
+        >
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="申报日期" prop="declaretime">
+                <el-date-picker
+                  v-model="dialog.editorBox.form.data.declaretime"
+                  type="date"
+                  placeholder="选择日期"
+                  value-format="yyyy-MM-dd"
+                  format="yyyy-MM-dd"
+                  :formatter="declaretime"
+                  style="width: 100%"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="申请负责人" prop="chargeman">
+                <el-input
+                  clearable
+                  v-model="dialog.editorBox.form.data.chargeman"
+                  placeholder=""
+                  style="width: 100%"
+                  disabled
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="检修类型" prop="equipmentname">
+                <el-select
+                  clearable
+                  v-model="dialog.editorBox.form.data.equipmentname"
+                  placeholder=""
+                  style="width: 100%"
+                >
+                  <el-option
+                    v-for="item of nameObj.equipmentname.arr"
+                    :key="item.id"
+                    :value="item.id"
+                    :label="item.name"
+                  >
+                  </el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="设备名称">
+                  <el-input
+                  clearable
+                  v-model="dialog.editorBox.form.data.devicename"
+                  placeholder=""
+                  style="width: 100%"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="设备分类">
+                 <el-input
+                  clearable
+                  v-model="dialog.editorBox.form.data.equipment"
+                  placeholder=""
+                  style="width: 100%"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="施工单位" prop="constructionunits">
+                <el-input
+                  clearable
+                  v-model="dialog.editorBox.form.data.constructionunits"
+                  placeholder=""
+                  style="width: 100%"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="施工人数" prop="construpeople">
+                <el-input
+                  type="number"
+                  οninput="value=value.replace(/[^0-9]/g,'')"
+                  clearable
+                  v-model="dialog.editorBox.form.data.construpeople"
+                  placeholder=""
+                  style="width: 100%"
+                ></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-container>
+            <el-main style="padding: 0">
+              <el-form-item label="申请内容" prop="reasoncontent">
+                <el-input
+                  clearable
+                  class="nr-textarea"
+                  type="textarea"
+                  v-model="dialog.editorBox.form.data.reasoncontent"
+                  placeholder=""
+                  style="width: 100%"
+                ></el-input>
+              </el-form-item>
+            </el-main>
+            <el-aside width="200px" style="padding-left: 15px">
+              <el-upload
+                class="upload-demo"
+                action=""
+                :on-change="fileRemoveHandle4"
+                multiple
+                :limit="5"
+                :file-list="fileList"
+                :auto-upload="false"
+              >
+                <el-button size="small" type="primary">点击上传</el-button>
+              </el-upload>
+            </el-aside>
+          </el-container>
+          <el-form-item label="备注" prop="bz">
+            <el-input
+              clearable
+              type="textarea"
+              v-model="dialog.editorBox.form.data.bz"
+              placeholder=""
+              style="width: 100%"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialog.editorBox.shownew = false" :loading="loading"
+          >取 消</el-button
+        >
+        <el-button type="primary" @click="dataSave()">保 存</el-button>
+      </span>
+    </el-dialog>
     <el-dialog
       :title="'文件下载列表'"
       :visible.sync="dialog.editorBox.showtype"
@@ -616,10 +761,12 @@
 import fileUploadBox from "~/components/zg/fileUploadBox.vue";
 import { formatDate } from "@/utils/util.js";
 import store from "@/store/index.js";
+import timegranDate from "~/components/zg/timegranDate.vue";
 export default {
   name: "MaintenanceApplication",
   components: {
     "zj-fileUploadBox": fileUploadBox,
+    "zj-timegran-date": timegranDate,
   },
   data() {
     return {
@@ -631,37 +778,6 @@ export default {
       declaretime: "",
       leixin: "add",
       multipleSelection: [],
-      pickerOptions: {
-        shortcuts: [
-          {
-            text: "最近一周",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-          {
-            text: "最近一个月",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-          {
-            text: "最近三个月",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-        ],
-      },
       store,
       userInfo: {
         data: null,
@@ -769,6 +885,7 @@ export default {
         editorBox: {
           show: false,
           showtype: false,
+          shownew: false,
           type: "",
           form: {
             data: {
@@ -838,16 +955,31 @@ export default {
     that.store.dispatch("getUserInfo").then((res) => {
       that.userInfo.data = res.data;
     });
-        // 接收路由参数
+    // 接收路由参数
     if (that.$route.query.applayer) {
       that.filterForm.data.applayer = that.$route.query.applayer;
     }
     that.getselect();
     that.getNodeData();
     that.getNodeDataa();
-
   },
   methods: {
+    datasavedioing() {
+      let that = this;
+      that.dialog.editorBox.shownew = true;
+      that.fileList = [];
+      for (let key in that.dialog.editorBox.form.data) {
+        that.dialog.editorBox.form.data[key] = "";
+      }
+      let nowDate = formatDate(new Date(), "yyyy-MM-dd");
+      that.dialog.editorBox.form.data.signtime = nowDate;
+      that.dialog.editorBox.form.data.chargetime = nowDate;
+      that.dialog.editorBox.form.data.declaretime = nowDate;
+      that.dialog.editorBox.form.data.chargeman = that.userInfo.data.userName;
+      setTimeout(() => {
+        that.$refs["dialog_form"].clearValidate();
+      }, 100);
+    },
     // 附件删除
     delFilevalue(row) {
       let that = this;
@@ -1446,7 +1578,7 @@ export default {
                   type: "success",
                 });
                 that.getselect();
-                that.dialog.editorBox.show = false;
+                that.dialog.editorBox.shownew = false;
               } else {
                 that.$message.error(res.message);
               }

+ 12 - 14
src/views/energyOperationSupport/components/MaintenanceStopService/approval.vue

@@ -10,21 +10,17 @@
           label-width="85px"
         >
           <el-row>
-            <el-col :span="7">
-              <el-form-item label="申报日期">
-                <el-date-picker
+            <el-col :span="5">
+                  <el-form-item label="申报日期">
+                <zj-timegran-date
                   v-model="filterForm.data.declaretime"
-                  value-format="yyyy-MM-dd"
-                  format="yyyy-MM-dd"
-                  :formatter="declaretime"
-                  type="daterange"
-                  range-separator="至"
-                  start-placeholder="开始日期"
-                  end-placeholder="结束日期"
-                  unlink-panels
-                  :picker-options="pickerOptions"
-                >
-                </el-date-picker>
+                  style="width: 100%"
+                  :type="'daterange'"
+                  :timegranId="filterForm.data.timegranid"
+                  :oneFoo="getselect"
+                  :defaultOffset="-1"
+                  :custom="1"
+                ></zj-timegran-date>
               </el-form-item>
             </el-col>
             <el-col :span="4">
@@ -548,12 +544,14 @@
 
 <script>
 import fileUploadBox from "~/components/zg/fileUploadBox.vue";
+import timegranDate from "~/components/zg/timegranDate.vue";
 import { formatDate } from "@/utils/util.js";
 import store from "@/store/index.js";
 export default {
   name: "MaintenanceApplication",
   components: {
     "zj-fileUploadBox": fileUploadBox,
+    "zj-timegran-date": timegranDate,
   },
   data() {
     return {

+ 69 - 59
src/views/energyOperationSupport/components/MaintenanceStopService/submitted.vue

@@ -10,22 +10,17 @@
           label-width="85px"
         >
           <el-row>
-            <el-col :span="7">
+            <el-col :span="5">
               <el-form-item label="申报日期">
-                <el-date-picker
+                <zj-timegran-date
                   v-model="filterForm.data.declaretime"
-                  value-format="yyyy-MM-dd"
-                  format="yyyy-MM-dd"
-                  :formatter="declaretime"
-                  type="daterange"
-                  range-separator="至"
-                  start-placeholder="开始日期"
-                  end-placeholder="结束日期"
-                  size="mini"
-                  unlink-panels
-                  :picker-options="pickerOptions"
-                >
-                </el-date-picker>
+                  style="width: 100%"
+                  :type="'daterange'"
+                  :timegranId="filterForm.data.timegranid"
+                  :oneFoo="getselect"
+                  :defaultOffset="-1"
+                  :custom="1"
+                ></zj-timegran-date>
               </el-form-item>
             </el-col>
             <el-col :span="4">
@@ -224,7 +219,7 @@
             min-width="100px"
             :show-overflow-tooltip="true"
           ></el-table-column>
-             <el-table-column
+          <el-table-column
             sortable
             prop="filename"
             label="附件"
@@ -369,7 +364,7 @@
             min-width="100px"
             :show-overflow-tooltip="true"
           ></el-table-column>
-             <el-table-column
+          <el-table-column
             sortable
             prop="filename"
             label="附件"
@@ -451,7 +446,7 @@
           <el-table-column
             sortable
             prop="bz"
-            label="报工人"
+            label="记录人"
             min-width="100px"
             :show-overflow-tooltip="true"
           ></el-table-column>
@@ -476,14 +471,14 @@
             min-width="100px"
             :show-overflow-tooltip="true"
           ></el-table-column>
-           <el-table-column
+          <el-table-column
             sortable
             prop="construfile"
             label="报工附件"
             min-width="100px"
             :show-overflow-tooltip="true"
           ></el-table-column>
-          
+
           <el-table-column
             class-name="gn-TableDownloadExcel-none"
             label="操作"
@@ -503,7 +498,7 @@
                   type="primary"
                   size="mini"
                   @click="but_delect(scope.row)"
-                  >撤销</el-button
+                  >删除</el-button
                 >
                 <el-button
                   size="mini"
@@ -605,7 +600,7 @@
               <el-col :span="8">
                 <el-form-item label="报工日期">
                   <el-date-picker
-                    v-model="filterForm.dataa.signtime"
+                    v-model="dialog.editorBox.form.dataa.signtime"
                     type="date"
                     placeholder="选择日期"
                     value-format="yyyy-MM-dd"
@@ -665,7 +660,7 @@
         </el-form>
       </div>
       <span slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="construdataSave()">提交</el-button>
+        <el-button type="primary" @click="test()">提交</el-button>
         <el-button type="primary" @click="reject()">取消</el-button>
       </span>
     </el-dialog>
@@ -839,7 +834,7 @@
               <el-form-item label="报工日期" prop="signtime">
                 <el-input
                   clearable
-                  v-model="dialog.editorBox.form.data.signtime"
+                  v-model="dialog.editorBox.form.dataa.signtime"
                   placeholder=""
                   style="width: 100%"
                   disabled
@@ -847,7 +842,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="报工人员" prop="bz">
+              <el-form-item label="记录人员" prop="bz">
                 <el-input
                   clearable
                   v-model="dialog.editorBox.form.dataa.bz"
@@ -1086,20 +1081,34 @@
         >
       </span>
     </el-dialog>
+    <el-dialog
+      title="提示"
+      :visible.sync="dialog.editorBox.datetype"
+      width="30%"
+    >
+      <span>该数据已存在是否继续提报</span>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialog.editorBox.datetype = false">取 消</el-button>
+        <el-button type="primary" @click="construdataSave()">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
 import fileUploadBox from "~/components/zg/fileUploadBox.vue";
+import timegranDate from "~/components/zg/timegranDate.vue";
 import { formatDate } from "@/utils/util.js";
 import store from "@/store/index.js";
 export default {
   name: "MaintenanceApplication",
   components: {
     "zj-fileUploadBox": fileUploadBox,
+    "zj-timegran-date": timegranDate,
   },
   data() {
     return {
+      valuebl:false,
       signtime: "",
       tableDatavalue: [],
       fileList: [],
@@ -1108,37 +1117,6 @@ export default {
       declaretime: "",
       leixin: "add",
       multipleSelection: [],
-      pickerOptions: {
-        shortcuts: [
-          {
-            text: "最近一周",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-          {
-            text: "最近一个月",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-          {
-            text: "最近三个月",
-            onClick(picker) {
-              const end = new Date();
-              const start = new Date();
-              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
-              picker.$emit("pick", [start, end]);
-            },
-          },
-        ],
-      },
       store,
       userInfo: {
         data: null,
@@ -1163,7 +1141,7 @@ export default {
           billstatus: "", //审核状态
           equipmentname: "", //检修类型
           chargeman: "", //申请人
-          applayer: "" ,//申请单位
+          applayer: "", //申请单位
           reasoncontent: "", //申请内容
           bz: "", //备注
           signtime: "", //审批时间
@@ -1269,6 +1247,7 @@ export default {
       },
       dialog: {
         editorBox: {
+          datetype: false,
           showtypea: false,
           showtype: false,
           show: false,
@@ -1360,9 +1339,34 @@ export default {
       that.filterForm.data.applayer = that.$route.query.applayer;
     }
     that.getselect();
-
   },
   methods: {
+    test() {
+      let that = this;
+      let arr = that.tableDataa;
+      let a = 0;
+      let newdate = that.dialog.editorBox.form.dataa.signtime;
+      for (let i = 0; i < arr.length; i++) {
+        if (newdate === arr[i].signtime) {
+           a += 1;
+        }
+      }
+      if (a===  0) {
+        that
+          .$confirm("是否保存?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+          .then(() => {
+            that.construdataSave();
+            a=0;
+          })
+          .catch(() => {});
+      }else{
+          that.dialog.editorBox.datetype = true;
+      }
+    },
     reject() {
       this.dialog.editorBox.show = false;
     },
@@ -1827,7 +1831,7 @@ export default {
         equipment: that.dialog.editorBox.form.data.equipment,
         constructionunits: that.dialog.editorBox.form.data.constructionunits,
         construpeople: that.dialog.editorBox.form.data.construpeople,
-        signtime: that.filterForm.dataa.signtime,
+        signtime: that.dialog.editorBox.form.dataa.signtime,
         construcontent: that.dialog.editorBox.form.dataa.construcontent,
         bz: that.dialog.editorBox.form.dataa.bz,
         devicename: that.dialog.editorBox.form.data.devicename,
@@ -1872,6 +1876,7 @@ export default {
               } else {
                 that.$message.error(res.message);
               }
+              that.dialog.editorBox.datetype = false;
               that.getselect1();
               that.fileList = [];
               that.loading = false;
@@ -1972,6 +1977,12 @@ export default {
       that.dialog.editorBox.show = true;
       (that.fileList = []),
         (that.dialog.editorBox.form.dataa.bz = that.userInfo.data.userName);
+      let nowDate = formatDate(new Date(), "yyyy-MM-dd");
+      that.dialog.editorBox.form.dataa.signtime = nowDate;
+      that.dialog.editorBox.form.data.signtime = nowDate;
+      setTimeout(() => {
+        that.$refs["dialog_form"].clearValidate();
+      }, 100);
       for (let key in that.dialog.editorBox.form.data) {
         if (typeof row[key] !== "undefined") {
           that.dialog.editorBox.form.data[key] = row[key];
@@ -1993,7 +2004,6 @@ export default {
         }
       }
       if (row.construfile) {
-        console.log("在这里");
         let fn = (row.construfile + "").trim().split(";");
         if (fn && fn.length > 0) {
           let construid = row.construid;