FormPanel.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. Ext.define('make.view.sale.saleFosenrecast.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: ['sale-saleforecast-formpanel', 'saleforecast-formpanel'],
  4. controller: 'sale-saleforecast-formpanel',
  5. viewModel: 'sale-saleforecast-formpanel',
  6. viewName: 'sale-saleforecast-formpanel',
  7. caller: 'SaleForecast',
  8. //字段属性
  9. _title: '备货单',
  10. _idField: 'id',
  11. _codeField: 'sf_code',
  12. _statusField: 'sf_status',
  13. _statusCodeField: 'sf_statuscode',
  14. _auditmanField: 'sf_auditman',
  15. _auditdateField: 'sf_auditdate',
  16. _readUrl: '/api/sale/saleforecast/read',
  17. _saveUrl: '/api/sale/saleforecast/save',
  18. _auditUrl: '/api/sale/saleforecast/audit',
  19. _unAuditUrl: '/api/sale/saleforecast/unAudit',
  20. _deleteUrl: '/api/sale/saleforecast/delete',
  21. _turnSaleUrl: '/api/sale/saleforecast/turnSale',
  22. _runATP: '/api/sale/saleforecast/runAtp',
  23. initId: 0,
  24. initComponent: function () {
  25. Ext.apply(this, {
  26. defaultItems: [{
  27. xtype: 'hidden',
  28. name: 'id',
  29. fieldLabel: 'id'
  30. },{
  31. xtype: 'currencyCombo',
  32. name:'sf_currency',
  33. fieldLabel: '币种',
  34. allowBlank: false,
  35. columnWidth: 0.25,
  36. defaultValue:this.getViewModel().get('defaultCurrency'),
  37. },{
  38. xtype: 'numberfield',
  39. name: 'sf_taxrate',
  40. fieldLabel: '税率(%)',
  41. columnWidth: 0.25,
  42. minValue: 0,
  43. maxValue: 100,
  44. defaultValue: saas.util.BaseUtil.getDefualtTaxRate(),
  45. },{
  46. xtype:'radiogroup',
  47. columnWidth: 0.4,
  48. name:'sf_clashway',
  49. margin:'0 0 0 55',
  50. simpleValue:true,
  51. tooltip: {
  52. text:'任意订单自动核销:任意客户的销售订单审核时自动根据物料编号核销掉对应的备货数量。<br>按备货客户核销:销售订单客户与备货客户一样时,订单审核时自动根据物料编号核销掉对应的备货数量。',
  53. title:'提示',
  54. dismissDelay:7200000
  55. },
  56. items: [
  57. { boxLabel: '任意订单自动核销', inputValue: 'ALL', checked: true},
  58. { boxLabel: '按备货客户核销', inputValue: 'client' }
  59. ]
  60. },{
  61. name: "detailGridField",
  62. xtype: "detailGridField",
  63. detnoColumn: 'sd_detno',
  64. storeModel: 'saas.model.sale.SaleForecastDetail',
  65. deleteDetailUrl: '/api/sale/saleforecast/deleteDetail',
  66. columns: [{
  67. text: "id",
  68. dataIndex: "id",
  69. xtype: "numbercolumn",
  70. hidden: true
  71. }, {
  72. text: "物料id",
  73. dataIndex: "sd_prodid",
  74. hidden: true
  75. }, {
  76. text: "物料名称",
  77. width: 150.0,
  78. dataIndex: "pr_detail",
  79. xtype: "",
  80. items: null,
  81. editor: {
  82. displayField: "display",
  83. editable: true,
  84. format: "",
  85. hideTrigger: false,
  86. maxLength: 100.0,
  87. minValue: null,
  88. positiveNum: false,
  89. queryMode: "local",
  90. store: null,
  91. valueField: "value",
  92. xtype: "productMultiDbfindTrigger"
  93. },
  94. renderer: function (v, m, r) {
  95. if (!v) {
  96. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  97. }
  98. return v;
  99. }
  100. }, {
  101. text: 'model映射需要',
  102. dataIndex: 'productDTO',
  103. hidden: true,
  104. }, {
  105. text: "型号",
  106. width: 200.0,
  107. dataIndex: "pr_orispeccode",
  108. ignore: true,
  109. renderer: function (v, m, r) {
  110. var str = '';
  111. if(r.data["productDTO"] ){
  112. if(r.data["productDTO"]['pr_brand']){
  113. str += '厂家/品牌:'+ r.data["productDTO"]['pr_brand'] + '<br>';
  114. }
  115. if(r.data["productDTO"]['pr_spec']){
  116. str += '规格:' + r.data["productDTO"]['pr_spec'];
  117. }
  118. if(str) m.tdAttr = 'data-qtip="'+ str +'"';
  119. if (!v) {
  120. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  121. }
  122. }
  123. return v;
  124. }
  125. }, {
  126. text: "数量",
  127. dataIndex: "sd_qty",
  128. width: 110.0,
  129. xtype: 'numbercolumn',
  130. allowBlank: false,
  131. editor: {
  132. xtype: "numberfield",
  133. decimalPrecision: 6,
  134. minValue: 0
  135. },
  136. renderer: function(v, m, r) {
  137. return saas.util.BaseUtil.numberFormat(v, 6, true);
  138. },
  139. summaryType: 'sum',
  140. summaryRenderer: function(v, d, f, m) {
  141. return saas.util.BaseUtil.numberFormat(v, 6, true);
  142. }
  143. }, {
  144. text: "已核销数量",
  145. dataIndex: "sd_yqty",
  146. width: 110.0,
  147. xtype: 'numbercolumn',
  148. allowBlank: true,
  149. editable: false,
  150. ignore:true,
  151. nocopy:true,
  152. renderer: function(v, m, r) {
  153. return saas.util.BaseUtil.numberFormat(v, 6, true);
  154. },
  155. summaryType: 'sum',
  156. summaryRenderer: function(v, d, f, m) {
  157. return saas.util.BaseUtil.numberFormat(v, 6, true);
  158. }
  159. }, {
  160. text: "已开工单数",
  161. dataIndex: "sd_ymaqty",
  162. width: 110.0,
  163. xtype: 'numbercolumn',
  164. allowBlank: true,
  165. editable: false,
  166. ignore:true,
  167. nocopy:true,
  168. renderer: function(v, m, r) {
  169. return saas.util.BaseUtil.numberFormat(v, 6, true);
  170. },
  171. summaryType: 'sum',
  172. summaryRenderer: function(v, d, f, m) {
  173. return saas.util.BaseUtil.numberFormat(v, 6, true);
  174. }
  175. }, {
  176. text: "订单冲减工单数",
  177. dataIndex: "sd_maqty",
  178. width: 120.0,
  179. xtype: 'numbercolumn',
  180. allowBlank: true,
  181. editable: false,
  182. ignore:true,
  183. nocopy:true,
  184. renderer: function(v, m, r) {
  185. return saas.util.BaseUtil.numberFormat(v, 6, true);
  186. },
  187. summaryType: 'sum',
  188. summaryRenderer: function(v, d, f, m) {
  189. return saas.util.BaseUtil.numberFormat(v, 6, true);
  190. }
  191. }, {
  192. text: "单位",
  193. width: 65.0,
  194. dataIndex: "pr_unit",
  195. ignore: true,
  196. renderer: function (v, m, r) {
  197. if (!v) {
  198. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  199. }
  200. return v;
  201. }
  202. },{
  203. text: "客户id",
  204. dataIndex: "sd_custid",
  205. hidden: true
  206. },{
  207. text: "客户编号",
  208. dataIndex: "sd_custcode",
  209. hidden: true
  210. },{
  211. text: "客户名称",
  212. dataIndex: "sd_custname",
  213. width: 110.0,
  214. editor: {
  215. displayField: "display",
  216. editable: true,
  217. format: "",
  218. hideTrigger: false,
  219. maxLength: 100.0,
  220. minValue: null,
  221. positiveNum: false,
  222. queryMode: "local",
  223. store: null,
  224. valueField: "value",
  225. xtype: "customerDbfindTrigger"
  226. }
  227. }, {
  228. text: "交货日期",
  229. dataIndex: "sd_delivery",
  230. width: 110.0,
  231. xtype: 'datecolumn',
  232. editor: {
  233. xtype: "datefield",
  234. editable: true,
  235. hideTrigger: false
  236. }
  237. }, {
  238. text: "可承诺交期",
  239. dataIndex: "sd_atpdelivery",
  240. width: 150.0,
  241. xtype: 'datecolumn',
  242. format: 'Y-m-d',
  243. ignore: true,
  244. },{
  245. text: "交期运算结果描述",
  246. dataIndex: "sd_atpdesc",
  247. width: 200.0,
  248. ignore: true,
  249. },{
  250. text: "物料编号",
  251. width: 150.0,
  252. dataIndex: "sd_prodcode",
  253. xtype: "",
  254. items: null,
  255. allowBlank: false,
  256. editor: {
  257. displayField: "display",
  258. editable: true,
  259. format: "",
  260. hideTrigger: false,
  261. maxLength: 100.0,
  262. minValue: null,
  263. positiveNum: false,
  264. queryMode: "local",
  265. store: null,
  266. valueField: "value",
  267. xtype: "productMultiDbfindTrigger"
  268. }
  269. }, {
  270. text: "厂家/品牌",
  271. width: 100.0,
  272. dataIndex: "pr_brand",
  273. ignore: true,
  274. renderer: function (v, m, r) {
  275. if (!v) {
  276. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  277. }
  278. return v;
  279. }
  280. }, {
  281. text: "规格",
  282. width: 200,
  283. dataIndex: "pr_spec",
  284. ignore: true,
  285. renderer: function (v, m, r) {
  286. if (!v) {
  287. return r.data["productDTO"] ? r.data["productDTO"][m.column.dataIndex] : null;
  288. }
  289. return v;
  290. }
  291. }, {
  292. text: "备注",
  293. dataIndex: "sd_remark",
  294. width: 250,
  295. items: null,
  296. editor: {
  297. xtype: "textfield"
  298. },
  299. }, {
  300. dataIndex: "sd_text1",
  301. text: "自定义字段1",
  302. width: 100,
  303. hidden: true,
  304. initHidden: false,
  305. editor: {
  306. xtype: "textfield"
  307. },
  308. }, {
  309. dataIndex: "sd_text2",
  310. text: "自定义字段2",
  311. width: 100,
  312. hidden: true,
  313. initHidden: false,
  314. editor: {
  315. xtype: "textfield"
  316. },
  317. }, {
  318. dataIndex: "sd_text3",
  319. text: "自定义字段3",
  320. width: 100,
  321. hidden: true,
  322. initHidden: false,
  323. editor: {
  324. xtype: "textfield"
  325. },
  326. }, {
  327. dataIndex: "sd_text4",
  328. text: "自定义字段4",
  329. width: 100,
  330. hidden: true,
  331. initHidden: false,
  332. editor: {
  333. xtype: "textfield"
  334. },
  335. }, {
  336. dataIndex: "sd_text5",
  337. text: "自定义字段5",
  338. width: 100,
  339. hidden: true,
  340. initHidden: false,
  341. editor: {
  342. xtype: "textfield"
  343. },
  344. }]
  345. }, {
  346. xtype: "textfield",
  347. name: "sf_remark",
  348. fieldLabel: "备注",
  349. columnWidth: 1
  350. }, {
  351. xtype: "datefield",
  352. name: "sf_date",
  353. fieldLabel: "单据日期",
  354. defaultValue: new Date()
  355. }, {
  356. xtype: "employeeDbfindTrigger",
  357. name: "sf_seller",
  358. fieldLabel: "业务员"
  359. }, {
  360. xtype: "hidden",
  361. name: "sf_sellerid",
  362. fieldLabel: "业务员ID"
  363. }, {
  364. xtype: "hidden",
  365. name: "sf_sellercode",
  366. fieldLabel: "业务员编号",
  367. }, {
  368. xtype: "hidden",
  369. name: "creatorId",
  370. fieldLabel: "录入人ID",
  371. readOnly: true
  372. }, {
  373. xtype: "textfield",
  374. name: "creatorName",
  375. fieldLabel: "录入人",
  376. readOnly: true
  377. }, {
  378. xtype: "datefield",
  379. name: "createTime",
  380. fieldLabel: "录入日期",
  381. readOnly: true,
  382. hidden:true,
  383. defaultValue: new Date()
  384. }, {
  385. xtype: "hidden",
  386. name: "updaterId",
  387. fieldLabel: "更新人ID",
  388. readOnly: true
  389. }, {
  390. xtype: "hidden",
  391. name: "updaterName",
  392. fieldLabel: "更新人",
  393. readOnly: true
  394. }, {
  395. xtype: "hidden",
  396. name: "updateTime",
  397. fieldLabel: "更新日期",
  398. readOnly: true,
  399. defaultValue: new Date()
  400. }, {
  401. xtype: "textfield",
  402. name: "sf_auditman",
  403. fieldLabel: "审核人",
  404. readOnly: true
  405. }, {
  406. xtype: "datefield",
  407. name: "sf_auditdate",
  408. fieldLabel: "审核日期",
  409. hidden:true,
  410. readOnly: true
  411. }, {
  412. xtype: "textfield",
  413. name: "sf_text1",
  414. fieldLabel: "自定义字段1",
  415. hidden: true,
  416. initHidden: false
  417. }, {
  418. xtype: "textfield",
  419. name: "sf_text2",
  420. fieldLabel: "自定义字段2",
  421. hidden: true,
  422. initHidden: false
  423. }, {
  424. xtype: "textfield",
  425. name: "sf_text3",
  426. fieldLabel: "自定义字段3",
  427. hidden: true,
  428. initHidden: false
  429. }, {
  430. xtype: "textfield",
  431. name: "sf_text4",
  432. fieldLabel: "自定义字段4",
  433. hidden: true,
  434. initHidden: false
  435. }, {
  436. xtype: "textfield",
  437. name: "sf_text5",
  438. fieldLabel: "自定义字段5",
  439. hidden: true,
  440. initHidden: false
  441. }],
  442. bbar:[{
  443. xtype:'component',
  444. html: saas.util.BaseUtil.getCompanyApp() == 'make-app' ? '*说明: <br> 1、用于没有客户明确的订单,对未来特定时间内,全部产品或特定产品的销售数量与销售金额的估计,备货销售时采用;<br>2、用于生产类型为自制、委外的成品、半成品备料,外购件备料请直接下采购单。':'*说明: 用于没有客户明确的订单,对未来特定时间内,全部产品或特定产品的销售数量与销售金额的估计,备货销售时采用。'
  445. }],
  446. toolBtns: [{
  447. xtype: 'button',
  448. text: '转工单',
  449. hidden: true,
  450. handler: 'turnMake',
  451. bind: {
  452. hidden: '{sf_statuscode!="AUDITED"}'
  453. }
  454. },{
  455. xtype: 'button',
  456. text: '交期运算',
  457. handler: 'runATP'
  458. }]
  459. });
  460. this.callParent();
  461. },
  462. });