feat:定制化开发

release
zhaoxingchang.sd 11 months ago
parent d8ba21993f
commit 0f87461e86
  1. 4
      src/api/invoice.js
  2. 8
      src/api/rules.js
  3. 5
      src/api/url.js
  4. 55
      src/components/ruleSetting/enterpriseInfo.vue
  5. 193
      src/components/ruleSetting/taxType.vue

@ -133,7 +133,9 @@ export default {
getSsoParam() {
return fetch(url.getSsoParam, {})
},
getUserInfoModelApi() {
return fetch(url.getUserInfoModelApi, {})
},
// 发票列表导出
exportInvoiceList(dimParam, invoiceTypeCode, invoiceTime) {
return fetch(url.exportInvoiceList, {

@ -157,4 +157,12 @@ export default {
ruleupdateSsjcApi(param, headers){
return fetch(url.ruleupdateSsjcApi, param, headers)
},
getUserInfoModelApi(param, headers){
return fetch(url.getUserInfoModelApi, param, headers)
},
importUserInfoExcelApi(param, headers){
return fetch(url.importUserInfoExcelApi, param, headers)
},
}

@ -291,4 +291,9 @@ export default {
deleteInvoiceFiles: '/app/common/invoice/deleteInvoiceFiles',
ruleupdateSsjcApi: '/web/common/rule/updateSsjc',
getUserInfoModelApi: '/web/common/orgUser/getUserInfoModel',
importUserInfoExcelApi: '/web/orgUser/importUserInfoExcel',
}

@ -57,6 +57,13 @@
<div v-else><span class="fakeCircle" style="background: red"></span><span>停用</span></div>
</template>
</el-table-column>
<el-table-column prop="bankName" label="适用时间">
<template slot-scope="scope">
<span>{{formDate(scope.row.startTime)}}</span>
<span> </span>
<span>{{formDate(scope.row.startTime)}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="140">
<template slot-scope="scope">
<span v-if="scope.row.isOpen==='N'" class="cellBtn" style="color: #229FFF;cursor: pointer" @click="handleBan(scope.row)">启用</span>
@ -109,6 +116,17 @@
<el-form-item label="账号:" prop="account">
<el-input v-model="addForm.account" maxlength="32" clearable></el-input>
</el-form-item>
<el-form-item label="适用日期:" >
<el-date-picker
v-model="addForm.time"
type="daterange"
:clearable=false
range-separator="至"
value-format="yyyy-MM-dd"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer">
<el-button size="medium" @click="closeWin">取消</el-button>
@ -182,7 +200,8 @@
tel: null,
bank: null,
account: null,
enterpriseNo: ''
enterpriseNo: '',
tiem:[],
},
addRules: {
name: [{required: true, message: '企业名称不能为空', trigger: 'blur'}],
@ -198,6 +217,9 @@
{ required: false, message: '账号不能为空', trigger: 'blur'},
{ validator: validNum, trigger: 'blur' }
],
time:[
{ required: true, message: '日期不能为空', trigger: 'change'},
]
},
/*分页*/
currentPage: 1,
@ -245,6 +267,11 @@
openAddWin() {
this.addTitle = '新增';
this.addWin = true;
const currentYear = new Date().getFullYear();
const startDate = `${currentYear}-01-01`; // 11
const endDate = `${currentYear}-12-31`; // 1231
const arrayObj = [startDate, endDate];
this.$set(this.addForm, 'time', arrayObj); // 使 this.$set
},
handleEdit(data) {
this.addTitle = '编辑';
@ -258,10 +285,21 @@
tel: data.phone,
bank: data.bankName,
account: data.bankCardNo,
enterpriseNo: data.enterpriseNo
enterpriseNo: data.enterpriseNo,
};
this.$set(this.addForm,'time', [
data.startTime,
data.endTime
]);
});
},
setDefaultDates() {
// const currentYear = new Date().getFullYear();
// this.addForm.time = [
// `${currentYear}-01-01`, // 11
// `${currentYear}-12-31` // 1231
// ];
},
handleBan(val) {
console.log(val.isOpen)
const params = {
@ -333,13 +371,16 @@
};
this.$refs[form].validate((valid) => {
if (valid) {
console.log(this.addForm.time[0])
const params = {
buyerName: this.addForm.name,
buyerTaxNo: this.addForm.code,
address: this.addForm.address,
phone: this.addForm.tel,
bankName: this.addForm.bank,
bankCardNo: this.addForm.account
bankCardNo: this.addForm.account,
startTime:this.addForm.time[0],
endTime:this.addForm.time[1]
};
if(this.addTitle == '编辑') {
params.enterpriseNo = this.addForm.enterpriseNo;
@ -370,6 +411,14 @@
})
},
formDate(value){
const date = new Date(value);
const year = date.getFullYear();
const month = ('0' + (date.getMonth() + 1)).slice(-2); //
const day = ('0' + date.getDate()).slice(-2); //
return `${year}-${month}-${day}`;
},
maxTableHeight() {
this.$nextTick(() => {
let self = this;

@ -8,6 +8,8 @@
<el-form-item>
<el-button type="primary" size="medium" icon="el-icon-search" @click="findAll(1)">查询</el-button>
<el-button type="primary" size="medium" icon="el-icon-plus" @click="openAddWin">新增</el-button>
<el-button type="primary" size="medium" @click="dowBtn">下载模板</el-button>
<el-button type="primary" size="medium" @click="upFileBtn">批量上传</el-button>
</el-form-item>
</el-form>
</div>
@ -20,6 +22,7 @@
style="width: 100%">
<!-- <el-table-column prop="userId" label="编号" width="150"></el-table-column> -->
<el-table-column label="序号" type="index" width="70" align="center"></el-table-column>
<el-table-column prop="userNum" label="人员编码"></el-table-column>
<el-table-column prop="userName" label="人员姓名"></el-table-column>
<el-table-column prop="phone" label="手机号" width="130"></el-table-column>
<el-table-column prop="identityNumber" label="证件号" width="180"></el-table-column>
@ -55,14 +58,10 @@
>
<div class="fakeLine"></div>
<el-form :model="addForm" ref="addForm" :rules="addRules" style="padding: 20px" label-width="111px">
<el-form-item label="人员编码:" prop="userNum">
<el-input v-model.trim="addForm.userNum" clearable maxlength="50"></el-input>
</el-form-item>
<el-form-item label="人员名称:" prop="memberId">
<!-- <el-select
style="width: 100%"
v-model="addForm.memberId">
<el-option v-for="(item,index) in nameList" :key="index"
:label="item.label" :value="item.id"
></el-option>
</el-select> -->
<el-input v-model.trim="addForm.memberId" clearable maxlength="50"></el-input>
</el-form-item>
<el-form-item label="手机号:" prop="phone">
@ -90,10 +89,61 @@
<el-button size="medium" type="primary" @click="saveCommodity('addForm')">确认</el-button>
</div>
</el-dialog>
<el-dialog
title="附件上传"
class="parseWinStyle scanDialogClass"
width="500px"
:visible.sync="showModal"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form
style="margin: 50px"
class="importFileForm"
ref="importFile"
:model="importFile"
:rules="importFileRules"
label-width="90px"
>
<el-form-item label="附件上传" prop="fileList">
<el-upload
action=""
ref="uploadFile"
:auto-upload="false"
:on-change="fileChange"
:on-remove="fileRemove"
:file-list="importFile.fileList"
:limit="1"
:on-exceed="handleExceed"
>
<el-button class="btn-cancel importBtn"
><i class="el-icon-upload2" style="font-size: 16px;"></i>
上传文件</el-button
>
<span v-if="importFile.fileList.length === 0">未选取文件</span>
</el-upload>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="medium" class="btn-cancel" @click="cancelSave" :loading="tipModaSureBtnloading"
>取消</el-button
>
<el-button
size="medium" type="primary"
class="btn-confirm"
:disabled="disabledImport"
:loading="tipModaSureBtnloading"
@click="importFileConfirm"
><i class="el-icon-loading" v-if="disabledImport"></i>确认</el-button
>
</span>
</el-dialog>
</div>
</template>
<script>
import api from '@/api/rules';
import axios from "axios";
export default {
name: 'taxType',
@ -125,6 +175,21 @@
}, 100)
};
return {
showModal:false,
tipModaSureBtnloading:false,
disabledImport: false, //
disabledDownload:false,
showTipModal:false,
importFile: {
fileType:'',
fileList: [] //
},
errorTip:false,
importFileRules: {
fileList: [
{ required: true, message: "请选择导入文件", trigger: "change" }
]
},
token: '',
formInline: {
user: '',
@ -137,6 +202,7 @@
addTitle: '新增',
addForm: {
memberId: '',
userNum:'',
company: [],
enterpriseName: [],
phone: '', //
@ -144,6 +210,7 @@
userId: '',
},
addRules: {
userNum: [{required: true, message: '人员编码不能为空', trigger: 'blur'}],
memberId: [{required: true, message: '人员名称不能为空', trigger: 'blur'}],
company: [{required: true, message: '可报销企业不能为空', trigger: 'blur'}],
phone: [
@ -297,11 +364,11 @@
'token': this.token
}
};
this.$refs[form].validate((valid) => {
if (valid) {
let params = {
userName: this.addForm.memberId,
userNum: this.addForm.userNum,
enterpriseCodeList: this.addForm.company.join(','),
enterpriseNameList: this.addForm.enterpriseName.join(','),
phone: this.addForm.phone,
@ -330,6 +397,80 @@
})
},
fileChange(file, fileList) {
this.importFile.fileList = fileList;
this.$refs.importFile.clearValidate();
},
//-
fileRemove(file, fileList) {
this.importFile.fileList = [];
},
//-
handleExceed() {
this.$message.warning("一次只可导入一个文件");
},
//--
importFileVerify() {
const file = this.importFile.fileList[0];
const fileFormat = file.name.substring(file.name.lastIndexOf(".") + 1);
const allowedExtensions = ['xls', 'xlsx'];
const extension = allowedExtensions.includes(fileFormat);
if (!extension) {
throw new Error("上传文件只能是Excel 格式!");
}
},
//-
importFileConfirm() {
this.$refs["importFile"].validate(valid => {
if (valid) {
try {
this.importFileVerify();
this.importFileRequest();
} catch (e) {
this.$message.warning(e.message);
}
}
});
},
//--
importFileRequest() {
this.disabledDownload = true;
const file = this.importFile.fileList[0].raw;
console.log(this.importFile.fileList)
let formData = new FormData();
formData.append("file", file);
api.importUserInfoExcelApi(formData, {
headers: {
'Content-Type': 'multipart/form-data'
}
})
.then(r => {
console.log(r)
if(r.data.code == '0000'){
this.tipModaSureBtnloading = false
this.$message.success(r.data.message);
this.findAll(1)
this.showModal = false
}else {
this.$message.error(r.data.message);
}
})
},
cancelSave() {
this.$confirm('是否放弃操作?', '提示', {
type: 'warning',
center: true
}).then(() => {
this.showModal = false;
}).catch(() => {
});
},
tipModaSureBtn(){
this.showTipModal = false
this.showModal = false
},
maxTableHeight() {
this.$nextTick(() => {
let self = this;
@ -356,12 +497,44 @@
this.addTitle = '新增';
this.addWin = true;
},
dowBtn() {
axios.get('/web/orgUser/getUserInfoModel', {
responseType: 'blob'
}).then(response => {
console.log('Response data type:', response.data.type); // blob
console.log('Response data size:', response.data.size); // blob
// Blob MIME
const blob = new Blob([response.data], { type: 'application/vnd.ms-excel' });
// URL
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
let fileName = '人员模板.xlsx';
a.download = fileName; //
//
document.body.appendChild(a); // DOM
a.click(); //
document.body.removeChild(a); //
// URL
setTimeout(() => {
window.URL.revokeObjectURL(url); //
}, 100);
}).catch(error => {
console.error('Error downloading file:', error);
});
},
handleEdit(data) {
this.addTitle = '编辑';
this.addWin = true;
this.$nextTick(() => {
this.addForm = {
id: data.id,
userNum: this.addForm.userNum,
// memberId: data.id,
// code: data.taxNo,
// phone: data.phone,
@ -378,6 +551,10 @@
};
});
},
upFileBtn(){
this.importFile.fileList = [];
this.showModal=true;
},
}
};
</script>

Loading…
Cancel
Save