Commit 98f347f2 by chenwq

新增发票样式

1 parent 0e2c2555
<template> <template>
<d2-container class="customer-tags m-t-40" v-loading="loading"> <d2-container class="edit-invoice" v-loading="loading">
<div class="d2-container-content"> <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"> <glsx-combi-form class="edit-form-container p-t-20" 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"> <div slot="invoiceIssueOptions" slot-scope="scope">
<el-checkbox-group v-model="editData[scope.scope.name]"> <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]"> <el-checkbox v-for="(item, index) in baseData[scope.scope.optionsName]" :key="index" :label="item[scope.scope.optionId]">
...@@ -9,13 +9,15 @@ ...@@ -9,13 +9,15 @@
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
<div slot="bizOrderCode" slot-scope="scope"> <div slot="bizOrderCode" class="bizOrderCode" slot-scope="scope">
<el-input :placeholder="scope.scope.placeholder" v-model="editData[scope.scope.name]" :maxlength="scope.scope.maxlength"></el-input> <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> <el-button type="text" class="btn-search" @click="getInvoiceInfo">搜索</el-button>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
<el-button type="primary" @click="handleConfirm">提交</el-button> <div class="btn-box">
<!-- <el-button type="default" @click="goBack">取消</el-button> --> <el-button type="primary" @click="handleConfirm">提交</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div> </div>
</d2-container> </d2-container>
</template> </template>
...@@ -36,21 +38,22 @@ export default { ...@@ -36,21 +38,22 @@ export default {
bizOrderCode: '', bizOrderCode: '',
privateProject: '', privateProject: '',
privateMoney: 0, privateMoney: 0,
privateAmount: '',
privatePrice: '',
privateSpec: '',
privateUnit: '',
casherName: '', casherName: '',
reviewerName: '', reviewerName: '',
allowInvoiceCount: 0, allowInvoiceCount: 0,
invoiceRemark: '', invoiceRemark: '',
expireDay: '', expireDay: '7',
email: '' email: ''
}, },
formRules: { formRules: {
invoiceIssueOptions: [{ required: true, message: '请选择可选开票种类', trigger: 'change' }], invoiceIssueOptions: [{ required: true, message: '请选择可选开票种类', trigger: 'change' }],
bizOrderCode: [{ required: true, message: '请输入主订单号', trigger: 'blur' }], bizOrderCode: [{ required: true, message: '请输入主订单号', trigger: 'blur' }],
email: [{ required: true, message: '请输入发送邮件', trigger: 'blur' }], email: [
{ required: true, message: '请输入发送邮件', trigger: 'blur' },
{ type: 'email', message: '请输入正确的邮箱地址', trigger: ['blur', 'change'] }
],
privateProject: [{ required: true, message: '请输入开票项目', trigger: 'blur' }],
privateMoney: [{ required: true, message: '请输入待开票金额', trigger: 'blur' }],
}, },
editFormData: [ editFormData: [
{ {
...@@ -92,48 +95,12 @@ export default { ...@@ -92,48 +95,12 @@ export default {
maxlength: '23' 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: "收款人", label: "收款人",
name: "casherName", name: "casherName",
type: "input", type: "input",
style: { width: '42%' }, style: { width: '42%' },
placeholder: "请填写", placeholder: "请填写",
maxlength: '20' maxlength: '16'
}, },
{ {
label: "复核人", label: "复核人",
...@@ -141,7 +108,7 @@ export default { ...@@ -141,7 +108,7 @@ export default {
type: "input", type: "input",
style: { width: '42%' }, style: { width: '42%' },
placeholder: "请填写", placeholder: "请填写",
maxlength: '20' maxlength: '16'
}, },
{ {
label: "可开票张数", label: "可开票张数",
...@@ -229,7 +196,7 @@ export default { ...@@ -229,7 +196,7 @@ export default {
}) })
}, },
resetPrivateVal() { resetPrivateVal() {
const attrList = ['privateProject', 'privateAmount', 'privatePrice'] const attrList = ['privateProject']
attrList.forEach(item => { attrList.forEach(item => {
this.editData[item] = '' this.editData[item] = ''
}) })
...@@ -255,8 +222,6 @@ export default { ...@@ -255,8 +222,6 @@ export default {
let separate = idx ? '/' : '' let separate = idx ? '/' : ''
this.editData.privateProject = this.editData.privateProject + separate + item.itemName this.editData.privateProject = this.editData.privateProject + separate + item.itemName
this.editData.privateMoney = (Number(this.editData.privateMoney) + Number(item.invoiceItemAmount)).toFixed(2) 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") { getOptionsList(formName = "editFormData") {
...@@ -280,6 +245,9 @@ export default { ...@@ -280,6 +245,9 @@ export default {
}) })
return params return params
}, },
handleCancel() {
this.$emit('handleChangeTab', { activeTab: "2" })
},
handleConfirm() { handleConfirm() {
if (this.loading) { if (this.loading) {
...@@ -288,12 +256,12 @@ export default { ...@@ -288,12 +256,12 @@ export default {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
var params = this.dealParams() var params = this.dealParams()
console.log(params, 'params----')
this.loading = true this.loading = true
invoiceCreate(params).then(res => { invoiceCreate(params).then(res => {
if (res) { if (res) {
this.$message.success("操作成功") this.$message.success("操作成功")
this.resetAll() this.resetAll()
this.handleCancel()
} }
}).finally(() => { }).finally(() => {
this.loading = false this.loading = false
...@@ -304,8 +272,23 @@ export default { ...@@ -304,8 +272,23 @@ export default {
} }
}; };
</script> </script>
<style scoped> <style lang="scss">
.m-t-40 { .edit-invoice {
margin-top: 40px; .p-t-20 {
padding-top: 20px;
}
.bizOrderCode {
display: flex;
width: 308px;
.el-input--small {
width: calc(100% - 30px);
}
.btn-search {
margin-left: 10px;
}
}
.btn-box {
text-align: center;
}
} }
</style> </style>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
:key="index"> :key="index">
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<components :is="tabName"></components> <components :is="tabName" @handleChangeTab="handleChangeTab"></components>
</div> </div>
</div> </div>
</template> </template>
...@@ -57,7 +57,15 @@ export default { ...@@ -57,7 +57,15 @@ export default {
2: "invoiceCodeList" 2: "invoiceCodeList"
} }
this.tabName = arr[+this.activeName] this.tabName = arr[+this.activeName]
} },
handleChangeTab(e) {
if(!e) {
return true
}
let { activeTab } = e
this.activeName = activeTab
this.handleClick()
},
} }
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!