Blame view

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

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

194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
        if (this.falg && this.falg1) {
          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);
              }
            });
        } else {
          return false;
        }
      },
      //打开常用意见列表弹窗
      /**
       * @description: 打开常用意见列表弹窗
       * @param {*} index
       * @author: renchao
       */
      commonOpinion (index) {
        this.currentindex = index;
        this.$popupDialog(
          "常用意见",
          "workflow/components/dialog/commonOpinion",
          {},
          "70%",
          true
        );
      },
      /**
       * @description: add
       * @param {*} val
       * @author: renchao
       */
      add (val) {
        if (val != "") {
          this.$set(this.tableData[this.currentindex], "shyj", val);
        }
      },
xiaomiao committed
236
    },
237
  };
xiaomiao committed
238
</script>
xiaomiao committed
239
<style scoped lang="scss">
240
  @import "~@/styles/mixin.scss";
xiaomiao committed
241

242
  .spyj {
xiaomiao committed
243
    width: 100%;
244 245 246 247
    height: 100%;
    background-color: #f5f5f5;
    .box {
      overflow-x: auto;
xiaomiao committed
248
      width: 100%;
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
      height: 95%;
      background: #fff;
      text-align: center;
      padding: 4px;
      overflow-y: scroll;
      padding-top: 20px;
      padding: 20px 40px;
      .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;
        margin: auto;
        font-size: 22px;
        font-weight: 400;
      }
xiaomiao committed
281
    }
xiaomiao committed
282

283 284 285
    /deep/.el-form-item {
      margin-bottom: 0;
    }
xiaomiao committed
286

287 288
    .bottom10 {
      margin-bottom: 15px;
xiaomiao committed
289 290
    }

291 292 293
    .spyj_form {
      display: flex;
      border: 1px solid $borderColor;
xiaomiao committed
294

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

      .item_right {
        flex: 1;
        width: 100%;

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

323 324
          border-bottom: 1px solid $borderColor;
        }
xiaomiao committed
325

326 327 328
        .opinion {
          position: relative;
          font-size: 14px;
xiaomiao committed
329

330 331 332
          /deep/.el-textarea__inner {
            border: none;
          }
xiaomiao committed
333 334
        }

335 336 337 338 339
        .opinion_btn {
          position: absolute;
          right: 15px;
          bottom: 10px;
        }
xiaomiao committed
340 341 342
      }
    }

343 344 345 346
    .submit_button {
      text-align: center;
      margin: 15px 0;
    }
xiaomiao committed
347

348 349 350
    .el-date-editor.el-input {
      width: 100%;
    }
xiaomiao committed
351
  }
xiaomiao committed
352
</style>