<!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 class="topbar-line">
|
<div class="query-icon">
|
<i class="iconfont icon-query"></i>
|
</div>
|
<div class="query-bar" style="width: 90%;">
|
<h-form-filter ref="form1"
|
:form-attr="filterAttr"
|
:table-fields="filterFields"
|
:form-data="filterObj"
|
|
v-on:show-popup="onShowFilterPopup"
|
v-on:on-query="onQuery"
|
v-on:on-init-query="onInitFilter"
|
>
|
</h-form-filter>
|
</div>
|
</div>
|
<h-table
|
v-if="isRefresh"
|
ref="table_order"
|
:table-fields="tableFields_order"
|
:table-data="tableData_order2"
|
:pagesize="pagesize"
|
:pagenum="pagenum"
|
:total="total"
|
:table-height="tableHeight_order"
|
|
:is-within-edit-table-data= "true"
|
:is-highlight-row="true"
|
:is-selection="true"
|
v-on:cell-input-change="cellInputChange"
|
v-on:selection-change="handleSelectionChange"
|
>
|
</h-table>
|
<div slot="footer" class="popup-footer" >
|
<el-button type="default" @click="close">取 消</el-button>
|
<el-button type="primary" @click="saveFormValByField_order">确 定</el-button>
|
</div>
|
</div>
|
|
</body>
|
|
<script type="text/javascript">
|
new Vue({
|
el: "#vbody",
|
data: {
|
dataname: "",
|
|
filterAttr: {
|
columnnumber: 3,
|
labelwidth: "100px",
|
labelposition: "right",
|
size: "medium",
|
border: "3px solid #c6c6c600"
|
},
|
filterFields:[],
|
filterFieldsObj: {},
|
filterObj: {},
|
|
isRefresh: true,
|
tableFields_order: [],
|
tableData_order2: [],
|
pagesize: 10,
|
pagenum: 1,
|
total: 0,
|
tableHeight_order: 340,
|
|
selectionList: [],
|
orderby: "parentid"
|
},
|
|
created() {
|
this.popupParames = clone(Root.popupParames);
|
},
|
|
mounted() {
|
this.onQuery();
|
},
|
|
methods:{
|
onQuery(){
|
this.pagenum = 1;
|
this.doQuery();
|
},
|
|
doQuery() {
|
let me = this;
|
let filter_ = "1=1";
|
|
me.selectionList = this.selectionList;
|
me.filterFields = dataRootFields.filterFields.chooseOrder_;
|
if(me.filterFields.length > 0) {
|
for(var i=0; i < me.filterFields.length; i++) {
|
let fieldObj_ = me.filterFields[i];
|
|
me.filterFieldsObj[fieldObj_.field] = fieldObj_;
|
}
|
}
|
|
if (this.popupParames.filter) {
|
filter_ = this.popupParames.filter;
|
}
|
if (this.popupParames.type) {
|
if (this.popupParames.type == "invoice") {
|
this.tableFields_order = dataRootFields.tableFields.chooseSinvoiceOrder_;
|
this.dataname = "getinvoiceorder";
|
}
|
}
|
|
for(var k in this.filterObj) {
|
let k_val = this.filterObj[k];
|
let fieldObj_ = this.filterFieldsObj[k];
|
|
let type_ = fieldObj_.type;
|
let field_ = fieldObj_.field;
|
let fieldtype_ = "equal";
|
if (fieldObj_.fieldname) {
|
field_ = fieldObj_.fieldname
|
}
|
if (fieldObj_.fieldtype) {
|
fieldtype_ = fieldObj_.fieldtype
|
}
|
if (fieldtype_ == "like") {
|
filter_ += " and " + field_ + " like '%" + k_val +"%'";
|
}
|
else {
|
filter_ += " and " + field_ + " = '" + k_val +"'";
|
}
|
}
|
|
let param_table = {
|
isClientMode: false,
|
dataname: this.dataname,
|
filter: filter_,
|
page: {
|
no: this.pagenum,
|
pagesize: this.pagesize
|
},
|
}
|
|
Server.call("root/data/getEntitySet", param_table, function(result) {
|
if (result && result.data) {
|
var aa_ = result.data.entityset;
|
me.total = result.data.page.recordcount;
|
for (var i = 0; i < aa_.length; i++) {
|
aa_[i].qty_canInvoice = aa_[i].delivery_qty - aa_[i].invoice_qty;
|
aa_[i].qty_needInvoice = aa_[i].qty_canInvoice;
|
}
|
me.tableData_order2 = aa_
|
}
|
});
|
},
|
|
onInitFilter() {
|
this.filterObj = {};
|
this.onQuery();
|
},
|
|
onShowFilterPopup(filter) {
|
var me = this;
|
var fieldObj_ = filter.obj;
|
var filterValue = clone(me.filterObj);
|
var field_ = fieldObj_.field;
|
|
if ("customername" == field_) {
|
Root.showPopup({
|
|
url: "../md/customer/popup/customer_list.html",
|
width: 800,
|
height: 550,
|
callback: function(result, callback) {
|
filterValue[field_] = result.row.md_description;scription;
|
me.filterObj = filterValue;
|
me.onQuery();
|
if (callback) {
|
callback();
|
}
|
}
|
});
|
}
|
},
|
|
close: function() {
|
Root.hidePopup();
|
},
|
|
saveFormValByField_order() {
|
if(this.popupParames.callback) {
|
let array = this.selectionList
|
this.popupParames.callback(array, function() {
|
Root.hidePopup();
|
});
|
}
|
else {
|
alert("该按键事件缺失!")
|
}
|
},
|
|
handleSelectionChange(selection) {
|
if (selection.length > 0) {
|
var doccode_ = selection[0].doccode;
|
var customerid_ = selection[0].customerid;
|
if (this.popupParames.type == "invoice") {
|
for (var i = 0; i < selection.length; i++) {
|
if (selection[i].customerid != customerid_) {
|
Root.message({
|
type: 'warning',
|
message: '只可选择同一订单'
|
})
|
this.onInitFilter();
|
return;
|
}
|
this.selectionList = selection;
|
}
|
}
|
else {
|
for (var i = 0; i < selection.length; i++) {
|
if (selection[i].doccode != doccode_) {
|
Root.message({
|
type: 'warning',
|
message: '只可选择同一订单'
|
})
|
this.onInitFilter();
|
return;
|
}
|
this.selectionList = selection;
|
}
|
}
|
}
|
},
|
|
cellInputChange(scope) {
|
let row = scope.row;
|
let field = scope.column.property;
|
if (row.qty_needInvoice > (row.qty_order - row.qty_invoice)) {
|
Root.message({
|
type: 'warning',
|
message: '超过可开票数量'
|
})
|
row.qty_needReturn = 0 ;
|
return;
|
}
|
},
|
}
|
});
|
|
</script>
|
</html>
|