Merge pull request 'master-模板替换' (#27) from master-模板替换 into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-frontend/pulls/27
This commit is contained in:
commit
2465f4b731
@ -42,3 +42,12 @@ export function delEmisCommissionQuote(quoteId) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//批量修改开始时间、结束时间
|
||||||
|
export function batchUpdate(data) {
|
||||||
|
return request({
|
||||||
|
url: '/emis/emisCommissionQuote/batchUpdate',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -161,7 +161,9 @@
|
|||||||
listSimpleEmisCountry(queryParams).then(response => {
|
listSimpleEmisCountry(queryParams).then(response => {
|
||||||
let allCountry={code:'-1',name:'全部',nameEn:'all'};
|
let allCountry={code:'-1',name:'全部',nameEn:'all'};
|
||||||
let allNoChinaCountry={code:'-2',name:'非中国',nameEn:'No China'};
|
let allNoChinaCountry={code:'-2',name:'非中国',nameEn:'No China'};
|
||||||
|
let allNoSoutheastAsia ={code:'-3',name:'非东南亚',nameEn:'No Southeast Asia'};
|
||||||
this.optionItems =response.rows;
|
this.optionItems =response.rows;
|
||||||
|
this.optionItems.unshift(allNoSoutheastAsia);
|
||||||
this.optionItems.unshift(allNoChinaCountry);
|
this.optionItems.unshift(allNoChinaCountry);
|
||||||
this.optionItems.unshift(allCountry);
|
this.optionItems.unshift(allCountry);
|
||||||
// 初始值存储
|
// 初始值存储
|
||||||
|
|||||||
@ -0,0 +1,247 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form ref="form" size="mini" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="开始日期" prop="startDate">
|
||||||
|
<el-date-picker style="width:100%" clearable v-model="form.startDate" type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss" default-time="00:00:00" placeholder="请选择开始日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<!-- </el-col> -->
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="结束日期" prop="endDate">
|
||||||
|
<el-date-picker style="width:100%" clearable v-model="form.endDate" type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss" default-time="23:59:59" placeholder="请选择结束日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="18">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24" :xs="24" style="padding: 5px;">
|
||||||
|
<el-row :gutter="0">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-button size="mini" type="primary" @click="handelSelectStaff">选择员工</el-button>
|
||||||
|
<el-button size="mini" type="primary" @click="handelSelectAllStaff">全部员工</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="" prop="empName" label-width="0px" style="margin-bottom: 0px;">
|
||||||
|
<el-input v-model="form.empName" rows="6" type="textarea" placeholder="" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-dialog :title="titleForm" :visible.sync="openForm" width="60%" :destroy-on-close="true" v-dialogDrag
|
||||||
|
append-to-body>
|
||||||
|
<el-form size="mini" label-width="60px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item :label="$t('名称')" prop="formBatchEmp">
|
||||||
|
<el-input v-model="impEmpListStr" type="textarea" :rows="8" placeholder="多个名称使用逗号或换行隔开" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer" style="text-align:center">
|
||||||
|
<el-button type="primary" @click="submitFormBatchEmp">确定</el-button>
|
||||||
|
<el-button @click="cancelBatchEmp">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-dialog>
|
||||||
|
<div style="text-align: center;margin-bottom: 10px;">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import { batchUpdate } from "@/api/emis/emisCommissionQuote";
|
||||||
|
import { listUser } from "@/api/system/user";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "BatchQuotePriceUpdateForm",
|
||||||
|
props:{
|
||||||
|
ids:{
|
||||||
|
type:[Number,Array]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
dicts: ['emis_cus_settled_type'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
impEmpListStr:null,
|
||||||
|
isDataChangeCount:0,
|
||||||
|
titleForm:null,
|
||||||
|
openForm:false,
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
startDate: [
|
||||||
|
{ required: true, message: "开始时间不能为空", trigger: ["blur",'change'] }
|
||||||
|
],
|
||||||
|
endDate: [
|
||||||
|
{ required: true, message: "结束时间不能为空", trigger: ["blur",'change'] }
|
||||||
|
],
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
"ids": {
|
||||||
|
handler (newValue, oldValue) {
|
||||||
|
this.id = newValue;
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
handler (n, o) {
|
||||||
|
// console.log('form handler', this.isDataChangeCount)
|
||||||
|
this.isDataChangeCount++
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.isDataChangeCount=0;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.reset();
|
||||||
|
this.$emit("on-cancel");
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
quoteId: null,
|
||||||
|
startDate: null,
|
||||||
|
endDate: null,
|
||||||
|
status:null,
|
||||||
|
empCode:null,
|
||||||
|
empName:null,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
async submitForm() {
|
||||||
|
// 判断是否有变动
|
||||||
|
if (this.isDataChangeCount>0 ) {
|
||||||
|
if(this.ids.length==0){
|
||||||
|
let updList = [];
|
||||||
|
let item={
|
||||||
|
quoteId:this.ids,
|
||||||
|
startDate:this.form.startDate,
|
||||||
|
endDate:this.form.endDate,
|
||||||
|
empCode:this.form.empCode,
|
||||||
|
empName:this.form.empName,
|
||||||
|
}
|
||||||
|
updList.push(item);
|
||||||
|
await batchUpdate(updList);
|
||||||
|
}
|
||||||
|
else if(this.ids.length>0){
|
||||||
|
let updList = [];
|
||||||
|
for(let i=0;i<this.ids.length;i++){
|
||||||
|
let item={
|
||||||
|
quoteId:this.ids[i],
|
||||||
|
startDate:this.form.startDate,
|
||||||
|
endDate:this.form.endDate,
|
||||||
|
empCode:this.form.empCode,
|
||||||
|
empName:this.form.empName,
|
||||||
|
}
|
||||||
|
updList.push(item);
|
||||||
|
}
|
||||||
|
// console.log('updList',updList)
|
||||||
|
await batchUpdate(updList);
|
||||||
|
}
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.$emit("on-changed");
|
||||||
|
}else{
|
||||||
|
this.$modal.msgSuccess("无变动,无需修改");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handelSelectStaff(){
|
||||||
|
this.titleForm="选择员工";
|
||||||
|
this.openForm=true;
|
||||||
|
},
|
||||||
|
handelSelectAllStaff(){
|
||||||
|
this.form.empCode="-1";
|
||||||
|
this.form.empName="全部";
|
||||||
|
},
|
||||||
|
// 批量员工录入
|
||||||
|
async submitFormBatchEmp(){
|
||||||
|
// 判断员工是否存在
|
||||||
|
if(this.impEmpListStr==null || this.impEmpListStr==''){
|
||||||
|
this.$modal.msgError("请输入名称");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let userArr=this.impEmpListStr.trim().split(/[;\;\,\,\n]/)||[];
|
||||||
|
let empCodeArr = [];
|
||||||
|
let empNameArr = [];
|
||||||
|
for(let i=0;i<userArr.length;i++){
|
||||||
|
if(userArr[i]==null || userArr[i]==' ' || userArr[i]==''){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let qName=userArr[i].trim();
|
||||||
|
let user=await this.getStaffUser(qName);
|
||||||
|
// console.log("====>user====>",user);
|
||||||
|
if(user==null){
|
||||||
|
this.$modal.msgError(userArr[i]+"不存在!");
|
||||||
|
return
|
||||||
|
}else{
|
||||||
|
empCodeArr.push(user.empCode);
|
||||||
|
empNameArr.push(qName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.form.empCode=empCodeArr.join(",");
|
||||||
|
this.form.empName=empNameArr.join(",");
|
||||||
|
this.openForm=false;
|
||||||
|
},
|
||||||
|
cancelBatchEmp(){
|
||||||
|
this.openForm=false;
|
||||||
|
},
|
||||||
|
async getStaffUser(name){
|
||||||
|
let qParams={
|
||||||
|
searchValue:name,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 1,
|
||||||
|
params:{
|
||||||
|
blMatchEmpName:1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let res=await listUser(qParams);
|
||||||
|
if(res.code == 200 ){
|
||||||
|
if(res.total>0){
|
||||||
|
return res.rows[0];
|
||||||
|
}else{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
@ -153,6 +153,17 @@
|
|||||||
v-hasPermi="['emis:emisCommissionQuote:remove']"
|
v-hasPermi="['emis:emisCommissionQuote:remove']"
|
||||||
>删除</el-button>
|
>删除</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleBatchUpdate"
|
||||||
|
v-hasPermi="['emis:emisQuotePrice:edit']"
|
||||||
|
>批量修改报价时间</el-button>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@ -193,6 +204,7 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.fromCountry=='-1'">全部</span>
|
<span v-if="scope.row.fromCountry=='-1'">全部</span>
|
||||||
<span v-if="scope.row.fromCountry=='-2'">非中国</span>
|
<span v-if="scope.row.fromCountry=='-2'">非中国</span>
|
||||||
|
<span v-if="scope.row.fromCountry=='-3'">非东南亚</span>
|
||||||
<span v-else>{{ scope.row.fromCountryName }}</span>
|
<span v-else>{{ scope.row.fromCountryName }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -201,6 +213,7 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.country=='-1'">全部</span>
|
<span v-if="scope.row.country=='-1'">全部</span>
|
||||||
<span v-if="scope.row.country=='-2'">非中国</span>
|
<span v-if="scope.row.country=='-2'">非中国</span>
|
||||||
|
<span v-if="scope.row.country=='-3'">非东南亚</span>
|
||||||
<span v-else>{{ scope.row.countryName }}</span>
|
<span v-else>{{ scope.row.countryName }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -266,7 +279,10 @@
|
|||||||
<emisCommissionQuoteForm :key="resetRefreshId" :quoteId="currentId" :isCopy="isCopy" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisCommissionQuoteForm>
|
<emisCommissionQuoteForm :key="resetRefreshId" :quoteId="currentId" :isCopy="isCopy" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisCommissionQuoteForm>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 批量修改报价开始时间、结束时间 -->
|
||||||
|
<el-dialog :title="titleBatchForm" :visible.sync="openBatchUpdateForm" width="90%" :destroy-on-close="true" :close-on-click-modal="false" v-dialogDrag append-to-body>
|
||||||
|
<batchCommissionQuotePriceUpdateForm :ids="ids" @on-changed="handleBatchFormChanged" @on-cancel="cancelBatchForm"></batchCommissionQuotePriceUpdateForm>
|
||||||
|
</el-dialog>
|
||||||
</XdPageContainer>
|
</XdPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -274,10 +290,13 @@
|
|||||||
import { listEmisCommissionQuote, getEmisCommissionQuote, delEmisCommissionQuote, addEmisCommissionQuote, updateEmisCommissionQuote } from "@/api/emis/emisCommissionQuote";
|
import { listEmisCommissionQuote, getEmisCommissionQuote, delEmisCommissionQuote, addEmisCommissionQuote, updateEmisCommissionQuote } from "@/api/emis/emisCommissionQuote";
|
||||||
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
||||||
import emisCommissionQuoteForm from '@/views/emis/emisCommissionQuote/emisCommissionQuoteForm';
|
import emisCommissionQuoteForm from '@/views/emis/emisCommissionQuote/emisCommissionQuoteForm';
|
||||||
|
import batchCommissionQuotePriceUpdateForm from '@/views/emis/emisCommissionQuote/batchCommissionQuotePriceUpdateForm';
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "EmisCommissionQuote",
|
name: "EmisCommissionQuote",
|
||||||
components: { elDateSimplePicker,emisCommissionQuoteForm },
|
components: { elDateSimplePicker,emisCommissionQuoteForm,batchCommissionQuotePriceUpdateForm },
|
||||||
|
|
||||||
dicts: ['emis_price_type','emis_fee_type','sys_currency_type',
|
dicts: ['emis_price_type','emis_fee_type','sys_currency_type',
|
||||||
'emis_commission_post','emis_biz_shipping_method','emis_commission_fee_type'],
|
'emis_commission_post','emis_biz_shipping_method','emis_commission_fee_type'],
|
||||||
data() {
|
data() {
|
||||||
@ -317,6 +336,8 @@ export default {
|
|||||||
daterangeCreateTime: [],
|
daterangeCreateTime: [],
|
||||||
// 更新网点时间范围
|
// 更新网点时间范围
|
||||||
daterangeUpdateTime: [],
|
daterangeUpdateTime: [],
|
||||||
|
openBatchUpdateForm:false,
|
||||||
|
titleBatchForm: "",
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -478,6 +499,19 @@ export default {
|
|||||||
dateTimeChange(value){
|
dateTimeChange(value){
|
||||||
this.dateTimeRange=value;
|
this.dateTimeRange=value;
|
||||||
},
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleBatchUpdate(row) {
|
||||||
|
// this.currentId= row.id;
|
||||||
|
this.openBatchUpdateForm = true;
|
||||||
|
this.titleBatchForm = "批量修改";
|
||||||
|
},
|
||||||
|
handleBatchFormChanged(){
|
||||||
|
this.openBatchUpdateForm = false;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
cancelBatchForm(){
|
||||||
|
this.openBatchUpdateForm = false;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user