C端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2068 lines
68 KiB

  1. <template>
  2. <div class="pointrent">
  3. <!-- 合同信息 -->
  4. <div class="layout-content">
  5. <div class="step">
  6. <!-- step -->
  7. <el-steps :active="active" finish-status="success" :align-center="true" class="fx_step">
  8. <el-step title="合同基本信息" class="first_title"></el-step>
  9. <el-step title="款项信息" class="second_title"></el-step>
  10. <el-step title="附件" class="third_title"></el-step>
  11. </el-steps>
  12. <div v-if="active==0">
  13. <el-form ref="form" :model="form" :rules="rules" label-width="130px">
  14. <!-- 选择信息 -->
  15. <div class="shopBox_choose" v-show="shopshow==false">
  16. <!-- <div class="shopBtn_choose" @click="!editIf?buluopenShopDialog():''">选择商户</div> -->
  17. <div class="shopBtn_choose" @click="buluopenShopDialog">选择商户</div>
  18. </div>
  19. <!-- <div class="shopBox" v-show="shopshow" @click="!editIf?buluopenShopDialog():''"> -->
  20. <div class="shopBox" v-show="shopshow" @click="buluopenShopDialog">
  21. <!-- <div class="shopBtn">{{!editIf?'切换商户':''}}</div> -->
  22. <div class="shopBtn">切换商户</div>
  23. <div class="shopContent">
  24. <div class="shoplist">
  25. <div>
  26. <i class="iconfont icon-iconshangpuguanli iconBox"></i>
  27. {{ this.newshopTableData.shopNumber}}
  28. </div>
  29. <div>{{ this.newshopTableData.building}}</div>
  30. <div>{{ this.newshopTableData.floor}}</div>
  31. <div
  32. :style="'color:'+[this.newshopTableData.status=='未出租'?'#EE7653':'#555']+' !important'"
  33. >{{changeStatus(this.newshopTableData.status)}}</div>
  34. <div>{{ this.newshopTableData.buildArea}} ㎡</div>
  35. <div>{{getRent(this.newshopTableData)}}</div>
  36. </div>
  37. <div class="jiaojiao">
  38. <img src="../../../static/images/jiaojiao.png" alt>
  39. </div>
  40. </div>
  41. </div>
  42. <!-- 合同信息 -->
  43. <div class="public_part">
  44. <div class="public_part_title">合同信息</div>
  45. <div class="public_part_Box">
  46. <el-form-item label="合同状态" prop="status" class="fx_send">
  47. <el-select
  48. v-if="!fromBulu"
  49. :disabled="formdisabled"
  50. v-model="form.status"
  51. placeholder="请选择"
  52. class="select-method"
  53. >
  54. <el-option
  55. v-for="item in options"
  56. :key="item.value"
  57. :value="item.value"
  58. :label="item.label"
  59. ></el-option>
  60. </el-select>
  61. <el-input
  62. v-else
  63. disabled
  64. value="合同补录"
  65. style="width:211px;"
  66. ></el-input>
  67. </el-form-item>
  68. <el-form-item label="合同编号" prop="contractNumber" class="fx_title">
  69. <el-input
  70. v-model="form.contractNumber"
  71. placeholder="请输入合同编号"
  72. class="edit-item-input"
  73. maxlength="50"
  74. clearable
  75. ></el-input>
  76. </el-form-item>
  77. <el-form-item label="合同签约日" prop="signDate">
  78. <el-date-picker
  79. type="date"
  80. placeholder="选择日期"
  81. v-model="form.signDate"
  82. :picker-options="pickerAfterdata"
  83. ></el-date-picker>
  84. </el-form-item>
  85. </div>
  86. </div>
  87. <!-- 商户信息 -->
  88. <div class="public_part">
  89. <div class="public_part_title">商户信息</div>
  90. <div class="public_part_Box">
  91. <el-form-item label="商户名称" prop="merchantName" class="fx_title">
  92. <el-input
  93. :disabled="formdisabled"
  94. v-model="form.merchantName "
  95. placeholder="请输入商户名称"
  96. class="edit-item-input"
  97. maxlength="50"
  98. clearable
  99. ></el-input>
  100. </el-form-item>
  101. <el-form-item label="合同主体名称" prop="" class="fx_title">
  102. <el-input
  103. v-model="form.subjectName "
  104. placeholder="合同中乙方主体名称"
  105. maxlength="50"
  106. clearable
  107. ></el-input>
  108. </el-form-item>
  109. <el-form-item label="经营品牌" prop="brand" class="fx_send">
  110. <el-select
  111. :disabled="form.brand==''?false:formdisabled"
  112. v-model="form.brand"
  113. placeholder="请先选择品牌"
  114. class="select-method"
  115. >
  116. <el-option
  117. v-for="(item,index) in brands"
  118. :key="index"
  119. :value="item.id"
  120. :label="item.value"
  121. ></el-option>
  122. </el-select>
  123. </el-form-item>
  124. <el-form-item label="经营业态" prop="businessId" class="fx_send">
  125. <el-select
  126. :disabled="form.businessId==''?false:formdisabled"
  127. v-model="form.businessId"
  128. placeholder="请先选择经营业态"
  129. class="select-method"
  130. >
  131. <el-option
  132. v-for="(item,index) in businessIds"
  133. :key="index"
  134. :value="item.id"
  135. :label="item.title"
  136. ></el-option>
  137. </el-select>
  138. </el-form-item>
  139. <el-form-item label="店面类型" prop="shopType" class="fx_send">
  140. <el-select
  141. :disabled="form.shopType==''?false:formdisabled"
  142. v-model="form.shopType "
  143. placeholder="请先选择店铺类型"
  144. class="select-method"
  145. >
  146. <el-option
  147. v-for="index in shopTypes"
  148. :key="index.value"
  149. :value="index.value"
  150. :label="index.label"
  151. ></el-option>
  152. </el-select>
  153. </el-form-item>
  154. <el-form-item label="联系人" prop="linkPerson" class="fx_title">
  155. <el-input
  156. :disabled="formdisabled"
  157. v-model="form.linkPerson"
  158. placeholder="请输入联系人"
  159. class="edit-item-input"
  160. maxlength="10"
  161. clearable
  162. ></el-input>
  163. </el-form-item>
  164. <el-form-item label="联系电话" prop="linkPhone" class="fx_title">
  165. <el-input
  166. :disabled="formdisabled"
  167. type="text"
  168. v-model="form.linkPhone"
  169. placeholder="请输入手机号或座机号"
  170. class="edit-item-input"
  171. clearable
  172. maxlength="20"
  173. ></el-input>
  174. </el-form-item>
  175. </div>
  176. </div>
  177. <!-- 租赁信息 -->
  178. <div class="public_part">
  179. <div class="public_part_title">租赁信息</div>
  180. <div class="public_part_Box">
  181. <el-form-item label="租赁开始日期" prop="rentalStartDate">
  182. <el-date-picker
  183. type="date"
  184. placeholder="选择日期"
  185. v-model="form.rentalStartDate"
  186. :picker-options="pickerOptions0"
  187. @change="(value) => changeDates(value, 'rentalStartDate')"
  188. ></el-date-picker>
  189. </el-form-item>
  190. <el-form-item label="租赁截止日期" prop="rentalEndDate">
  191. <el-date-picker
  192. type="date"
  193. placeholder="选择日期"
  194. v-model="form.rentalEndDate"
  195. :picker-options="pickerOptions1"
  196. @change="(value) => changeDates(value, 'rentalEndDate')"
  197. ></el-date-picker>
  198. </el-form-item>
  199. <el-form-item label="总租期" class="width">
  200. <span>{{form.totalPeriodMonth}}</span>个月
  201. <span>{{form.totalPeriodDay}}</span>天
  202. </el-form-item>
  203. <el-form-item label="装修日期" prop="fixDate">
  204. <el-date-picker
  205. v-model="form.fixDate"
  206. type="daterange"
  207. style="width:400px!important;"
  208. range-separator="至"
  209. start-placeholder="开始日期"
  210. end-placeholder="结束日期"
  211. ></el-date-picker>
  212. </el-form-item>
  213. <el-form-item label="计租开始日期" prop="startDate">
  214. <el-date-picker
  215. type="date"
  216. placeholder="选择日期"
  217. v-model="form.startDate"
  218. @change="comperData"
  219. ></el-date-picker>
  220. </el-form-item>
  221. <el-form-item label="账单生成方式" prop="adjustPeriod">
  222. <el-radio-group
  223. v-model="form.adjustPeriod"
  224. @change="setAdjustPeriod"
  225. size="small"
  226. style="margin-left:20px;"
  227. >
  228. <el-radio-button label="2" value="2">按计租日期</el-radio-button>
  229. <el-radio-button label="3" value="3">按自然月</el-radio-button>
  230. </el-radio-group>
  231. </el-form-item>
  232. </div>
  233. </div>
  234. </el-form>
  235. </div>
  236. </div>
  237. </div>
  238. <shop-list-dgnew
  239. :ref="tKeynew"
  240. :t-keynew="tKeynew"
  241. :shops-type="shopsType"
  242. :cbnew="getShopCbNew"
  243. ></shop-list-dgnew>
  244. <!-- 款项信息 -->
  245. <div v-if="active==1" class="layout-content">
  246. <el-form ref="form" :model="form" :rules="rules" label-width="130px">
  247. <div class="public_part">
  248. <div class="public_part_title">租金信息</div>
  249. <div class="public_part_Box">
  250. <el-form-item label="选择计算方式" prop="type" class="fx_send">
  251. <el-select
  252. :value="form.type"
  253. @input="changeFormData('type', $event)"
  254. placeholder="请先选择计算方式"
  255. class="select-method"
  256. >
  257. <el-option
  258. v-for="index in computedTypes"
  259. :key="index.value"
  260. :value="index.value"
  261. :label="index.label"
  262. ></el-option>
  263. </el-select>
  264. </el-form-item>
  265. <div>
  266. <el-form-item label="计租面积" prop="rentArea" class="fx_title numberInputBox">
  267. <el-input
  268. type="number"
  269. :value="form.rentArea"
  270. @input="changeArea('rentArea', $event)"
  271. placeholder="请输入计租面积"
  272. maxlength="8"
  273. clearable
  274. ></el-input>
  275. <span class="per">㎡</span>
  276. </el-form-item>
  277. <el-form-item label="租赁单价" prop="rentPrice" class="fx_title" v-if="this.form.type!=2">
  278. <el-radio-group
  279. :value="form.priceUnit"
  280. @input="changeFormData('priceUnit', $event)"
  281. size="small"
  282. >
  283. <el-radio-button
  284. v-for="(item,index) in priceUnitOption"
  285. :key="index"
  286. :label="item.value"
  287. >{{item.name}}</el-radio-button>
  288. </el-radio-group>
  289. </el-form-item>
  290. <el-form-item label prop="rentPrice" class="fx_title" v-if="this.form.type!=2">
  291. <el-input
  292. :value="form.rentPrice"
  293. @input="changeArea('rentPrice', $event)"
  294. placeholder="请输入租赁单价"
  295. maxlength="10"
  296. clearable
  297. ></el-input>
  298. <span class="per">元/㎡</span>
  299. </el-form-item>
  300. <el-form-item label="租金" prop="price" class="fx_title" v-if="this.form.type!=2">
  301. <el-input v-model="form.price" placeholder="请输入租金金额" maxlength="10" clearable></el-input>
  302. <span class="per">元/{{changeUnitType}}</span>
  303. </el-form-item>
  304. <el-form-item label="保底营业额" prop="revenue" class="fx_title" v-if="this.form.type==2">
  305. <el-input v-model="form.revenue" placeholder="请输入保底营业额金额" maxlength="10" clearable></el-input>
  306. <span class="per">元/{{changeUnitType}}</span>
  307. </el-form-item>
  308. <!-- prop="payRatio" -->
  309. <el-form-item
  310. label="联营扣点率"
  311. v-if="this.form.type!=1"
  312. prop="payRatio"
  313. class="fx_title numberInputBox"
  314. >
  315. <el-input
  316. type="number"
  317. v-if="form.busDiscountRatio==''"
  318. v-model="form.payRatio"
  319. placeholder="请输入"
  320. maxlength="10"
  321. clearable
  322. ></el-input>
  323. <span v-if="form.busDiscountRatio==''" class="per" style="margin-right:30px;">%</span>
  324. <el-button @click="jumpRateSet" size="small" class="jump-rate-set" type="primary">跳点设置</el-button>
  325. <!-- ul -->
  326. <show-rate-list v-show="form.busDiscountRatio!=''"></show-rate-list>
  327. </el-form-item>
  328. <!-- <el-form-item label="联营扣点率" prop="payRatio" class="fx_title" v-if="this.form.type!=1">
  329. <el-input v-model="form.payRatio" placeholder="请输入" maxlength="10" clearable></el-input>
  330. <span class="per">%</span>
  331. </el-form-item> -->
  332. <el-form-item label="押金" prop="deposit" class="fx_title">
  333. <el-input v-model="form.deposit" placeholder="请输入押金金额" maxlength="10" clearable></el-input>
  334. <span class="per">元</span>
  335. </el-form-item>
  336. <el-form-item label="付款周期" prop="receivePeriod" class="paydata">
  337. <el-select
  338. v-model="form.receivePeriod"
  339. filterable
  340. class="select-method innerinput"
  341. style="width:150px"
  342. >
  343. <el-option
  344. v-for="index in cycles"
  345. :key="index.value"
  346. :value="index.value"
  347. :label="index.label"
  348. ></el-option>
  349. </el-select>
  350. <!-- <el-input-number
  351. v-if="form.priceUnit==1"
  352. :value="form.receivePeriod"
  353. @input="changeFormData('receivePeriod', $event)"
  354. controls-position="right"
  355. :min="1"
  356. :max="365"
  357. ></el-input-number> -->
  358. <span class="per">月</span>
  359. </el-form-item>
  360. <div v-if="isshowYear">
  361. <el-form-item v-if="months.length>0" label="年租金调整" class="fx_title" style="display:inline-block;">
  362. <el-radio-group
  363. :value="form.adjustRatioWay"
  364. @input="changeFormData('adjustRatioWay', $event)"
  365. size="small"
  366. style="margin-left:20px;" >
  367. <el-radio-button label="1" value="1">比例上调</el-radio-button>
  368. <el-radio-button label="2" value="2">固定上调</el-radio-button>
  369. <el-radio-button label="3" value="3">自定义</el-radio-button>
  370. </el-radio-group>
  371. <!-- <help title="" content="年租金调整为固定上调,请在输入框中输入需要上调的比例或金额"></help> -->
  372. </el-form-item>
  373. <div v-if="form.adjustRatioWay==1" class="per-list">
  374. <el-form-item
  375. v-for="index in months" :key="index" label="" :value="index" :prop="`adjustRatio[${index}]`" :rules="formvail.adjustRatio" class="fx_title" style="display:inline-block;width:400px;">
  376. <el-input v-model="form.adjustRatio[index]" placeholder="调整比例" clearable >
  377. <template slot="prepend">第{{index+2}}年</template>
  378. </el-input>
  379. <span class="per">%</span>
  380. </el-form-item>
  381. </div>
  382. <div v-else class="per-list">
  383. <el-form-item
  384. v-for="index in months" :key="index" label="" :value="index" :prop="`adjustRatio[${index}]`" :rules="formvail.adjustRatio1" class="fx_title" style="display:inline-block;width:400px;">
  385. <el-input v-model="form.adjustRatio[index]" placeholder="调整金额" clearable>
  386. <template slot="prepend">第{{index+2}}年</template>
  387. </el-input>
  388. <span class="per">元/{{changeUnitType}}</span>
  389. </el-form-item>
  390. </div>
  391. </div>
  392. </div>
  393. </div>
  394. <el-row>
  395. <el-col :span="8">
  396. <el-form-item
  397. label="滞纳金费率"
  398. label-width="160px"
  399. prop='latePayRatio'
  400. >
  401. <el-input
  402. style="width:150px"
  403. v-model="form.latePayRatio"
  404. placeholder="请输入"
  405. maxlength="10"
  406. clearable
  407. ></el-input>
  408. %
  409. </el-form-item>
  410. </el-col>
  411. <el-col :span="14">
  412. <el-form-item
  413. label="欠缴后"
  414. prop='latePayDay'
  415. >
  416. <el-input
  417. style="width:150px"
  418. v-model="form.latePayDay"
  419. placeholder="请输入"
  420. maxlength="10"
  421. clearable
  422. ></el-input>
  423. 日开始计费
  424. <help title content="例如:“0”为欠缴当天开始计滞纳金"></help>
  425. </el-form-item>
  426. </el-col>
  427. </el-row>
  428. </div>
  429. <div class="public_part">
  430. <div class="public_part_title">账户信息</div>
  431. <div class="public_part_Box">
  432. <el-form-item label="甲方接收账户" prop="payAccount" class="fx_title">
  433. <el-input v-model="form.payAccount " placeholder="请输入接收账户" maxlength="20" clearable></el-input>
  434. </el-form-item>
  435. <el-form-item label="开户行" prop="bankName" class="fx_title">
  436. <el-input v-model="form.bankName " placeholder="请输入开户行" maxlength="20" clearable></el-input>
  437. </el-form-item>
  438. </div>
  439. </div>
  440. </el-form>
  441. </div>
  442. <!-- 附件 -->
  443. <div class="layout-content" v-show="active==2">
  444. <!-- 合同上传 -->
  445. <el-form ref="form02" :model="form" :rules="rules" label-width="130px">
  446. <div class="public_part">
  447. <div class="public_part_title">合同租金明细</div>
  448. <div class="public_part_Box">
  449. <el-radio-group v-model="form.rentStartType" @change="submitMoney()" style="margin-bottom:20px;">
  450. <el-radio :label="1" border>按租赁开始日生成</el-radio>
  451. <el-radio :label="2" border>按计租日生成</el-radio>
  452. </el-radio-group>
  453. <rent-bill :data="billData" :id="form.id" :type='1' :ref="billTk"></rent-bill>
  454. </div>
  455. </div>
  456. <div class="public_part">
  457. <div class="public_part_title">附件</div>
  458. <div class="public_part_Box" style="width:800px;">
  459. <el-form-item label="合同文件:">
  460. <el-upload
  461. class="upload-demo fx_upload"
  462. drag
  463. action="/api/upload/awsFileUpload"
  464. :on-error="importError"
  465. :on-success="importSuccess"
  466. :on-remove="handleRemove"
  467. :file-list="fileNames"
  468. :beforeUpload="beforeUpload"
  469. >
  470. <i class="el-icon-upload"></i>
  471. <div class="el-upload__text">
  472. 将文件拖到此处,或
  473. <em>点击上传</em>
  474. </div>
  475. </el-upload>
  476. </el-form-item>
  477. </div>
  478. <div class="public_part_title" v-if="processData.length>0">合同审批</div>
  479. <div class="public_part_Box" style="width:800px;" v-if="processData.length>0">
  480. <el-form-item label="审批流程">
  481. <process-template :processData="processData"></process-template>
  482. </el-form-item>
  483. <el-form-item label="备注" prop="remark">
  484. <el-input
  485. type="textarea"
  486. maxlength="150"
  487. v-model="form.remark"
  488. placeholder="请填写备注!"
  489. class="edit-item-input"
  490. ></el-input>
  491. </el-form-item>
  492. </div>
  493. </div>
  494. </el-form>
  495. </div>
  496. <div class="group-btn">
  497. <el-button class="quxiaoBtn" @click="goback" v-if="active!=0">返回上一步</el-button>
  498. <el-button class="quxiaoBtn" @click="cancel" v-show="iscancel">取消</el-button>
  499. <el-button class="baocunBtn" :loading="loading" @click="submit('form02')" v-if="active==2">保存</el-button>
  500. <el-button class="nextBtn" @click="next('form')" v-if="active!=2">下一步</el-button>
  501. </div>
  502. <!-- -->
  503. <jump-rate-set ref="jumpRateSetDialog"></jump-rate-set>
  504. </div>
  505. </template>
  506. <script>
  507. import help from "../../help.vue";
  508. import commonUtil from "../../../core/tool/commonUtil";
  509. import shopListDgnew from "../contractComp/shopListDgnew.vue"; //补录合同
  510. import moment from "moment";
  511. import { mapState, mapActions } from "vuex";
  512. import { deepcopy } from "../../../utils/validate";
  513. import rentBill from "../contractutil/rentbill.vue";
  514. import { ContractUrl } from "../businessComp/UrlEnum.js";
  515. import { ContractData } from "../../../service/contract/data.js";
  516. import processTemplate from "../contractutil/processTemplate.vue";
  517. import jumpRateSet from '../rent/jumpRateSet.vue';
  518. import showRateList from '../rent/showRateList.vue';
  519. import { promissionUrl } from "../../../urlconfig/promission/url.js";
  520. import Vue from "vue";
  521. export default {
  522. components: {
  523. shopListDgnew,
  524. rentBill,
  525. processTemplate,
  526. help,
  527. jumpRateSet,
  528. showRateList,
  529. },
  530. name: "pointrentBulu",
  531. data() {
  532. return {
  533. ...mapActions(["setRentInfo", "setNavData", "setFormData"]),
  534. processData: [],
  535. loading: false,
  536. billTk: "rentbill",
  537. billData: null,
  538. editIf: false,
  539. pickerAfterdata: {
  540. // disabledDate(time) {
  541. // return time.getTime() < Date.now() - 8.64e7; //限制只能选今天以后的日期
  542. // }
  543. },
  544. brands: [],
  545. fileNames: [],
  546. months: [],
  547. copelease: "", //总租期备份
  548. shopsType: "2",
  549. dateType: "月",
  550. isshowYear: true,
  551. tKey: "shopListDg",
  552. tKeynew: "shopListDgnew",
  553. active: 0,
  554. formdisabled: false,
  555. shopshow: false,
  556. iscancel: true,
  557. businessIds: [], //经营业态列表
  558. newshopTableData: {},
  559. priceUnitOption: ContractData.priceUnitOption,
  560. //来自补录还是编辑补录
  561. fromBulu: false,
  562. form: {
  563. adjustRatioWay:'1',//年物业费调整方式1、比例上调2、按固定上调
  564. operationType:1,
  565. rentStartType:1,
  566. rentPrice: 0,
  567. fixDate: [],
  568. rentShopType: 2,
  569. signDate: "", //合同签约日
  570. startDate: "", //起租日
  571. rentalStartDate: "", //租赁开始日期
  572. rentalEndDate: "", //租賃截止日期
  573. totalPeriodMonth: 0, //总租期(月)
  574. totalPeriodDay: 0, //总租期(天)
  575. priceUnit: "2",
  576. lease: "",
  577. shopTableData: [], //商铺信息列表
  578. brand: "", //商铺经营品牌
  579. subjectName:"",//合同主体名称
  580. merchantName: "", //商户名称
  581. contractNumber: "", //合同编号
  582. status: "", //合同状态
  583. linkPerson: "", //联系人
  584. linkPhone: "", //联系人电话
  585. rentArea: "", //计租面积
  586. shopType: "", //店铺类型
  587. zuqi: "", //计租日期
  588. price: "", //租金
  589. deposit: "", //押金
  590. receivePeriod: "", //付款周期
  591. payAccount: "", //支付账号
  592. payDate: "", //支付规则
  593. shopId: "", //商铺id
  594. filepath: "", //文件路径
  595. filename: "", //文件名称
  596. merchantId: "", //商户id
  597. businessId: "", //经营业态
  598. id: "",
  599. type: 1, //计算方式
  600. revenue: "", //营业额
  601. payRatio: "", //支付比例
  602. busDiscountRatio: "", //跳点信息
  603. busDiscountTime: 1, //时间计算类型123年月日
  604. adjustRatio: [], //上浮比例
  605. adjustPeriod: "2", //周期按天还是按月
  606. monthHandleType: "2",
  607. accountType: "", //支付账号类型
  608. bankName: "", //开户行
  609. latePayRatio:"",
  610. latePayDay:""
  611. },
  612. //合同状态
  613. options: [
  614. {
  615. value: 0,
  616. label: "意向"
  617. },
  618. {
  619. value: 1,
  620. label: "待签约"
  621. },
  622. {
  623. value: 8,
  624. label: "合同补录"
  625. }
  626. ],
  627. // 店铺类型
  628. shopTypes: ContractData.shopTypes,
  629. //计租计算方式
  630. computedTypes: ContractData.computedTypes,
  631. //周期浮动比例
  632. changeScale: [
  633. {
  634. value: 3,
  635. label: "3"
  636. },
  637. {
  638. value: 6,
  639. label: "6"
  640. },
  641. {
  642. value: 12,
  643. label: "12"
  644. }
  645. ],
  646. cycles: ContractData.cycles,
  647. formvail: {
  648. adjustRatio: [
  649. {
  650. required: true,
  651. message: "抱歉,不能识别您输入的浮动比例",
  652. trigger: "blur"
  653. },
  654. {
  655. validator(rule, value, callback, source, options) {
  656. var errors = [];
  657. const reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
  658. if (!reg.test(value)) {
  659. callback("抱歉,浮动比例限制为数字");
  660. } else if (value > 50) {
  661. callback("抱歉,浮动比例不能大于50%");
  662. }
  663. callback(errors);
  664. }
  665. }
  666. ],
  667. adjustRatio1:[
  668. {
  669. required: true,
  670. message: "抱歉,此项为必填项!",
  671. trigger: "blur"
  672. },
  673. {
  674. validator(rule, value, callback, source, options) {
  675. var errors = [];
  676. const reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
  677. console.log(value)
  678. if (!reg.test(value)||Number(value)>=10000000) {
  679. callback("抱歉,金额限制为大于0且小于9999999.99的最多保留两位小数的数字!");
  680. }
  681. callback(errors);
  682. }
  683. }
  684. ]
  685. },
  686. rules: {
  687. latePayRatio: [
  688. {
  689. required: false,
  690. trigger: "blur"
  691. },
  692. {
  693. validator(rule, value, callback, source, options) {
  694. var errors = [];
  695. const reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
  696. if (!reg.test(value)&&value!='') {
  697. callback("抱歉,滞纳金费率限制为大于0且最多保留两位小数的数字");
  698. } else {
  699. if (typeof value == "string") {
  700. if (Number(value)>100) {
  701. callback("滞纳金费率最大值为100%");
  702. }
  703. }
  704. }
  705. callback(errors);
  706. }
  707. }
  708. ],
  709. latePayDay: [
  710. {
  711. required: false,
  712. trigger: "blur"
  713. },
  714. {
  715. validator(rule, value, callback, source, options) {
  716. var errors = [];
  717. const reg = /^[0-9]+$/;
  718. if (!reg.test(value)&&value!='') {
  719. callback("抱歉,限制为0~1000的整数!");
  720. } else {
  721. if (typeof value == "string") {
  722. if (Number(value)>1000) {
  723. callback("抱歉,限制为0~1000的整数!");
  724. }
  725. }
  726. }
  727. callback(errors);
  728. }
  729. }
  730. ],
  731. adjustPeriod: [
  732. {
  733. required: true,
  734. trigger: "change",
  735. message: "抱歉,请选择账单生成方式"
  736. }
  737. ],
  738. monthHandleType: [
  739. {
  740. required: true,
  741. trigger: "change",
  742. message: "抱歉,不能识别您选择的账单生成方式"
  743. }
  744. ],
  745. rentalStartDate: [
  746. {
  747. required: true,
  748. trigger: "change",
  749. message: "抱歉,不能识别您选择的租赁开始日期"
  750. }
  751. ],
  752. rentalEndDate: [
  753. {
  754. required: true,
  755. trigger: "change",
  756. message: "抱歉,不能识别您选择的租赁结束日期"
  757. }
  758. ],
  759. startDate: [
  760. {
  761. required: true,
  762. trigger: "change",
  763. message: "抱歉,不能识别您选择的计租开始日期"
  764. }
  765. ],
  766. signDate: [
  767. {
  768. required: true,
  769. trigger: "change",
  770. message: "抱歉,不能识别您选择的合同签约日"
  771. }
  772. ],
  773. revenue: [
  774. {
  775. required: true,
  776. pattern: /.+/,
  777. message: "抱歉,不能识别您输入的营业额",
  778. trigger: "blur"
  779. },
  780. {
  781. validator(rule, value, callback, source, options) {
  782. var errors = [];
  783. const reg = /(^[0-9]\d*(\.\d{1,2})?$)|(^1(\.\d{1,2})?$)/;
  784. if (!reg.test(value)) {
  785. callback("抱歉,营业额限制为数字");
  786. } else {
  787. if (typeof value == "string") {
  788. if (value.split(".")[0].length > 7) {
  789. callback("最大金额为9999999.99");
  790. }
  791. }
  792. }
  793. callback(errors);
  794. }
  795. }
  796. ],
  797. lease: [
  798. {
  799. required: true,
  800. trigger: "blur",
  801. message: "抱歉,不能识别您输入的总租期"
  802. },
  803. {
  804. validator(rule, value, callback, source, options) {
  805. var errors = [];
  806. const reg = /^[0-9]*[1-9][0-9]*$/;
  807. if (value && !reg.test(value)) {
  808. callback("抱歉,总租期必须是正整数");
  809. }
  810. callback(errors);
  811. }
  812. }
  813. ],
  814. status: [
  815. {
  816. required: true,
  817. trigger: "change",
  818. message: "抱歉,不能识别您选择的合同状态"
  819. }
  820. ],
  821. businessId: [
  822. {
  823. required: true,
  824. trigger: "change",
  825. message: "抱歉,不能识别您选择的经营业态"
  826. }
  827. ],
  828. contractNumber: [
  829. {
  830. required: true,
  831. trigger: "blur",
  832. message: "抱歉,不能识别您输入的合同编号"
  833. }
  834. ],
  835. merchantName: [
  836. {
  837. required: true,
  838. trigger: "blur",
  839. message: "抱歉,不能识别您输入的商铺名称"
  840. }
  841. ],
  842. zuqi: [
  843. {
  844. required: true,
  845. trigger: "blur",
  846. message: "抱歉,不能识别您输入的总租期"
  847. }
  848. ],
  849. receivePeriod: [
  850. {
  851. required: true,
  852. trigger: "blur",
  853. message: "抱歉,不能识别您输入的付款周期"
  854. },
  855. {
  856. validator(rule, value, callback, source, options) {
  857. var errors = [];
  858. if (value < 1) {
  859. callback("抱歉,付款周期不能小于1");
  860. }
  861. callback(errors);
  862. }
  863. }
  864. ],
  865. payDate: [
  866. {
  867. required: true,
  868. trigger: "blur",
  869. message: "抱歉,不能识别您输入的支付规定"
  870. },
  871. {
  872. validator(rule, value, callback, source, options) {
  873. var errors = [];
  874. if (value > 31 || value < 1) {
  875. callback("抱歉,支付日期只能是1-31");
  876. }
  877. callback(errors);
  878. }
  879. }
  880. ],
  881. rentdata: [
  882. {
  883. required: true,
  884. trigger: "blur",
  885. message: "抱歉,不能识别您输入的交租日"
  886. }
  887. ],
  888. firstrentdata: [
  889. {
  890. required: true,
  891. trigger: "blur",
  892. message: "抱歉,不能识别您输入的首期款缴日期"
  893. }
  894. ],
  895. linkPhone: [
  896. {
  897. required: true,
  898. message: "抱歉,不能识别您输入的手机号哦!",
  899. trigger: "blur"
  900. },
  901. {
  902. validator(rule, value, callback, source, options) {
  903. var errors = [];
  904. var mobile = /^1[0|1|2|3|4|5|6|7|8|9]\d{9}$/,
  905. phone = /^0\d{2,3}-?\d{7,8}$/;
  906. if (value && !mobile.test(value) && !phone.test(value)) {
  907. callback("抱歉,请输入正确的手机号和座机号");
  908. }
  909. if (value && !mobile.test(value) && !phone.test(value)) {
  910. callback("抱歉,请输入正确的手机号和座机号");
  911. }
  912. callback(errors);
  913. }
  914. }
  915. ],
  916. // addr: [{
  917. // required: true,
  918. // message: '地址不能不能为空...',
  919. // trigger: 'blur'
  920. // }],
  921. linkPerson: [
  922. {
  923. required: true,
  924. message: "抱歉,不能识别您输入的联系人",
  925. trigger: "blur"
  926. }
  927. ],
  928. buildArea: [
  929. {
  930. required: true,
  931. pattern: /.+/,
  932. message: "抱歉,不能识别您输入的建筑面积",
  933. trigger: "blur"
  934. },
  935. {
  936. validator(rule, value, callback, source, options) {
  937. var errors = [];
  938. const reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^1(\.\d{1,2})?$)/;
  939. if (!reg.test(value)) {
  940. callback("抱歉,建筑面积限制为大于0的数字");
  941. }
  942. callback(errors);
  943. }
  944. }
  945. ],
  946. rentArea: [
  947. {
  948. required: true,
  949. pattern: /.+/,
  950. message: "抱歉,不能识别您输入的计租面积",
  951. trigger: "blur"
  952. },
  953. {
  954. validator(rule, value, callback, source, options) {
  955. var errors = [];
  956. const reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
  957. if (!reg.test(value)) {
  958. callback("抱歉,计租面积限制为大于等于0的且最多保留两位小数");
  959. }else {
  960. if (typeof value == "string") {
  961. if (value.split(".")[0].length > 7) {
  962. callback("最大值为9999999.99");
  963. }
  964. }
  965. }
  966. callback(errors);
  967. }
  968. }
  969. ],
  970. price: [
  971. {
  972. required: true,
  973. pattern: /.+/,
  974. message: "抱歉,不能识别您输入的租金金额",
  975. trigger: "blur"
  976. },
  977. {
  978. validator(rule, value, callback, source, options) {
  979. var errors = [];
  980. const reg = /^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$/;
  981. if (!reg.test(value)) {
  982. callback("抱歉,租金金额限制为大于0的数字");
  983. } else {
  984. if (typeof value == "string") {
  985. if (value.split(".")[0].length > 7) {
  986. callback("最大金额为9999999.99");
  987. }
  988. }
  989. }
  990. callback(errors);
  991. }
  992. }
  993. ],
  994. rentPrice: [
  995. {
  996. required: true,
  997. pattern: /.+/,
  998. message: "抱歉,不能识别您输入的租金单价",
  999. trigger: "blur"
  1000. },
  1001. {
  1002. validator(rule, value, callback, source, options) {
  1003. var errors = [];
  1004. const reg = /(^[0-9]\d*(\.\d{1,2})?$)|(^1(\.\d{1,2})?$)/;
  1005. if (!reg.test(value)) {
  1006. callback("抱歉,租金单价限制为大于等于0保留两位小数数字");
  1007. } else {
  1008. if (typeof value == "string") {
  1009. if (value.split(".")[0].length > 7) {
  1010. callback("最大金额为9999999.99");
  1011. }
  1012. }
  1013. }
  1014. callback(errors);
  1015. }
  1016. }
  1017. ],
  1018. deposit: [
  1019. {
  1020. required: true,
  1021. pattern: /.+/,
  1022. message: "抱歉,不能识别您输入的押金金额",
  1023. trigger: "blur"
  1024. },
  1025. {
  1026. validator(rule, value, callback, source, options) {
  1027. var errors = [];
  1028. const reg = /(^[0-9]\d*(\.\d{1,2})?$)|(^1(\.\d{1,2})?$)/;
  1029. if (!reg.test(value)) {
  1030. callback("抱歉,押金金额限制为大于0的数字");
  1031. } else {
  1032. if (typeof value == "string") {
  1033. if (value.split(".")[0].length > 7) {
  1034. callback("最大金额为9999999.99");
  1035. }
  1036. }
  1037. }
  1038. callback(errors);
  1039. }
  1040. }
  1041. ],
  1042. type: [
  1043. {
  1044. required: true,
  1045. message: "抱歉,不能识别您选择的计算方式",
  1046. trigger: "change"
  1047. }
  1048. ],
  1049. payRatio: [
  1050. {
  1051. required: true,
  1052. message: "抱歉,不能识别您输入的支付比例",
  1053. trigger: "blur"
  1054. },
  1055. {
  1056. validator(rule, value, callback, source, options) {
  1057. var errors = [];
  1058. /* const reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^1(\.\d{1,2})?$)/;
  1059. if (!reg.test(value)) {
  1060. callback("抱歉,最多只能保留两位小数");
  1061. } else if (value < 0 || value > 100) {
  1062. callback("抱歉,支付比例不能小于0或大于100%");
  1063. } */
  1064. const reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/;
  1065. if (!reg.test(value) || value < 0 || value > 100) {
  1066. callback(
  1067. "抱歉,联营扣点数值限制为大于0%~100%且最多保留两位小数!"
  1068. );
  1069. }
  1070. callback(errors);
  1071. }
  1072. }
  1073. ],
  1074. adjustPeriod: [
  1075. {
  1076. required: true,
  1077. message: "抱歉,不能识别您选择的周期",
  1078. trigger: "change"
  1079. }
  1080. ]
  1081. }
  1082. };
  1083. },
  1084. watch: {
  1085. formData: {
  1086. handler(newVal, oldVal) {
  1087. this.form.busDiscountRatio = newVal.busDiscountRatio;
  1088. this.form.payRatio = newVal.payRatio;
  1089. this.form.busDiscountTime = newVal.busDiscountTime;
  1090. },
  1091. deep: true,
  1092. immediate: true
  1093. }
  1094. },
  1095. computed: {
  1096. ...mapState({
  1097. rentInfo: state => state.setRentInfo.rentInfo,
  1098. formData: state => state.setRentInfo.formData
  1099. }),
  1100. getFreceveperiodUnit() {
  1101. return this.form.priceUnit == 1 ? "日" : "月";
  1102. },
  1103. changeUnitType() {
  1104. return this.priceUnitOption.filter(e => e.value == this.form.priceUnit)[0]
  1105. .name;
  1106. },
  1107. pickerOptions0: function() {
  1108. return {
  1109. disabledDate: time => {
  1110. let endDate = moment(this.form.rentalEndDate);
  1111. if (endDate) {
  1112. return moment(time) > endDate;
  1113. }
  1114. }
  1115. };
  1116. },
  1117. pickerOptions1: function() {
  1118. return {
  1119. disabledDate: time => {
  1120. let beginDateVal = moment(this.form.rentalStartDate);
  1121. if (beginDateVal) {
  1122. return moment(time) < beginDateVal;
  1123. }
  1124. }
  1125. };
  1126. }
  1127. },
  1128. methods: {
  1129. // 打开jumpRateSet 跳点设置弹框组件
  1130. jumpRateSet() {
  1131. this.$refs['jumpRateSetDialog'].openDialog();
  1132. },
  1133. getRent(item){
  1134. return item.rent?item.rent+' 元/㎡/'+this.priceUnitOption.filter(e=>e.value==item.rent_unit)[0].name:'未设置';
  1135. },
  1136. /**
  1137. * 修改租赁面积及单价改变租金
  1138. */
  1139. changeArea(type, val) {
  1140. this.form[type] = val;
  1141. this.form.price =
  1142. ((Number(this.form["rentPrice"] * 100) *
  1143. Number(this.form["rentArea"] * 100)) /
  1144. 10000).toFixed(2);
  1145. },
  1146. changeFormData(type, val) {
  1147. this.form[type] = val;
  1148. if(type=='type'&&val==2){
  1149. this.form.priceUnit=2;
  1150. }
  1151. },
  1152. //
  1153. setAdjustPeriod(e) {
  1154. this.form.adjustPeriod = e;
  1155. // this.form.adjustRatio = [];
  1156. },
  1157. //修改租赁开始时间及租赁结束日期
  1158. changeDates(e, type) {
  1159. this.form[type] = e;
  1160. this.getDateDiff(this.form.rentalStartDate, this.form.rentalEndDate);
  1161. },
  1162. getDateDiff(rentalStartDate, rentalEndDate) {
  1163. if (rentalStartDate && rentalEndDate) {
  1164. this.getFetch(
  1165. `${ContractUrl.getDateDiff}?startDate=${moment(
  1166. this.form.rentalStartDate
  1167. ).format("YYYY-MM-DD")}&endDate=${moment(this.form.rentalEndDate)
  1168. .add(1, "days")
  1169. .format("YYYY-MM-DD")}`
  1170. ).then(res => {
  1171. this.form.totalPeriodMonth = res.data.month;
  1172. this.form.totalPeriodDay = res.data.day;
  1173. this.form.lease =
  1174. Number(res.data.month) + (Number(res.data.day) > 0 ? 1 : 0);
  1175. this.lease();
  1176. });
  1177. }
  1178. },
  1179. changeStatus(value) {
  1180. return value == 1 ? "已出租" : "未出租";
  1181. },
  1182. next(formName) {
  1183. this.$refs[formName].validate(valid => {
  1184. if (valid) {
  1185. this.lease();
  1186. if (this.form.shopTableData.length == 0) {
  1187. this.$message.error("抱歉,请先选择点位商铺");
  1188. return;
  1189. }
  1190. if(this.form.lease>600){
  1191. this.$message.error("抱歉,总租期最大限制为600个月");
  1192. return;
  1193. }
  1194. for (let shopItem of this.form.shopTableData) {
  1195. this.form.shopId = shopItem.id;
  1196. this.form.merchantId = shopItem.merchantId;
  1197. }
  1198. if (this.form.startDate && this.form.rentalStartDate) {
  1199. //计租开始时间
  1200. let startDate = moment(this.form.startDate).format("YYYY-MM-DD");
  1201. //租赁开始日期
  1202. let rentalStartDate = moment(this.form.rentalStartDate).format(
  1203. "YYYY-MM-DD"
  1204. );
  1205. if (moment(startDate).isBefore(rentalStartDate)) {
  1206. this.$message.error("计租开始日期不能早于租赁开始日期");
  1207. return;
  1208. }
  1209. }
  1210. if(moment(this.form.startDate).valueOf()>moment(this.form.rentalEndDate).valueOf()){
  1211. this.$message.error("计租开始日期不能大于租赁结束日期");
  1212. return;
  1213. }
  1214. if (this.active != 0) {
  1215. this.submitOn();
  1216. } else {
  1217. this.active += 1;
  1218. this.iscancel = false;
  1219. }
  1220. } else {
  1221. return false;
  1222. }
  1223. });
  1224. },
  1225. //合同基本信息提交
  1226. submit(formName) {
  1227. this.$refs[formName].validate(valid => {
  1228. if (valid) {
  1229. this.submitOn();
  1230. } else {
  1231. return false;
  1232. }
  1233. });
  1234. },
  1235. //保存第一步
  1236. saveFirst(url, param) {
  1237. this.loading = true;
  1238. this.postFetch(url, param)
  1239. .then(d => {
  1240. this.iscancel = false;
  1241. if (this.active == 2) {
  1242. if (this.processData.length<=0) {
  1243. this.updateRentContractStatus();
  1244. }else{
  1245. this.$message.success("提交成功");
  1246. this.loading = false;
  1247. this.$router.back(-1);
  1248. }
  1249. } else {
  1250. this.form.id = d.data.id;
  1251. this.active += 1;
  1252. this.loading = false;
  1253. this.$refs[this.billTk].setData(d.data.previewBillRentList,this.form.receivePeriod);
  1254. }
  1255. //
  1256. /* if (d.data.busDiscountRatio == undefined) {
  1257. d.data.busDiscountRatio = '';
  1258. } */
  1259. let myObj = Object.assign({},this.formData);
  1260. myObj.busDiscountRatio = d.data.busDiscountRatio;
  1261. myObj.busDiscountTime = d.data.busDiscountTime;
  1262. myObj.payRatio = Number(d.data.payRatio) / 100;
  1263. this.setFormData(myObj);
  1264. // this.form.busDiscountRatio = d.data.busDiscountRatio;
  1265. // _this.submitApproval(d.data.contractNumber);
  1266. })
  1267. .catch(err => {
  1268. this.$message.error(err.data);
  1269. this.loading = false;
  1270. });
  1271. },
  1272. updateRentContractStatus(){
  1273. let param = {
  1274. id:this.form.id
  1275. }
  1276. this.postFetch(ContractUrl.updateRentContractStatus,param)
  1277. .then(d=>{
  1278. this.$message.success("保存成功!");
  1279. this.loading = false;
  1280. this.$router.back(-1);
  1281. //
  1282. this.formData.busDiscountRatio = '';
  1283. this.formData.busDiscountTime = 1;
  1284. this.formData.payRatio = 0;
  1285. this.setFormData(this.formData);
  1286. })
  1287. .catch(err=>{
  1288. this.$message.error(err.data);
  1289. })
  1290. },
  1291. submitMoney() {
  1292. let param = {
  1293. id: this.form.id,
  1294. rentStartType: this.form.rentStartType,
  1295. rentalStartDate:moment(this.form.rentalStartDate).format('YYYY-MM-DD')+' 00:00:00'
  1296. };
  1297. let _this = this;
  1298. _this
  1299. .postFetch("/api/wxRentContract/updateRentStartTime", param)
  1300. .then(d => {
  1301. _this.$message.success("预账单生成成功!");
  1302. _this.$refs[_this.billTk].setData(d.data.previewBillRentList,this.form.receivePeriod);
  1303. })
  1304. .catch(err => {
  1305. _this.form.rentStartType = _this.form.rentStartType==1?2:1;
  1306. _this.$message.error(err.data);
  1307. });
  1308. },
  1309. checkcontractNum(url, param) {
  1310. this.$confirm(
  1311. "抱歉,此合同编号已存在,取消请返回上一步修改合同编号, 是否继续?",
  1312. "提示",
  1313. {
  1314. confirmButtonText: "确定",
  1315. cancelButtonText: "取消",
  1316. type: "warning"
  1317. }
  1318. )
  1319. .then(() => {
  1320. this.saveFirst(url, param);
  1321. })
  1322. .catch(() => {
  1323. this.$message({
  1324. type: "info",
  1325. message: "已取消"
  1326. });
  1327. });
  1328. },
  1329. makeSure(url,param){
  1330. this.$confirm('为确保合同有效生成,请联系管理员添加审批流程!', '提示', {
  1331. confirmButtonText: '坚持提交',
  1332. cancelButtonText: '取消',
  1333. type: 'warning'
  1334. }).then(() => {
  1335. this.saveFirst(url,param);
  1336. }).catch(() => {
  1337. this.loading = false;
  1338. this.$message({
  1339. type: 'info',
  1340. message: '已取消'
  1341. });
  1342. });
  1343. },
  1344. submitOn: function() {
  1345. let _this=this;
  1346. //账单生成方式未自然月时付款周期处理
  1347. this.form.receivePeriod=this.form.adjustPeriod==3?(this.cycles.filter(e=>e.value==this.form.receivePeriod).length>0?this.form.receivePeriod:1):this.form.receivePeriod;
  1348. let param = deepcopy(this.form);
  1349. if (param.adjustPeriod == 1) {
  1350. param.monthHandleType = "";
  1351. }
  1352. param.rentalStartDate =
  1353. commonUtil.date.date(this.form.rentalStartDate) + " 00:00:00";
  1354. param.rentalEndDate =
  1355. commonUtil.date.date(this.form.rentalEndDate) + " 23:59:59";
  1356. param.startDate = commonUtil.date.date(this.form.startDate) + " 00:00:00";
  1357. param.signDate = commonUtil.date.date(this.form.signDate) + " 00:00:00";
  1358. if (this.form.fixDate&&this.form.fixDate[0] != undefined) {
  1359. param.fixStartDate =
  1360. moment(this.form.fixDate[0]).format("YYYY-MM-DD") + " 00:00:00";
  1361. param.fixEndDate =
  1362. moment(this.form.fixDate[1]).format("YYYY-MM-DD") + " 23:59:59";
  1363. }else{
  1364. param.fixStartDate = ''
  1365. param.fixEndDate = ''
  1366. }
  1367. param.depositStr = this.form.deposit;
  1368. param.priceStr = this.form.price;
  1369. param.deposit = Number(Number(this.form.deposit * 100).toFixed(2));
  1370. param.price = Number(Number(this.form.price * 100).toFixed(2));
  1371. param.revenue = Number(Number(this.form.revenue * 100).toFixed(2));
  1372. param.payRatio = Number(Number(this.form.payRatio * 100).toFixed(2));
  1373. //aaaa 合同补录
  1374. param.status = 8;
  1375. param.fileNames = JSON.stringify(this.fileNames);
  1376. let adjustRatios01 = this.form.adjustRatio.filter(
  1377. (item, index) => param.lease / 12 - 1 > index
  1378. );
  1379. let adjustRatios02 = adjustRatios01.map(item => Number(Number(item * 100).toFixed(2)));
  1380. param.adjustRatio = JSON.stringify(adjustRatios02);
  1381. if (this.form.id) {
  1382. if (this.active == 2) {
  1383. if(this.processData.length > 0){
  1384. param.flowParams = {
  1385. variables: [
  1386. {
  1387. key: "contractType",
  1388. value: "2"
  1389. },
  1390. {
  1391. key: "contractNumber",
  1392. value: this.form.contractNumber
  1393. }
  1394. ],
  1395. businessType: 5,
  1396. remark: this.form.remark
  1397. };
  1398. }
  1399. let previewBillRentList = [];
  1400. if (
  1401. this.$refs[this.billTk].getData() != false &&
  1402. this.$refs[this.billTk].getData().length > 0
  1403. ) {
  1404. let haveCommentsError = false;
  1405. let message = "";
  1406. this.$refs[this.billTk].getData().map((item, index) => {
  1407. let a = {};
  1408. a.id = item.id;
  1409. a.receivePay = item.receivePay;
  1410. a.needPay = item.needPay;
  1411. a.receiveDate = item.receiveDate;
  1412. a.starttime = moment(item.starttime).format('YYYY-MM-DD')+' 00:00:00';
  1413. a.endtime = moment(item.endtime).format('YYYY-MM-DD')+' 23:59:59';
  1414. a.comments = item.comments;
  1415. previewBillRentList.push(a);
  1416. if(item.receivePay!=item.needPay&&!item.comments){
  1417. haveCommentsError = true;
  1418. message = "建议账单金额调整后,补充金额调整原因!";
  1419. }
  1420. });
  1421. param.previewBillRentList = previewBillRentList;
  1422. //aaa 合同补录的状态是8不能选择 第二步保存的时候如果是来自补录,需要将status重置为8
  1423. if (this.fromBulu) {
  1424. param.status = 8;
  1425. }
  1426. if(haveCommentsError){
  1427. this.$confirm(message, '有金额变更原因未填写', {
  1428. confirmButtonText: '去补充',
  1429. cancelButtonText: '继续提交',
  1430. type: 'warning'
  1431. }).then(() => {
  1432. return false;
  1433. }).catch(() => {
  1434. if (_this.processData.length > 0) {
  1435. this.saveFirst("/api/wxRentContract/update", param);
  1436. }else{
  1437. this.makeSure("/api/wxRentContract/update", param);
  1438. }
  1439. });
  1440. }else{
  1441. if (_this.processData.length > 0) {
  1442. this.saveFirst("/api/wxRentContract/update", param);
  1443. }else{
  1444. this.makeSure("/api/wxRentContract/update", param);
  1445. }
  1446. }
  1447. } else {
  1448. return;
  1449. }
  1450. }
  1451. if (this.active == "1") {
  1452. this.getFetch(
  1453. `/api/wxRentContract/hasContractNumber?contractNumber=${
  1454. this.form.contractNumber
  1455. }&id=${this.form.id}`
  1456. )
  1457. .then(d => {
  1458. //如果合同编号重复
  1459. if (d.data) {
  1460. this.checkcontractNum("/api/wxRentContract/update", param);
  1461. } else {
  1462. this.saveFirst("/api/wxRentContract/update", param);
  1463. }
  1464. })
  1465. .catch(err => {
  1466. this.$message.error(err.data);
  1467. });
  1468. }
  1469. } else {
  1470. //如果没有id走到这一步代表补录进来的 aaa
  1471. param.status = 8;
  1472. this.getFetch(
  1473. `/api/wxRentContract/hasContractNumber?contractNumber=${
  1474. this.form.contractNumber
  1475. }&id=${this.form.id}`
  1476. )
  1477. .then(d => {
  1478. //如果合同编号重复
  1479. if (d.data) {
  1480. this.checkcontractNum("/api/wxRentContract/add", param);
  1481. } else {
  1482. this.saveFirst("/api/wxRentContract/add", param);
  1483. }
  1484. })
  1485. .catch(err => {
  1486. this.$message.error(err.data);
  1487. });
  1488. }
  1489. },
  1490. goback() {
  1491. if (this.active-- < 0) {
  1492. this.active = 0;
  1493. }
  1494. },
  1495. cancel() {
  1496. this.$router.back(-1);
  1497. },
  1498. // 店铺弹框
  1499. openShopDialog() {
  1500. this.$refs[this.tKey].openDialog();
  1501. },
  1502. getShopCb(items) {
  1503. this.form.shopTableData = items.data;
  1504. this.form.rentArea = items.data[0].operationArea;
  1505. this.shopshow = true;
  1506. this.newshopTableData = this.form.shopTableData[0];
  1507. },
  1508. //文件上传
  1509. beforeUpload: function(file) {
  1510. let type = file.name.split(".")[1];
  1511. const extension =
  1512. type === "doc" ||
  1513. type === "docx" ||
  1514. type === "pdf" ||
  1515. type === "png" ||
  1516. type === "jpg" ||
  1517. type === "jpeg";
  1518. const isLt2M = file.size / 1024 / 1024 < 20;
  1519. if (!extension) {
  1520. this.$message.warning(
  1521. "抱歉,上传文件只能是doc、docx、pdf、png、jpg、jpeg格式"
  1522. );
  1523. }
  1524. if (!isLt2M) {
  1525. this.$message.warning("抱歉,上传文件大小不能超过 20MB");
  1526. }
  1527. return extension && isLt2M;
  1528. },
  1529. importSuccess: function(response, file, fileList) {
  1530. this.$message.success("上传成功");
  1531. let a = {
  1532. name: file.name,
  1533. url: response.data.url
  1534. };
  1535. this.fileNames.push(a);
  1536. },
  1537. importError: function(response, file, fileList) {
  1538. this.$message.error("抱歉,上传失败");
  1539. console.log("error:" + response + "--" + file + "---" + fileList);
  1540. },
  1541. downloadPr(file) {
  1542. window.open(file.url);
  1543. },
  1544. handleRemove: function(file, filelist) {
  1545. this.fileNames.map((item, index) => {
  1546. if (item.url == file.url) {
  1547. this.fileNames.splice(index, 1);
  1548. }
  1549. });
  1550. },
  1551. //按计租和联营扣点显示不同内容
  1552. computedChange(item) {
  1553. this.form.type = item;
  1554. },
  1555. comperData() {
  1556. if (this.form.startDate && this.form.rentalStartDate) {
  1557. //计租开始问题
  1558. let startDate = moment(this.form.startDate).format("YYYY-MM-DD");
  1559. //租赁开始日期
  1560. let rentalStartDate = moment(this.form.rentalStartDate).format(
  1561. "YYYY-MM-DD"
  1562. );
  1563. if (moment(startDate).isBefore(rentalStartDate)) {
  1564. this.$message.error("计租开始日期不能早于租赁开始日期");
  1565. return;
  1566. }
  1567. }
  1568. },
  1569. // 店铺弹框
  1570. buluopenShopDialog() {
  1571. this.$refs[this.tKeynew].openDialog();
  1572. },
  1573. // 商铺选中之后的操作
  1574. getShopCbNew(items) {
  1575. console.log(items)
  1576. this.form.shopTableData = items.data;
  1577. this.form.shopTableData.status = "已出租";
  1578. if (items.data[0].linkPerson) {
  1579. this.form.linkPerson = items.data[0].linkPerson;
  1580. } else {
  1581. this.form.linkPerson = "";
  1582. }
  1583. if (items.data[0].linkPhone) {
  1584. this.form.linkPhone = items.data[0].linkPhone;
  1585. } else {
  1586. this.form.linkPhone = "";
  1587. }
  1588. if (items.data[0].merchantName) {
  1589. this.form.merchantName = items.data[0].merchantName;
  1590. } else {
  1591. this.form.merchantName = "";
  1592. }
  1593. this.form.merchantId = items.data[0].merchantId;
  1594. if (items.data[0].brand) {
  1595. this.form.brand = items.data[0].brand;
  1596. } else {
  1597. this.form.brand = "";
  1598. }
  1599. if (items.data[0].shopType) {
  1600. this.form.shopType = items.data[0].shopType;
  1601. } else {
  1602. this.form.shopType = "";
  1603. }
  1604. if (items.data[0].businessId) {
  1605. this.form.businessId = items.data[0].businessId;
  1606. } else {
  1607. this.form.businessId = "";
  1608. }
  1609. this.form.rentArea = items.data[0].operationArea;
  1610. this.formdisabled = true;
  1611. //aaaa 合同补录
  1612. this.form.status = 8;
  1613. this.isShow = true;
  1614. this.shopshow = true;
  1615. this.newshopTableData = this.form.shopTableData[0];
  1616. },
  1617. lease() {
  1618. this.months = [];
  1619. if (this.form.lease > 12) {
  1620. let j = this.form.lease / 12;
  1621. if (j % 1 === 0) {
  1622. //判断是不是整数
  1623. j = j - 1;
  1624. } else {
  1625. j = Math.floor(j);
  1626. }
  1627. for (var i = 0; i < j; i++) {
  1628. this.months.push(i);
  1629. }
  1630. this.form.adjustRatio.length = this.months.length;
  1631. for (var q = 0; q < this.form.adjustRatio.length; q++) {
  1632. if (this.form.adjustRatio[q] == undefined) {
  1633. this.form.adjustRatio[q] = 0;
  1634. }
  1635. }
  1636. } else {
  1637. this.months = [];
  1638. }
  1639. this.copelease = this.form.lease;
  1640. },
  1641. getAdjustRatio(item) {
  1642. let arr = [];
  1643. for (let i of item) {
  1644. arr.push(i / 100);
  1645. }
  1646. return arr;
  1647. },
  1648. /**
  1649. * 获取默认收银信息
  1650. */
  1651. getPayAccountInfo() {
  1652. this.getFetch(ContractUrl.getPayAccountInfo)
  1653. .then(d => {
  1654. this.form.payAccount = d.data.bankCardId;
  1655. this.form.bankName = d.data.bankAccountName;
  1656. })
  1657. .catch(err => {
  1658. this.$message.error(err.data);
  1659. });
  1660. },
  1661. /**
  1662. * 根据业务查询模板
  1663. */
  1664. getModelBybusiness(){
  1665. this.getFetch(`${promissionUrl.getModelBybusiness}?flowType=5`)
  1666. .then(d=>{
  1667. if(d.data.length>0){
  1668. this.processData = JSON.parse(d.data[0].flow).lists;
  1669. }
  1670. })
  1671. .catch(err=>{
  1672. this.$message.error(err.data);
  1673. })
  1674. },
  1675. dealInfoFromMerchant() {
  1676. let {curMerchantId} = this.$route.query;
  1677. if (curMerchantId != undefined && curMerchantId) {
  1678. //相当于来自编辑,不可切换商户
  1679. this.fromBulu = true;
  1680. this.editIf = true;
  1681. this.shopshow = false;
  1682. this.getFetch('/api/wxMerchant/findById?id='+curMerchantId)
  1683. .then(d=>{
  1684. let curMerchantObj = d.data.shoplist[0];
  1685. curMerchantObj.businessId = d.data.businessId;
  1686. //和普通合同的存储不一样,多经的补录取得是merchantId不是id,merchantName不是name
  1687. // curMerchantObj.merchantId = curMerchantObj.id;
  1688. // curMerchantObj.merchantName = curMerchantObj.name;
  1689. let arr01 = [];
  1690. let arr02 = [];
  1691. arr01.push(curMerchantObj)
  1692. arr02.push(curMerchantObj.id)
  1693. let obj = {
  1694. data: arr01,
  1695. vals: arr02
  1696. }
  1697. // 执行商铺选中之后的操作
  1698. this.getShopCbNew(obj);
  1699. })
  1700. .catch(err=>{
  1701. this.$message.error(err.data);
  1702. })
  1703. }
  1704. },
  1705. },
  1706. mounted() {
  1707. //来自商户管理的补录跳转操作 属于补录不属于编辑补录
  1708. this.dealInfoFromMerchant();
  1709. },
  1710. created() {
  1711. let _this = this;
  1712. let datastr = moment(new Date()).format("YYYYMMDDhhmmss");
  1713. this.form.contractNumber = datastr;
  1714. this.setNavData(["合同管理", "多经点位", "租金合同", "补录"]);
  1715. this.getFetch(ContractUrl.businessList)
  1716. .then(d => {
  1717. this.businessIds = d.data;
  1718. })
  1719. .catch(err => {
  1720. this.$message.error(err.data);
  1721. });
  1722. //获取品牌列表
  1723. this.getFetch("/api/wxBrand/queryBrand")
  1724. .then(d => {
  1725. this.brands = d.data;
  1726. })
  1727. .catch(err => {
  1728. this.$message.error(err.data);
  1729. });
  1730. this.getModelBybusiness();
  1731. if (this.$route.query.id) {
  1732. this.fromBulu = false;
  1733. this.setNavData(["合同管理", "多经点位", "租金合同", "补录编辑"]);
  1734. this.getFetch("/api/wxRentContract/findById?id=" + this.$route.query.id)
  1735. .then(d => {
  1736. this.formdisabled = true;
  1737. _this.shopshow = true;
  1738. _this.editIf = true;
  1739. if (d.data.wxRentContract.adjustPeriod == 1) {
  1740. d.data.wxRentContract = "2";
  1741. }
  1742. this.form = Object.assign(this.form, d.data.wxRentContract);
  1743. if (d.data.wxRentContract.fileNames) {
  1744. this.fileNames = JSON.parse(d.data.wxRentContract.fileNames);
  1745. }
  1746. if (d.data.wxRentContract.filename) {
  1747. this.fileName = d.data.wxRentContract.filename;
  1748. }
  1749. if (d.data.wxRentContract.adjustRatio) {
  1750. this.form.adjustRatio = this.getAdjustRatio(
  1751. eval("(" + d.data.wxRentContract.adjustRatio + ")")
  1752. );
  1753. }
  1754. this.form.rentalStartDate = moment(this.form.rentalStartDate).format(
  1755. "YYYY-MM-DD"
  1756. );
  1757. this.form.rentalEndDate = moment(this.form.rentalEndDate).format(
  1758. "YYYY-MM-DD"
  1759. );
  1760. this.getDateDiff(this.form.rentalStartDate, this.form.rentalEndDate);
  1761. if (d.data.wxShops) {
  1762. this.form.merchantId = d.data.wxShops[0].merchantId;
  1763. this.form.shopTableData = d.data.wxShops;
  1764. this.newshopTableData = d.data.wxShops[0];
  1765. }
  1766. if (d.data.wxRentContract.lease) {
  1767. this.copelease = d.data.wxRentContract.lease;
  1768. }
  1769. this.form.price = Number(d.data.wxRentContract.price) / 100;
  1770. this.form.deposit = Number(d.data.wxRentContract.deposit) / 100;
  1771. this.form.revenue = Number(d.data.wxRentContract.revenue) / 100;
  1772. Vue.set(this.form, "fixDate", [
  1773. d.data.wxRentContract.fixStartDate,
  1774. d.data.wxRentContract.fixEndDate
  1775. ]);
  1776. if (d.data.wxRentContract.payRatio == undefined) {
  1777. this.form.payRatio = 0;
  1778. } else {
  1779. this.form.payRatio = Number(d.data.wxRentContract.payRatio) / 100;
  1780. }
  1781. this.form.shopTableData = d.data.wxShops;
  1782. //
  1783. let curObj = Object.assign({},this.formData);
  1784. curObj.busDiscountRatio = d.data.wxRentContract.busDiscountRatio;
  1785. curObj.busDiscountTime = d.data.wxRentContract.busDiscountTime;
  1786. curObj.payRatio = Number(d.data.wxRentContract.payRatio)/100;
  1787. this.setFormData(curObj);
  1788. if (this.form.adjustPeriod == 1) {
  1789. this.dateType = "日";
  1790. this.isshowYear = false;
  1791. } else {
  1792. this.dateType = "月";
  1793. this.isshowYear = true;
  1794. }
  1795. //根据总租期限时调整比例
  1796. if (this.form.lease > 12) {
  1797. let j = this.form.lease / 12;
  1798. if (j % 1 === 0) {
  1799. //判断是不是整数
  1800. j = j - 1;
  1801. } else {
  1802. j = Math.floor(j);
  1803. }
  1804. for (var i = 0; i < j; i++) {
  1805. this.months.push(i);
  1806. }
  1807. this.form.adjustRatio.length = this.months.length;
  1808. for (var q = 0; q < this.form.adjustRatio.length; q++) {
  1809. if (this.form.adjustRatio[q] == undefined) {
  1810. this.form.adjustRatio[q] = 0;
  1811. }
  1812. }
  1813. } else {
  1814. this.months = [];
  1815. }
  1816. })
  1817. .catch(err => {
  1818. this.$message.error(err.data);
  1819. });
  1820. } else {
  1821. this.setNavData(["合同管理", "多经点位", "租金合同", "补录"]);
  1822. //aaa
  1823. this.fromBulu = true;
  1824. this.getPayAccountInfo();
  1825. }
  1826. }
  1827. };
  1828. </script>
  1829. <style scoped>
  1830. .fx_step .el-step.is-center .el-step__line {
  1831. left: 0;
  1832. right: -100%;
  1833. }
  1834. .layout-content {
  1835. width: 100%;
  1836. background: #141e29;
  1837. height: auto;
  1838. border-radius: 2px;
  1839. /* min-height: 300px; */
  1840. padding: 0 20px;
  1841. overflow: hidden;
  1842. text-align: left;
  1843. }
  1844. form {
  1845. text-align: left;
  1846. width: 100%;
  1847. }
  1848. .shopBox {
  1849. width: 100%;
  1850. background: #3fc496;
  1851. height: 40px;
  1852. overflow: hidden;
  1853. border-bottom-left-radius: 2px;
  1854. border-top-left-radius: 2px;
  1855. }
  1856. .shopBox .shopBtn {
  1857. width: 110px;
  1858. height: 40px;
  1859. float: left;
  1860. text-align: center;
  1861. line-height: 40px;
  1862. color: #fefefe;
  1863. font-size: 14px;
  1864. cursor: pointer;
  1865. background: RGBA(63, 196, 150, 1);
  1866. border-radius: 4px;
  1867. }
  1868. .shopBox .shopBtn:hover {
  1869. background: RGBA(63, 196, 150, 0.88);
  1870. }
  1871. .shopBox_choose {
  1872. width: 100%;
  1873. height: 40px;
  1874. overflow: hidden;
  1875. }
  1876. .shopBox_choose .shopBtn_choose {
  1877. width: 110px;
  1878. height: 40px;
  1879. float: left;
  1880. text-align: center;
  1881. line-height: 40px;
  1882. color: #fefefe;
  1883. font-size: 14px;
  1884. cursor: pointer;
  1885. background: RGBA(63, 196, 150, 1);
  1886. border-radius: 4px;
  1887. }
  1888. .shopBox_choose .shopBtn_choose:hover {
  1889. background: RGBA(63, 196, 150, 0.88);
  1890. }
  1891. .shopBox .shopContent {
  1892. width: calc(100% - 110px);
  1893. background: #ffffff;
  1894. position: relative;
  1895. float: right;
  1896. height: 40px;
  1897. border-top: 5px solid #3fc496;
  1898. border-bottom: 5px solid #3fc496;
  1899. border-right: 5px solid #3fc496;
  1900. padding-right: 10px;
  1901. }
  1902. .shoplist div {
  1903. width: 16%;
  1904. float: left;
  1905. text-align: center;
  1906. line-height: 30px;
  1907. color: #555;
  1908. font-size: 14px;
  1909. }
  1910. .jiaojiao {
  1911. width: 27px;
  1912. position: absolute;
  1913. right: 5px;
  1914. }
  1915. .iconBox {
  1916. font-size: 18px !important;
  1917. color: #3fc496 !important;
  1918. margin-right: 6px !important;
  1919. }
  1920. .public_part {
  1921. background: #fff;
  1922. margin-top: 20px;
  1923. }
  1924. .public_part_title {
  1925. height: 40px;
  1926. padding: 11px 0 11px 21px;
  1927. background: #5976bf;
  1928. font-size: 14px;
  1929. color: #fff;
  1930. }
  1931. .public_part_Box {
  1932. padding: 30px;
  1933. }
  1934. .baocun {
  1935. background: #5976bf;
  1936. border: 0;
  1937. }
  1938. .baocun:hover {
  1939. background: #7a6ce1;
  1940. }
  1941. .text {
  1942. width: 100%;
  1943. }
  1944. .edit-item-input {
  1945. width: 59%;
  1946. }
  1947. .payDate {
  1948. width: 80px;
  1949. }
  1950. .download-file {
  1951. position: relative;
  1952. overflow: hidden;
  1953. text-align: center;
  1954. display: inline-block;
  1955. width: 120px;
  1956. border: 1px #dcdfe6 solid;
  1957. background-color: #409eff;
  1958. border-radius: 4px;
  1959. padding: 7px 10px;
  1960. font-size: 12px;
  1961. font-weight: normal;
  1962. line-height: 24px;
  1963. color: #fff;
  1964. text-decoration: none;
  1965. }
  1966. .el-form-item .el-form-item__content,
  1967. .el-form-item .el-form-item__content .el-date-editor,
  1968. .el-form-item .el-form-item__content .el-date-editor .el-input__inner {
  1969. width: 211px;
  1970. }
  1971. .fx_send .el-form-item__content .el-select {
  1972. width: 211px !important;
  1973. }
  1974. .fx_title .el-input {
  1975. width: 211px;
  1976. }
  1977. /* 按钮处理 */
  1978. .addBtn {
  1979. height: 40px;
  1980. /* margin: 20px 0 0 20px; */
  1981. background: RGBA(81, 169, 201, 1);
  1982. color: #ffffff;
  1983. font-size: 14px;
  1984. border: 0;
  1985. }
  1986. .addBtn:hover {
  1987. background: RGBA(81, 169, 201, 0.88);
  1988. }
  1989. .group-btn {
  1990. margin: 20px 0;
  1991. text-align: center;
  1992. }
  1993. .group-btn .quxiaoBtn,
  1994. .group-btn .baocunBtn {
  1995. height: 40px;
  1996. font-size: 14px;
  1997. border-radius: 3px;
  1998. border: 0;
  1999. }
  2000. .group-btn .quxiaoBtn {
  2001. /* width:83px; */
  2002. color: #555;
  2003. margin-right: 9px;
  2004. background: RGBA(255, 255, 255, 1);
  2005. }
  2006. .group-btn .baocunBtn,
  2007. .group-btn .nextBtn {
  2008. /* width:130px; */
  2009. color: #ffffff;
  2010. margin-left: 9px;
  2011. border: 0;
  2012. background: rgba(81, 169, 201, 1);
  2013. }
  2014. .group-btn .quxiaoBtn:hover {
  2015. background: rgba(255, 255, 255, 0.88);
  2016. }
  2017. .group-btn .baocunBtn:hover,
  2018. .group-btn .nextBtn:hover {
  2019. background: rgba(81, 169, 201, 0.88);
  2020. }
  2021. .innerinput {
  2022. width: 120px;
  2023. }
  2024. </style>
  2025. <style>
  2026. input[type="file"] {
  2027. display: none;
  2028. }
  2029. .el-table th > .cell {
  2030. text-align: center !important;
  2031. }
  2032. /* .pointrent .el-radio-button__orig-radio:checked + .el-radio-button__inner {
  2033. background-color: #5976bf !important;
  2034. border-color: #5976bf !important;
  2035. } */
  2036. .per-list .el-form-item__content{
  2037. margin-left: 0 !important;
  2038. width: auto !important;
  2039. }
  2040. .per-list .el-form-item{
  2041. width: auto !important;
  2042. margin-right: 50px;
  2043. margin-bottom: 40px;
  2044. }
  2045. .per-list{
  2046. margin-left: 150px;
  2047. }
  2048. </style>