|
@@ -0,0 +1,291 @@
|
|
|
+<template>
|
|
|
+ <zj-tab-page ref="tabPage" :defaultActives="[{ key: 'list', label: $route.meta.title + '-列表', essential: true }]">
|
|
|
+ <template slot-scope="{ activeKey, data }">
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ width: '100%',
|
|
|
+ height: activeKey == 'list' ? '100%' : '0px',
|
|
|
+ overflow: 'hidden'
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <template-page
|
|
|
+ ref="pageRef"
|
|
|
+ :get-list="getList"
|
|
|
+ :table-attributes="tableAttributes"
|
|
|
+ :table-events="tableEvents"
|
|
|
+ :options-evens-group="optionsEvensGroup"
|
|
|
+ :moreParameters="moreParameters"
|
|
|
+ :column-parsing="columnParsing"
|
|
|
+ :operationColumnWidth="180"
|
|
|
+ :operation="operation()"
|
|
|
+ >
|
|
|
+ </template-page>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
+ width: '100%',
|
|
|
+ height: activeKey == 'view' ? '100%' : '0px',
|
|
|
+ overflow: 'hidden'
|
|
|
+ }"
|
|
|
+ >
|
|
|
+ <template-page
|
|
|
+ ref="pageRef"
|
|
|
+ :operationColumnWidth="180"
|
|
|
+ :table-attributes="tableAttributes2"
|
|
|
+ :table-events="tableEvents2"
|
|
|
+ :get-list="getList2"
|
|
|
+ :exportList="exportList2"
|
|
|
+ :options-evens-group="optionsEvensGroup2"
|
|
|
+ :operation="operation2()"
|
|
|
+ >
|
|
|
+ </template-page>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </zj-tab-page>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import TemplatePage from '@/components/template/template-page-1.vue'
|
|
|
+import import_mixin from '@/components/template/import_mixin.js'
|
|
|
+import ImageUpload from '@/components/file-upload'
|
|
|
+import operation_mixin from '@/components/template/operation_mixin.js'
|
|
|
+import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
|
|
|
+import {
|
|
|
+ dailySummaryList,
|
|
|
+ dailySummaryOrderImport,
|
|
|
+ dailySummaryRepairDelete,
|
|
|
+ dailySummaryRepairSummary,
|
|
|
+ dailySummaryRepairDetailList,
|
|
|
+ dailySummaryRepairDetailListExport,
|
|
|
+ dailySummaryRepairItemDelete,
|
|
|
+ dailySummaryRepairItemWait,
|
|
|
+ dailySummaryRepairItemResummary
|
|
|
+} from '@/api/settlementDataImport'
|
|
|
+export default {
|
|
|
+ components: { TemplatePage, ImageUpload },
|
|
|
+ mixins: [import_mixin, operation_mixin],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 表格属性
|
|
|
+ tableAttributes: {
|
|
|
+ // 启用勾选列
|
|
|
+ selectColumn: true
|
|
|
+ },
|
|
|
+ // 表格事件
|
|
|
+ tableEvents: {
|
|
|
+ 'selection-change': this.selectionChange
|
|
|
+ },
|
|
|
+ // 勾选选中行
|
|
|
+ recordSelected: [],
|
|
|
+ // 表格属性
|
|
|
+ tableAttributes2: {
|
|
|
+ // 启用勾选列
|
|
|
+ selectColumn: true
|
|
|
+ },
|
|
|
+ // 表格事件
|
|
|
+ tableEvents2: {
|
|
|
+ 'selection-change': this.selectionChange2
|
|
|
+ },
|
|
|
+ // 勾选选中行
|
|
|
+ recordSelected2: [],
|
|
|
+ // 表单
|
|
|
+ formData: {}
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 更多参数
|
|
|
+ moreParameters() {
|
|
|
+ return []
|
|
|
+ },
|
|
|
+ optionsEvensGroup() {
|
|
|
+ return [
|
|
|
+ [
|
|
|
+ [
|
|
|
+ this.optionsEvensAuth('import', ({ moduleName }) => {
|
|
|
+ return {
|
|
|
+ name: moduleName,
|
|
|
+ render: () => {
|
|
|
+ return this.importButton(dailySummaryOrderImport, moduleName)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ this.optionsEvensAuth('batchSummary', {
|
|
|
+ click: () => {
|
|
|
+ if (this.recordSelected.length === 0) {
|
|
|
+ this.$message.warning('请勾选')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ dailySummaryRepairSummary({
|
|
|
+ importBatchNos: this.recordSelected.map(item => item.importBatchNo).join(',')
|
|
|
+ }).then(res => {
|
|
|
+ this.$message({ type: 'success', message: '汇总成功!' })
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ //
|
|
|
+ optionsEvensGroup2() {
|
|
|
+ return [
|
|
|
+ [
|
|
|
+ [
|
|
|
+ this.optionsEvensAuth('batchNoSettlement', {
|
|
|
+ click: () => {
|
|
|
+ if (this.recordSelected2.length === 0) {
|
|
|
+ this.$message.warning('请勾选')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ dailySummaryRepairItemWait({
|
|
|
+ ids: this.recordSelected2.map(item => item.id).join(',')
|
|
|
+ }).then(res => {
|
|
|
+ this.$message({ type: 'success', message: '设置成功!' })
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ],
|
|
|
+ [
|
|
|
+ this.optionsEvensAuth('batchDel2', {
|
|
|
+ click: () => {
|
|
|
+ if (this.recordSelected.length === 0) {
|
|
|
+ this.$message.warning('请勾选')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ dailySummaryRepairItemDelete({
|
|
|
+ ids: this.recordSelected.map(item => item.id).join(',')
|
|
|
+ }).then(res => {
|
|
|
+ this.$message({ type: 'success', message: '删除成功!' })
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ formItems() {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 列表请求函数
|
|
|
+ getList(p, cb) {
|
|
|
+ try {
|
|
|
+ cb && cb(p)
|
|
|
+ return dailySummaryList(p)
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getList2(p, cb) {
|
|
|
+ try {
|
|
|
+ cb && cb(p)
|
|
|
+ return dailySummaryRepairDetailList(p)
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 列表导出函数
|
|
|
+ exportList2: dailySummaryRepairDetailListExport,
|
|
|
+ // 表格列解析渲染数据更改
|
|
|
+ columnParsing(item, defaultData) {
|
|
|
+ return defaultData
|
|
|
+ },
|
|
|
+ // 监听勾选变化
|
|
|
+ selectionChange(data) {
|
|
|
+ this.recordSelected = data
|
|
|
+ },
|
|
|
+ selectionChange2(data) {
|
|
|
+ this.recordSelected2 = data
|
|
|
+ },
|
|
|
+ operation() {
|
|
|
+ return this.operationBtn({
|
|
|
+ view: {
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ this.$refs.tabPage.addTab({
|
|
|
+ // 对应显示的模块
|
|
|
+ activeKey: 'view',
|
|
|
+ // 唯一标识
|
|
|
+ key: 'view',
|
|
|
+ // 页签名称
|
|
|
+ label: '明细',
|
|
|
+ // 打开时事件
|
|
|
+ triggerEvent: () => {},
|
|
|
+ // 关闭时事件
|
|
|
+ closeEvent: () => {}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ summary: {
|
|
|
+ prompt: '确定汇总吗?',
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ dailySummaryRepairSummary({ importBatchNos: row.importBatchNo }).then(res => {
|
|
|
+ this.$message({ type: 'success', message: '汇总成功!' })
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ coverImport: {
|
|
|
+ click: ({ row, index, column }) => {}
|
|
|
+ },
|
|
|
+ del: {
|
|
|
+ prompt: '确定删除吗?',
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ dailySummaryRepairDelete({ importBatchNo: row.importBatchNo }).then(res => {
|
|
|
+ this.$message({ type: 'success', message: '删除成功!' })
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ operation2() {
|
|
|
+ return this.operationBtn({
|
|
|
+ noSettlement: {
|
|
|
+ prompt: '确定暂不结算吗?',
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ dailySummaryRepairItemWait({ ids: row.id }).then(res => {
|
|
|
+ this.$message({ type: 'success', message: '设置成功!' })
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ del2: {
|
|
|
+ prompt: '确定删除吗?',
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ dailySummaryRepairItemDelete({ ids: row.id }).then(res => {
|
|
|
+ this.$message({ type: 'success', message: '删除成功!' })
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ resumeSettlement: {
|
|
|
+ prompt: '确定恢复结算吗?',
|
|
|
+ click: ({ row, index, column }) => {
|
|
|
+ dailySummaryRepairItemResummary({ ids: row.id }).then(res => {
|
|
|
+ this.$message({ type: 'success', message: '设置成功!' })
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ formConfirm(removeTab) {
|
|
|
+ this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
|
|
|
+ if (valid) {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.$data.formData = this.$options.data().formData
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped></style>
|