licp
2024-05-28 52e18000ace434b2acdebce5e118c45c337a3fe7
src/views/accounting/jmreport/index.vue
@@ -18,6 +18,7 @@
import { mapGetters } from 'vuex'
import ttable from '@/views/common/ztt-table.vue'
import { pageList } from '@/api/accounting/personReport'
import { remote } from '@/api/admin/dict'
export default {
    components: {
        ttable
@@ -42,7 +43,7 @@
                isShowHide: true, // 是否显示显影按钮H
                isSearch: true, // 高级查询按钮
                defaultOrderBy: { column: 'createTime', direction: 'desc' },
                cancelRunCreated: true
                cancelRunCreated: false
            },
            table: {
                total: 0,
@@ -53,9 +54,77 @@
                column: [
                    {
                        minWidth: '100',
                        width: '100px',
                        prop: 'contractNo',
                        label: '合同编号',
                        prop: 'createTime',
                        label: '生产日期',
                        sort: true,
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'date',
                        formatter: this.formatDutyDate,
                    },
                    {
                        minWidth: '100',
                        prop: 'workShop',
                        label: '车间',
                        isTrue: true,
                        isSearch: true,searchInfoType:'select',
                        optList: () => {
                        return this.workShopList
                        }
                    },
                    {
                        minWidth: '100',
                        prop: 'partName',
                        label: '生产零件',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text',
                    },
                    {
                        minWidth: '100',
                        prop: 'partNo',
                        label: '生产零件号',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text',
                    },
                    {
                        minWidth: '100',
                        prop: 'staffName',
                        label: '生产人员',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text',
                    },
                    {
                        minWidth: '100',
                        prop: 'operation',
                        label: '工序',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text',
                    },
                    {
                        minWidth: '100',
                        prop: 'workSum',
                        label: '报工总数量',
                        sort: true,
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text',
                    },
                    {
                        minWidth: '100',
                        prop: 'unit',
                        label: '单位',
                        isTrue: true,
                        isSearch: true,
                        searchInfoType: 'text',
                    },
                    {
                        minWidth: '100',
                        prop: 'workTotal',
                        label: '报工总次数',
                        sort: true,
                        isTrue: true,
                        isSearch: true,
@@ -66,13 +135,35 @@
                operator: null
            },
            prelang: "operation",
            workShopList:[],
        }
    },
    mounted(){
        this.getWorkShopList()
    },
    methods:{
        // table自带事件
        handleSelectionChange(val) {
            this.multipleSelection = val
        },
        getWorkShopList(){
            remote('work_shop').then((response) => {
            if (response.data.code === 0) {
                this.workShopList = response.data.data
            } else {
                this.workShopList = []
            }
            })
        },
        formatDutyDate(row, column, cellValue) {
            if (cellValue) {
                const dutyDateList = /\d{4}-\d{1,2}-\d{1,2}/g.exec(cellValue)
                if (dutyDateList && dutyDateList.length > 0) {
                    return dutyDateList[0]
                }
            }
            return ''
        },
    }
}
</script>