<!doctype html>
|
<html>
|
<head>
|
<meta charset="utf-8"><meta http-equiv="Expires" content="0"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Cache" content="no-cache">
|
<title>批量订单拆分</title>
|
<script src="../../../js/vue/vue.js"></script>
|
<script src="../../../js/vue/element-ui/lib/index.js"></script>
|
<script src="../../../js/myelement.js?v=20220615"></script>
|
<script src="../../../js/vue/page.js?v=20220615"></script>
|
|
<link href="../../../js/vue/element-ui/lib/theme-chalk/index.css" rel="stylesheet">
|
<link href="../../../css/myelement.css?v=20220425" rel="stylesheet">
|
<link href="../../../css/iconfont.css" rel="stylesheet">
|
<link href="../../../css/page.css?v=20220425" rel="stylesheet">
|
<link href="//at.alicdn.com/t/font_2374495_13ltsxm2eor.css" rel="stylesheet">
|
</head>
|
|
<body>
|
<div id="vbody">
|
<div id="page_root">
|
<div class="topbar">
|
<span>{{title}}</span>
|
<div style="float: right; margin-right: 24px;">
|
|
<el-button @click="setEditTableData">{{isEditTableData ? '取消编辑' : '在线编辑'}}</el-button>
|
|
</div>
|
</div>
|
<div class="versionNo">
|
<h-table
|
v-if="isRefresh"
|
ref="table1"
|
:table-fields="tableFields"
|
:table-data="tableData"
|
:is-edit-table-data="isEditTableData"
|
:is-within-edit-table-data= "isWithinEditTableData"
|
:total="total"
|
:is-pagination="false"
|
:table-height="tableHeight1"
|
:is-highlight-row="true"
|
v-on:get-data="getData"
|
v-on:edit-data="editData"
|
v-on:row-click="rowClick"
|
v-on:cell-click="cellClick"
|
>
|
</h-table>
|
|
<h-table
|
v-if="isRefresh"
|
ref="table2"
|
:table-fields="tableFields_Mapping"
|
:table-data="tableData1"
|
:is-edit-table-data="isEditTableData"
|
:total="total"
|
:is-pagination="false"
|
:table-height="tableHeight1"
|
:is-highlight-row="true"
|
v-on:get-data="getData"
|
v-on:edit-data="editData"
|
v-on:row-click="rowClick_Mapping"
|
v-on:cell-click="cellClick"
|
|
>
|
</h-table>
|
</div>
|
|
</div>
|
<div class="el-dialog__footer">
|
<el-button type="default" @click="closeDialog">取 消</el-button>
|
<el-button type="primary" @click="saveRowTable">保 存</el-button>
|
</div>
|
<div id="page_loading" style="position: absolute; top:0px; width: 100vw; height: 100vh;z-index:9999">
|
<div class="spinner">
|
<div class="cube1"></div>
|
<div class="cube2"></div>
|
</div>
|
</div>
|
</div>
|
|
<script type="text/javascript">
|
|
var initlized = false;
|
|
new ListVue({
|
el: "#vbody",
|
data: {
|
|
//dataname: "salesOrder",
|
tabaleFieldsName: "savecombine_",
|
isWithinEditTableData:false,
|
tableHeight1: 250,
|
title: "拆分订单确认",
|
tableData1: [],
|
tableFields_Mapping: [],
|
editTableButton: {
|
edit: false,
|
del: true
|
},
|
|
},
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
this.tableFields_Mapping = dataRootFields.tableFields.savecombine_mapping_;
|
|
},
|
|
mounted() {
|
this.initData();
|
/* if(this.popupParames.tabselected){
|
window.top.tab.removeItem(this.popupParames.tabselected);
|
} */
|
this.$nextTick(() => { // 以服务的方式调用的 Loading 需要异步关闭
|
hideLoading();
|
});
|
},
|
|
methods:{
|
|
|
initData() {
|
if (initlized) { return; }
|
initlized = true;
|
|
this.onQuery();
|
},
|
onQuery(){
|
if (this.popupParames.data) {
|
let me = this;
|
var tabledata_ = clone(me.popupParames.data);
|
for(var i = 0; i < tabledata_.length; i++ ){
|
tabledata_[i].userName = tabledata_[i].customerConsignee.userName
|
tabledata_[i].phone = tabledata_[i].customerConsignee.phone
|
tabledata_[i].address = tabledata_[i].customerConsignee.address
|
}
|
me.tableData = tabledata_;
|
|
}
|
},
|
closeDialog() {
|
Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, false);
|
},
|
onServerInitData(data) {
|
var me = this.data;
|
me.tableFields = data.tableFields;
|
if(me.tableFields.length > 0) {
|
for(var i=0; i < me.tableFields.length; i++) {
|
let fieldObj_ = me.tableFields[i];
|
|
me.tableFieldsObj[fieldObj_.field] = fieldObj_;
|
}
|
}
|
},
|
saveRowTable() {
|
let me = this;
|
|
let param = me.tableData;
|
param.isClientMode = false
|
|
Server.call("root/order/saveBatchSalesOrder", param, function(result) {
|
console.log(result);
|
if (result.success){
|
Root.message({
|
type: 'success',
|
message: '提交成功'
|
});
|
}else{
|
Root.message({
|
type: 'warning',
|
message: result.message
|
});
|
}
|
Root.tab.removeItem(Root.tab.selected);
|
Root.tab.open(me.popupParames.parentOption, true);
|
});
|
},
|
editData(scope) {
|
if (this.selectrow != {}) {
|
this.selectrow.isWithinEdit = false;
|
}
|
this.selectrow = scope.row;
|
scope.row.isWithinEdit = scope.row.isWithinEdit ? false : true;
|
this.isRefresh = false;
|
this.$nextTick(function(){
|
this.isRefresh = true;
|
})
|
},
|
rowClick: function(obj) {
|
this.tableData1 = [];
|
if (this.selectrow != {}) {
|
//this.selectrow.isWithinEdit = false;
|
}
|
this.selectrow = obj.row;
|
// obj.row.isWithinEdit = obj.row.isWithinEdit ? false : true;
|
let me = this;
|
for(var i = 0; i < me.selectrow.subSalesOrderList.length; i++ ){
|
this.tableData1.push(me.selectrow.subSalesOrderList[i].agreementRecord);
|
}
|
|
},
|
rowClick_Mapping: function(obj) {
|
this.selectedrow = {};
|
this.selectedrow = obj.row;
|
|
},
|
|
onShowRelated() {
|
var me = this;
|
var row = this.selectedrow;
|
|
if (!row || !row.id) {
|
Root.message({
|
type: 'warning',
|
message: '请先选择一条数据'
|
});
|
return false;
|
}
|
else {
|
Root.popupParames = {
|
width: "900px",
|
url: "../tool/popup_docNumber.html",
|
};
|
Root.popupParames.data = row;
|
Root.showPopup(Root.popupParames);
|
}
|
},
|
delData: function(scope) {
|
let me = this;
|
|
if (this.onDelData) {
|
this.onDelData.call(this, scope);
|
return
|
}
|
|
let row = scope.row;
|
let index_ = scope.$index;
|
let name_ = "该数据";
|
|
if (!this.dataname) {
|
Root.message({
|
type: 'warning',
|
message: '该事件需指定数据对象'
|
});
|
return
|
}
|
if (!row.id) {
|
Root.message({
|
type: 'warning',
|
message: '该事件需存在数据ID'
|
});
|
return
|
}
|
if (row.code) {
|
name_ = "_" + row.code + "_";
|
}
|
|
Root.confirm('确定删除' + name_ + '吗?', '删除提示', {
|
confirmButtonText: '删除',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
let param1 = {
|
filter:{
|
parent_id: row.id
|
},
|
|
isClientMode: false,
|
dataname: 'salesOrderDetail',
|
}
|
Server.call("root/data/deleteEntitySet", param1, function(result) {
|
|
});
|
|
let param = {
|
id: row.id,
|
isClientMode: false,
|
dataname: this.dataname,
|
}
|
Server.call("root/data/deleteEntity", param, function(result) {
|
console.log(result);
|
Root.message({
|
type: 'success',
|
message: '删除成功!'
|
});
|
me.doQuery();
|
});
|
}).catch(() => {
|
Root.message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
|
|
|
}
|
});
|
</script>
|
|
</body>
|
</html>
|