buyingBackAdd.vue 11 KB

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