Commit 98f347f2 by chenwq

新增发票样式

1 parent 0e2c2555
<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">
<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">
<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]">
......@@ -9,13 +9,15 @@
</el-checkbox>
</el-checkbox-group>
</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-button type="text" class="add-mer-btn" @click="getInvoiceInfo">搜索</el-button>
<el-button type="text" class="btn-search" @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 class="btn-box">
<el-button type="primary" @click="handleConfirm">提交</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
</d2-container>
</template>
......@@ -36,21 +38,22 @@ export default {
bizOrderCode: '',
privateProject: '',
privateMoney: 0,
privateAmount: '',
privatePrice: '',
privateSpec: '',
privateUnit: '',
casherName: '',
reviewerName: '',
allowInvoiceCount: 0,
invoiceRemark: '',
expireDay: '',
expireDay: '7',
email: ''
},
formRules: {
invoiceIssueOptions: [{ required: true, message: '请选择可选开票种类', trigger: 'change' }],
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: [
{
......@@ -92,48 +95,12 @@ export default {
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'
maxlength: '16'
},
{
label: "复核人",
......@@ -141,7 +108,7 @@ export default {
type: "input",
style: { width: '42%' },
placeholder: "请填写",
maxlength: '20'
maxlength: '16'
},
{
label: "可开票张数",
......@@ -229,7 +196,7 @@ export default {
})
},
resetPrivateVal() {
const attrList = ['privateProject', 'privateAmount', 'privatePrice']
const attrList = ['privateProject']
attrList.forEach(item => {
this.editData[item] = ''
})
......@@ -255,8 +222,6 @@ export default {
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") {
......@@ -280,6 +245,9 @@ export default {
})
return params
},
handleCancel() {
this.$emit('handleChangeTab', { activeTab: "2" })
},
handleConfirm() {
if (this.loading) {
......@@ -288,12 +256,12 @@ export default {
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()
this.handleCancel()
}
}).finally(() => {
this.loading = false
......@@ -304,8 +272,23 @@ export default {
}
};
</script>
<style scoped>
.m-t-40 {
margin-top: 40px;
<style lang="scss">
.edit-invoice {
.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>
......@@ -10,7 +10,7 @@
:key="index">
</el-tab-pane>
</el-tabs>
<components :is="tabName"></components>
<components :is="tabName" @handleChangeTab="handleChangeTab"></components>
</div>
</div>
</template>
......@@ -57,7 +57,15 @@ export default {
2: "invoiceCodeList"
}
this.tabName = arr[+this.activeName]
}
},
handleChangeTab(e) {
if(!e) {
return true
}
let { activeTab } = e
this.activeName = activeTab
this.handleClick()
},
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!