| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- <template>
- <div>
- <FullPage title='安装订单列表'
- :list='set_list'
- @init='init'
- :loading='loading'
- @searchData='init'
- @changePage='changePage'
- @changeSize='changeSize'
- :tableColums='computedTable'
- :tableData='tableData'
- :pageIndex='pageIndex'
- :total='total'>
- <!-- <div slot='titleButton'>
- <Button v-if='persimissionData["批量确认"]||persimissionData.all' @click="setupTableHeader" type="primary" ghost>批量确认</Button>
- </div> -->
- <div slot='navButton'>
- <Button v-if='persimissionData["表头设置"]||persimissionData.all'
- @click="setupTableHeader"
- type="primary"
- ghost
- icon='ios-cog'>表头设置</Button>
- </div>
- <template slot='set'
- slot-scope='{row}'>
- <div>
- <a v-if='persimissionData["详情"]||persimissionData.all'
- style="margin:0 5px"
- @click="goPage(row)">详情</a>
- <a style="margin:0 5px"
- @click="goUnusualPage(row)">查看异常</a>
- </div>
- </template>
- </FullPage>
- </div>
- </template>
- <script>
- import { mapState } from 'vuex'
- export default {
- data () {
- let _this = this;
- return {
- title: '',
- tableColums: [
- { title: '订单编号', align: 'center', key: 'order_no', fixed: 'left', width: '200' },
- {
- title: '订单类型', align: 'center', key: 'type', minWidth: 150,
- render: (h, params) => h('span', {}, params.row.type == 1 ? '工装' : '家装')
- },
- { title: '客户', align: 'center', key: 'client_name', minWidth: 150 },
- { title: '手机号', align: 'center', key: 'mobile', minWidth: 150 },
- { title: '地址', align: 'center', key: 'address', minWidth: 150 },
- { title: '项目名称', align: 'center', key: 'residential_name', minWidth: 200 },
- {
- title: '出库时间', align: 'center', key: 'predict_time', minWidth: 200,
- render: (h, params) => h('span', {}, this.func.replaceDate(params.row.transport_start_time))
- },
- {
- title: '运输时间', align: 'center', key: 'crt_time', minWidth: 200,
- render: (h, params) => h('span', {}, this.func.replaceDate(params.row.transport_end_time))
- },
- { title: '操作', align: 'center', slot: 'set', fixed: 'right', width: '150' },
- ],
- tableData: [],
- pageIndex: 1,
- total: 0,
- pageSize: 10,
- loading: false,
- tableheaders: [],
- warningList: []
- }
- },
- created () {
- // 获取紧急程度
- this.axios.get('/api/warning_list').then(res => { this.warningList = res.data.data })
- },
- mounted () {
- },
- watch: {
- $route (to, from) {
- this.type = to.query.type ? to.query.type : '';
- this.getData(this.proxyObj)
- }
- },
- computed: {
- ...mapState(['persimissionData']),
- computedTable () {
- if (this.tableheaders.length < 1) {
- return this.tableColums
- }
- return this.func.computedHeader(this.tableheaders, this.tableColums)
- },
- set_list () {
- return [
- { title: '订单编号', name: 'Input', serverName: 'order_no', placeholder: '请输入订单编号', value: '' },
- {
- title: '订单类型', name: 'Select', placeholder: '请选择', serverName: 'type', value: '',
- option: [
- { label: '工装', value: 1 },
- { label: '家装', value: 0 },
- ]
- },
- { title: '紧急程度', name: 'Select', serverName: 'warning_state', placeholder: '请选择', value: '', optionName: 'title', optionValue: 'id', option: this.warningList },
- { title: '项目名称', name: 'Input', serverName: 'residential_name', placeholder: '项目名称', value: '' },
- { title: '客户', name: 'Input', serverName: 'client_name', placeholder: '客户', value: '' },
- { title: '手机号', name: 'Input', serverName: 'mobile', placeholder: '手机号', value: '' },
- { title: '出库时间', name: 'Input', start_server: 'start_out_storage_time', end_server: 'end_out_storage_time', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期' },
- { title: '运输时间', name: 'Input', start_server: 'start_transport_time', end_server: 'end_transport_time', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期' },
- { title: '下单日期范围', name: 'Input', start_server: 'start_time', end_server: 'end_time', start_value: '', end_value: '', isDate: true, start_placeholder: '开始日期', end_placeholder: '结束日期' },
- ]
- }
- },
- methods: {
- init (row) {
- this.pageIndex = 1
- row.page_index = this.pageIndex;
- row.page_size = this.pageSize;
- this.proxyObj = row
- this.getData(row)
- },
- changePage (e) {
- this.pageIndex = e;
- this.proxyObj.page_index = this.pageIndex;
- this.getData(this.proxyObj)
- },
- changeSize (e) {
- this.pageSize = e;
- this.proxyObj.page_size = this.pageSize;
- this.getData(this.proxyObj)
- },
- getData (row) {
- this.loading = true;
- this.axios('/api/orders_install_list', { params: row }).then(res => {
- this.loading = false;
- if (res.code == 200) {
- this.tableData = res.data.data;
- this.total = res.data.total;
- this.tableheaders = res.data.tableSet || []
- }
- })
- },
- goPage (row) {
- this.$router.push({
- path: '/cms/mountorder/details',
- query: {
- order_no: row.order_no,
- type: 3
- }
- })
- },
- goUnusualPage (row) {
- this.$router.push({
- path: '/cms/mountorder/unusual',
- query: {
- order_no: row.order_no,
- type: 3
- }
- })
- },
- setupTableHeader () {
- this.tableheaders.length < 1 ? this.tableheaders = this.tableColums.reduce((pre, cur) => pre.concat(cur.key), []) : ''
- this.$setTableheader({
- list: this.tableColums,
- selects: this.tableheaders,
- then: (result) => {
- this.tableheaders = result
- this.axios.post('/api/update/table', { id: this.$route.query.id, result }).then(res => {
- if (res.code == 200) {
- this.$Message.success(res.msg)
- }
- })
- }
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|