You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
246 lines
8.5 KiB
246 lines
8.5 KiB
let productsinfo = new Vue({
|
|
el: '#PackCapacity',
|
|
components: {
|
|
'BootstrapTable': BootstrapTable
|
|
},
|
|
data: {
|
|
columns: [{
|
|
field: 'no',
|
|
title: '序号',
|
|
sortable: true,
|
|
align: "center",
|
|
width: 40,
|
|
formatter: function (value, row, index) {
|
|
//获取每页显示的数量
|
|
var pageSize = $('#asd').bootstrapTable('getOptions').pageSize;
|
|
//获取当前是第几页
|
|
var pageNumber = $('#asd').bootstrapTable('getOptions').pageNumber;
|
|
//返回序号,注意index是从0开始的,所以要加上1
|
|
return pageSize * (pageNumber - 1) + index + 1;
|
|
}
|
|
}, {
|
|
field: 'part_type_desc',
|
|
title: '材料名称',
|
|
align: 'center'
|
|
}, {
|
|
field: 'orig_batch_nbr',
|
|
title: '母批次',
|
|
align: 'center'
|
|
}, {
|
|
field: 'lot_nbr',
|
|
title: '子批次',
|
|
align: 'center'
|
|
}, {
|
|
field: 'lot_qty_remaining',
|
|
title: '子批次剩余数量',
|
|
align: 'center'
|
|
}, {
|
|
field: 'lot_qty',
|
|
title: '子批原数量',
|
|
align: 'center'
|
|
}, {
|
|
field: 'residue',
|
|
title: '母批剩余数量',
|
|
align: 'center'
|
|
}, {
|
|
field: 'uom',
|
|
title: '单位',
|
|
align: 'center'
|
|
}, {
|
|
field: 'supplier_code',
|
|
title: '厂商',
|
|
align: 'center'
|
|
}, {
|
|
field: 'attr_value',
|
|
title: '规格',
|
|
align: 'center'
|
|
}],
|
|
data: [],
|
|
txtSales: '',
|
|
txtWO: '',
|
|
options: {
|
|
pagination: true, //是否显示分页(*)
|
|
pageSize: 12, //每页的记录行数(*)
|
|
search: true, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,
|
|
strictSearch: true,
|
|
//showColumns: true, //是否显示所有的列
|
|
showRefresh: true,
|
|
//height: 580,
|
|
//onClickRow: function (row, $element, field) {
|
|
// console.log(row);
|
|
// var flow = row.flow;
|
|
// console.log(flow);
|
|
// productsinfo.requestApi({
|
|
// modulename: "Orders",
|
|
// funname: "QueryWorkshop", //BatchRate
|
|
// para: { flow: flow },
|
|
// success: (res) => {
|
|
// console.log(res);
|
|
// productsinfo.stations = res;
|
|
// //显示工艺流程
|
|
// //clearTimeout(produstsinfo.hide);
|
|
// $("#flow").slideDown('slow');
|
|
// console.log(productsinfo.hide);
|
|
// productsinfo.hide = setTimeout(function () { $("#flow").slideUp('slow'); }, 6000);
|
|
// $("#flow").mouseover(function () {
|
|
// clearTimeout(productsinfo.hide);
|
|
// console.log(productsinfo.hide);
|
|
// $("#flow").stop(false, true);
|
|
// });
|
|
// $("#flow").mouseleave(function () {
|
|
// $("#flow").slideUp('slow');
|
|
// });
|
|
// },
|
|
// fail: (ex) => {
|
|
// console.log(ex);
|
|
// }
|
|
// })
|
|
|
|
//}
|
|
}
|
|
},
|
|
created() {
|
|
|
|
|
|
},
|
|
mounted() {
|
|
var self = this;
|
|
//self.QueryddlWorkshop();
|
|
|
|
},
|
|
methods: {
|
|
//查询表格数据
|
|
inquireinfo: function () {
|
|
var self = this;
|
|
//console.log($('#ddlWorkshop').val());
|
|
if (self.txtWO == '') {
|
|
toastr.warning('请输入查询参数', '', { progressBar: true });
|
|
return;
|
|
}
|
|
//var workshop;
|
|
//if ($('#ddlWorkshop').val() == null) {
|
|
// workshop = '';
|
|
//} else {
|
|
// workshop = $('#ddlWorkshop').val();
|
|
//};
|
|
self.requestApi({
|
|
modulename: "MaterialBatchNumber",
|
|
funname: "MaterialBatchNumber", //BatchRate
|
|
para: { workorder: self.txtWO},
|
|
success: (res) => {
|
|
console.log(res);
|
|
self.data = res;
|
|
},
|
|
fail: (ex) => {
|
|
console.log(ex);
|
|
}
|
|
})
|
|
},
|
|
QueryddlWorkshop: function () {
|
|
var promiseweld = $.ajax({
|
|
url: '/api/Orders/QueryWorkshop', //'/api/QC/QueryStatus'
|
|
type: 'post',
|
|
cache: true,
|
|
async: true,
|
|
});
|
|
promiseweld.done(function (r) {
|
|
console.log(r);
|
|
$.each(r.info, function (index, value) {
|
|
console.log(index);
|
|
$("#ddlWorkshop").append("<option value='" + value.area_code + "'>" + value.descriptions + "</option>");
|
|
})
|
|
$('#ddlWorkshop').val('');
|
|
$('#ddlWorkshop').select2({
|
|
placeholder: "车间",
|
|
allowClear: true
|
|
});
|
|
});
|
|
promiseweld.fail(function (error) {
|
|
console.log(error)
|
|
alert(error);
|
|
});
|
|
},
|
|
//excel: function () {
|
|
// var self = this;
|
|
// if ($('#ddlWorkshop').val() == null && self.txtWO == '' && self.txtSales == '') {
|
|
// toastr.warning('请输入查询参数', '', { progressBar: true });
|
|
// return;
|
|
// }
|
|
// self.doPost('/Report/PackCapacityExcel', [
|
|
// workshop= $('#ddlWorkshop').val(),
|
|
// workorder= self.txtWO,
|
|
// saleorder= self.txtSales
|
|
// ])
|
|
|
|
//},
|
|
//Daterangeini: function () {
|
|
// jeDate("#jedatetime", {
|
|
// onClose: false,
|
|
// theme: { bgcolor: "#00A1CB", color: "#ffffff", pnColor: "#00CCFF" },
|
|
// format: "YYYY-MM",
|
|
// isinitVal: true,
|
|
// })
|
|
|
|
//},
|
|
requestApi: function (config) {//modulename, funname, para, success, fail) {
|
|
fetch("/api/" + config.modulename + "/" + config.funname + "", {
|
|
method: "post",
|
|
headers: {
|
|
"Accept": "application/json, text/plain, */*",
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(config.para)
|
|
}).then(
|
|
(res) => { return res.json() }
|
|
).then(
|
|
(res) => { config.success(res) }
|
|
).catch(
|
|
(ex) => { config.fail(ex) }
|
|
)
|
|
},
|
|
form: function (config) {
|
|
fetch("/" + config.modulename + "/" + config.funname + "", {
|
|
method: "post",
|
|
headers: {
|
|
"Accept": "application/json, text/plain, */*",
|
|
"Content-Type": "application/json"
|
|
},
|
|
body: JSON.stringify(config.para)
|
|
}).then(
|
|
(res) => { return res.json() }
|
|
).then(
|
|
(res) => { config.success(res) }
|
|
).catch(
|
|
(ex) => { config.fail(ex) }
|
|
)
|
|
}
|
|
}
|
|
|
|
|
|
});
|
|
|
|
$('#btnExportExcel').click(function () {
|
|
if ($('#txtWO').val() == '') {
|
|
toastr.warning('请输入查询参数', '', { progressBar: true });
|
|
return;
|
|
}
|
|
doPost('/Report/MaterialBatchNumberExcel', [
|
|
//workshop = $('#ddlWorkshop').val(),
|
|
workorder = $('#txtWO').val(),
|
|
//saleorder = $('#txtSales').val()
|
|
])
|
|
})
|
|
function doPost(to, p) { // to:提交动作(action),p:参数
|
|
var myForm = document.createElement("form");
|
|
myForm.method = "post";
|
|
myForm.action = to;
|
|
for (var i in p) {
|
|
var myInput = document.createElement("input");
|
|
myInput.setAttribute("name", "para"); // 为input对象设置name
|
|
myInput.setAttribute("value", p[i]); // 为input对象设置value
|
|
myForm.appendChild(myInput);
|
|
}
|
|
document.body.appendChild(myForm);
|
|
myForm.submit();
|
|
document.body.removeChild(myForm); // 提交后移除创建的form
|
|
}
|