Merge pull request 'develop' (#214) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-frontend/pulls/214
This commit is contained in:
wuteng 2026-03-13 17:21:18 +08:00
commit bddcf2a1fa
2 changed files with 45 additions and 38 deletions

View File

@ -61,7 +61,7 @@ import { getStaffList } from "@/api/emis/emisStaff";
mixins: [emitter], mixins: [emitter],
props: { props: {
value: { value: {
type: String, type: Number,
required: false required: false
}, },
sideCode: { sideCode: {
@ -143,14 +143,8 @@ import { getStaffList } from "@/api/emis/emisStaff";
onClick(){ onClick(){
this.isInit=false; this.isInit=false;
// 第一次点击时需要初始化 // 第一次点击时需要初始化
if(!this.defaultItems){
this.queryParams.pageNum=1; this.queryParams.pageNum=1;
this.queryData(null,null); this.queryData();
}else{
this.total = this.defaultTotal;
this.optionItems = [...this.defaultItems];
}
// this.$refs.popoverRef.doShow();
}, },
onInput(val) { onInput(val) {
if(val == null ) return; if(val == null ) return;
@ -158,7 +152,8 @@ import { getStaffList } from "@/api/emis/emisStaff";
this.isInputing = true; this.isInputing = true;
this.slable = val; this.slable = val;
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1
this.queryData(val,null) this.queryParams.searchValue = val;
this.queryData()
}, },
onRowClick(row, column, event) { onRowClick(row, column, event) {
@ -170,6 +165,7 @@ import { getStaffList } from "@/api/emis/emisStaff";
this.$emit("input", this.svalue); this.$emit("input", this.svalue);
this.$emit("onChange",row); this.$emit("onChange",row);
this.$refs.popoverRef.doClose(); this.$refs.popoverRef.doClose();
this.queryParams.searchValue = this.slable;
}, },
isRed({ row }) { isRed({ row }) {
if (row.userId == this.svalue) { if (row.userId == this.svalue) {
@ -182,27 +178,24 @@ import { getStaffList } from "@/api/emis/emisStaff";
onClear(el){ onClear(el){
this.slable = null; this.slable = null;
this.svalue = null; this.svalue = null;
this.queryParams.searchValue = null;
this.$emit("input", this.svalue); this.$emit("input", this.svalue);
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]); this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
}, },
onBlur(el) { onBlur(el) {
// 如果编辑没有选择则清关历史记录 if(this.svalue){
if( this.isInputing ){ this.queryParams.searchValue = this.slable;
this.svalue = null;
this.slable = null;
} }
this.$emit("input", this.svalue); this.$emit("input", this.svalue);
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]); this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
}, },
changePage(cur) { changePage(cur) {
this.queryParams.pageNum = cur this.queryParams.pageNum = cur
this.queryData() this.queryData();
}, },
queryData(val,key) { queryData(val,key) {
this.loading = true; this.loading = true;
this.queryParams.searchValue = val;
this.queryParams.userId = key; this.queryParams.userId = key;
getStaffList(this.queryParams).then(response => { getStaffList(this.queryParams).then(response => {
@ -211,7 +204,7 @@ import { getStaffList } from "@/api/emis/emisStaff";
this.optionItems = response.rows; this.optionItems = response.rows;
// 初始值存储 // 初始值存储
if(key==null && val==null){ if (!this.queryParams.userId && !this.queryParams.searchValue) {
this.defaultTotal = this.total+0; this.defaultTotal = this.total+0;
this.defaultItems=[...this.optionItems] this.defaultItems=[...this.optionItems]
} }

View File

@ -120,7 +120,7 @@
v-hasPermi="['emis:emisSupplier:remove']" v-hasPermi="['emis:emisSupplier:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<!-- <el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
plain plain
@ -129,7 +129,7 @@
@click="handleExport" @click="handleExport"
v-hasPermi="['emis:emisSupplier:export']" v-hasPermi="['emis:emisSupplier:export']"
>导出</el-button> >导出</el-button>
</el-col> --> </el-col>
</el-row> </el-row>
</div> </div>
@ -343,36 +343,50 @@ export default {
qParam.pageSize=5000; qParam.pageSize=5000;
listEmisSupplier(this.addDateRange(qParam, this.dateTimeRange)).then(response => { listEmisSupplier(this.addDateRange(qParam, this.dateTimeRange)).then(response => {
this.downloadLoading = false
if (response.code === 200) { if (response.code === 200) {
const curList = response.rows this.exportData(response.rows,loadingInstance);
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['id','供应商编码','供应商名称','英文简称','结算类型','运输方式','业务网点','业务网点名称,逗号隔开','公司名称','公司类型','营业执照号','所在国','所在省','所在市','所在区','地址','公司电话','电子邮件','联系人','联系电话','状态','备注','删除标志(0代表存在','创建者','创建时间','更新者','更新时间','创建站点','更新站点',];
const filterVal = ['id','code','name','nameEn','settledType','transType','bizSite','bizSiteName','companyName','companyType','licenceNo','country','province','city','district','address','tel','email','contact','phone','status','remark','delFlag','createBy','createTime','updateBy','updateTime','createSite','updateSite',];
const data = this.formatJson(filterVal, curList, response.rows)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '公司供应商表',
autoWidth: true
})
loadingInstance.close()
})
} }
}); });
}, },
exportData(selData,loadingInstance){
const curList =selData
import('@/vendor/Export2Excel').then(excel => {
const exportParam=this.$refs.refTable.getExportParam();
const tHeader = exportParam.header;
const filterVal = exportParam.filter;
const data = this.formatJson(filterVal, curList, selData)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '供应商列表',
autoWidth: true
})
loadingInstance.close()
})
},
formatJson(filterVal, jsonData, resData) { formatJson(filterVal, jsonData, resData) {
let index = 0 let index = 0
return jsonData.map(v => filterVal.map(j => { return jsonData.map(v => filterVal.map(j => {
if (j === 'index') { if (j === 'index') {
return ++index return ++index
} }
if (j === 'status') { if (j === 'settledType') {
var statusStr='xxx' if(v[j] == '1'){
if(v[j] == 10){ return '现金'
statusStr='xxx'
} }
return statusStr; if(v[j] == '2'){
return '月结'
}
}
if (j === 'transType') {
return v[j].split(',').map(item =>
this.selectDictLabel(this.dict.type.emis_biz_shipping_method, item)
).join(',')
}
if (j === 'feeItemRel') {
return v[j].split(',').map(item =>
this.selectDictLabel(this.dict.type.emis_cost_fee_type, item)
).join(',')
} }
return v[j] return v[j]
})) }))