buyingBackAdd.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <template>
  2. <div class="addInvoice">
  3. <el-form ref="form" :model="form" style="width: 100%;padding: 5px" :rules="rules">
  4. <el-row>
  5. <el-col style="padding-bottom: 10px">
  6. <span class="card_title">回购登记</span>
  7. <span v-if="!isView">&nbsp;&nbsp;&nbsp;&nbsp;买受人当前最新产权份额占比为(%):</span>
  8. <span v-if="!isView">{{ form.buyerProportion }}</span>
  9. <el-card shadow="always" style="padding-top: 10px">
  10. <el-row>
  11. <el-col :span="4" class="col-txt"><span><span class="red-asterisk">*</span>回购编号</span></el-col>
  12. <el-col :span="20" class="col-input">
  13. <el-form-item>
  14. <el-input v-model="form.serialNumber" />
  15. </el-form-item>
  16. </el-col>
  17. </el-row>
  18. <el-row v-if="!isView&&!id">
  19. <el-col :span="4" class="col-txt"><span><span class="red-asterisk">*</span>原签约信息</span></el-col>
  20. <el-col :span="20" class="col-input">
  21. <el-form-item>
  22. <el-button type="text" @click="handleContract()">去选择</el-button>
  23. </el-form-item>
  24. </el-col>
  25. </el-row>
  26. <el-row>
  27. <el-col :span="4" class="col-txt"><span>买受人</span></el-col>
  28. <el-col :span="20" class="col-input">
  29. <el-form-item>
  30. <el-input v-model="form.buyerName" />
  31. </el-form-item>
  32. </el-col>
  33. </el-row>
  34. <el-row>
  35. <el-col :span="4" class="col-txt"><span>房屋</span></el-col>
  36. <el-col :span="20" class="col-input">
  37. <el-form-item>
  38. <el-input v-model="form.houseName" />
  39. </el-form-item>
  40. </el-col>
  41. </el-row>
  42. <el-row>
  43. <el-col :span="4" class="col-txt"><span>实测建筑面积(㎡)</span></el-col>
  44. <el-col :span="20" class="col-input">
  45. <el-form-item>
  46. <el-input v-model="form.actualBuildArea" />
  47. </el-form-item>
  48. </el-col>
  49. </el-row>
  50. <el-row>
  51. <el-col :span="4" class="col-txt"><span>签约日期</span></el-col>
  52. <el-col :span="20" class="col-input">
  53. <el-form-item>
  54. <el-date-picker
  55. v-model="form.signingDate"
  56. type="date"
  57. placeholder="年月日"
  58. value-format="yyyy-MM-dd"
  59. />
  60. </el-form-item>
  61. </el-col>
  62. </el-row>
  63. <el-row>
  64. <el-col :span="4" class="col-txt"><span>房屋买卖单价(元/㎡)</span></el-col>
  65. <el-col :span="20" class="col-input">
  66. <el-form-item>
  67. <el-input v-model="form.housePrice" />
  68. </el-form-item>
  69. </el-col>
  70. </el-row>
  71. <!-- <el-row>-->
  72. <!-- <el-col :span="4" class="col-txt"><span>买受人产权份额占比为(%)</span></el-col>-->
  73. <!-- <el-col :span="20" class="col-input">-->
  74. <!-- <el-form-item>-->
  75. <!-- <el-input v-model="form.buyerProportion" />-->
  76. <!-- </el-form-item>-->
  77. <!-- </el-col>-->
  78. <!-- </el-row>-->
  79. <el-row>
  80. <el-col :span="4" class="col-txt"><span>转让份额</span></el-col>
  81. <el-col :span="20" class="col-input">
  82. <el-form-item>
  83. <el-input v-model="form.transferProportion" @input="proportionChange" />
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <el-row>
  88. <el-col :span="4" class="col-txt"><span>转让后买受人产权份额占比为(%)</span></el-col>
  89. <el-col :span="20" class="col-input">
  90. <el-form-item>
  91. <el-input v-model="form.transferBuyerProportionAfter" readonly />
  92. </el-form-item>
  93. </el-col>
  94. </el-row>
  95. <el-row>
  96. <el-col :span="4" class="col-txt"><span>转让后安居公司产权份额占比为(%)</span></el-col>
  97. <el-col :span="20" class="col-input">
  98. <el-form-item>
  99. <el-input v-model="form.transferCompanyProportionAfter" readonly />
  100. </el-form-item>
  101. </el-col>
  102. </el-row>
  103. <el-row>
  104. <el-col :span="4" class="col-txt"><span>转让单价(元/每平方)</span></el-col>
  105. <el-col :span="20" class="col-input">
  106. <el-form-item>
  107. <el-input v-model="form.transferPrice" oninput="value=value.replace(/[^\d.]/g,'')" />
  108. </el-form-item>
  109. </el-col>
  110. </el-row>
  111. <el-row>
  112. <el-col :span="4" class="col-txt"><span>转让金(元)</span></el-col>
  113. <el-col :span="20" class="col-input">
  114. <el-form-item>
  115. <el-input v-model="form.transferMoney" />
  116. </el-form-item>
  117. </el-col>
  118. </el-row>
  119. <el-row>
  120. <el-col :span="4" class="col-txt"><span>登记日期</span></el-col>
  121. <el-col :span="20" class="col-input">
  122. <el-form-item>
  123. <el-date-picker
  124. v-model="form.registrationDate"
  125. type="date"
  126. placeholder="年月日"
  127. value-format="yyyy-MM-dd"
  128. />
  129. </el-form-item>
  130. </el-col>
  131. </el-row>
  132. <el-row>
  133. <el-col :span="4" class="col-txt"><span>相关资料</span></el-col>
  134. <el-col :span="20" class="col-input">
  135. <el-form-item>
  136. <el-upload
  137. class="upload-demo"
  138. action="/server/wx/fileController/uploadImage"
  139. :http-request="uploadFile"
  140. :before-remove="beforeRemove"
  141. multiple
  142. :file-list="fileList"
  143. :limit="6"
  144. :before-upload="$common.beforeUploadJustWordExcel"
  145. >
  146. <el-button v-if="!isView" size="small" type="primary">点击上传</el-button>
  147. <div slot="tip" class="el-upload__tip">只能上传pdf、doc、docx、xls、xlsx文件,且不超过5MB,数量不超过6</div>
  148. <div slot="file" slot-scope="{file}">
  149. <a :href="file.url">{{ file.name }}</a>
  150. <span v-show="!isView" class="el-upload-list__item-actions">
  151. <i class="el-icon-delete" @click="handlePictureRemove(file,fileList)" />
  152. </span>
  153. </div>
  154. </el-upload>
  155. </el-form-item>
  156. </el-col>
  157. </el-row>
  158. <el-row>
  159. <el-col :span="4" class="col-txt"><span>登记人</span></el-col>
  160. <el-col :span="20" class="col-input">
  161. <el-form-item>
  162. <el-input v-model="username" readonly />
  163. </el-form-item>
  164. </el-col>
  165. </el-row>
  166. </el-card>
  167. </el-col>
  168. </el-row>
  169. </el-form>
  170. <div style="text-align: right">
  171. <el-button @click="cancel">取 消</el-button>
  172. <el-button v-if="!isView" :loading="loadingFlag" type="primary" @click="confirmSubmit()">确 定</el-button>
  173. </div>
  174. <el-dialog
  175. :visible.sync="dialogVisible"
  176. :title="dialogTitle"
  177. width="90%"
  178. top="20px"
  179. class="statistic_base"
  180. :append-to-body="true"
  181. :modal-append-to-body="true"
  182. custom-class="tagdialog"
  183. >
  184. <contract-index v-if="dialogVisible" ref="contractIndex" from-address="addInvoice" @getChildrenData="getChildrenData" />
  185. </el-dialog>
  186. </div>
  187. </template>
  188. <script>
  189. import Base from '@/views/base/base.vue'
  190. import BaseData from '@/views/base/baseData.vue'
  191. import { upload } from '@/static/utils/channel'
  192. import ContractIndex from '@/views/signingManagement/contractManagement/index.vue'
  193. export default {
  194. name: 'BuyingBackAdd',
  195. components: { ContractIndex },
  196. mixins: [Base, BaseData],
  197. data() {
  198. return {
  199. dc_key: ['TRANSFER_PROPORTION'],
  200. form: {},
  201. rules: {},
  202. dialogVisible: false,
  203. dialogTitle: '',
  204. isView: false,
  205. bankOptions: [],
  206. loadingFlag: false,
  207. fileList: [],
  208. username: '',
  209. id: ''
  210. }
  211. },
  212. mounted() {
  213. const username = this.$common.currUser().username
  214. this.username = username
  215. this.initDict(this.dc_key).then((res) => {
  216. })
  217. },
  218. methods: {
  219. initData(data) {
  220. this.isView = data.isView
  221. this.id = data.id
  222. if (data.id) {
  223. this.getData(data)
  224. }
  225. },
  226. getData(data) {
  227. console.log(data)
  228. const postData = {
  229. id: data.id
  230. }
  231. this.baseRequest('getById', postData).then(res => {
  232. if (res.data) {
  233. this.form = res.data
  234. this.username = this.form.createdName
  235. this.fileList = JSON.parse(this.form.fileList)
  236. }
  237. }).catch(err => {
  238. this.$message.error(err)
  239. })
  240. },
  241. cancel() {
  242. this.$emit('cancel')
  243. },
  244. confirmSubmit() {
  245. const _this = this
  246. if (!_this.form.contractId) {
  247. _this.$message.warning('请选择合同')
  248. return
  249. }
  250. this.$refs.form.validate(valid => {
  251. if (valid) {
  252. _this.loadingFlag = true
  253. let soaUrl = 'add'
  254. if (_this.form.id) {
  255. soaUrl = 'edit'
  256. }
  257. const extraData = {
  258. type: '2',
  259. fileList: JSON.stringify(_this.fileList)
  260. }
  261. const postData = Object.assign({}, _this.form, extraData)
  262. this.baseRequest(soaUrl, postData).then(res => {
  263. if (res.data.code === 200) {
  264. this.$message.success('保存成功')
  265. this.cancel()
  266. } else {
  267. this.$message.error(res.data.msg)
  268. }
  269. _this.loadingFlag = false
  270. }).catch(err => {
  271. // this.$message.error(err)
  272. _this.loadingFlag = false
  273. })
  274. }
  275. })
  276. },
  277. handleContract() {
  278. this.dialogVisible = true
  279. this.dialogTitle = ''
  280. },
  281. getChildrenData(data) {
  282. this.dialogVisible = false
  283. if (!data) return
  284. const postData = {
  285. contractId: data
  286. }
  287. this.baseRequest('getByContractId', postData).then(res => {
  288. if (res.data) {
  289. this.form = res.data
  290. }
  291. })
  292. },
  293. uploadFile: function(param) {
  294. upload(param, true).then((res) => {
  295. this.fileList.push(res)
  296. })
  297. },
  298. proportionChange() {
  299. // 最新买受人份额占比
  300. const buyerProportion = Number(this.form.buyerProportion)
  301. this.form.transferBuyerProportionAfter = buyerProportion - this.form.transferProportion
  302. this.form.transferCompanyProportionAfter = 100 - Number(this.form.transferBuyerProportionAfter)
  303. },
  304. baseRequest(opUrl, postData) {
  305. return this.$channel.globeRequest('BuyingMoreController', opUrl, postData, 'project')
  306. }
  307. }
  308. }
  309. </script>F
  310. <style lang="scss">
  311. </style>
  312. <style scoped>
  313. .red-asterisk {
  314. color: red;
  315. }
  316. </style>