Docpre.vue 15 KB
Newer Older
zhoukai committed
1
<template>
liushikai committed
2 3
  <div class="eibs-tab">
    <!-- =================左边====================== -->
liuxin committed
4
    <c-col :span="12">
5
      <el-form-item label="不符点" prop="bddgrp.blk.docdis">
liushikai committed
6
        <c-col :span="21">
wangyanjiao committed
7 8
          <c-input type="textarea" v-model="model.bddgrp.blk.docdis" :disabled="!model.bddgrp.blk.docdisflg"
            maxlength="50" show-word-limit placeholder="请输入不符点"></c-input>
zhoukai committed
9 10
        </c-col>

liushikai committed
11 12
        <c-col :span="3" style="text-align: right">
          <!-- <el-form-item label-width="0"> -->
wangyanjiao committed
13
          <c-button size="small" type="primary" icon="el-icon-search" style="margin-left: 0" @click="onDocdisButtxmsel"
14
            :disabled="!model.bddgrp.blk.docdisflg"></c-button>
liushikai committed
15 16 17 18 19
          <!-- </el-form-item> -->
        </c-col>
      </el-form-item>

      <c-col :span="24">
20
        <el-form-item label="注释和结论" prop="bddgrp.blk.comcon">
wangyanjiao committed
21 22
          <c-input type="textarea" v-model="model.bddgrp.blk.comcon" maxlength="65" show-word-limit
            placeholder="请输入注释和结论"></c-input>
liushikai committed
23 24 25 26
        </el-form-item>
      </c-col>

      <c-col :span="24">
27
        <el-form-item label="到期付款确认备注" prop="bddgrp.blk.accrmk">
wangyanjiao committed
28 29
          <c-input type="textarea" v-model="model.bddgrp.blk.accrmk" maxlength="65" show-word-limit
            placeholder="请输入到期付款确认备注"></c-input>
liushikai committed
30 31 32 33 34
        </el-form-item>
      </c-col>
    </c-col>

    <!-- =================右边====================== -->
liuxin committed
35
    <c-col :span="12">
liushikai committed
36
      <c-col :span="24">
37 38
        <c-col :span="12">
        <c-col :span="12">
liushikai committed
39
        <el-form-item label="" prop="bddgrp.rec.igndisflg">
wangyanjiao committed
40
          <c-checkbox v-model="model.bddgrp.rec.igndisflg">忽略不符点</c-checkbox>
41 42 43 44
        </el-form-item>
      </c-col>
      <c-col :span="12">
        <el-form-item label="" prop="bddgrp.blk.docdisflg">
wangyanjiao committed
45
          <c-checkbox v-model="model.bddgrp.blk.docdisflg" @change="docdis">录入不符点</c-checkbox>
liushikai committed
46 47
        </el-form-item>
      </c-col>
48 49
    </c-col>
  </c-col>
liushikai committed
50 51

      <!-- <c-col :span="24">
52 53
                <el-form-item label="" prop="bddgrp.blk.docdisflg">
                </el-form-item>
liushikai committed
54
            </c-col> -->
zhoukai committed
55

liushikai committed
56 57
      <c-col :span="24">
        <el-form-item label="收到的通知类型" prop="bddgrp.rec.advtyp">
wangyanjiao committed
58
          <c-select v-model="model.bddgrp.rec.advtyp" style="width: 100%" placeholder="请选择收到的通知类型" disabled>
liushikai committed
59 60 61 62 63 64
          </c-select>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="付款日期" prop="bddgrp.rec.totdat">
wangyanjiao committed
65
          <c-date-picker type="date" v-model="model.bddgrp.rec.totdat" style="width: 100%" placeholder="请选择付款日期" disabled>
wangyanjiao committed
66
          </c-date-picker>
liushikai committed
67 68 69 70 71
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <el-form-item label="不符点通知日期" prop="bddgrp.rec.disdat">
wangyanjiao committed
72
          <c-date-picker type="date" v-model="model.bddgrp.rec.disdat" style="width: 100%" placeholder="请选择不符点通知日期" disabled>
wangyanjiao committed
73
          </c-date-picker>
liushikai committed
74 75 76 77
        </el-form-item>
      </c-col>

      <c-col :span="24">
78 79
        <c-col :span="12">
      <c-col :span="12">
liushikai committed
80
        <el-form-item label="" prop="bddgrp.rec.approvcod">
wangyanjiao committed
81
          <c-checkbox v-model="model.bddgrp.rec.approvcod">议付行担保协议</c-checkbox>
82 83 84 85
        </el-form-item>
      </c-col>
      <c-col :span="12">
        <el-form-item label="" prop="bdtp.cre732flg">
wangyanjiao committed
86
          <c-checkbox v-model="model.bdtp.cre732flg" disabled>Create MT 732</c-checkbox>
liushikai committed
87 88
        </el-form-item>
      </c-col>
89 90 91 92
    </c-col>
    </c-col>


liushikai committed
93 94

      <!-- <c-col :span="8">
zhoukai committed
95 96 97 98 99 100 101 102
                <c-checkbox v-model="model.bdtp.cre752flg">Create MT 752</c-checkbox>
            </c-col>

            <c-col :span="16">
                <el-form-item label="Further Identification" prop="bdtp.furide">
                    <c-select v-model="model.bdtp.furide" style="width:100%" placeholder="请选择Further Identification">
                    </c-select>
                </el-form-item>
103
            </c-col> -->
zhoukai committed
104

liushikai committed
105
      <!-- <c-col :span="24">
106 107
                 <el-form-item label="" prop="bdtp.cre732flg">
                 </el-form-item>
liushikai committed
108
            </c-col> -->
liushikai committed
109 110 111
    </c-col>

    <!-- =================已交单据====================== -->
wangyanjiao committed
112 113 114 115 116 117 118 119 120 121 122
    

 <c-docpre 
        :model="model" 
        :argadr="{
          path: 'bddgrp.blk.prsdoc',
          grp: 'bdtp',
          code: 'prsdoc'
        }"></c-docpre>


liuxin committed
123
    <!-- 不符点 -->
liushikai committed
124
    <c-col>
125
      <el-dialog :visible.sync="InsertErrorDialogVisibal" center width="500px">
liushikai committed
126 127
        <c-col :span="24">
          <c-col :span="20">
liuxin committed
128
            <el-form-item label="不符点" label-width="100px">
129
              <c-input v-model="newInsertError"></c-input>
liushikai committed
130 131 132 133
            </el-form-item>
          </c-col>
        </c-col>
        <span slot="footer" class="dialog-footer">
134
          <el-button type="primary" @click="InsertError()">确定</el-button>
wangyanjiao committed
135
          <el-button @click="InsertErrorDialogVisibal = false; newInsertError = ''">取消</el-button>
liushikai committed
136 137 138
        </span>
      </el-dialog>
    </c-col>
潘际乾 committed
139
    <OcrRecognition ref="ocrRecognition" v-on:confirm="selectGridPDF"></OcrRecognition>
liushikai committed
140
  </div>
zhoukai committed
141 142
</template>
<script>
143
import Api from "~/service/Api";
wangren committed
144
import commonProcess from "~/mixin/commonProcess";
145 146 147
import CodeTable from "~/config/CodeTable";
import Event from "~/model/Ditdck/Event";

潘际乾 committed
148
import OcrRecognition from "./OcrRecognition.vue";
wangyanjiao committed
149 150 151
import Utils from "~/utils";
import Docpre from "~/views/Public/Docpre";

潘际乾 committed
152

153 154 155
export default {
  inject: ["root"],
  props: ["model", "codes"],
wangren committed
156
  mixins: [commonProcess],
wangyanjiao committed
157 158
  components: { OcrRecognition ,
    "c-docpre": Docpre,},
159
  data() {
liushikai committed
160 161
    return {
      addDialogVisible: false,
162
      InsertErrorDialogVisibal: false,
liuxin committed
163
      InsertGridDataDialogVisibal: false,
wangyanjiao committed
164
      newInsertError: "",
165
      newInsertErrorIndex: -1,
wangyanjiao committed
166
      newInsertGridData: "",
liushikai committed
167 168 169
      dialog: {
        cmail1: "",
        cmail2: "",
wangyanjiao committed
170 171
        docnam: "",
        state: "",
liushikai committed
172
      },
wangyanjiao committed
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
      liData: ["增值税发票", "发票", "装箱单", "空运单", "海运提单", "铁路运单", "货物收据", "邮政收据", "出库单", "保险单", "质检证", "受益人证明"],
      docgrdDataStore: [
        {
          id: "invoice",
          cmail1: "1",
          cmail2: "",
          docnam: "发票",
          state: "缺失",
        },
        {
          id: "receipt",
          cmail1: "1",
          cmail2: "",
          docnam: "货物收据",
          state: "缺失",
        },
        {
          id: "oceanShipping",
          cmail1: "1",
          cmail2: "",
          docnam: "海运提单",
          state: "缺失",
        },
196
      ],
wangyanjiao committed
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 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
      docgrdData: [],
      gridData: [
        {
          id: "invoice",
          data: [
            {
              name: "KZ3500220597AA-001.pdf",
              errorData: [
                {
                  discribe: "发票金额不符",
                  state: true
                },
                {
                  discribe: "发票非原始正本",
                  state: true
                },
                {
                  discribe: "未批注交单情况",
                  state: true
                },
              ]
            }
          ],
        },
        {
          id: "receipt",
          data: [
            {
              name: "KZ3500220597AA-002.pdf",
              errorData: [
                {
                  discribe: "货物收据金额不符",
                  state: true
                },
                {
                  discribe: "货物收据缺失",
                  state: true
                },
              ]
            },
            // {
            //     name:"KZ3500220597AA-003.pdf",
            //     errorData:[
            //         {
            //             discribe:"货物数量有误",
            //             state:true
            //         },
            //     ]
            // },
          ],
        },
        {
          id: "oceanShipping",
          data: [
            {
              name: "KZ3500220597AA-003.pdf",
              errorData: [
              ]
            },
          ]
        }
258
      ],
wangyanjiao committed
259 260
      gridPDFData: [],
      selectPDFData: "",
潘际乾 committed
261 262 263 264
      selectedPdf: {
        id: '',
        index: null
      }
liushikai committed
265
    };
266 267 268
  },
  methods: {
    ...Event,
wangyanjiao committed
269 270 271 272 273 274 275 276 277 278
    docdis() {
      console.log("进入前---------");
      this.executeDefault("bddgrp.blk.docdis").then((res) => {
      console.log("进入后---------");
        if ((res.respCode == 'AAAAAA')) {
          Utils.copyValueFromVO(this.model, res.data);
      console.log("if中---------");
        }
      });
    },
潘际乾 committed
279 280 281
    importFile() {
      this.root.setDraggableContent('cms', '影像信息');
    },
wangyanjiao committed
282 283 284 285
    addRow() {
      this.addDialogVisible = false;
      let newRow = { ...this.dialog };
      this.model.bdtp.docgrdm.docgrd.push(newRow);
286
    },
wangyanjiao committed
287 288
    removeRow(idx) {
      this.model.bdtp.docgrdm.docgrd.pop(idx);
289
    },
wangyanjiao committed
290 291
    addPDF(idx) {
      this.selectPDFData = idx;
292
    },
wangyanjiao committed
293 294
    detailPDF(id) {
      this.openPdfDialog(id, 0);
liuxin committed
295
    },
潘际乾 committed
296
    openPdfDialog(id, idx) {
潘际乾 committed
297
      this.$refs.ocrRecognition.show = true
liuxin committed
298
      var tempId = 0;
wangyanjiao committed
299 300 301 302 303
      for (let i = 0; i < this.docgrdDataStore.length; i++) {
        if (id == this.docgrdDataStore[i].id) {
          tempId = i;
          break;
        }
liuxin committed
304 305
      }
      this.$refs.ocrRecognition.formData.type = this.$refs.ocrRecognition.fileType[tempId].value;
潘际乾 committed
306 307
      this.selectedPdf.id = id;
      this.selectedPdf.index = idx;
hulei committed
308 309 310
      this.$nextTick(() => {
        this.$refs.ocrRecognition.fileUrl = require(`~/assets/demo-files/${this.$refs.ocrRecognition.formData.type}.jpg`)
      })
潘际乾 committed
311
    },
wangyanjiao committed
312 313 314 315 316 317 318 319 320 321 322
    selectGridPDF() {
      const id = this.selectedPdf.id;
      // const idx = this.selectedPdf.index;
      const idx = 0;  //PDF全部展示,就不存在idx
      var tempData = [];
      var list = [];
      var flag = false;
      for (let i = 0; i < this.gridData.length; i++) {
        if (this.gridData[i].id == this.selectPDFData) {
          list = [...this.gridData[i].data[idx].errorData]
          break;
323
        }
wangyanjiao committed
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347
      }
      for (let i = 0; i < this.docgrdData.length; i++) {
        if (this.docgrdData[i].id == id && id == this.selectPDFData) {
          if (list.length > 0) {
            this.docgrdData[i].state = "内容不符"
          } else {
            this.docgrdData[i].state = "符合"
          }
        }
        if (flag) {
          let tempListData = this.docgrdData[i];
          tempListData.list.push(...list);
          tempData.push(tempListData);
          flag = false;
        } else {
          tempData.push(this.docgrdData[i]);
          if (this.docgrdData[i].id == id && id == this.selectPDFData && list.length > 0) {
            if (i < this.docgrdData.length - 1 && this.docgrdData[i + 1].hasOwnProperty("list")) {
              flag = true;
            } else {
              tempData.push({
                list,
                states: true,
              });
348
            }
wangyanjiao committed
349
          }
350
        }
wangyanjiao committed
351 352 353
      }
      this.docgrdData = tempData;
      sessionStorage.setItem('docgrdData', JSON.stringify(this.docgrdData));
354 355
    },
    arraySpanMethod({ row, column, rowIndex, columnIndex }) {
wangyanjiao committed
356 357 358
      if (this.docgrdData[rowIndex].states) {
        return [1, 5];
      }
359
    },
wangyanjiao committed
360 361 362 363 364 365 366
    DeleteError(index, idx) {
      this.docgrdData[index].list.splice(idx, 1);
      if (this.docgrdData[index].list.length == 0) {
        this.docgrdData.splice(index, 1);
        this.docgrdData[index - 1].state = "符合"
      }
      sessionStorage.setItem('docgrdData', JSON.stringify(this.docgrdData));
367
    },
wangyanjiao committed
368 369 370
    InsertErrorDialog(index) {
      this.InsertErrorDialogVisibal = true;
      this.newInsertErrorIndex = index;
371
    },
wangyanjiao committed
372 373 374 375 376 377 378 379 380
    InsertError() {
      var temp = {
        discribe: this.newInsertError,
        state: true
      };
      this.docgrdData[this.newInsertErrorIndex].list.push(temp);
      this.newInsertError = "";
      this.InsertErrorDialogVisibal = false;
      sessionStorage.setItem('docgrdData', JSON.stringify(this.docgrdData));
381
    },
wangyanjiao committed
382 383
    addDocgrdDataStore() {
      this.InsertGridDataDialogVisibal = true;
liuxin committed
384
    },
wangyanjiao committed
385 386 387 388 389 390 391 392 393 394
    InsertGridData() {
      var index = this.docgrdData.length;
      var tempData = this.dialog;
      tempData.cmail1 = this.newInsertGridData;
      tempData.id = "tempId" + index;
      tempData.state = "符合";
      this.docgrdData.push(this.dialog);
      this.InsertGridDataDialogVisibal = false;
      this.newInsertGridData = "";
      sessionStorage.setItem('docgrdData', JSON.stringify(this.docgrdData));
liuxin committed
395
    }
396 397
  },
  created: function () {
wangyanjiao committed
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415
    //docgrdData, gridPDFData
    var temp_docgrdData = JSON.parse(sessionStorage.getItem("docgrdData"));
    if (temp_docgrdData != null) {
      var temp_gridPDFData = JSON.parse(sessionStorage.getItem("gridPDFData"));
      this.docgrdData = temp_docgrdData;
      this.gridPDFData = temp_gridPDFData;
    } else {
      var IconList = JSON.parse(sessionStorage.getItem("IconList"));
      if (IconList == null) {
        IconList = ["invoice", "receipt"];
      }
      var list = [];
      for (let i = 0; i < IconList.length; i++) {
        for (let j = 0; j < this.docgrdDataStore.length; j++) {
          if (IconList[i] == this.docgrdDataStore[j].id) {
            list.push(this.docgrdDataStore[j]);
            break;
          }
416
        }
417
      }
wangyanjiao committed
418 419
      this.docgrdData = list;
    }
420
  },
wangyanjiao committed
421
  computed: {
422
  },
wangyanjiao committed
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437
  watch: {
    selectPDFData() {
      if (this.selectPDFData.length > 0) {
        const arr = []
        for (let i = 0; i < this.gridData.length; i++) {
          // if(this.gridData[i].id == this.selectPDFData){
          // arr.push({"id" : this.gridData[i].id});
          for (let j = 0; j < this.gridData[i].data.length; j++) {
            arr.push({ "name": this.gridData[i].data[j].name, "id": this.gridData[i].id });
          }
          //     break;
          // }
        }
        this.gridPDFData = arr;
        sessionStorage.setItem('gridPDFData', JSON.stringify(this.gridPDFData));
438
      }
wangyanjiao committed
439
    }
440
  }
441
};
zhoukai committed
442
</script>
liushikai committed
443
<style scoped>
wangyanjiao committed
444 445
.addCss {}

446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
/* 如果要增加竖线上方加上.el-table td */
/* 鼠标滑过td上作用的样式,ie6不支持:hover伪类属性,如果是ie6要写成tr.over样式 */
/* 如果td没有颜色,可以去掉,这里加上保险 */
/* .el-table{
  background-color: transparent;
  color:white;
}
.el-table th, .el-table tr{
  border: 0;
  background-color: transparent;
}
.el-table tbody tr:hover>td {
  background-color:transparent!important;
}
.el-table__body tr.hover-row>td {
  background-color: transparent;
} */

/* .el-table tbody tr:hover>td {   
    background-color:#ffffff!important
} */

潘际乾 committed
468 469 470 471 472 473 474
.file-add {
  margin-top: 16px;
  text-align: center;
  font-size: 16px;
  cursor: pointer;
  border: 1px solid #EBEEF5;
}
wangyanjiao committed
475

潘际乾 committed
476 477 478
.file-add:hover {
  color: #5cb6ff;
  border: 1px solid #5cb6ff;
liushikai committed
479
}
zhoukai committed
480
</style>