Commit 11cfd61c by 张立顺

Merge branch 'SAAS+V4.53.0-0528' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.53.0-0528
2 parents adf523e9 b6a2c348
import request from "./request"
import RequestMethods from "./request.methods"
const path = "dj.smartcarlife.api.vpt.invoiceIssueQrcode."
// 查询订单开票项目
export function getInvoiceIssueItems(data) {
data.method = path + `getInvoiceIssueItems`
return request(data)
}
// 生成开票二维码
export function invoiceCreate(data) {
data.method = path + `create`
return request(data, RequestMethods.POST)
}
const _import = require("@/libs/util.import." + process.env.NODE_ENV)
export const routerName = {
917: {
path: "/invoiceManage",
name: "invoiceManage",
meta: {
title: "发票管理",
authId: "917",
parentId: "1",
cache: false
}
},
91701: {
path: "/invoiceCode",
name: "invoiceCode",
meta: {
title: "开发二维码",
authId: "91701",
parentId: "917",
cache: false
},
auth: [],
component: _import("invoiceManage/invoiceCode")
}
}
<template>
<d2-container class="customer-tags m-t-40" v-loading="loading">
<div class="d2-container-content">
<glsx-combi-form class="edit-form-container" ref="editFormRef" label-width="150px" default-width="308px" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
<div slot="invoiceIssueOptions" slot-scope="scope">
<el-checkbox-group v-model="editData[scope.scope.name]">
<el-checkbox v-for="(item, index) in baseData[scope.scope.optionsName]" :key="index" :label="item[scope.scope.optionId]">
{{ item[scope.scope.optionLabel] }}
</el-checkbox>
</el-checkbox-group>
</div>
<div slot="bizOrderCode" slot-scope="scope">
<el-input :placeholder="scope.scope.placeholder" v-model="editData[scope.scope.name]" :maxlength="scope.scope.maxlength"></el-input>
<el-button type="text" class="add-mer-btn" @click="getInvoiceInfo">搜索</el-button>
</div>
</glsx-combi-form>
<el-button type="primary" @click="handleConfirm">提交</el-button>
<!-- <el-button type="default" @click="goBack">取消</el-button> -->
</div>
</d2-container>
</template>
<script>
import {
getInvoiceIssueItems,
invoiceCreate
} from "@api/invoiceManage"
export default {
data() {
return {
loading: false,
editChildRef: "editChildRef",
// private开头的是私有参数,不传给后端
editData: {
invoiceIssueOptions: [],
bizOrderCode: '',
privateProject: '',
privateMoney: 0,
privateAmount: '',
privatePrice: '',
privateSpec: '',
privateUnit: '',
casherName: '',
reviewerName: '',
allowInvoiceCount: 0,
invoiceRemark: '',
expireDay: '',
email: ''
},
formRules: {
invoiceIssueOptions: [{ required: true, message: '请选择可选开票种类', trigger: 'change' }],
bizOrderCode: [{ required: true, message: '请输入主订单号', trigger: 'blur' }],
email: [{ required: true, message: '请输入发送邮件', trigger: 'blur' }],
},
editFormData: [
{
label: "可选开票种类",
name: "invoiceIssueOptions",
addHtml: "invoiceIssueOptions",
style: { width: '100%' },
optionId: "confId",
optionLabel: "confLabel",
optionsName: "invoiceTypeList",
optionList: [],
handleRadioChange: () => { }
},
{
label: "主订单号",
name: "bizOrderCode",
addHtml: "bizOrderCode",
type: "input",
width: '90%',
style: { width: '100%' },
placeholder: "请填写",
maxlength: '50'
},
{
label: "开票项目",
name: "privateProject",
type: "input",
style: { width: '42%' },
placeholder: "接口返回(多条项目使用“/”隔开)",
isDisabled: true
},
{
label: "待开票金额",
name: "privateMoney",
type: "input",
style: { width: '42%' },
placeholder: "接口返回",
isDisabled: true,
maxlength: '23'
},
{
label: "数量",
name: "privateAmount",
type: "input",
style: { width: '42%' },
placeholder: "接口返回(多条数量使用“/”隔开)",
isDisabled: true,
maxlength: '20'
},
{
label: "单价",
name: "privatePrice",
type: "input",
style: { width: '42%' },
placeholder: "接口返回(多条单价使用“/”隔开)",
isDisabled: true,
maxlength: '23'
},
{
label: "规格型号",
name: "privateSpec",
type: "input",
style: { width: '42%' },
placeholder: "接口返回(默认为空,显示为--)",
isDisabled: true,
maxlength: '20'
},
{
label: "单位",
name: "privateUnit",
type: "input",
style: { width: '42%' },
placeholder: "接口返回(默认展示“pcs”)",
isDisabled: true,
maxlength: '50'
},
{
label: "收款人",
name: "casherName",
type: "input",
style: { width: '42%' },
placeholder: "请填写",
maxlength: '20'
},
{
label: "复核人",
name: "reviewerName",
type: "input",
style: { width: '42%' },
placeholder: "请填写",
maxlength: '20'
},
{
label: "可开票张数",
name: "allowInvoiceCount",
type: "input",
style: { width: '42%' },
placeholder: "接口返回(默认“1”)",
isDisabled: true
},
{
label: "发票备注",
name: "invoiceRemark",
type: "input",
style: { width: '42%' },
placeholder: "请填写",
maxlength: '50'
},
{
label: "发送短信",
name: "",
type: "input",
style: { width: '42%' },
placeholder: "暂未开通",
isDisabled: true
},
{
label: "二维码有效期",
name: "expireDay",
type: "select",
style: { width: '42%' },
optionId: "confId",
optionLabel: "confLabel",
optionsName: "expireDayList",
optionList: [],
handleRadioChange: () => { }
},
{
label: "发送邮件",
name: "email",
type: "input",
style: { width: '42%' },
placeholder: "请填写",
maxlength: '50'
}
],
baseData: {
invoiceTypeList: [{
confId: '82',
confLabel: '数电票(普通发票)'
}, {
confId: '81',
confLabel: '数电票(增值税专用发票)'
}],
expireDayList: [{
confId: '7',
confLabel: '一周(7天)'
}, {
confId: '15',
confLabel: '半个月(15天)'
}, {
confId: '30',
confLabel: '一个月(30天)'
}]
}
};
},
mounted() {
this.getOptionsList()
},
methods: {
getInvoiceInfo() {
if (!this.editData.bizOrderCode) {
this.$message({
message: "请输入主订单号",
type: "error"
})
return true
}
const params = {
orderCode: this.editData.bizOrderCode
}
getInvoiceIssueItems(params).then(res => {
console.log(res, 'res---')
this.dealVal(res)
})
},
resetPrivateVal() {
const attrList = ['privateProject', 'privateAmount', 'privatePrice']
attrList.forEach(item => {
this.editData[item] = ''
})
this.editData.privateMoney = 0
this.editData.allowInvoiceCount = 1
},
resetAll() {
this.resetPrivateVal()
const attrList = ['bizOrderCode', 'casherName', 'reviewerName', 'invoiceRemark', 'expireDay', 'email']
attrList.forEach(item => {
this.editData[item] = ''
})
this.editData.invoiceIssueOptions = []
this.editData.allowInvoiceCount = 0
},
dealVal(list) {
if (!list) {
this.$message.warning('该订单没有服务项目,请重新查询!')
return true
}
this.resetPrivateVal()
list.forEach((item, idx) => {
let separate = idx ? '/' : ''
this.editData.privateProject = this.editData.privateProject + separate + item.itemName
this.editData.privateMoney = (Number(this.editData.privateMoney) + Number(item.invoiceItemAmount)).toFixed(2)
this.editData.privateAmount = this.editData.privateAmount + separate + '1'
this.editData.privatePrice = this.editData.privatePrice + separate + item.invoiceItemAmount
})
},
getOptionsList(formName = "editFormData") {
this[formName].forEach((item, index) => {
if (item.type === "select" || item.type === "radio") {
this.$set(
this[formName][index],
"optionList",
this.baseData[item.optionsName]
)
}
})
},
dealParams() {
var params = JSON.parse(JSON.stringify(this.editData))
const keyList = Object.keys(params)
keyList.forEach(item => {
if (item.includes('private')) {
delete params[item]
}
})
return params
},
handleConfirm() {
if (this.loading) {
return
}
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
var params = this.dealParams()
console.log(params, 'params----')
this.loading = true
invoiceCreate(params).then(res => {
if (res) {
this.$message.success("操作成功")
this.resetAll()
}
}).finally(() => {
this.loading = false
})
}
})
},
}
};
</script>
<style scoped>
.m-t-40 {
margin-top: 40px;
}
</style>
<template>
<div class="order-list-wrap">
<div class="header" slot="header" style="background: #e7eaec">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="(item, index) in tabPaneList" :label="item.label" :name="item.name" :key="index">
</el-tab-pane>
</el-tabs>
<components :is="tabName"></components>
</div>
</div>
</template>
<script>
import editInvoice from "./editInvoice.vue"
import invoiceCodeList from "./invoiceCodeList.vue"
export default {
name: "OrderList",
components: {
editInvoice,
invoiceCodeList
},
data() {
return {
activeName: "1",
tabPaneList: [
{
label: "生成发票二维码",
name: "1"
},
{
label: "管理开票二维码",
name: "2"
}
],
tabName: "editInvoice"
}
},
mounted() {
if (this.$route.params.tabPane) {
this.activeName = this.$route.params.tabPane
this.tabName = this.$route.params.tabLabel
}
},
watch: {},
methods: {
async getBaseData() {
this.baseData.channelTypeList = await this.get(BaseData.channelType)
this.getOptionsList()
},
handleClick() {
const arr = {
1: "editInvoice",
2: "invoiceCodeList",
}
this.tabName = arr[+this.activeName]
}
}
}
</script>
<style lang="scss" scoped>
.order-list-wrap {
padding: 0 20px;
.header {
::v-deep .el-tabs__header {
height: 54px;
line-height: 54px;
margin: 0;
padding: 0 20px;
color: #666666;
font-size: 16px;
background: #ffffff;
}
}
}
</style>
<template>
<d2-container class="customer-tags m-t-40" v-loading="!show">
<div class="d2-container-content">
<!-- <div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="'100px'" :form-data="showFormData">
</d2-search>
<div class="up-btns">
<el-button size="small" type="primary" @click="handleSearch">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div> -->
<d2-table-header title="">
</d2-table-header>
<!-- <d2-table ref="table" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="tableParams" :before-search-fn="beforeSearchFn">
<div slot="auth-button" slot-scope="scope">
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9122001']" />
</span>
</div>
</d2-table> -->
</div>
</d2-container>
</template>
<script>
export default {
data() {
return {
show: true,
};
},
methods: {}
};
</script>
<style scoped>
.m-t-40 {
margin-top: 40px;
}
</style>
...@@ -409,17 +409,17 @@ export default { ...@@ -409,17 +409,17 @@ export default {
const addedIds = new Set() const addedIds = new Set()
sceneList.forEach(item => { sceneList.forEach(item => {
if (item.scene === 0) { if (item.scene === 0) {
// 添加confId为0和1的对象 权益和延保 // 添加confId为1和2的对象 权益和延保
arr.forEach(obj => { arr.forEach(obj => {
if ((obj.confId === 0 || obj.confId === 1) && !addedIds.has(obj.confId)) { if ((obj.confId === 1 || obj.confId === 2) && !addedIds.has(obj.confId)) {
result.push(obj) result.push(obj)
addedIds.add(obj.confId) addedIds.add(obj.confId)
} }
}) })
} else if (item.scene === 1) { } else if (item.scene === 1) {
// 添加confId为2的对象 轻改 // 添加confId为0的对象 轻改
arr.forEach(obj => { arr.forEach(obj => {
if (obj.confId === 2 && !addedIds.has(obj.confId)) { if (obj.confId === 0 && !addedIds.has(obj.confId)) {
result.push(obj) result.push(obj)
addedIds.add(obj.confId) addedIds.add(obj.confId)
} }
...@@ -470,8 +470,8 @@ export default { ...@@ -470,8 +470,8 @@ export default {
var params = deepClone(this.formData) var params = deepClone(this.formData)
params.merchantName = this.baseData.merchantList.find(item => item.merchantId == params.merchantId)?.merchantName || params?.merchantName params.merchantName = this.baseData.merchantList.find(item => item.merchantId == params.merchantId)?.merchantName || params?.merchantName
params.staffName = this.baseData.staffList?.find(item => item.staffUuid == params.staffUuid)?.staffName || params?.staffName params.staffName = this.baseData.staffList?.find(item => item.staffUuid == params.staffUuid)?.staffName || params?.staffName
params.brandChildId = params?.carChildsBrandId params.brandChildId = params.brandChildId || params?.carChildsBrandId // 编辑时使用详情接口返回的carChildsBrandId
params.brandChildName = params?.carChildsBrandName params.brandChildName = params.brandChildName || params?.carChildsBrandName
delete params.createdDate delete params.createdDate
delete params.updatedDate delete params.updatedDate
delete params.operateLogs delete params.operateLogs
......
...@@ -578,7 +578,6 @@ export default { ...@@ -578,7 +578,6 @@ export default {
this.actionSetDownloadList({ list, type: 'updateList' }) this.actionSetDownloadList({ list, type: 'updateList' })
this.notice.okTips('上传成功') this.notice.okTips('上传成功')
this.$refs.personalTable.refreshTable(false, true)
this.handleImport() this.handleImport()
} }
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!