Blame view

src/views/djbworkflow/djbBook/spyj.vue 8.97 KB
xiaomiao committed
1 2 3 4 5 6
<!--
 * @Description: 审批意见
 * @Autor: renchao
 * @LastEditTime: 2023-05-17 10:41:24
-->
<template>
xiaomiao committed
7
  <div class="spyj loadingtext">
xiaomiao committed
8
    <div class="box">
xiaomiao committed
9
      <div class="spyj_title">
xiaomiao committed
10
        <div class="righttitle">审批表</div>
xiaomiao committed
11 12
      </div>

xiaomiao committed
13
      <div v-for="(item, index) in tableData" :key="index">
xiaomiao committed
14 15 16
        <el-form
          :model="tableData[index]"
          label-width="120px"
xiaomiao committed
17
          ref="ruleFormRef'"
xiaomiao committed
18 19 20 21 22 23 24 25
        >
          <div class="spyj_form">
            <div class="item_left">
              <div class="right">{{ item.jdmc }}意见</div>
            </div>
            <div class="item_right">
              <el-row>
                <el-col :span="24">
xiaomiao committed
26
                  <el-form-item label-width="0" class="opinion_item">
xiaomiao committed
27
                    <el-input
xiaomiao committed
28
                      :disabled="!ableOperation"
xiaomiao committed
29 30 31 32 33 34
                      type="textarea"
                      :rows="4"
                      class="opinion"
                      placeholder="请输入审批意见"
                      v-model="item.shyj"
                    ></el-input>
xiaomiao committed
35 36 37 38 39 40
                    <el-button
                      class="opinion_btn"
                      @click="commonOpinion(index)"
                      v-if="ableOperation"
                      >常用意见</el-button
                    >
xiaomiao committed
41 42 43 44 45
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="16">
xiaomiao committed
46 47
                  <el-form-item label="审查人">
                    <el-input
xiaomiao committed
48
                      maxlength="20"
xiaomiao committed
49
                      :disabled="!ableOperation"
xiaomiao committed
50 51
                      v-model="item.shryxm"
                    ></el-input>
xiaomiao committed
52 53 54
                  </el-form-item>
                </el-col>
                <el-col :span="8">
xiaomiao committed
55
                  <el-form-item class="sjxzq" label="审核时间">
xiaomiao committed
56
                    <el-date-picker
xiaomiao committed
57
                      :disabled="!ableOperation"
xiaomiao committed
58
                      v-model="item.shkssj"
xiaomiao committed
59
                      type="date"
xiaomiao committed
60 61 62
                      placeholder="选择日期"
                      value-format="yyyy-MM-dd HH:mm:ss"
                      format="yyyy-MM-dd"
xiaomiao committed
63 64 65 66 67 68
                    >
                    </el-date-picker>
                  </el-form-item>
                </el-col>
              </el-row>
            </div>
xiaomiao committed
69
          </div>
xiaomiao committed
70 71
        </el-form>
      </div>
xiaomiao committed
72
      <div class="submit_button" v-if="ableOperation">
xiaomiao committed
73
        <el-button type="primary" @click="onSubmit()">保存</el-button>
xiaomiao committed
74
      </div>
xiaomiao committed
75
    </div>
xiaomiao committed
76
    <!-- <el-empty v-if="isNoData" description="暂无数据"></el-empty> -->
xiaomiao committed
77 78 79
  </div>
</template>
<script>
xiaomiao committed
80
import { addidea, getShList } from "@/api/djbRepair.js";
xiaomiao committed
81 82 83 84 85 86 87 88
import { mapGetters } from "vuex";
export default {
  computed: {
    ...mapGetters(["userData", "yjsqOptions"]),
  },
  data() {
    return {
      isNoData: false,
xiaomiao committed
89
      currentindex: 0,
xiaomiao committed
90
      ableOperation: false,
xiaomiao committed
91 92 93
      tableData: [{ jdmc: "初审" }, { jdmc: "复审" }, { jdmc: "核定" }],
      falg: false,
      falg1: false,
xiaomiao committed
94
      monitor:true
xiaomiao committed
95 96 97
    };
  },

xiaomiao committed
98 99 100
  watch: {
    yjsqOptions: {
      handler(val) {
xiaomiao committed
101
        if(this.monitor){
xiaomiao committed
102
          this.add("");
xiaomiao committed
103 104 105 106
          this.monitor=false
        }else{
          this.add(val);
        }
xiaomiao committed
107
      },
xiaomiao committed
108 109
      deep: true,
      immediate: true,
xiaomiao committed
110
    },
xiaomiao committed
111
  },
xiaomiao committed
112
  created() {},
xiaomiao committed
113
  mounted() {
xiaomiao committed
114
    this.ableOperation = this.$parent.ableOperation;
xiaomiao committed
115 116
    this.getShList();
  },
xiaomiao committed
117
  methods: {
xiaomiao committed
118
  /**
yuanbo committed
119
     * @description: getShList
xiaomiao committed
120 121 122
     * @param {*} obj
     * @author: renchao
     */
xiaomiao committed
123 124 125 126 127 128 129 130 131 132 133 134 135 136
    getShList() {
      this.$startLoading();
      var formdata = {
        bsmRepair: this.$parent.bsmRepair,
      };
      getShList(formdata).then((res) => {
        this.$endLoading();
        if (res.code === 200 && res.result) {
          if (res.result.length) {
            this.tableData = res.result;
          }
        }
      });
    },
yuanbo committed
137 138 139 140 141
    /**
     * @description: judgment
     * @param {*} obj
     * @author: renchao
     */
xiaomiao committed
142
    judgment(obj) {},
yuanbo committed
143 144 145 146
    /**
     * @description: onSubmit
     * @author: renchao
     */
xiaomiao committed
147 148 149 150 151 152 153 154 155 156 157 158 159
    onSubmit() {
      if (
        this.tableData[2].shyj == null ||
        this.tableData[2].shryxm == null ||
        this.tableData[2].shkssj == null ||
        this.tableData[2].shyj == "" ||
        this.tableData[2].shryxm == "" ||
        this.tableData[2].shkssj == ""
      ) {
        this.falg = false;
        this.$message.error("请完善核定意见信息填写");
      } else {
        this.falg = true;
xiaomiao committed
160 161 162
        if (this.tableData[0].shyj != null && this.tableData[0].shyj != ""||
            this.tableData[0].shryxm != null && this.tableData[0].shryxm != ""||
            this.tableData[0].shkssj != null && this.tableData[0].shkssj != "") {
xiaomiao committed
163
          if (
xiaomiao committed
164 165
            this.tableData[0].shyj == null ||
            this.tableData[0].shyj == ""||
xiaomiao committed
166 167 168 169 170 171 172 173 174
            this.tableData[0].shryxm == null ||
            this.tableData[0].shryxm == "" ||
            this.tableData[0].shkssj == null ||
            this.tableData[0].shkssj == ""
          ) {
            this.$message.error("请完善初审意见信息填写");
            this.falg = false;
          } else {
            this.falg = true;
xiaomiao committed
175
          }
xiaomiao committed
176 177 178
        } else {
          this.falg = true;
        }
xiaomiao committed
179 180 181
         if (this.tableData[1].shyj != null && this.tableData[1].shyj != ""||
            this.tableData[1].shryxm != null && this.tableData[1].shryxm != ""||
            this.tableData[1].shkssj != null && this.tableData[1].shkssj != "") {
xiaomiao committed
182
          if (
xiaomiao committed
183 184
            this.tableData[1].shyj == null ||
            this.tableData[1].shyj == ""||
xiaomiao committed
185 186 187 188 189 190 191 192 193 194 195 196 197
            this.tableData[1].shryxm == null ||
            this.tableData[1].shryxm == "" ||
            this.tableData[1].shkssj == null ||
            this.tableData[1].shkssj == ""
          ) {
            this.$message.error("请完善复审意见信息填写");
            this.falg1 = false;
          } else {
            this.falg1 = true;
          }
        } else {
          this.falg1 = true;
        }
xiaomiao committed
198
      }
xiaomiao committed
199 200

      if (this.falg && this.falg1) {
xiaomiao committed
201 202 203 204 205 206 207 208 209 210 211
        this.tableData.forEach((item, index) => {
          item["bsmBusiness"] = this.$parent.bsmRepair;
        }),
          addidea(this.tableData).then((res) => {
            if (res.code === 200) {
              this.$message.success("保存成功");
              this.refresh += 1;
            } else {
              this.$message.error(res.message);
            }
          });
xiaomiao committed
212
      } else {
xiaomiao committed
213
        return false;
xiaomiao committed
214
      }
xiaomiao committed
215
    },
xiaomiao committed
216
    //打开常用意见列表弹窗
yuanbo committed
217 218 219 220 221
    /**
     * @description: 打开常用意见列表弹窗
     * @param {*} index
     * @author: renchao
     */
xiaomiao committed
222 223 224 225 226 227 228 229 230 231
    commonOpinion(index) {
      this.currentindex = index;
      this.$popupDialog(
        "常用意见",
        "workflow/components/dialog/commonOpinion",
        {},
        "70%",
        true
      );
    },
yuanbo committed
232 233 234 235 236
    /**
     * @description: add
     * @param {*} val
     * @author: renchao
     */
xiaomiao committed
237 238 239
    add(val) {
      if (val != "") {
        this.$set(this.tableData[this.currentindex], "shyj", val);
xiaomiao committed
240
      }
xiaomiao committed
241
    },
xiaomiao committed
242 243
  },
};
xiaomiao committed
244
</script>
xiaomiao committed
245 246
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
xiaomiao committed
247

xiaomiao committed
248 249 250 251 252 253 254
.spyj {
  width: 100%;
  height: 100%;
  background-color: #f5f5f5;
  padding: 5px;
  .box {
    overflow-x: auto;
xiaomiao committed
255
    width: 100%;
xiaomiao committed
256 257 258 259 260 261 262
    height: 95%;
    background: #fff;
    text-align: center;
    padding: 4px;
    overflow-y: scroll;
    padding-top: 20px;
    padding: 20px 40px;
xiaomiao committed
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
    .spyj_title {
      width: 100%;
      height: 80px;
      border: 1px solid $borderColor;
      background-color: #eceef2;
      display: flex;
    }
    .leftadd {
      width: 3%;
      height: 100%;
      display: flex;
      font-size: 14px;
      text-indent: 20px;
      align-items: center;
      border: 1px solid $borderColor;
    }
    .righttitle {
      width: 80%;
      height: 100%;
      line-height: 80px;
      border: 1px solid $borderColor;
xiaomiao committed
284
      margin: auto;
xiaomiao committed
285 286
      font-size: 22px;
      font-weight: 400;
xiaomiao committed
287
    }
xiaomiao committed
288
  }
xiaomiao committed
289

xiaomiao committed
290 291 292
  /deep/.el-form-item {
    margin-bottom: 0;
  }
xiaomiao committed
293

xiaomiao committed
294 295 296 297 298 299 300
  .bottom10 {
    margin-bottom: 15px;
  }

  .spyj_form {
    display: flex;
    border: 1px solid $borderColor;
xiaomiao committed
301

xiaomiao committed
302 303 304 305
    .item_left {
      width: 150px;
      background-color: #f8f8fa;
      color: #606266;
xiaomiao committed
306
      display: flex;
xiaomiao committed
307
      font-size: 14px;
xiaomiao committed
308
      text-indent: 50px;
xiaomiao committed
309 310 311 312 313 314 315
      align-items: center;
      border-right: 1px solid $borderColor;
    }

    .item_right {
      flex: 1;
      width: 100%;
xiaomiao committed
316

xiaomiao committed
317
      /deep/.el-form-item__label {
xiaomiao committed
318 319
        background-color: #f8f8fa;
      }
xiaomiao committed
320 321 322 323 324 325 326 327
      /deep/.el-form-item__content {
        display: block;
        text-align: left;
      }
      .opinion_item {
        /deep/.el-form-item__error {
          margin-top: -16px !important;
          left: 3px;
xiaomiao committed
328 329
        }

xiaomiao committed
330 331
        border-bottom: 1px solid $borderColor;
      }
xiaomiao committed
332

xiaomiao committed
333 334 335
      .opinion {
        position: relative;
        font-size: 14px;
xiaomiao committed
336

xiaomiao committed
337 338
        /deep/.el-textarea__inner {
          border: none;
xiaomiao committed
339
        }
xiaomiao committed
340
      }
xiaomiao committed
341

xiaomiao committed
342 343 344 345
      .opinion_btn {
        position: absolute;
        right: 15px;
        bottom: 10px;
xiaomiao committed
346 347
      }
    }
xiaomiao committed
348
  }
xiaomiao committed
349

xiaomiao committed
350 351 352
  .submit_button {
    text-align: center;
    margin: 15px 0;
xiaomiao committed
353
  }
xiaomiao committed
354

xiaomiao committed
355 356
  .el-date-editor.el-input {
    width: 100%;
xiaomiao committed
357
  }
xiaomiao committed
358
}
xiaomiao committed
359
</style>