123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327 |
- //物资信息查询页面
- define(function (require) {
- return function () {
- var $grid1, $grid2, $form;
- // 弹框的方式
- var widgets = {
- // 搜索分类检索
- selectCatalogWidget: {
- url: '/app/mat/widget/selectCatalog.js',
- bind: {
- matcId: 'matcId',
- matcName: 'matcName'
- },
- queryParams: {matcBusi: MATC_BUSI_检验, status: 1}
- },
- // 派工号
- selectPmgPghWidget: {
- url: '/app/wms/widget/selectPmsPgh.js',
- bind: {
- pghId: 'pghId',
- pghCode: 'pghCode'
- },
- widgetPrompt: "派工号编号"
- },
- };
- function enterQueryGrid1(e) {
- if (e.keyCode === 13) {
- var tmp = $(this).val();
- $form.formSet({queryProperties: tmp});
- queryGrid1();
- }
- }
- function queryGrid1() {
- var queryUrl = '/wms/wmsOutPoolmat/queryStockMatMiss';// 自行替换此参数
- $grid1.jqGrid("clearGridData");
- var queryForm = $form.formGet();
- $grid1.reload({
- mtype: 'POST',
- url: api(queryUrl),
- queryParams: queryForm
- }, true);
- if ($grid2 != undefined && $grid2 != null) {
- $grid2.jqGrid("clearGridData");
- }
- }
- function queryGrid2() {
- if ($grid2 == undefined || $grid2 == null)
- return;
- var row = $grid1.rowData();
- if (!row) {
- $.yvan.msg('请先选择一行数据');
- return;
- }
- var queryForm = $form.formGet();
- queryForm.matId = row.matId;
- var queryUrl = '/wms/wmsOutPoolmat/queryStockMatMissBill';// 自行替换此参数
- $grid2.reload({
- mtype: 'POST',
- url: api(queryUrl),
- queryParams: queryForm
- });
- }
- //获取库区
- function getFarmList() {
- var _datas = [];
- _datas.push({
- "id": '',
- "text": '全部'
- })
- $.yvan.ajax({
- url: api('/wms/whFarm/queryAll'),
- data: {},
- method: 'post',
- async: false,
- success: function (data) {
- if (data.data != null && data.data != undefined) {
- for (var i = 0; i < data.data.length; i++) {
- _datas.push({
- "id": data.data[i].farmId,
- "text": data.data[i].farmName
- })
- }
- }
- }
- });
- return _datas;
- }
- //获取车间信息
- function getRoomList() {
- var _datas = [{"id": '', "text": '全部'}];
- $.yvan.ajax({
- url: api('/wms/wmsOutPoolmat/queryRoomByMiss'),
- method: 'post',
- async: false,
- success: function (data) {
- if (data.data != null && data.data != undefined) {
- for (var i = 0; i < data.data.length; i++) {
- _datas.push({
- "id": data.data[i].roomId,
- "text": data.data[i].roomName
- })
- }
- }
- }
- });
- return _datas;
- }
- // 搜索按钮
- var queryToolbarTitle = '库存缺件查询';// 自行替换此参数
- var queryToolbar = {
- xtype: 'toolbar', title: queryToolbarTitle, items: [
- {
- text: '查询', iconCls: 'fa fa-search', onClick: function () {
- queryGrid1();
- }
- }, {
- text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
- $form.formClear();
- queryGrid1();
- }
- }, {
- text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
- App.closeMe(this);
- }
- }
- ]
- };
- // 搜索条件
- var queryFormPrompt = '物资编码/图号型号/物资名称';// 自行替换此参数
- var queryForm = {
- onRender: function () {
- $form = $(this);
- },
- xtype: 'form',
- items: [
- [
- {xtype: 'hidden', name: 'matcId'},
- {xtype: 'hidden', name: 'corpId'},
- {xtype: 'hidden', name: 'pghId'},
- {
- xtype: 'searchbox',
- label: '派工号',
- name: 'pghCode',
- labelWidth: 'auto',
- width: 250,
- prompt: '派工号编号',
- widget: widgets.selectPmgPghWidget,
- onChange: function (data) {
- queryGrid1();
- }
- },
- {
- xtype: 'yvselect',
- label: '需求车间',
- name: 'roomId',
- labelWidth: 'auto',
- width: 240,
- data: getRoomList(),
- onChange: function () {
- queryGrid1();
- }
- },
- {
- xtype: 'yvselect', label: '需求阶段', name: 'outapType', labelWidth: 'auto', width: 180, value: '',
- data: $.yvan.sysDict('outapType').combowithAll(),
- onChange: function () {
- queryGrid1();
- }
- },
- {
- xtype: 'yvselect', label: '需求库区', name: 'farmId', labelWidth: 'auto', width: 200, value: '',
- data: getFarmList(),
- onChange: function () {
- queryGrid1();
- }
- },
- ],
- [
- {
- xtype: 'yvselect', label: '物资分类', name: 'matType', labelWidth: 'auto', width: 180,
- data: $.yvan.sysDict('matType').combowithAll(), value: '',
- onChange: function () {
- queryGrid1();
- }
- },
- {
- xtype: 'textbox',
- label: '检索条件',
- name: 'queryProperties',
- prompt: queryFormPrompt,
- labelWidth: 'auto',
- width: 320,
- events: {keydown: enterQueryGrid1},
- },
- ],
- ]
- };
- // 列表1增删改查按钮
- var gridToolbarTitle1 = '缺件物资列表';// 自行替换此参数
- var gridToolbar1 = {
- xtype: 'toolbar',
- title: gridToolbarTitle1,
- items: [
- {
- text: '导出数据', iconCls: 'fa fa-cloud-upload', onClick: function () {
- var para = "";
- if ($form.formGet().pghId != "") {
- para = (para == "") ? "" : para + "&";
- para += "pghId=" + $form.formGet().pghId;
- }
- if ($form.formGet().outapType != "") {
- para = (para == "") ? "" : para + "&";
- para += "outapType=" + $form.formGet().outapType;
- }
- if ($form.formGet().farmId != "") {
- para = (para == "") ? "" : para + "&";
- para += "farmId=" + $form.formGet().farmId;
- }
- if ($form.formGet().roomId != "") {
- para = (para == "") ? "" : para + "&";
- para += "roomId=" + $form.formGet().roomId;
- }
- if ($form.formGet().matType != "") {
- para = (para == "") ? "" : para + "&";
- para += "matType=" + $form.formGet().matType;
- }
- if ($form.formGet().queryProperties != "") {
- para = (para == "") ? "" : para + "&";
- para += "queryProperties=" + $form.formGet().queryProperties;
- }
- para = (para == "") ? "/wms/wmsOutPoolmat/exportStockMatMissExcel" : "/wms/wmsOutPoolmat/exportStockMatMissExcel?" + para;
- $.yvan.download({
- method: 'get',
- url: api(para),
- fileName: "库存物资缺件统计表" + $.yvan.getMoment().format('YYYY-MM-DD HH:mm:ss') + '.xlsx'
- });
- }
- },
- ]
- };
- return {
- north: {
- height: 135,
- split: true,
- border: false,
- items: [
- queryToolbar,
- queryForm
- ]
- },
- center: {
- height: '60%',
- split: true,
- items: {
- onRender: function () {
- $grid1 = $(this);
- queryGrid1();
- },
- xtype: 'grid',
- toolbar: gridToolbar1,
- autoSizeColumns: true,
- columns:
- [[
- {title: '物资ID', field: 'matId', hidden: true},
- {title: '物资分类', field: 'matType', formatter: $.fn.fmatter.matType, width: 80},
- {title: '物资编码', field: 'matBar', width: 200},
- {title: '图号/型号', field: 'matCode', width: 200},
- {title: '物资名称', field: 'matName', width: 200},
- {title: '物资编码属性', field: 'matAttrCode'},
- {title: '计量单位', field: 'unitName'},
- {title: '待发数', field: 'dfAmount', align: 'right', formatter: $.fn.fmatter.formatNumberBigDecimal},
- {title: '库存数', field: 'stockAmount', align: 'right', formatter: $.fn.fmatter.formatNumberBigDecimal},
- {title: '缺件数', field: 'missAmount', align: 'right', formatter: $.fn.fmatter.formatNumberBigDecimal},
- //{title: '需求单据数', field: 'billAmount', align: 'right', formatter: $.fn.fmatter.formatNumberBigDecimal},
- ]],
- onSelectRow: function (rowid) {
- queryGrid2();
- }
- }
- },
- south: {
- height: '40%',
- border: false,
- items: {
- xtype: 'tabs',
- items: [
- {
- title: '需求单据列表',
- lazy: true,
- items: {
- onRender: function () {
- $grid2 = $(this);
- },
- xtype: 'grid',
- autoSizeColumns: true,
- pagination: true,
- columns: [
- [
- {title: '需求单号', field: 'billCode', width: 140},
- {title: '需求类型', field: 'outapType', align: 'center', formatter: $.fn.fmatter.outapType},
- {title: '待发数', field: 'dfAmount', align: 'right', formatter: $.fn.fmatter.formatNumberBigDecimal},
- {title: '缺件数', field: 'missAmount', align: 'right', formatter: $.fn.fmatter.formatNumberBigDecimal},
- {title: '派工号', field: 'pghCode', width: 140},
- {title: '需求库区', field: 'farmName', width: 200},
- {title: '需求车间', field: 'roomName', width: 200},
- {title: '申请人', field: 'takeUser'},
- {title: '需求日期', field: 'dateUse', align: 'center', formatter: $.fn.fmatter.tsymd}
- ]
- ]
- }
- },
- ]
- }
- }
- };
- };
- });
|