账务设置工单支付方式
This commit is contained in:
parent
d6a4763c60
commit
f27631f460
@ -42,3 +42,11 @@ export function assignRoleDataScope(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 用来判断角色
|
||||
export function checkRole(code){
|
||||
return request({
|
||||
url: '/system/permission/checkRole?code=' + code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -41,7 +41,7 @@
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch"></right-toolbar>
|
||||
</el-row>
|
||||
<TicketTable :ticket-type="TicketType" :list="list" @setVoid="getPage"/>
|
||||
<TicketTable :ticket-type="TicketType" :list="list" @setVoid="getPage" :is-w-x-c-w="isWXCW"/>
|
||||
<pagination @pagination="getPage" v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
</div>
|
||||
@ -53,6 +53,7 @@ import TicketTable from "@/views/repair/tickets/Components/TicketTable.vue";
|
||||
import RepairTypeChoose from "@/views/repair/Components/RepairTypeChoose.vue";
|
||||
import {getTicketsPage} from "@/api/repair/tickets/Tickets";
|
||||
import CorpChoose from "@/views/repair/Components/CorpChoose.vue";
|
||||
import {checkRole} from "@/api/system/permission";
|
||||
|
||||
export default {
|
||||
name: "TicketSearch",
|
||||
@ -83,13 +84,20 @@ export default {
|
||||
},
|
||||
showSearch: true,
|
||||
total: 0,
|
||||
list: []
|
||||
list: [],
|
||||
isWXCW: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getPage()
|
||||
this.getIsWXCW()
|
||||
},
|
||||
methods: {
|
||||
// 是否是财务
|
||||
async getIsWXCW(){
|
||||
const res = await checkRole("wxcw")
|
||||
this.isWXCW = res.data
|
||||
},
|
||||
// 类型选择
|
||||
getRepairType(data){
|
||||
console.log(data)
|
||||
|
@ -104,7 +104,7 @@
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleShow(scope.row)"
|
||||
>查看
|
||||
</el-button>
|
||||
<el-button v-if="TicketType === 'tu'" size="mini" type="text" icon="el-icon-finished"
|
||||
<el-button v-if="TicketType === 'tu' && isWXCW && !scope.row.payType" size="mini" type="text" icon="el-icon-finished"
|
||||
@click="handlePaid(scope.row)"
|
||||
>结算
|
||||
</el-button>
|
||||
@ -145,6 +145,30 @@
|
||||
<!-- <el-table-column label="作废备注" align="center" prop="remark" width="180" />-->
|
||||
<!-- </el-table>-->
|
||||
<TicketsShow ref="ticketsShow"/>
|
||||
<el-dialog title="结算信息" :visible.sync="dialogVisible" width="40%" v-dialogDrag append-to-body>
|
||||
<el-form :model="formData" ref="formRef" :inline="true" label-width="10rem" :rules="formRules">
|
||||
<el-row :gutter="1">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="结算方法" prop="payType">
|
||||
<el-select v-model="formData.payType">
|
||||
<el-option v-for="item in this.getDictDatas(DICT_TYPE.REPAIR_PAY_TYPE)" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="1">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="结算备注" prop="remark">
|
||||
<el-input style="width:40rem" type="textarea" v-model="formData.remark" :autosize="{ minRows: 4, maxRows: 8}"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doPaid">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -164,6 +188,9 @@ export default {
|
||||
list: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
isWXCW:{
|
||||
type:Boolean
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -172,8 +199,13 @@ export default {
|
||||
formData: {
|
||||
id: null,
|
||||
ticketsStatus: null,
|
||||
remark: null
|
||||
}
|
||||
remark: null,
|
||||
payType: null
|
||||
},
|
||||
formRules:{
|
||||
payType: [{required: true, message: '支付方式不能为空', trigger: 'blur'}]
|
||||
},
|
||||
dialogVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -218,25 +250,30 @@ export default {
|
||||
},
|
||||
|
||||
handlePaid(row) {
|
||||
this.$prompt('结算备注', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
}).then(({value}) => {
|
||||
const data = {}
|
||||
data['id'] = row.id
|
||||
data['remark'] = value
|
||||
data['ticketsStatus'] = '02'
|
||||
this.doPaid(data)
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
async doPaid(data) {
|
||||
try {
|
||||
await setTicketsPaid(data)
|
||||
this.$modal.msgSuccess("结算成功")
|
||||
this.$emit("setVoid")
|
||||
} catch {
|
||||
this.formData = {
|
||||
id: null,
|
||||
ticketsStatus: null,
|
||||
remark: null,
|
||||
payType: null
|
||||
}
|
||||
this.formData['id'] = row.id
|
||||
this.formData['ticketsStatus'] = '02'
|
||||
this.dialogVisible = true
|
||||
},
|
||||
async doPaid() {
|
||||
try {
|
||||
await this.$refs['formRef'].validate()
|
||||
await setTicketsPaid(this.formData)
|
||||
this.$modal.msgSuccess("结算成功")
|
||||
this.dialogVisible = false
|
||||
this.$emit("setVoid")
|
||||
}catch{}
|
||||
// try {
|
||||
// await setTicketsPaid(this.formData)
|
||||
// this.$modal.msgSuccess("结算成功")
|
||||
// this.$emit("setVoid")
|
||||
// } catch {
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,16 +147,7 @@
|
||||
<span>{{ scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="名称" align="center" prop="waresName"/>
|
||||
<el-table-column label="规格" align="center" prop="wares.model" />
|
||||
<el-table-column label="数量" align="center" prop="waresCount" />
|
||||
<el-table-column label="状态" align="center" prop="waresStatus">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :type="DICT_TYPE.TW_ITEM_STATUS" :value="scope.row.waresStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备注" prop="remark" />
|
||||
<el-table-column align="center" label="客户可见" prop="isShow" v-if="userRole === 2">
|
||||
<el-table-column align="center" label="客户可见" prop="isShow" v-if="userRole === 2" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.isShow"
|
||||
@ -169,6 +160,15 @@
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="名称" align="center" prop="waresName" width="180" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="规格" align="center" prop="wares.model" width="180"/>
|
||||
<el-table-column label="数量" align="center" prop="waresCount" width="180"/>
|
||||
<el-table-column label="状态" align="center" prop="waresStatus" width="180">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :type="DICT_TYPE.TW_ITEM_STATUS" :value="scope.row.waresStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="备注" prop="remark" width="180" :show-overflow-tooltip="true"/>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
|
Loading…
Reference in New Issue
Block a user