buyingMoreAdd.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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 prop="transferProportion">
  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 prop="transferBuyerProportionAfter">
  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 prop="transferCompanyProportionAfter">
  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. >
  144. <el-button v-if="!isView" size="small" type="primary">点击上传</el-button>
  145. <div slot="file" slot-scope="{file}">
  146. <a :href="file.url">{{ file.name }}</a>
  147. <span v-show="!isView" class="el-upload-list__item-actions">
  148. <i class="el-icon-delete" @click="handlePictureRemove(file,fileList)" />
  149. </span>
  150. </div>
  151. </el-upload>
  152. </el-form-item>
  153. </el-col>
  154. </el-row>
  155. <el-row>
  156. <el-col :span="4" class="col-txt"><span>登记人</span></el-col>
  157. <el-col :span="20" class="col-input">
  158. <el-form-item>
  159. <el-input v-model="username" readonly />
  160. </el-form-item>
  161. </el-col>
  162. </el-row>
  163. </el-card>
  164. </el-col>
  165. </el-row>
  166. </el-form>
  167. <div style="text-align: right">
  168. <el-button @click="cancel">取 消</el-button>
  169. <el-button v-if="!isView" :loading="loadingFlag" type="primary" @click="confirmSubmit()">确 定</el-button>
  170. </div>
  171. <el-dialog
  172. :visible.sync="dialogVisible"
  173. :title="dialogTitle"
  174. width="90%"
  175. top="20px"
  176. class="statistic_base"
  177. :append-to-body="true"
  178. :modal-append-to-body="true"
  179. custom-class="tagdialog"
  180. >
  181. <contract-index v-if="dialogVisible" ref="contractIndex" from-address="addInvoice" @getChildrenData="getChildrenData" />
  182. </el-dialog>
  183. </div>
  184. </template>
  185. <script>
  186. import Base from '@/views/base/base.vue'
  187. import BaseData from '@/views/base/baseData.vue'
  188. import { upload } from '@/static/utils/channel'
  189. import ContractIndex from '@/views/signingManagement/contractManagement/index.vue'
  190. export default {
  191. name: 'BuyingMoreAdd',
  192. components: { ContractIndex },
  193. mixins: [Base, BaseData],
  194. data() {
  195. return {
  196. dc_key: ['TRANSFER_PROPORTION'],
  197. form: {},
  198. rules: {
  199. serialNumber: [{ required: true, message: '请输入编号', trigger: 'blur' }],
  200. transferProportion: [{ required: true, message: '请输入转让份额', trigger: 'blur' }],
  201. transferBuyerProportionAfter: [{ required: true, message: '请输入转让后买受人产权份额占比', trigger: 'change' }],
  202. transferCompanyProportionAfter: [{ required: true, message: '请输入转让后安居公司产权份额占比', trigger: 'change' }]
  203. },
  204. dialogVisible: false,
  205. dialogTitle: '',
  206. isView: false,
  207. bankOptions: [],
  208. loadingFlag: false,
  209. fileList: [],
  210. username: '',
  211. id: ''
  212. }
  213. },
  214. mounted() {
  215. const username = this.$common.currUser().username
  216. this.username = username
  217. this.initDict(this.dc_key).then((res) => {
  218. })
  219. },
  220. methods: {
  221. initData(data) {
  222. this.isView = data.isView
  223. this.id = data.id
  224. if (data.id) {
  225. this.getData(data)
  226. }
  227. },
  228. getData(data) {
  229. console.log(data)
  230. const postData = {
  231. id: data.id
  232. }
  233. this.baseRequest('getById', postData).then(res => {
  234. if (res.data) {
  235. this.form = res.data
  236. this.username = this.form.createdName
  237. }
  238. }).catch(err => {
  239. this.$message.error(err)
  240. })
  241. },
  242. cancel() {
  243. this.$emit('cancel')
  244. },
  245. confirmSubmit() {
  246. const _this = this
  247. if (!_this.form.contractId) {
  248. _this.$message.warning('请选择合同')
  249. return
  250. }
  251. this.$refs.form.validate(valid => {
  252. if (valid) {
  253. _this.loadingFlag = true
  254. const soaUrl = 'add'
  255. const extraData = {
  256. type: '1'
  257. }
  258. const postData = Object.assign({}, _this.form, extraData)
  259. this.baseRequest(soaUrl, postData).then(res => {
  260. if (res.data.code === 200) {
  261. this.$message.success('保存成功')
  262. this.cancel()
  263. } else {
  264. this.$message.error(res.data.msg)
  265. }
  266. _this.loadingFlag = false
  267. }).catch(err => {
  268. _this.loadingFlag = false
  269. })
  270. } else {
  271. return false
  272. }
  273. })
  274. },
  275. handleContract() {
  276. this.dialogVisible = true
  277. this.dialogTitle = ''
  278. },
  279. getChildrenData(data) {
  280. this.dialogVisible = false
  281. if (!data) return
  282. const postData = {
  283. contractId: data
  284. }
  285. this.baseRequest('getByContractId', postData).then(res => {
  286. if (res.data) {
  287. this.form = res.data
  288. }
  289. })
  290. },
  291. uploadFile: function(param) {
  292. upload(param, true).then((res) => {
  293. this.fileList.push(res)
  294. })
  295. },
  296. proportionChange() {
  297. const buyerProportion = Number(this.form.buyerProportion)
  298. this.form.transferBuyerProportionAfter = buyerProportion + Number(this.form.transferProportion)
  299. this.form.transferCompanyProportionAfter = 100 - Number(this.form.transferBuyerProportionAfter)
  300. },
  301. baseRequest(opUrl, postData) {
  302. return this.$channel.globeRequest('BuyingMoreController', opUrl, postData, 'project')
  303. }
  304. }
  305. }
  306. </script>
  307. <style lang="scss">
  308. </style>
  309. <style scoped>
  310. .red-asterisk {
  311. color: red;
  312. }
  313. </style>