|
|
@@ -240,38 +240,35 @@ Ext.define('saas.view.stock.make.FormPanelController', {
|
|
|
beforerender:function(f){
|
|
|
Ext.apply(f,{
|
|
|
//数据接口
|
|
|
- dataUrl:'/api/document/product/list',
|
|
|
- addXtype: 'document-product-formpanel',
|
|
|
- addTitle: '物料资料',
|
|
|
+ dataUrl:'/api/document/bom/list',
|
|
|
+ addXtype: 'document-bom-formpanel',
|
|
|
+ addTitle: 'BOM资料',
|
|
|
//放大镜赋值设置
|
|
|
dbfinds:[{
|
|
|
- from:'pr_code',to:'ma_prodcode'
|
|
|
- },{
|
|
|
from:'id',to:'ma_prodid'
|
|
|
},{
|
|
|
- from:'pr_detail',to:'ma_proddetail'
|
|
|
- },{
|
|
|
- from:'pr_spec',to:'ma_prodspec'
|
|
|
+ from:'bo_mothercode',to:'ma_prodcode'
|
|
|
},{
|
|
|
- from:'pr_unit',to:'ma_produnit'
|
|
|
+ from:'bo_mothername',to:'ma_proddetail'
|
|
|
}],
|
|
|
//联想设置
|
|
|
dbtpls:[{
|
|
|
- field:'pr_code',width:100
|
|
|
- },{
|
|
|
- field:'pr_detail',width:100
|
|
|
+ field:'bo_mothercode',width:100
|
|
|
},{
|
|
|
- field:'pr_spec',width:100
|
|
|
+ field:'bo_mothername',width:100
|
|
|
}],
|
|
|
- defaultCondition:"pr_statuscode='OPEN'",
|
|
|
+ aftertrigger:function(f,record){
|
|
|
+ me.getBomData(record.data.id)
|
|
|
+ },
|
|
|
+ defaultCondition:"bo_statuscode='OPEN'",
|
|
|
//窗口字段设置
|
|
|
dbSearchFields:[{
|
|
|
- emptyText:'输入物料编号、名称或规格',
|
|
|
+ emptyText:'输入BOM编号或名称',
|
|
|
xtype : "textfield",
|
|
|
name : "search",
|
|
|
width: 200,
|
|
|
getCondition: function(v) {
|
|
|
- return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
|
|
|
+ return "(upper(bo_mothercode) like '%"+v.toUpperCase()+"%' or upper(bo_mothername) like '%"+v.toUpperCase()+"%')";
|
|
|
},
|
|
|
allowBlank : true,
|
|
|
columnWidth : 0.25
|
|
|
@@ -283,63 +280,66 @@ Ext.define('saas.view.stock.make.FormPanelController', {
|
|
|
"dataIndex": "id",
|
|
|
}, {
|
|
|
"text": "物料编号",
|
|
|
- "dataIndex": "pr_code",
|
|
|
+ "dataIndex": "bo_mothercode",
|
|
|
"width": 200,
|
|
|
}, {
|
|
|
"text": "物料名称",
|
|
|
"width": 200,
|
|
|
- "dataIndex": "pr_detail",
|
|
|
- }, {
|
|
|
- "text": "规格",
|
|
|
- "dataIndex": "pr_spec",
|
|
|
- "width": 100,
|
|
|
- }, {
|
|
|
- "text": "单位",
|
|
|
- "dataIndex": "pr_spec",
|
|
|
- "width": 100,
|
|
|
- },{
|
|
|
- "text": "仓库id",
|
|
|
- "dataIndex": "pr_whid",
|
|
|
- "hidden": true,
|
|
|
- },{
|
|
|
- "text": "仓库编号",
|
|
|
- "dataIndex": "pr_whcode",
|
|
|
- "hidden": true,
|
|
|
- },{
|
|
|
- "text": "仓库",
|
|
|
- "dataIndex": "pr_whname",
|
|
|
- "width": 200,
|
|
|
- },{
|
|
|
- "text": "总库存数",
|
|
|
- "dataIndex": "po_onhand",
|
|
|
- "width": 100,
|
|
|
- align:'right'
|
|
|
- },{
|
|
|
- "text": "类型",
|
|
|
- "dataIndex": "pr_kind",
|
|
|
- "width": 100,
|
|
|
- },{
|
|
|
- "text": "型号",
|
|
|
- "dataIndex": "pr_orispeccode",
|
|
|
- "width": 100,
|
|
|
- },{
|
|
|
- "text": "品牌",
|
|
|
- "dataIndex": "pr_brand",
|
|
|
- "width": 100,
|
|
|
- },{
|
|
|
- "text": "供应商",
|
|
|
- "dataIndex": "pr_vendname",
|
|
|
- "width": 100,
|
|
|
- },{
|
|
|
- "text": "最小包装",
|
|
|
- "dataIndex": "pr_zxbzs",
|
|
|
- "width": 100,
|
|
|
- align:'right'
|
|
|
- },{
|
|
|
- "text": "L/T",
|
|
|
- "dataIndex": "pr_leadtime",
|
|
|
- "width": 100,
|
|
|
- }]
|
|
|
+ "dataIndex": "bo_mothername",
|
|
|
+ }
|
|
|
+ // ,{
|
|
|
+ // "text": "规格",
|
|
|
+ // "dataIndex": "pr_spec",
|
|
|
+ // "width": 100,
|
|
|
+ // }, {
|
|
|
+ // "text": "单位",
|
|
|
+ // "dataIndex": "pr_spec",
|
|
|
+ // "width": 100,
|
|
|
+ // },{
|
|
|
+ // "text": "仓库id",
|
|
|
+ // "dataIndex": "pr_whid",
|
|
|
+ // "hidden": true,
|
|
|
+ // },{
|
|
|
+ // "text": "仓库编号",
|
|
|
+ // "dataIndex": "pr_whcode",
|
|
|
+ // "hidden": true,
|
|
|
+ // },{
|
|
|
+ // "text": "仓库",
|
|
|
+ // "dataIndex": "pr_whname",
|
|
|
+ // "width": 200,
|
|
|
+ // },{
|
|
|
+ // "text": "总库存数",
|
|
|
+ // "dataIndex": "po_onhand",
|
|
|
+ // "width": 100,
|
|
|
+ // align:'right'
|
|
|
+ // },{
|
|
|
+ // "text": "类型",
|
|
|
+ // "dataIndex": "pr_kind",
|
|
|
+ // "width": 100,
|
|
|
+ // },{
|
|
|
+ // "text": "型号",
|
|
|
+ // "dataIndex": "pr_orispeccode",
|
|
|
+ // "width": 100,
|
|
|
+ // },{
|
|
|
+ // "text": "品牌",
|
|
|
+ // "dataIndex": "pr_brand",
|
|
|
+ // "width": 100,
|
|
|
+ // },{
|
|
|
+ // "text": "供应商",
|
|
|
+ // "dataIndex": "pr_vendname",
|
|
|
+ // "width": 100,
|
|
|
+ // },{
|
|
|
+ // "text": "最小包装",
|
|
|
+ // "dataIndex": "pr_zxbzs",
|
|
|
+ // "width": 100,
|
|
|
+ // align:'right'
|
|
|
+ // },{
|
|
|
+ // "text": "L/T",
|
|
|
+ // "dataIndex": "pr_leadtime",
|
|
|
+ // "width": 100,
|
|
|
+ // }
|
|
|
+
|
|
|
+ ]
|
|
|
}) ;
|
|
|
|
|
|
}
|
|
|
@@ -466,23 +466,39 @@ Ext.define('saas.view.stock.make.FormPanelController', {
|
|
|
viewModel.set('ma_price',sum_qty);
|
|
|
},
|
|
|
|
|
|
- turnIn: function() {
|
|
|
+
|
|
|
+ getBomData: function(v) {
|
|
|
var me = this,
|
|
|
form = me.getView(),
|
|
|
- id = form.getForm().findField(form._idField);
|
|
|
+ viewModel = me.getViewModel(),
|
|
|
+ store = viewModel.get('detail0').detailStore,
|
|
|
+ loadData = new Array();;
|
|
|
+ //请求bom资料
|
|
|
form.BaseUtil.request({
|
|
|
- url: form._turnInUrl+id.value,
|
|
|
+ url: form._getBomUrl+v,
|
|
|
method: 'GET',
|
|
|
})
|
|
|
.then(function(localJson) {
|
|
|
if(localJson.success){
|
|
|
- showToast('转单成功');
|
|
|
-
|
|
|
+ var data = localJson.data.items;
|
|
|
+ Ext.Array.each(data, function(item, i) {
|
|
|
+ loadData.push({
|
|
|
+ mm_detno:item.bd_detno,
|
|
|
+ mm_prodidid:item.bd_sonid,
|
|
|
+ mm_prodcode:item.bd_soncode,
|
|
|
+ mm_oneuseqty:item.bd_baseqty,
|
|
|
+ pr_detail:'',
|
|
|
+ pr_spec:'',
|
|
|
+ pr_unit:''
|
|
|
+ })
|
|
|
+ });
|
|
|
+ store.loadData(loadData)
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
.catch(function(res) {
|
|
|
console.error(res);
|
|
|
- showToast('转单失败: ' + res.message);
|
|
|
+ showToast('获取BOM资料失败: ' + res.message);
|
|
|
});
|
|
|
}
|
|
|
});
|