批量修改
This commit is contained in:
parent
e024776abc
commit
d52a15d2b3
@ -84,3 +84,11 @@ export function reCalcCostFeeByBillMonth(billMonth) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//批量修改batchEdit
|
||||||
|
export function batchEdit(data) {
|
||||||
|
return request({
|
||||||
|
url: '/emis/emisTmsCostFee/batchEdit',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@ -172,6 +172,17 @@
|
|||||||
v-hasPermi="['emis:emisTmsCostFee:add']"
|
v-hasPermi="['emis:emisTmsCostFee:add']"
|
||||||
>批量导入成本</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:emisTmsCostFee:add']"
|
||||||
|
>批量修改</el-button>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -249,22 +260,27 @@
|
|||||||
<el-dialog :title="titleForm" :visible.sync="openForm" width="90%" :close-on-click-modal="false" :destroy-on-close="true" v-dialogDrag append-to-body>
|
<el-dialog :title="titleForm" :visible.sync="openForm" width="90%" :close-on-click-modal="false" :destroy-on-close="true" v-dialogDrag append-to-body>
|
||||||
<EmisTmsCostFeeForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisTmsCostFeeForm>
|
<EmisTmsCostFeeForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisTmsCostFeeForm>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!-- 批量修改 -->
|
||||||
|
<el-dialog :title="titleForm" :visible.sync="openBatchUpdateForm" width="90%" :close-on-click-modal="false" :destroy-on-close="true" v-dialogDrag append-to-body>
|
||||||
|
<EmisTmsCostFeeBatchForm :ids="ids" @on-changed="handleBatchFormChanged" @on-cancel="cancelBatchForm"></EmisTmsCostFeeBatchForm>
|
||||||
|
|
||||||
</XdPageContainer>
|
</el-dialog>
|
||||||
|
</XdPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listEmisTmsCostFee, getEmisTmsCostFee,reCalcSplitCostFee, delEmisTmsCostFee, addEmisTmsCostFee, updateEmisTmsCostFee } from "@/api/emis/emisTmsCostFee";
|
import { listEmisTmsCostFee, getEmisTmsCostFee,reCalcSplitCostFee, delEmisTmsCostFee, addEmisTmsCostFee, updateEmisTmsCostFee } from "@/api/emis/emisTmsCostFee";
|
||||||
import { listEmisTmsCostFeeSplit } from "@/api/emis/emisTmsCostFeeSplit";
|
import { listEmisTmsCostFeeSplit } from "@/api/emis/emisTmsCostFeeSplit";
|
||||||
import EmisTmsCostFeeForm from '@/views/emis/emisTmsCostFee/emisTmsCostFeeForm';
|
import EmisTmsCostFeeForm from '@/views/emis/emisTmsCostFee/emisTmsCostFeeForm';
|
||||||
|
import EmisTmsCostFeeBatchForm from '@/views/emis/emisTmsCostFee/emisTmsCostFeeBatchForm';
|
||||||
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
|
import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker';
|
||||||
import EmisSupplierPicker from '@/views/emis/EmisBaseTools/EmisSupplierPicker';
|
import EmisSupplierPicker from '@/views/emis/EmisBaseTools/EmisSupplierPicker';
|
||||||
import EmisTmsSiteBatchPicker from '@/views/emis/EmisBaseTools/EmisTmsSiteBatchPicker';
|
import EmisTmsSiteBatchPicker from '@/views/emis/EmisBaseTools/EmisTmsSiteBatchPicker';
|
||||||
import { listEmisTmsSiteBatchDtl} from "@/api/emis/emisTmsSiteBatchDtl";
|
import { listEmisTmsSiteBatchDtl} from "@/api/emis/emisTmsSiteBatchDtl";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "EmisTmsCostFee",
|
name: "EmisTmsCostFee",
|
||||||
components: { EmisTmsCostFeeForm ,elDateAdvPicker,EmisSupplierPicker,EmisTmsSiteBatchPicker},
|
components: { EmisTmsCostFeeForm ,elDateAdvPicker,EmisSupplierPicker,EmisTmsSiteBatchPicker, EmisTmsCostFeeBatchForm },
|
||||||
|
|
||||||
dicts: ['emis_cost_fee_type','emis_supplier_name','emis_cost_split_type','emis_biz_shipping_method','emis_payment_type','emis_qujian_fangshi','emis_declare_mode','emis_customs_clear','emis_cost_split_type'],
|
dicts: ['emis_cost_fee_type','emis_supplier_name','emis_cost_split_type','emis_biz_shipping_method','emis_payment_type','emis_qujian_fangshi','emis_declare_mode','emis_customs_clear','emis_cost_split_type'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -296,7 +312,8 @@ export default {
|
|||||||
id:null,
|
id:null,
|
||||||
titleView:"",
|
titleView:"",
|
||||||
openView: false,
|
openView: false,
|
||||||
|
openBatchUpdateForm:false,
|
||||||
|
titleBatchForm: "",
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -920,6 +937,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>
|
||||||
|
|||||||
148
src/views/emis/emisTmsCostFee/emisTmsCostFeeBatchForm.vue
Normal file
148
src/views/emis/emisTmsCostFee/emisTmsCostFeeBatchForm.vue
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
<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="billMonth">
|
||||||
|
<el-date-picker style="width:100%" v-model="form.billMonth" type="month" placeholder="账期" value-format="yyyy-MM"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<!-- </el-col> -->
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="成本时间" prop="tradeDate">
|
||||||
|
<el-date-picker
|
||||||
|
style="width:100%"
|
||||||
|
clearable
|
||||||
|
v-model="form.tradeDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="成本时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<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 { batchEdit } from "@/api/emis/emisTmsCostFee";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "EmisTmsCostFeeBatchForm",
|
||||||
|
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 = {
|
||||||
|
id:null,
|
||||||
|
billMonth:null,
|
||||||
|
tradeDate:null,
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
async submitForm() {
|
||||||
|
// 判断是否有变动
|
||||||
|
// if (this.isDataChangeCount>0 ) {
|
||||||
|
console.log('ids--',this.ids)
|
||||||
|
if(this.ids.length==0){
|
||||||
|
let updList = [];
|
||||||
|
let item={
|
||||||
|
id:this.ids,
|
||||||
|
billMonth:this.form.billMonth,
|
||||||
|
tradeDate:this.form.tradeDate,
|
||||||
|
}
|
||||||
|
updList.push(item);
|
||||||
|
await batchEdit(updList);
|
||||||
|
}
|
||||||
|
else if(this.ids.length>0){
|
||||||
|
let updList = [];
|
||||||
|
for(let i=0;i<this.ids.length;i++){
|
||||||
|
let item={
|
||||||
|
id:this.ids[i],
|
||||||
|
billMonth:this.form.billMonth,
|
||||||
|
tradeDate:this.form.tradeDate,
|
||||||
|
}
|
||||||
|
updList.push(item);
|
||||||
|
}
|
||||||
|
await batchEdit(updList);
|
||||||
|
}
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.$emit("on-changed");
|
||||||
|
// }else{
|
||||||
|
// this.$modal.msgSuccess("无变动,无需修改");
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user