瀏覽代碼

temp save

liujq 4 年之前
父節點
當前提交
f9df753f28

+ 15 - 0
src/api/house.js

@@ -100,4 +100,19 @@ export default {
   adminformationdel: params => { // 洪楼文章删除
     return getRequestNoSort('/adm/information/del', params, 'loading')
   },
+  admlandlist: params => { // 土拍 - 列表接口
+    return getRequest('/adm/land/list', params)
+  },
+  admlandadd: params => { // 土拍 - 添加
+    return getRequestNoSort('/adm/land/add', params, 'loading')
+  },
+  admlandedit: params => { // 土拍 - 编辑
+    return getRequestNoSort('/adm/land/edit', params, 'loading')
+  },
+  admlanddetail: params => { // 土拍 - 详情
+    return getRequestNoSort('/adm/land/detail', params, 'loading')
+  },
+  admlanddel: params => { // 土拍 - 删除
+    return getRequestNoSort('/adm/land/del', params, 'loading')
+  },
 }

+ 11 - 0
src/router/index.js

@@ -139,6 +139,17 @@ export const moreRoutes = [
       meta: { title: '问答管理', icon: 'dashboard' }
     }]
   },
+  {
+    path: '/tupai',
+    component: Layout,
+    redirect: '/tupai/index',
+    children: [{
+      path: 'index',
+      name: 'TupaiIndex',
+      component: () => import('@/views/tupai/index'),
+      meta: { title: '土拍管理', icon: 'dashboard' }
+    }]
+  },
 ]
 export const constantRoutes = [
   {

二進制
src/views/news/img/icon_g_close.png


+ 1 - 3
src/views/news/index.vue

@@ -40,7 +40,6 @@ import { arrToObj } from '@/utils'
 import SearchForm from './components/searchForm/Index'
 import PopupEdit from './components/popup/IndexEdit'
 import baseTable from '_m/baseTable.js'
-import xData from './mixin'
 export default {
   name: 'index',
   components: {
@@ -58,8 +57,7 @@ export default {
       apiStr: 'house.adminformationlist',
       searchForm: null,
       isDtlShow: false,
-      curObj: {},
-      ...xData
+      curObj: {}
     }
   },
   computed: {

+ 0 - 6
src/views/news/mixin.js

@@ -1,6 +0,0 @@
-export default {
-  enabledStateArr: [
-    { key: '启用', val: '1' },
-    { key: '禁用', val: '2' }
-  ],
-}

+ 114 - 0
src/views/tupai/components/popup/IndexEdit.vue

@@ -0,0 +1,114 @@
+<template>
+  <div>
+    <el-dialog
+      v-loading="loading"
+      :show-close="false"
+      :close-on-click-modal="false"
+      :visible.sync="isShow"
+      :title="curObj.id ? '编辑土拍' : '新增土拍'"
+      :fullscreen="false"
+      width="700px"
+      custom-class="xl-dialog"
+      center
+    >
+      <base-form ref="ruleForm" class="lib-edit" :data="formData" :is-inline="false" label-width="110px">
+        <div slot="footer" style="padding-top: 20px;">
+          <el-button class="xl-form-btn t2" @click="close">关 闭</el-button>
+          <el-button class="xl-form-btn t1" @click="close('confirm')">确定</el-button>
+        </div>
+      </base-form>
+    </el-dialog>
+  </div>
+</template>
+<script>
+export default {
+  components: { },
+  mixins,
+  props: {
+    isShow: Boolean,
+    curObj: Object
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      formData: [],
+      loading: true,
+      cObj: {},
+      isShowMap: false
+    }
+  },
+  watch: {
+    isShow: function(val) {
+      if (val) {
+        if (val) {
+          if (this.curObj.id) {
+            this.$api.house.admlanddetail({id: this.curObj.id}).then(res => {
+              let curData = res || {}
+              this.cObj = curData || {}
+              this.getDef()
+            })
+          } else {
+            this.cObj = this.curObj
+            this.getDef()
+          }
+        }
+      }
+    },
+  },
+  methods: {
+    getDef() {
+      const params = { ...this.cObj }
+      this.formData = [
+        { label: '地块编号', key: 'no', class: 'c-2' },
+        { label: '区域', key: 'area_type', type: 'select', class: 'c-2', options: this.$dictData.area_type },
+        { label: '竞得单位', key: 'company', class: 'c-2' },
+        { label: '成交日期', key: 'deal_time', class: 'c-2', type: 'datePicker', type2: 'date'},
+        { label: '成交价', key: 'final_price', class: 'c-2', type: 'inputFont', appendFont: '万元'},
+        { label: '楼面价', key: 'floor_price', class: 'c-2', type: 'inputFont', appendFont: '元' },
+        { label: '起拍总价', key: 'start_total_price', class: 'c-2', type: 'inputFont', appendFont: '万元' },
+        { label: '起拍单价', key: 'start_unit_price', class: 'c-2', type: 'inputFont', appendFont: '元' },
+        { label: '溢价率', key: 'premium_rate', class: 'c-2', type: 'inputFont', appendFont: '%' },
+        { label: '出让年限', key: 'sell_ownership', class: 'c-2', type: 'inputFont', appendFont: '年' },
+        { label: '出让面积', key: 'sell_area', class: 'c-2', type: 'inputFont', appendFont: '㎡'},
+        { label: '建筑面积', key: 'built_area', class: 'c-2', type: 'inputFont', appendFont: '㎡' },
+        { label: '用途', key: 'purpose', class: 'c-2' },
+        { label: '容积率', key: 'plot_ratio', class: 'c-2' },
+        { label: '土拍图', key: 'pri_image', type: 'upload', class: 'c-2' },
+      ]
+      this.setDefaultValue(params)
+    },
+    close(str) {
+      if (str === 'confirm') {
+        this.$refs['ruleForm'].$refs['baseForm'].validate((valid) => {
+          if (valid) {
+            const oldform = this.$refs.ruleForm.baseForm
+            const newForm = { ...oldform }
+            if (this.curObj.id) newForm.id = this.curObj.id
+            let apiStr = 'admlandadd'
+            if (newForm.id) apiStr = 'admlandedit'
+            this.$api.house[apiStr](newForm).then(data => {
+              this.$msgs(newForm.id ? '编辑成功' : '新增成功')
+              this.$emit('close', newForm)
+            })
+          }
+        })
+      } else {
+        this.$emit('close')
+        this.setDefaultValue()
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+@import '../../../../styles/libEdit.scss';
+.lib-edit {
+  padding-top: 0;
+  ::v-deep .el-form-item {
+    margin-bottom: 10px;
+  }
+  ::v-deep .el-date-editor.el-input {
+    width: 100%;
+  }
+}
+</style>

+ 32 - 0
src/views/tupai/components/searchForm/Index.vue

@@ -0,0 +1,32 @@
+<template>
+  <base-form slot="content" ref="ruleForm" :data="searchData">
+    <div slot="footer">
+      <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
+      <!-- <el-button :loading="listLoading" icon="el-icon-document" class="xl-form-btn bgc2" @click="toExportExcel">导出{{ this.$route.meta.title }}信息</el-button> -->
+    </div>
+  </base-form>
+</template>
+<script>
+export default {
+  props: {
+    listLoading: Boolean
+  },
+  inject: ['parentData'],
+  data() {
+    return {
+      searchData: [
+        { label: '地块编号', key: 'no' },
+        { label: '用途', key: 'purpose' },
+        { label: '区域', key: 'area_type', type: 'select', options: this.$dictData.area_type },
+      ]
+    }
+  },
+  methods: {
+    searchHandle() {
+      const oldform = this.$refs.ruleForm.baseForm
+      const newForm = { ...oldform }
+      this.$emit('change', newForm)
+    }
+  }
+}
+</script>

+ 121 - 0
src/views/tupai/index.vue

@@ -0,0 +1,121 @@
+<template>
+  <div class="app-container">
+    <search-form
+      :list-loading="listLoading"
+      @change="searchHandle"
+    />
+    <table-list
+      :list-loading="listLoading"
+      :data="tableData2"
+      :columns="listConfig"
+      :current-page="currentPage"
+      :page-size="pageSize"
+      :total-records="totalRecords"
+      @currentChange="pageHandle"
+      :isAdd="true"
+      @add="openPopup"
+    >
+    </table-list>
+    <popup-edit
+      :isShow="isDtlShow"
+      :curObj="curObj"
+      @close="closePopup"
+    />
+  </div>
+</template>
+<script>
+import { arrToObj } from '@/utils'
+import SearchForm from './components/searchForm/Index'
+import PopupEdit from './components/popup/IndexEdit'
+import baseTable from '_m/baseTable.js'
+export default {
+  name: 'index',
+  components: {
+    SearchForm,
+    PopupEdit,
+  },
+  provide() {
+    return {
+      parentData: this
+    }
+  },
+  mixins: [baseTable],
+  data() {
+    return {
+      apiStr: 'house.admlandlist',
+      searchForm: null,
+      isDtlShow: false,
+      curObj: {}
+    }
+  },
+  computed: {
+    tableData2() {
+      const arr = [...this.tableData]
+      arr.map(item => {
+      })
+      return arr
+    }
+  },
+  created() {},
+  mounted() {
+    this.listConfig = {
+      rows: [
+        { label: '土拍图', prop: 'pri_image', type: 'img' },
+        { label: '地块编号', prop: 'no' },
+        { label: '区域', prop: 'area_type', type: 'tag', tags: arrToObj(this.$dictData.area_type) }, 
+        { label: '竞得单位', prop: 'company' },
+        { label: '成交日期', prop: 'deal_time' },
+        { label: '成交价', prop: 'final_price' },
+        { label: '楼面价', prop: 'floor_price' },
+        { label: '起拍总价', prop: 'start_total_price' },
+        { label: '起拍单价', prop: 'start_unit_price' },
+        { label: '溢价率', prop: 'premium_rate' },
+        { label: '出让面积', prop: 'sell_area' },
+        { label: '建筑面积', prop: 'built_area' },
+        { label: '出让年限', prop: 'sell_ownership' },
+        { label: '用途', prop: 'purpose' },
+        { label: '容积率', prop: 'plot_ratio' },
+        { label: '操作', width: 120, type: 'handle2', operations:
+          [
+            { label: '编辑', func: this.openPopup, btnType: 'primary' },
+            { label: '删除', func: this.delHandle, btnType: 'danger' },
+          ]
+        }
+      ]
+    }
+  },
+  methods: {
+    delHandle(row) {
+      this.$msg(`您确定要删除该文章吗?`, 'confirm', () => {
+        this.$api.house.admlanddel({
+          id: row.id,
+        }).then(data => {
+          this.$msgs(`已删除!`)
+          this.fetchData()
+        })
+      }, null, true)
+    },
+    openPopup(row) {
+      if (row && row.id) {
+        this.curObj = row
+      } else {
+        this.curObj = {}
+      }
+      this.isDtlShow = true
+    },
+    closePopup(obj) {
+      this.isDtlShow = false
+      if (obj) {
+        this.fetchData() 
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.scoped-link {
+  color: #2d8cf0;
+  text-decoration: underline;
+}
+</style>
+