|
@@ -0,0 +1,177 @@
|
|
|
|
+<template>
|
|
|
|
+ <template-page ref="pageRef" :get-list="getList" :exportList="exportList" :table-attributes="tableAttributes"
|
|
|
|
+ :table-events="tableEvents" :moreParameters="moreParameters" :column-parsing="columnParsing" :operation="operation"
|
|
|
|
+ :operationColumnWidth="200" :replaceOrNotMap="false">
|
|
|
|
+ <div class="cartographer">
|
|
|
|
+ <el-dialog :title="formTypeName[formType]" width="100%" :modal="false" :visible.sync="formDialog"
|
|
|
|
+ :before-close="formCancel">
|
|
|
|
+ <zj-form-container v-if="formDialog" ref="formRef" :form-data="formData" :styleSwitch="false">
|
|
|
|
+ <zj-form-module title="基础信息" label-width="120px" :showPackUp="false" :form-data="formData"
|
|
|
|
+ :form-items="formItems">
|
|
|
|
+ </zj-form-module>
|
|
|
|
+ <zj-form-module title="订单信息" label-width="120px" :showPackUp="false" :form-data="formData"
|
|
|
|
+ :form-items="formItems">
|
|
|
|
+ </zj-form-module>
|
|
|
|
+ <zj-form-module title="附件图片" label-width="120px" :showPackUp="false" :form-data="formData"
|
|
|
|
+ :form-items="formItems">
|
|
|
|
+ </zj-form-module>
|
|
|
|
+ </zj-form-container>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button size="mini" @click="formCancel">取 消</el-button>
|
|
|
|
+ <el-button size="mini" @click="formConfirm" type="primary">确定</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
|
|
+ </template-page>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import TemplatePage from '@/components/template/template-page-1.vue'
|
|
|
|
+import import_mixin from '@/components/template/import_mixin.js'
|
|
|
|
+import { increOrderSettleList, increOrderSettleListExport, increOrderSettleDetail, increOrderSettleConfirm, increOrderSettleRefund } from "@/api/orderSettleManag.js"
|
|
|
|
+export default {
|
|
|
|
+ props: {
|
|
|
|
+ storageType: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: ""
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ components: { TemplatePage },
|
|
|
|
+ mixins: [import_mixin],
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ // 事件组合
|
|
|
|
+ optionsEvensGroup: [[
|
|
|
|
+ [
|
|
|
|
+ {
|
|
|
|
+ name: '批量结算',
|
|
|
|
+ click: () => {
|
|
|
|
+ if (this.recordSelected.length === 0) {
|
|
|
|
+ this.$message.warning('请勾选订单')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ increOrderSettleConfirm({
|
|
|
|
+ ids: this.recordSelected.map(item => item.id)
|
|
|
|
+ }).then(res => {
|
|
|
|
+ this.$message({ type: 'success', message: `成功!` })
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ ]],
|
|
|
|
+ // 表格属性
|
|
|
|
+ tableAttributes: {
|
|
|
|
+ // 启用勾选列
|
|
|
|
+ selectColumn: true
|
|
|
|
+ },
|
|
|
|
+ // 表格事件
|
|
|
|
+ tableEvents: {
|
|
|
|
+ 'selection-change': this.selectionChange
|
|
|
|
+ },
|
|
|
|
+ // 勾选选中数据
|
|
|
|
+ recordSelected: [],
|
|
|
|
+ formTypeName: ["查看", "结算"],
|
|
|
|
+ formType: -1,
|
|
|
|
+ formData: {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ formDialog: false,
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ // 更多参数
|
|
|
|
+ moreParameters() {
|
|
|
|
+ return []
|
|
|
|
+ },
|
|
|
|
+ formItems() {
|
|
|
|
+ return []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ // 列表请求函数
|
|
|
|
+ getList: increOrderSettleList,
|
|
|
|
+ // 列表导出函数
|
|
|
|
+ exportList: increOrderSettleListExport,
|
|
|
|
+ // 表格列解析渲染数据更改
|
|
|
|
+ columnParsing(item, defaultData) {
|
|
|
|
+ return defaultData
|
|
|
|
+ },
|
|
|
|
+ // 监听勾选变化
|
|
|
|
+ selectionChange(data) {
|
|
|
|
+ this.recordSelected = data
|
|
|
|
+ },
|
|
|
|
+ // 操作按钮
|
|
|
|
+ operation(h, { row, index, column }) {
|
|
|
|
+ return (
|
|
|
|
+ <div class='operation-btns'>
|
|
|
|
+ <el-button type="text" onClick={() => {
|
|
|
|
+ this.formType = 0
|
|
|
|
+ this.getDetail(row.id)
|
|
|
|
+ }}>查看</el-button>
|
|
|
|
+ <el-button type="text" onClick={() => {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: "workOrderPool",
|
|
|
|
+ query: {
|
|
|
|
+ pgIncreItemId: row.id,
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }}>服务单明细</el-button>
|
|
|
|
+ <el-popconfirm
|
|
|
|
+ title={`是否确定退款?`}
|
|
|
|
+ onConfirm={() => {
|
|
|
|
+ increOrderSettleRefund({ id: row.id }).then(res => {
|
|
|
|
+ this.$message({ type: 'success', message: `退款成功!` })
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
|
+ })
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ <el-button type="text" slot="reference">退款</el-button>
|
|
|
|
+ </el-popconfirm>
|
|
|
|
+ <el-button type="text" onClick={() => {
|
|
|
|
+ this.formType = 1
|
|
|
|
+ this.getDetail(row.id)
|
|
|
|
+ }}>结算</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ },
|
|
|
|
+ getDetail(id) {
|
|
|
|
+ increOrderSettleDetail({ id }).then(res => {
|
|
|
|
+ Object.assign(this.formData, res.data)
|
|
|
|
+ this.openForm()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ openForm() {
|
|
|
|
+ this.formDialog = true
|
|
|
|
+ },
|
|
|
|
+ // 关闭弹窗
|
|
|
|
+ formCancel() {
|
|
|
|
+ this.$refs.formRef.$refs.inlineForm.clearValidate()
|
|
|
|
+ this.$data.formData = this.$options.data().formData
|
|
|
|
+ this.formDialog = false
|
|
|
|
+ },
|
|
|
|
+ formConfirm() {
|
|
|
|
+ this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ increOrderSettleConfirm({
|
|
|
|
+ ids: [this.formData.id]
|
|
|
|
+ }).then(res => {
|
|
|
|
+ this.$message({ type: 'success', message: `${this.formTypeName[this.formType]}成功!` })
|
|
|
|
+ this.formCancel()
|
|
|
|
+ this.$refs.pageRef.refreshList()
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss">
|
|
|
|
+.redbordererr {
|
|
|
|
+ .el-form-item {
|
|
|
|
+ margin: 0 !important;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|