123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462 |
- Ext.define('make.view.make.makePick.FormPanel', {
- extend: 'saas.view.core.form.FormPanel',
- xtype: ['make-makepick-formpanel', 'makepick-formpanel'],
- controller: 'make-makepick-formpanel',
- viewModel: 'make-makepick-formpanel',
- viewName: 'make-makepick-formpanel',
- caller: 'MakePick',
- //字段属性
- _title: '生产领料单',
- _idField: 'id',
- _codeField: 'pi_inoutno',
- _statusField: 'pi_status',
- _statusCodeField: 'pi_statuscode',
- _auditmanField: 'pi_auditman',
- _auditdateField: 'pi_auditdate',
- _relationColumn: 'pd_piid',
- _readUrl: '/api/make/prodinout/read',
- _saveUrl: '/api/make/prodinout/save',
- _auditUrl: '/api/make/prodinout/audit',
- _unAuditUrl: '/api/make/prodinout/unAudit',
- _deleteUrl: '/api/make/prodinout/delete',
- //_turnOutUrl: '/api/make/prodinout/turnPurchaseOut',
- initId: 0,
- initComponent: function () {
- var currentDepart = saas.util.BaseUtil.getCurrentUserDepart();
- Ext.apply(this, {
- defaultItems: [{
- xtype: 'hidden',
- name: 'id',
- fieldLabel: 'id',
- allowBlank: true,
- columnWidth: 0
- }, {
- xtype: "datefield",
- name: "pi_date",
- fieldLabel: "单据日期",
- allowBlank: false,
- columnWidth: 0.25,
- defaultValue: new Date()
- }, {
- xtype: "hidden",
- name: "pi_class",
- fieldLabel: "单据类型",
- readOnly: true,
- allowBlank: true,
- defaultValue: 'MAKEPICK',
- columnWidth: 0.25
- }, {
- xtype: 'departDbfindTrigger',
- name: 'pi_departmentname',
- fieldLabel: '部门名称',
- allowBlank: false,
- columnWidth: 0.25,
- defaultValue: currentDepart.dp_name
- }, {
- xtype: 'hidden',
- name: 'pi_departmentcode',
- fieldLabel: '部门编号',
- allowBlank: true,
- defaultValue: currentDepart.dp_code
- },{
- name: "detailGridField",
- xtype: "detailGridField",
- storeModel: 'make.model.make.MakePickDetail',
- deleteDetailUrl: '/api/make/prodinout/deleteDetail',
- relativeBinds:{
- refFields:['pd_maid'],
- fields:['pd_prodcode','pr_detail']
- },
- detnoColumn: 'pd_pdno',
- columns: [{
- text: "id",
- dataIndex: "id",
- xtype: "numbercolumn",
- hidden: true
- },{
- text: "pd_mmid",
- dataIndex: "pd_mmid",
- xtype: "numbercolumn",
- hidden: true
- },{
- text: "pd_maid",
- dataIndex: "pd_maid",
- xtype: "numbercolumn",
- hidden: true
- },{
- text: "制造单号",
- dataIndex: "pd_ordercode",
- width: 150.0,
- editor: {
- displayField: "display",
- editable: true,
- format: "",
- hideTrigger: false,
- maxLength: 100.0,
- minValue: null,
- positiveNum: false,
- store: null,
- valueField: "value",
- xtype: "makeMultiDbfindTrigger",
- caller:'MakePick'
- }
- },{
- text: "工单序号",
- dataIndex: "pd_orderdetno",
- align: 'center',
- width: 80
- },{
- text: "工单id",
- dataIndex: "pd_orderid",
- xtype: "numbercolumn",
- hidden: true
- }, {
- text: "物料id",
- dataIndex: "pd_prodid",
- xtype: "numbercolumn",
- hidden: true
- }, {
- text: "物料编号",
- width: 150.0,
- dataIndex: "pd_prodcode",
- xtype: "",
- items: null
- }, {
- text: "物料名称",
- width: 150.0,
- dataIndex: "pr_detail",
- ignore: true,
- renderer: function (v, m, r) {
- if (!v) {
- return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
- }
- return v;
- }
- }, {
- text: "厂家/品牌",
- hidden:true,
- width: 100.0,
- dataIndex: "pr_brand",
- ignore: true,
- renderer: function (v, m, r) {
- if (!v) {
- return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
- }
- return v;
- }
- }, {
- text: "型号",
- width: 200.0,
- dataIndex: "pr_orispeccode",
- ignore: true,
- renderer: function (v, m, r) {
- var str = '';
- if(r.data["productDTO"] ){
- if(r.data["productDTO"]['pr_brand']){
- str += '厂家/品牌:'+ r.data["productDTO"]['pr_brand'] + '<br>';
- }
- if(r.data["productDTO"]['pr_spec']){
- str += '规格:' + r.data["productDTO"]['pr_spec'];
- }
- if(str) m.tdAttr = 'data-qtip="'+ str +'"';
- if (!v) {
- return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
- }
- }
- return v;
- }
- }, {
- text: "单位",
- width: 65.0,
- dataIndex: "pr_unit",
- ignore: true,
- renderer: function (v, m, r) {
- if (!v) {
- return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
- }
- return v;
- }
- },{
- text: "发料数量",
- dataIndex: "pd_outqty",
- xtype: 'numbercolumn',
- width: 110.0,
- allowBlank: false,
- editor: {
- xtype: "numberfield",
- decimalPrecision: 6,
- minValue: 0
- },
- renderer: function(v, m, r) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- },
- summaryType: 'sum',
- summaryRenderer: function(v, d, f, m) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- }
- }, {
- text: "仓库id",
- dataIndex: "pd_whid",
- xtype: "numbercolumn",
- hidden: true
- }, {
- text: "仓库编号",
- dataIndex: "pd_whcode",
- hidden: true
- }, {
- text: "仓库",
- dataIndex: "pd_whname",
- width: 110.0,
- allowBlank: false,
- editor: {
- displayField: "display",
- editable: true,
- format: "",
- hideTrigger: false,
- maxLength: 100.0,
- minValue: null,
- positiveNum: false,
- queryMode: "local",
- store: null,
- valueField: "value",
- xtype: "warehouseDbfindTrigger"
- }
- }, {
- text: 'model映射需要',
- dataIndex: 'productDTO',
- hidden: true,
- }, {
- text: "成本单价(元)",
- xtype: 'numbercolumn',
- width: 120,
- dataIndex: "pd_price",
- renderer: function(v, m, r) {
- return saas.util.BaseUtil.numberFormat(v, 8, true);
- }
- }, {
- text: "金额(元)",
- xtype: 'numbercolumn',
- dataIndex: "pd_total",
- width: 120,
- renderer: function(v, m, r) {
- return saas.util.BaseUtil.numberFixFormat(v, 2, true);
- },
- summaryType: 'sum',
- summaryRenderer: function(v, d, f, m) {
- return saas.util.BaseUtil.numberFixFormat(v, 2, true);
- }
- },{
- text: "应领数量",
- dataIndex: "mm_qty",
- xtype: 'numbercolumn',
- width: 110.0,
- ignore: true,
- renderer: function(v, m, r) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- },
- summaryType: 'sum',
- summaryRenderer: function(v, d, f, m) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- }
- },{
- text: "已领数量",
- dataIndex: "mm_havegetqty",
- xtype: 'numbercolumn',
- width: 110.0,
- ignore: true,
- renderer: function(v, m, r) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- },
- summaryType: 'sum',
- summaryRenderer: function(v, d, f, m) {
- return saas.util.BaseUtil.numberFormat(v, 6, true);
- }
- }, {
- text: "备注",
- dataIndex: "pd_remark",
- width: 250,
- items: null,
- editor: {
- xtype: "textfield"
- }
- }, {
- text: "规格",
- hidden:true,
- width: 200,
- dataIndex: "pr_spec",
- ignore: true,
- renderer: function (v, m, r) {
- if (!v) {
- return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
- }
- return v;
- }
- }, {
- dataIndex: "pd_text1",
- text: "自定义字段1",
- width: 100,
- hidden: true,
- initHidden: false,
- editor: {
- xtype: "textfield"
- },
- }, {
- dataIndex: "pd_text2",
- text: "自定义字段2",
- width: 100,
- hidden: true,
- initHidden: false,
- editor: {
- xtype: "textfield"
- },
- }, {
- dataIndex: "pd_text3",
- text: "自定义字段3",
- width: 100,
- hidden: true,
- initHidden: false,
- editor: {
- xtype: "textfield"
- },
- }, {
- dataIndex: "pd_text4",
- text: "自定义字段4",
- width: 100,
- hidden: true,
- initHidden: false,
- editor: {
- xtype: "textfield"
- },
- }, {
- dataIndex: "pd_text5",
- text: "自定义字段5",
- width: 100,
- hidden: true,
- initHidden: false,
- editor: {
- xtype: "textfield"
- },
- }]
- }, {
- xtype: "textfield",
- name: "pi_remark",
- fieldLabel: "备注",
- columnWidth: 1
- }, {
- xtype: "datefield",
- name: "pi_date",
- fieldLabel: "单据日期",
- columnWidth: 0.3,
- hidden: true,
- defaultValue: new Date()
- }, {
- xtype: "hidden",
- name: "creatorId",
- fieldLabel: "录入人ID",
- readOnly: true
- }, {
- xtype: "textfield",
- name: "creatorName",
- fieldLabel: "录入人",
- readOnly: true,
- columnWidth: 0.3
- }, {
- xtype: "hidden",
- name: "createTime",
- fieldLabel: "录入日期",
- readOnly: true,
- defaultValue: new Date()
- }, {
- xtype: "hidden",
- name: "updaterId",
- fieldLabel: "更新人ID",
- readOnly: true
- }, {
- xtype: "hidden",
- name: "updaterName",
- fieldLabel: "更新人",
- readOnly: true
- }, {
- xtype: "hidden",
- name: "updateTime",
- fieldLabel: "更新日期",
- readOnly: true,
- defaultValue: new Date()
- }, {
- xtype: "textfield",
- name: "pi_auditman",
- fieldLabel: "审核人",
- columnWidth: 0.3,
- readOnly: true
- }, {
- xtype: "displayfield",
- name: "pi_costtotal",
- fieldLabel: "金额(元)",
- labelWidth:200,
- labelAlign : 'right',
- columnWidth: 0.4,
- thousandSeparator: ',',
- renderer: function (v){
- if(!v){
- v=0;
- }
- return '<p class="money-rtl"><font color="red"><B>'+saas.util.BaseUtil.numberFixFormat(v, 2, true)+'</font>'
- },
- readOnly: true
- }, {
- xtype: "hidden",
- name: "pi_auditdate",
- fieldLabel: "审核日期",
- readOnly: true
- }, {
- xtype: "textfield",
- name: "pi_text1",
- fieldLabel: "自定义字段1",
- hidden: true,
- initHidden: false
- }, {
- xtype: "textfield",
- name: "pi_text2",
- fieldLabel: "自定义字段2",
- hidden: true,
- initHidden: false
- }, {
- xtype: "textfield",
- name: "pi_text3",
- fieldLabel: "自定义字段3",
- hidden: true,
- initHidden: false
- }, {
- xtype: "textfield",
- name: "pi_text4",
- fieldLabel: "自定义字段4",
- hidden: true,
- initHidden: false
- }, {
- xtype: "textfield",
- name: "pi_text5",
- fieldLabel: "自定义字段5",
- hidden: true,
- initHidden: false
- }],
- });
- this.callParent(arguments);
- },
- // beforeAudit: function () {
- // var me = this,
- // viewModel = me.getViewModel(),
- // grid = me.down('detailGridField'),
- // data = grid.getTrueData();
- // Ext.Array.each(data, function (item) {
- // if (item.pd_price == 0) {
- // saas.util.BaseUtil.showSuccessToast(item.pd_pdno + '行' + item.pd_prodcode + '物料单价为0');
- // }
- // });
- // return true;
- // }
- });
|