addCustomer.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div>
  3. <el-form ref="form" v-loading="addLoading" :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: 15px 5px 5px 15px">
  8. <el-row>
  9. <el-col :span="3" class="col-txt"><span>小区-分期</span></el-col>
  10. <el-col :span="9" class="col-input">
  11. <el-form-item prop="roomUse">
  12. <el-select v-model="form.roomUse" filterable placeholder="请选择">
  13. <el-option
  14. v-for="item in dc_data.HOUSE_USAGE"
  15. :key="item.value"
  16. :label="item.label"
  17. :value="item.value"
  18. />
  19. </el-select>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :span="3" class="col-txt"><span>选房日</span></el-col>
  23. <el-col :span="9" class="col-input">
  24. <el-form-item prop="">
  25. <el-date-picker
  26. v-model="form.roomSelectionDate"
  27. type="date"
  28. placeholder="年月日"
  29. value-format="yyyy-MM-dd"
  30. />
  31. </el-form-item>
  32. </el-col>
  33. </el-row>
  34. <el-row>
  35. <el-col :span="3" class="col-txt"><span>批次号</span></el-col>
  36. <el-col :span="9" class="col-input">
  37. <el-form-item prop="companyId">
  38. <el-input v-model="form.batchNumber" />
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="3" class="col-txt"><span>选房号</span></el-col>
  42. <el-col :span="9" class="col-input">
  43. <el-form-item prop="companyId">
  44. <el-input v-model="form.roomSelectionNumber" />
  45. </el-form-item>
  46. </el-col>
  47. </el-row>
  48. </el-card>
  49. </el-col>
  50. </el-row>
  51. </el-form>
  52. <div style="text-align: right">
  53. <el-button @click="cancel">取 消</el-button>
  54. <el-button type="primary" @click="confirmSubmit()">提 交</el-button>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import Base from '@/views/base/base'
  60. import BaseData from '@/views/base/baseData'
  61. export default {
  62. name: 'AddCustomer',
  63. components: { },
  64. mixins: [Base, BaseData],
  65. data() {
  66. return {
  67. dc_key: [],
  68. form: {},
  69. rules: {
  70. },
  71. addLoading: false
  72. }
  73. },
  74. mounted() {
  75. },
  76. methods: {
  77. initData(data) {
  78. this.initDict(this.dc_key).then(res => {
  79. })
  80. },
  81. confirmSubmit: function() {
  82. const _this = this
  83. this.$refs.form.validate(valid => {
  84. if (valid) {
  85. const soaUrl = 'billAdd'
  86. const extraData = {}
  87. const postData = Object.assign({}, _this.form, extraData)
  88. // this.opRecord(postData, soaUrl)
  89. this.baseRequest(soaUrl, postData).then(res => {
  90. if (res.data.code == '200') {
  91. _this.$message({
  92. message: '新增成功',
  93. type: 'success'
  94. })
  95. _this.cancel()
  96. }
  97. }).catch(err => {
  98. _this.$message({
  99. message: err,
  100. type: 'warning'
  101. })
  102. })
  103. } else {
  104. console.log('error submit!!')
  105. return false
  106. }
  107. })
  108. },
  109. cancel() {
  110. this.$emit('cancel')
  111. },
  112. baseRequest(opUrl, postData) {
  113. return this.$channel.globeRequest('BillManagementController', opUrl, postData, 'project')
  114. }
  115. }
  116. }
  117. </script>
  118. <style scoped>
  119. </style>