businessInformation.vue 20.5 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 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528
<template>
  <a-spin :spinning="confirmLoading">
    <a-form-model ref="form" :model="jingying" :rules="validatorRules">
      <a-row :gutter="24">
        <a-col :span="12">
          <a-form-model-item prop="mainManagerName" label="主办业务经理" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
            <a-input placeholder="请输入主办业务经理" v-model="jingying.mainManagerName" :readOnly="true" />
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item prop="secondManagerName" label="协办业务经理" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
            <a-select v-model="jingying.secondManagerName" placeholder="请选择" :disabled="onlyread && disableSubmit">
              <a-select-option v-for="(item, index) in selectList" :key="index" :value="item.workNo">{{ item.username }}
              </a-select-option>
            </a-select>
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row :gutter="24">
        <a-col :span="12">
          <a-form-model-item prop="surveyTime" label="调查时间" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
            <a-date-picker show-time placeholder="请输入调查时间" format="YYYY-MM-DD hh:mm:ss" style="width:100%;"
              :disabled="onlyread && disableSubmit" v-model="jingying.surveyTime" />
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-card title="经营信息" :bordered="false">
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item prop="cowType" label="经营品种" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
              <a-radio-group v-model="jingying.cowType" :disabled="onlyread && disableSubmit">
                <a-radio :value="'0'">奶牛养殖</a-radio>
                <a-radio :value="'1'">肉牛养殖</a-radio>
              </a-radio-group>
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item prop="placeOwner" label="经营场地所有权" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
              <a-radio-group v-model="jingying.placeOwner" :disabled="onlyread && disableSubmit">
                <a-radio :value="'0'">完全自有</a-radio>
                <a-radio :value="'1'">部分自有</a-radio>
                <a-radio :value="'3'">租用</a-radio>
                <a-radio :value="'4'">其它</a-radio>
              </a-radio-group>
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item prop="mainBusiness" label="主营业务" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
              <a-textarea v-model="jingying.mainBusiness" :readOnly="onlyread && disableSubmit" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item prop="ownCows" label="牛存栏量(头)" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
              <a-input placeholder="请输入牛存栏量" :readOnly="onlyread && disableSubmit" v-model="jingying.ownCows" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item prop="insureCows" label="牛保单投保牛数(头)" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
              <a-input placeholder="请输入牛保单投保牛数(头)" :readOnly="onlyread && disableSubmit"
                v-model="jingying.insureCows" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item prop="insureCharge" label="保费总计(元)" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
              <a-input placeholder="请输入保费总计(元)" :readOnly="onlyread && disableSubmit" v-model="jingying.insureCharge" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item prop="lastyearPayCows" label="上年度牛保单理赔牛数(头)" :labelCol="{ span: 10 }"
              :wrapperCol="{ span: 14 }">
              <a-input placeholder="上年度牛保单理赔牛数(头)" :readOnly="onlyread && disableSubmit"
                v-model="jingying.lastyearPayCows" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item prop="lastyearPayCharge" label="上年度理赔金额总计(元)" :labelCol="{ span: 10 }"
              :wrapperCol="{ span: 14 }">
              <a-input placeholder="上年度理赔金额总计(元)" :readOnly="onlyread && disableSubmit"
                v-model="jingying.lastyearPayCharge" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item prop="startBreedYear" label="从事牛养殖起始年份" :labelCol="{ span: 8 }"
              :wrapperCol="{ span: 16 }">
              <a-date-picker show-time placeholder="请输入从事牛养殖起始年份" format="YYYY-MM-DD hh:mm:ss" style="width:100%;"
                :disabled="onlyread && disableSubmit" v-model="jingying.startBreedYear" />
            </a-form-model-item>
          </a-col>
          <a-col :span="12">
            <a-form-model-item prop="startBreedYears" label="从业经验年数(年)" :labelCol="{ span: 8 }"
              :wrapperCol="{ span: 16 }">
              <a-input placeholder="从业经验年数(年)" :readOnly="onlyread && disableSubmit"
                v-model="jingying.startBreedYears" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <table style="margin-left: 180px;" align="center" border="1" cellspacing="0" cellpadding="1">
              <tr>
                <th style="width:135px;">奶牛类型</th>
                <th>数量</th>
              </tr>
              <tr>
                <td>牛犊(0-3个月)</td>
                <td>
                  <a-input placeholder="" v-model="jingying.cowStockNum1" :readOnly="onlyread && disableSubmit" @click="cattleList" @blur.native.capture="cattleEdit" />
                </td>
              </tr>
              <tr>
                <td>育成牛(3月到2年)</td>
                <td>
                  <a-input placeholder="" v-model="jingying.cowStockNum2" :readOnly="onlyread && disableSubmit" @click="cattleList" @blur.native.capture="cattleEdit" />
                </td>
              </tr>
              <tr>
                <td>产奶牛(2年到7年)</td>
                <td>
                  <a-input placeholder="" v-model="jingying.cowStockNum3" :readOnly="onlyread && disableSubmit" @click="cattleList" @blur.native.capture="cattleEdit" />
                </td>
              </tr>
              <tr>
                <td>淘汰牛</td>
                <td>
                  <a-input placeholder="" v-model="jingying.cowStockNum4" :readOnly="onlyread && disableSubmit" @click="cattleList" @blur.native.capture="cattleEdit" />
                </td>
              </tr>
              <tr>
                <td>总计</td>
                <td>
                  <a-input placeholder="" v-model="sun" :readOnly="onlyread && disableSubmit" />
                </td>
              </tr>
            </table>
          </a-col>
          <a-col :span="12">
            <table style="margin-left: 180px;" align="center" border="1" cellspacing="0" cellpadding="1">
              <tr>
                <th style="width:135px;">肉牛类型</th>
                <th>数量</th>
              </tr>
              <tr>
                <td>基础母牛</td>
                <td>
                  <a-input placeholder="" v-model="jingying.bullStockNum1" :readOnly="onlyread && disableSubmit" @click="cattleAdd" @blur.native.capture="cattleUp" />
                </td>
              </tr>
              <tr>
                <td>牛犊(0-2月)</td>
                <td>
                  <a-input placeholder="" v-model="jingying.bullStockNum2" :readOnly="onlyread && disableSubmit" @click="cattleAdd" @blur.native.capture="cattleUp" />
                </td>
              </tr>
              <tr>
                <td>育成牛(3-4月)</td>
                <td>
                  <a-input placeholder="" v-model="jingying.bullStockNum3" :readOnly="onlyread && disableSubmit" @click="cattleAdd" @blur.native.capture="cattleUp" />
                </td>
              </tr>
              <tr>
                <td>育成牛(5-6月)</td>
                <td>
                  <a-input placeholder="" v-model="jingying.bullStockNum4" :readOnly="onlyread && disableSubmit" @click="cattleAdd" @blur.native.capture="cattleUp" />
                </td>
              </tr>
              <tr>
                <td>育肥牛(7-8月)</td>
                <td>
                  <a-input placeholder="" v-model="jingying.bullStockNum5" :readOnly="onlyread && disableSubmit" @click="cattleAdd" @blur.native.capture="cattleUp" />
                </td>
              </tr>
              <tr>
                <td>育肥牛(9-10月)</td>
                <td>
                  <a-input placeholder="" v-model="jingying.bullStockNum6" :readOnly="onlyread && disableSubmit" @click="cattleAdd" @blur.native.capture="cattleUp" />
                </td>
              </tr>
              <tr>
                <td>育肥牛(11-12月)</td>
                <td>
                  <a-input placeholder="" v-model="jingying.bullStockNum7" :readOnly="onlyread && disableSubmit" @click="cattleAdd" @blur.native.capture="cattleUp" />
                </td>
              </tr>
              <tr>
                <td>育肥牛(12月以上)</td>
                <td>
                  <a-input placeholder="" v-model="jingying.bullStockNum8" :readOnly="onlyread && disableSubmit"@click="cattleAdd" @blur.native.capture="cattleUp" />
                </td>
              </tr>
              <tr>
                <td>公牛共计</td>
                <td>
                  <a-input placeholder="" v-model="gnum" :readOnly="onlyread && disableSubmit" />
                </td>
              </tr>
              <tr>
                <td>总计</td>
                <td>
                  <a-input placeholder="" v-model="sum" :readOnly="onlyread && disableSubmit" />
                </td>
              </tr>
            </table>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item prop="breedStatus" label="养殖品种情况" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
              <a-textarea v-model="jingying.breedStatus" :readOnly="onlyread && disableSubmit" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item prop="upSettlement" label="上游结算方式" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
              <a-textarea v-model="jingying.upSettlement" :readOnly="onlyread && disableSubmit" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-model-item prop="downSettlement" label="下游结算方式" :labelCol="{ span: 8 }" :wrapperCol="{ span: 16 }">
              <a-textarea v-model="jingying.downSettlement" :readOnly="onlyread && disableSubmit" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="24" v-show="!disableSubmit"
          style="float:right;margin-right:20px;margin-top: 30px;margin-bottom: 30px;">
          <a-button style="margin-right:10px;" @click="handleCancel">取消</a-button>
          <a-button type="primary" @click="handleSubmit" :disabled="watchBtn1">保存</a-button>
        </a-row>
      </a-card>
    </a-form-model>
  </a-spin>
</template>
<script>
function getBase64(img, callback) {
  const reader = new FileReader()
  reader.addEventListener('load', () => callback(reader.result))
  reader.readAsDataURL(img)
}

import moment from 'moment'
import { JeecgListMixin } from '@/mixins/CoreListMixin'
import { updateCustomerManageInfo, queryCustomerManageInfoByNO, selectSecondManagerUser } from '@/api/configApi'
export default {
  name: 'businessInformation',
  mixins: [JeecgListMixin],
  components: {

  },
  props: {
    jingying: {
      type: Object,
      // default: () => {
      //   return [];
      // }
    },
    applyNo: {
      type: String,
      default: ''
    },
    disableSubmit: {
      type: Boolean,
      default: false
    },
    onlyread: {
      type: Boolean,
      default: false
    },
    selectList: {
      type: Array,
      default: () => {
        return [];
      }
    },
  },
  data() {
    return {
      visible: false,
      confirmLoading: false,
      title: '',
      imageUrlFront: '',
      imageUrlBack: '',
      // disableSubmit: false,
      // onlyread: false,
      // applyNo: '',
      id: '',
      defaultTabKey: '',
      programOffices: JSON.parse(sessionStorage.getItem('PROGRAMOFFICES')), // 组织机构
      dbCollectionInfo: JSON.parse(sessionStorage.getItem('DB_COLLECTION_INFO')), // 进件流编号
      dbBusinessChannel: JSON.parse(sessionStorage.getItem('DB_BUSINESS_CHANNEL')), // 业务线名称
      dbCooPerationPlatform: JSON.parse(sessionStorage.getItem('DB_COOPERATION_PLATFORM')), // 合作平台
      dbProductCategory: JSON.parse(sessionStorage.getItem('DB_PRODUCT_CATEGORY')), // 产品分类
      creditList: '',
      model: {},
      form: this.$form.createForm(this),
      dateFormat: 'YYYY-MM-DD',
      disableMixinCreated: true,
      url: {
        upload: window._CONFIG['uploadUrl']
      },
      headers: {
        'X-Access-Token': this.$store.state.user.token,
      },
      validatorRules: {
        // applyAmount: [
        //   { required: true, message: '请输入申请金额!' },
        // ],
        // applyDeadline: [
        //   { required: true, message: '请输入申请期限!' },
        // ]
      },
      watchBtn1: true,
      updateCount: 0,
    }
  },
  computed: {
    sun() {
      return Number(this.jingying.cowStockNum1) + Number(this.jingying.cowStockNum2) + Number(this.jingying.cowStockNum3) + Number(this.jingying.cowStockNum4) || 0
    },
    sum() {
      return Number(this.jingying.bullStockNum1) + Number(this.gnum) || 0
    },
    gnum() {
      return Number(this.jingying.bullStockNum2) + Number(this.jingying.bullStockNum3) + Number(this.jingying.bullStockNum4) + Number(this.jingying.bullStockNum5) + Number(this.jingying.bullStockNum6) + Number(this.jingying.bullStockNum7) + Number(this.jingying.bullStockNum8) || 0
    }
  },
  mounted() {
  },
  watch: {
    jingying: {
      handler(val) {
        if (val) {
          this.updateCount++
          if (this.updateCount > 1) {
            this.watchBtn1 = false
            console.log(this.updateCount)
          }
        }
      },
      deep: true
    }
  },
  methods: {
    moment,
    edit(res, applyNo) {
      this.defaultTabKey = '1'
      // console.log("ssss",res)
      // console.log("hhh",res.cusBankAccountResponses)
      this.assignment(res)
      // this.applyNo = applyNo
      this.id = res.cusBankAccountResponses.id
      this.form.resetFields()
      // this.form2.resetFields()
      this.visible = true
      this.$nextTick(() => { })
    },
    add() {
      this.model = {}
      this.form.resetFields()
      this.visible = true
      this.$nextTick(() => { })
    },

    close() {
      this.$emit('close')
      this.visible = false
      this.disableSubmit = false
      this.selectedRole = []
    },
    resetFields() {
      this.form.resetFields()
    },
    handleSubmit() {
      // 触发表单验证
      this.$refs.form.validate(valid => {
        if (valid) {
          this.confirmLoading = true
          let aType = Number(this.jingying.cowStockNum1) + Number(this.jingying.cowStockNum2) + Number(this.jingying.cowStockNum3) + Number(this.jingying.cowStockNum4)
          let a = [Number(this.jingying.cowStockNum1), Number(this.jingying.cowStockNum2), Number(this.jingying.cowStockNum3), Number(this.jingying.cowStockNum4), aType]
          let bType = Number(this.jingying.bullStockNum2) + Number(this.jingying.bullStockNum3) + Number(this.jingying.bullStockNum4) + Number(this.jingying.bullStockNum5) + Number(this.jingying.bullStockNum6) + Number(this.jingying.bullStockNum7) + Number(this.jingying.bullStockNum8)
          let cType = Number(this.jingying.bullStockNum1) + Number(bType)
          let b = [Number(this.jingying.bullStockNum1), Number(this.jingying.bullStockNum2), Number(this.jingying.bullStockNum3), Number(this.jingying.bullStockNum4), Number(this.jingying.bullStockNum5), Number(this.jingying.bullStockNum6), Number(this.jingying.bullStockNum7), Number(this.jingying.bullStockNum8), bType, cType]
          this.jingying.cowStockNum = a.toString()
          this.jingying.bullStockNum = b.toString()
          let s = this.jingying.surveyTime
          let d = this.jingying.tartBreedYear
          // this.jingying.surveyTime = s.format("YYYY-MM-DD hh:mm:ss")
          // this.jingying.tartBreedYear = d.format("YYYY-MM-DD hh:mm:ss")
          // let applyNo = { applyNo: this.applyNo }
          this.jingying.applyNo = this.applyNo
          // alert(this.jingying.applyNo)
          // let formData = Object.assign(applyNo, this.jingying)
          let formData = this.jingying
          // console.log(a)
          updateCustomerManageInfo(formData)
            .then(res => {
              if (res.status.statusCode == 0) {
                this.$message.success(res.status.statusReason)
                this.$emit('editReload')
                this.updateCount = 0
                this.watchBtn1 = true
              } else {
                this.$message.warning(res.status.statusReason)
              }
            })
            .finally(() => {
              this.confirmLoading = false
              // this.close()
              this.updateCount = 0
              this.watchBtn1 = true
            })
        }
      })
    },
    handleCancel() {
      this.$emit('handleCancel')
    },
    local() {
      // var li = this.jingying
      // console.log("aaaaa",li.cowStockNum.split(",")[0])
      // console.log("我的牛呢?")
    },
    // tabs 回调
    callback(key) {
      if (key == 7) {
        this.$refs.approval.loadData()
      }
    },
    editReload() {
      let _p = { applyNo: this.applyNo }
      queryCustomerManageInfoByNO(_p).then(res => {
        this.assignment(res.result)
      })
    },
    cattleList(val){
      // console.log("ssss",val.target.value)
      if(val.target.value == 0){
        val.target.value = ''
        this.updateCount = 0
      }
    },
    cattleEdit(val){
      // console.log("aaaaaa",val.target.value)
      if(val.target.value == ''){
        val.target.value = 0
        this.updateCount = 0
      }
    },
    cattleAdd(val){
      // console.log("ssss",val.target.value)
      if(val.target.value == 0){
        val.target.value = ''
        this.updateCount = 0
      }
    },
    cattleUp(val){
      // console.log("aaaaaa",val.target.value)
      if(val.target.value == ''){
        val.target.value = 0
        this.updateCount = 0
      }
    },
    assignment(res) {
      this.model = res ? res : {}
      // this.jingying = this.model
      // //console.log("111111", this.jingying)
      // if (this.jingying) {
      //   this.imageUrlFront = this.jingying.idCardUrl
      //   this.imageUrlBack = this.jingying.idCardBackUrl
      // } else {
      //   this.imageUrlFront = ''
      //   this.imageUrlBack = ''
      // }
      // this.collCusContactInfoList = this.model.collCusContactInfoList
      // this.collCusBankAccountList = this.model.cusBankAccountResponses
      // this.collCusExtAttachmentList = this.model.collCusExtAttachmentList
      // this.collCusExtObjDataList = this.model.collCusExtObjDataList
      // this.collCreditStatusList = this.model.collCreditStatusList
      // this.financingInformation = this.model.financingApplyInfoResponse
    }
  }
}
</script>
<style>
.scope-person .ant-modal-body {
  padding: 0 24px !important;
}

.scope-person .ant-modal-body {
  overflow-y: scroll;
  min-height: 600px;
  max-height: 600px !important;
}

.scope-person .ant-tabs-bar {
  margin-bottom: 0;
}

.scope-person .ant-card-body {
  padding: 10px 24px;
}

.scope-person .ant-layout-sider {
  flex: 0 0 300px;
  max-width: 300px !important;
  min-width: 300px !important;
  width: 300px !important;
}

.scope-person .ant-modal-footer {
  display: none;
}

.scope-person .scoped-img img {
  width: 200px;
}
</style>