lpjManageDetail.vue 14.9 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 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 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 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 236 237 238 239 240 241 242 243 244 245 246 247 248 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 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428
<template>
  <!-- 收费查询-账单查询 -->
  <div class="white_bg burt-container custom-info">
    <Goback title="理赔件详情" />
    <!-- form -->
    <a-form-model ref="form" layout="vertical" :model="form">
      <a-row :gutter="30">
        <a-col :lg="8" :sm="12">
          <a-form-model-item label="保险公司">
            <a-select v-model="form.payorCode" placeholder="请选择保险公司" allowClear>
              <a-select-option v-for="item in companyOptions" :key="item.id" :value="item.payorCode">
                {{ item.longName }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :lg="8" :sm="12">
          <a-form-model-item label="寄送状态">
            <a-select v-model="form.sendSts" placeholder="请选择寄送状态" allowClear>
              <a-select-option value="1">已寄送</a-select-option>
              <a-select-option value="2">未寄送</a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :lg="8" :sm="12">
          <a-form-model-item label="快递公司">
            <a-select v-model="form.sendCompany" placeholder="请选择快递公司" showSearch allowClear>
              <a-select-option v-for="(item) in expressList" :key="item.id" :value="item.descCh">{{item.descCh}}</a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :lg="8" :sm="12">
          <a-form-model-item label="快递单号">
            <a-input v-model="form.trackingNo" placeholder="请输入快递单号" allow-clear />
          </a-form-model-item>
        </a-col>
        <a-col :lg="8" :sm="12">
          <a-form-model-item label="寄送方式">
            <a-select v-model="form.sendMode" placeholder="请选择寄送方式" allowClear>
              <a-select-option value="快递">快递</a-select-option>
              <a-select-option value="邮件">邮件</a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
        <a-col :lg="8" :sm="12">
          <a-form-model-item label="寄送日期">
            <a-date-picker format="YYYY年MM月DD日" v-model="form.sendDate" placeholder="选择日期" />
          </a-form-model-item>
        </a-col>
        <a-col :lg="8" :sm="12">
          <a-form-model-item label="寄送地址">
            <a-input v-model="form.sendAddress" placeholder="请输入寄送地址" allow-clear />
          </a-form-model-item>
        </a-col>
        <a-col :lg="8" :sm="12">
          <a-form-model-item label="寄送邮箱">
            <a-input v-model="form.sendEmail" placeholder="请输入寄送邮箱" allow-clear />
          </a-form-model-item>
        </a-col>
        <a-col :lg="8" :sm="12">
          <a-form-model-item label="寄送备注">
            <a-textarea v-model="form.sendRemark" placeholder="请输入寄送备注" :auto-size="{ minRows: 2, maxRows: 5 }" />
          </a-form-model-item>
        </a-col>
        <a-col :sm="24" class="none-label">
          <div class="btn-div flex">
            <span></span>
            <a-form-model-item label="button">
              <a-button class="mar-left10" type="primary" @click="addNewCharge">
                <Icon :name="sendBatchNo?'ssibaocun':'ssiadd'" :size="14" />{{sendBatchNo?'保存寄送':'新建寄送'}}</a-button>
            </a-form-model-item>
          </div>
        </a-col>
      </a-row>
      <a-row :gutter="30">
        <a-col :sm="24" class="none-label">
          <div class="btn-div flex">
            <span></span>
            <a-form-model-item label="button">
              <!-- <a-button class="mar-left10" type="primary" @click="handlerSearch">
                <Icon name="ssisearch_active" :size="14" />查询
              </a-button> -->
              <a-button class="mar-left10" type="primary" @click="addNewBill">
                <Icon :name="isEditNewBill?'ssibaocun':'ssiadd'" :size="14" />{{isEditNewBill? '保存账单': '添加账单'}}</a-button>
            </a-form-model-item>
          </div>
        </a-col>
      </a-row>
    </a-form-model>

    <!-- table -->
    <a-table :columns="columns" :data-source="dataList" :scroll="{ x: true }" :pagination="false"
      :row-selection="isEditNewBill? { selectedRowKeys: selectedRowKeys, onChange: onSelectChange }: null">
      <template slot="sendDate" slot-scope="text">
        {{ text? moment(text).format('YYYY-MM-DD'): '' }}
      </template>
      <template slot="sendSts" slot-scope="text">
        {{ text==1?'已寄送':'未寄送' }}
      </template>
      <template slot="operation" slot-scope="text, record, index">
        <a-button type="link" @click.stop="editEvt(record)">修改</a-button>
        <a-button type="link" class="danger" @click.stop="delRecord(index)">删除</a-button>
      </template>
    </a-table>
    <!--分页-->
    <BurtPagination :pagination="pagination" @pageChange="getData" />

    <a-modal title="编辑" :visible="dialogShow" width="700px" :maskClosable="false"
      okText="确定" cancelText="取消"
      @ok="handleEditOK" @cancel="dialogShow = false">
      <a-form-model ref="editForm" :model="editFormObj" :rules="editRules">
        <a-row :gutter="30">
          <a-col :lg="12" :xs="24">
            <a-form-model-item label="保险公司" prop="payorCode">
              <a-select v-model="editFormObj.payorCode" placeholder="请选择保险公司" allowClear>
                <a-select-option v-for="item in companyOptions" :key="item.id" :value="item.payorCode">
                  {{ item.longName }}
                </a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :lg="12" :sm="24">
            <a-form-model-item label="寄送状态" prop="sendSts">
              <a-select v-model="editFormObj.sendSts" placeholder="请选择寄送状态" allowClear>
                <a-select-option :value="1">已寄送</a-select-option>
                <a-select-option :value="2">未寄送</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
          <a-col :lg="12" :sm="24">
            <a-form-model-item label="寄送日期" prop="sendDate">
              <a-date-picker format="YYYY年MM月DD日" v-model="editFormObj.sendDate" placeholder="选择日期" />
            </a-form-model-item>
          </a-col>
          <a-col :lg="12" :xs="24">
            <a-form-model-item label="快递单号" prop="trackingNo">
              <a-input v-model.trim="editFormObj.trackingNo" placeholder="快递单号" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="30">
          <a-col :lg="12" :xs="24">
            <a-form-model-item label="寄送备注" prop="sendRemark">
              <a-textarea v-model.trim="editFormObj.sendRemark" placeholder="寄送备注" />
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-form-model>
    </a-modal>
  </div>
</template>

<script>
import Goback from "@/components/CUSTOMER/goback";
import BurtPagination from "@/components/CUSTOMER/pagation";
import moment from 'moment'
export default {
  data() {
    const columns = [
      { title: "账单编号", dataIndex: "receiptNo", key:"receiptNo",align:'center', width: 136},
      { title: "病历号", dataIndex: "patientNo", key:"patientNo",align:'center', width: 136},
      { title: "客户姓名", dataIndex: "patientName", width: 98 },
      { title: "保险公司", dataIndex: "payorName", width: 110 },
      { title: "就诊日期", dataIndex: "visitTimeStart", width: 200,scopedSlots: { customRender: "visitTimeStart" } },
      { title: "账单金额", dataIndex: "chargeAmount", width: 100, align: 'center' },
      { title: "折后金额", dataIndex: "discountAmount", width: 100, align: 'center' },
      { title: "客户自负", dataIndex: "paidAmount", width: 100, align: 'center' },
      { title: "理赔金额", dataIndex: "paidamount", width: 100, align: 'center' },
      // { title: "操作", key: "operation", width: "175px",fixed: "right",scopedSlots: { customRender: "operation" }},
    ];
    return {
      loading: false,
      dialogShow: false,
      columns,
      sendBatchNo: '', //寄送批号
      form: {
        payorCode: '',
        sendSts: '',
        sendMode: '',
        sendDate: '',
        sendCompany: '',
        trackingNo: '',
        sendAddress: '',
        sendEmail: '',
        sendRemark: ''
      },
      companyOptions: [], //保险公司
      expressList: [], //快递列表
      selectedRowKeys: [], // Check here to configure the default column
      dataList: [],
      isEditNewBill: false, //是否在新建账单
      pagination: {
        pageNum: 1,
        pageSize: 10,
        total: 0,
      },
      editFormObj: {
        payorCode: '',
        sendSts: '',
        sendDate: '',
        trackingNo: '',
        sendRemark: '',
      },
      editRules: {
        sendDate: [{ required: true, message: "请选择寄送日期", trigger: "change" }],
        trackingNo: [{ required: true, message: "请输入寄送单号", trigger: "blur" }],
      },
    };
  },
  components: {
    Goback,
    BurtPagination,
  },
  created() {
    this.sendBatchNo = this.$route.query.sendBatchNo;
    this._getCompanyOptions();
    this.getRefcdByRefgrp();
    if(this.sendBatchNo){
      let jisongDataDetail = localStorage.getItem('jisongDataDetail');
      this.form = jisongDataDetail? JSON.parse(jisongDataDetail): {};
      this.getData();
    }
  },
  methods: {
    moment,
    onSelectChange(selectedRowKeys) {
      let arr = [];
      for(let i=0; i<selectedRowKeys.length; i++){
        let idx = selectedRowKeys[i];
        if(this.dataList[idx].sendBatchNo){
          this.$msg.destroy();
          this.$message.warning('寄送批号已存在')
        }else{
          arr.push(idx);
        }
      }
      this.selectedRowKeys = arr;
    },
    // 获取列表数据
    getData() {
      this.selectedRowKeys = [];
      let filter = {
        pageNum: this.pagination.pageNum,
        pageSize: this.pagination.pageSize,
        sendBatchNo: this.sendBatchNo,
      }
      this.$apis.QUERYSENDRECEIPLIST(filter)
      .then((res) => {
        if (res.returnCode == "0000") {
          let content = res.content || {};
          this.pagination.total = content.total || 0;
          this.dataList = content.list || [];
        } else {
          this.$message.error(res.returnMsg);
        }
      });
    },
    // 获取保险公司下拉选项
    _getCompanyOptions() {
      this.$apis.GETCOMPANYOPTIONS().then((res) => {
        this.companyOptions = res.content || [];
      });
    },
    // 获取快递列表
    getRefcdByRefgrp() {
      this.$apis.GETREFCDBYREFGRP({
        modid: "CI",
        refgrp: "SEND_COMPANY"
      }).then((res) => {
        this.expressList = res.content || [];
      });
    },
    //查看 
    detailEvt(record) {
      const { receiptNo } = record;
      this.$router.push({
        name: "chargeQueryDetail",
        query: { receiptNo },
      });
    },
    editEvt(record) {
      this.editFormObj = {
        ciReceiptSendVos: [
          {
            id: record.id,
            receiptNo: record.receiptNo,
          }
        ],
        payorCode: record.payorCode || "",
        sendSts: Number(record.sendSts) || "",
        sendDate: record.sendDate || "",
        trackingNo: record.trackingNo || "",
        sendRemark: record.sendRemark || "",
      };
      this.dialogShow = true;
    },
    //编辑保存
    handleEditOK() {
      this.$refs.editForm.validate((valid) => {
        if (valid) {
          this.$apis.SAVERECEIPSENDINFO({
            ...this.editFormObj,
            sendDate: moment(this.editFormObj.sendDate).format('YYYY-MM-DD 00:00:00')
          })
          .then((res) => {
            if (res.returnCode == "0000") {
              this.$message.success("编辑成功");
              this.dialogShow = false;
              this.getData();
            } else {
              this.$message.error(res.returnMsg);
            }
          });
        }
      });
    },
    handlerSearch() {
      this.pagination.pageNum = 1;
      this.isEditNewBill = false;
      this.getData();
    },
    //删除
    delRecord(index) {
      this.$modal.confirm({
        title: "删除",
        content: "确定删除该条记录?",
        okText: "确定",
        cancelText: "取消",
        onOk: () => {
          this.$apis.DELETERECEIPTSENDINFO({
              sendBatchNo: this.dataList[index].sendBatchNo,
            })
            .then((res) => {
              if (res.returnCode == "0000") {
                this.$message.success("删除成功");
                this.dataList.splice(index, 1);
              } else {
                this.$message.error(res.returnMsg);
              }
            });
        },
      });
    },
    //添加账单
    addNewBill(){
      this.isEditNewBill = !this.isEditNewBill;
      if(!this.isEditNewBill){ //保存
        this.addNewCharge()
        .then(()=>{
          this.isEditNewBill = false;
        })
      }else{ //查询所有未加入的账单
        this.pagination.pageNum = 1;
        this.$apis.QUERYNOSENDRECEIPLIST({
          pageNum: this.pagination.pageNum,
          pageSize: this.pagination.pageSize,
          payorCode: this.form.payorCode
        })
        .then((res) => {
          if (res.returnCode == "0000") {
            this.selectedRowKeys = [];
            let content = res.content || {};
            this.pagination.total = content.total || 0;
            this.dataList = content.list || [];
          } else {
            this.$message.error(res.returnMsg);
          }
        });
      }
    },
    //新建/保存寄送
    addNewCharge(){
      if(!this.form.trackingNo){
        this.$message.warning("请输入快递单号");
        return;
      }
      if(!this.form.sendDate){
        this.$message.warning("请选择寄送日期");
        return;
      }
      let ciReceiptSendVos = [];
      this.dataList.forEach((item,index)=>{
        if(this.selectedRowKeys.indexOf(index)!=-1){
          ciReceiptSendVos.push({
            id: item.id,
            receiptNo: item.receiptNo,
          })
        }
      })
      let formData = {
        ...this.form,
        ciReceiptSendVos: ciReceiptSendVos,
        sendDate: moment(this.form.sendDate).format('YYYY-MM-DD 00:00:00'),
        sendBatchNo: this.sendBatchNo
      }
      return new Promise((resolve,reject)=>{
        this.$apis.SAVERECEIPSENDINFO(formData)
        .then((res) => {
          if (res.returnCode == "0000") {
            this.sendBatchNo = res.content;
            this.$message.success("成功");
            this.selectedRowKeys = [];
            this.getData();
            resolve();
          } else {
            this.$message.error(res.returnMsg);
            reject();
          }
        });
      })
    }
  },
};
</script>
<style lang="less" scoped>
.none-label {
  text-align: right;
  .ant-form-item-label {
    opacity: 0;
  }
}
.ant-btn .icon-class {
  .mg-r(10);
}
.btn-div{
  justify-content: space-between;
}
</style>