QueryPanel2.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. Ext.define('make.view.osmake.osMakeCheckIn.QueryPanel_2', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'osmake-osmakecheckin-querypanel-2',
  4. controller: 'osmake-osmakecheckin-querypanel',
  5. viewModel: {
  6. extend: 'saas.view.core.query.QueryPanelModel',
  7. data: {
  8. form: {}, // 查询字段记录
  9. addEnable: false, // 显示新增按钮
  10. auditEnable: false, // 显示审核按钮
  11. printEnable: false, // 显示打印按钮
  12. importEnable: false, // 显示导入按钮
  13. exportEnable: true, // 显示导出按钮
  14. closeEnable: false, // 显示关闭按钮
  15. deleteEnable: false, // 显示删除按钮
  16. deleteDisable:false, //删除按钮是否可使用
  17. openAudit:false,//单独显示审核按钮
  18. openUnAudit:true,//单独显示反审核按钮
  19. cancelEnable:false, //单独显示取消
  20. openEnable:false, //显示开启 针对已取消列表
  21. configurable: true, // 允许列设置
  22. }
  23. },
  24. viewName: 'osmake-osmakecheckin-querypanel',
  25. caller: 'OsMakeIn',
  26. //importUploadPath: '/api/osmake/osmakeReturn/saveToFormal',
  27. initComponent: function () {
  28. var me = this;
  29. Ext.apply(me, {
  30. queryFormItems: [ {
  31. xtype: 'condatefield',
  32. name: 'pi_date',
  33. fieldLabel: '日期',
  34. columnWidth: 0.5,
  35. operation: 'between',
  36. },{
  37. xtype: 'multiqueryField',
  38. columnWidth: 0.4,
  39. name: 'multi_query',
  40. querys: {
  41. "Vend":{"field": "pi_vendname", "dbfinds": [{//仓库
  42. from: 've_name',
  43. to: 'pi_vendname'
  44. }]},
  45. "BillCode": {"field": "pi_inoutno" ,"desc": "验收单号"},
  46. "MakeCode": {"field": "prodiodetail.pd_ordercode" ,"desc": "外协单号"},
  47. "Prod": {"field": "pr_code", "dbfinds": [{//物料
  48. from: 'pr_code',
  49. to: 'pr_code'
  50. },{
  51. from: 'pr_detail',
  52. to: 'pr_detail'
  53. }]},
  54. "Emp":{"field": "prodinout.creatorName", "dbfinds": [{
  55. from: 'em_name',
  56. to: 'prodinout.creatorName'
  57. }]},
  58. },
  59. setShowDetail: function(v){
  60. this.showDetail = (v == 'Prod' ||v=='MakeCode');
  61. },
  62. }],
  63. moreQueryFormItems: [{
  64. xtype: 'condatefield',
  65. name: 'pi_date',
  66. fieldLabel: '单据日期',
  67. columnWidth: 1
  68. },{
  69. xtype: 'vendorDbfindTrigger',
  70. name: 'pi_vendname',
  71. fieldLabel: '外协厂商'
  72. },{
  73. xtype: 'combobox',
  74. name: 'pi_currency',
  75. fieldLabel: '币别',
  76. queryMode: 'local',
  77. displayField: 'pi_currency',
  78. valueField: 'pi_currency',
  79. emptyText :'',
  80. editable:false,
  81. store: Ext.create('Ext.data.ArrayStore', {
  82. fields: ['pi_currency', 'pi_currency'],
  83. data: [
  84. ["RMB", "RMB"],
  85. ["USD", "USD"],
  86. ["HKD", "HKD"]
  87. ]
  88. }),
  89. getCondition: function(value) {
  90. if(!value) {
  91. return '1=1';
  92. }else {
  93. return 'pi_currency=\'' + value + '\'';
  94. }
  95. }
  96. },{
  97. xtype: 'warehouseDbfindTrigger',
  98. name: 'pi_whname',
  99. fieldLabel: '仓库'
  100. },{
  101. xtype: 'productDbfindTrigger',
  102. name: 'prodiodetail.pd_prodcode',
  103. showDetail: true,
  104. fieldLabel: '物料编号'
  105. },{
  106. xtype: 'textfield',
  107. name: 'pr_detail',
  108. fieldLabel: '产品名称',
  109. readOnly: true,
  110. }, {
  111. xtype: 'textfield',
  112. name: 'pr_orispeccode',
  113. fieldLabel: '产品型号',
  114. readOnly: true,
  115. }, {
  116. editable: false,
  117. xtype: "remotecombo",
  118. storeUrl: '/api/document/productbrand/getCombo',
  119. name: "pr_brand",
  120. fieldLabel: "厂家/品牌",
  121. hiddenBtn:true
  122. },{
  123. xtype: 'combobox',
  124. name: 'pi_statuscode',
  125. fieldLabel: '审核状态',
  126. queryMode: 'local',
  127. displayField: 'pi_status',
  128. valueField: 'pi_statuscode',
  129. emptyText :'全部',
  130. editable:false,
  131. store: Ext.create('Ext.data.ArrayStore', {
  132. fields: ['pi_statuscode', 'pi_status'],
  133. data: [
  134. ["ALL", "全部"],
  135. ["AUDITED", "已审核"],
  136. ["UNAUDITED", "未审核"]
  137. ]
  138. }),
  139. getCondition: function(value) {
  140. if(value == 'ALL') {
  141. return '1=1';
  142. }else {
  143. return 'pi_statuscode=\'' + value + '\'';
  144. }
  145. }
  146. }, {
  147. xtype: 'employeeDbfindTrigger',
  148. name: 'creatorName',
  149. fieldLabel: '录入人',
  150. emptyText:'请输入账户名称或姓名',
  151. getCondition: function(value) {
  152. if(!value) {
  153. return '1=1';
  154. }else {
  155. return 'prodinout.creatorName like\'%' + value + '%\'';
  156. }
  157. }
  158. }, {
  159. xtype: 'employeeDbfindTrigger',
  160. name: 'pi_auditman',
  161. fieldLabel: '审核人',
  162. emptyText:'请输入账户名称或姓名',
  163. }],
  164. queryGridConfig: {
  165. idField: 'id',
  166. codeField: 'pi_inoutno',
  167. mainIdField:'_id',
  168. detailIdField:'pd_id',
  169. addTitle: me.addTitle,
  170. addXtype: me.addXtype,
  171. defaultCondition: me.defaultCondition,
  172. baseVastUrl: me.baseVastUrl,
  173. caller: 'OsMakeIn',
  174. baseColumn: [{
  175. text: 'id',
  176. dataIndex: 'id',
  177. hidden: true,
  178. xtype: 'numbercolumn'
  179. }, {
  180. text: '验收单号',
  181. dataIndex: 'pi_inoutno',
  182. width: 150
  183. }, {
  184. text: '单据日期',
  185. dataIndex: 'pi_date',
  186. xtype: 'datecolumn',
  187. width: 110
  188. }, {
  189. text: '外协厂商',
  190. dataIndex: 'pi_vendname',
  191. width: 200
  192. }, {
  193. text: '价税合计(元)',
  194. xtype: 'numbercolumn',
  195. dataIndex: 'pi_total',
  196. width: 110,
  197. renderer: function(v, m, r) {
  198. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  199. }
  200. }, {
  201. text: '金额(元)',
  202. xtype: 'numbercolumn',
  203. dataIndex: 'pi_nettotal',
  204. width: 110,
  205. renderer: function(v, m, r) {
  206. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  207. }
  208. }, {
  209. text: '币种',
  210. dataIndex: 'pi_currency',
  211. align: 'center',
  212. width: 65,
  213. }, {
  214. text: '审核状态',
  215. align: 'center',
  216. dataIndex: 'pi_status',
  217. width: 80
  218. }, {
  219. text: '录入人',
  220. align: 'center',
  221. dataIndex: 'creatorName',
  222. width: 100
  223. }, {
  224. text: '审核人',
  225. align: 'center',
  226. dataIndex: 'pi_auditman',
  227. width: 100
  228. }, {
  229. text: '审核日期',
  230. align: 'center',
  231. dataIndex: 'pi_auditdate',
  232. xtype: 'datecolumn',
  233. width: 100
  234. }, {
  235. text: '开票金额',
  236. dataIndex: 'pi_billamount',
  237. xtype: 'numbercolumn',
  238. width: (saas.util.BaseUtil.getBillOutSource("BillOutAPSource") == 'PRODIOAUTO')? 0.0:110,
  239. renderer: function(v, m, r) {
  240. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  241. }
  242. }, {
  243. text: '开票状态',
  244. dataIndex: 'pi_billstatus',
  245. width: (saas.util.BaseUtil.getBillOutSource("BillOutAPSource") == 'PRODIOAUTO')? 0.0:100
  246. }, {
  247. text: '备注',
  248. dataIndex: 'pi_remark',
  249. width: 250
  250. }],
  251. relativeColumn: [{
  252. text: 'id',
  253. dataIndex: 'pd_id',
  254. xtype: 'numbercolumn',
  255. hidden: true
  256. }, {
  257. text: '入库单号',
  258. dataIndex: 'pi_inoutno',
  259. width: 150
  260. }, {
  261. text: '单据日期',
  262. dataIndex: 'pi_date',
  263. xtype: 'datecolumn',
  264. width: 110
  265. }, {
  266. text: '供应商名称',
  267. dataIndex: 'pi_vendname',
  268. width: 200,
  269. hidden: true
  270. }, {
  271. text: '审核状态',
  272. align: 'center',
  273. dataIndex: 'pi_status',
  274. width: 80
  275. }, {
  276. text: '物料编号',
  277. dataIndex: 'pr_code',
  278. width: 150,
  279. }, {
  280. text: '厂家/品牌',
  281. dataIndex: 'pr_brand',
  282. width: 100
  283. }, {
  284. text: '物料名称',
  285. dataIndex: 'pr_detail',
  286. width: 150
  287. }, {
  288. text: '型号',
  289. dataIndex: 'pr_orispeccode',
  290. width: 200,
  291. renderer: saas.util.RenderUtil['renderer_prod']
  292. }, {
  293. text: '规格',
  294. dataIndex: 'pr_spec',
  295. width: 200
  296. }, {
  297. text: '仓库',
  298. dataIndex: 'pd_whname',
  299. width: 120
  300. }, {
  301. text: '数量',
  302. dataIndex: 'pd_inqty',
  303. xtype: 'numbercolumn',
  304. width: 110,
  305. renderer: function(v, m, r) {
  306. return saas.util.BaseUtil.numberFormat(v, 6, true);
  307. }
  308. }, {
  309. text: '单位',
  310. dataIndex: 'pr_unit',
  311. width: 65
  312. }, {
  313. text: '单价(元)',
  314. dataIndex: 'pd_netprice',
  315. xtype: 'numbercolumn',
  316. renderer: function(v, m, r) {
  317. return saas.util.BaseUtil.numberFormat(v, 8, true);
  318. },
  319. width: 110
  320. }, {
  321. text: '含税单价(元)',
  322. dataIndex: 'pd_orderprice',
  323. xtype: 'numbercolumn',
  324. renderer: function(v, m, r) {
  325. return saas.util.BaseUtil.numberFormat(v, 8, true);
  326. },
  327. width: 110
  328. }, {
  329. text: '金额(元)',
  330. dataIndex: 'pd_nettotal',
  331. xtype: 'numbercolumn',
  332. width: 110,
  333. renderer: function(v, m, r) {
  334. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  335. },
  336. }, {
  337. text: '税额(元)',
  338. dataIndex: 'pd_taxamount',
  339. xtype: 'numbercolumn',
  340. width: 110,
  341. renderer: function (v, g, r) {
  342. v = (r.data["pd_ordertotal"] || 0.0) - (r.data["pd_nettotal"] || 0.0);
  343. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  344. }
  345. }, {
  346. text: '价税合计(元)',
  347. dataIndex: 'pd_ordertotal',
  348. xtype: 'numbercolumn',
  349. width: 110,
  350. renderer: function(v, m, r) {
  351. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  352. },
  353. }, {
  354. text: 'B2B上传状态',
  355. dataIndex: 'b2bStatus',
  356. textAlign: 'center',
  357. width:120,
  358. hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  359. initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  360. renderer: function(v) {
  361. return v ? v : '待上传'
  362. }
  363. }, {
  364. text: '开票数量',
  365. dataIndex: 'pd_auditbillqty',
  366. xtype: 'numbercolumn',
  367. width: (saas.util.BaseUtil.getBillOutSource("BillOutAPSource") == 'PRODIOAUTO')? 0.0:110,
  368. renderer: function(v, m, r) {
  369. return saas.util.BaseUtil.numberFixFormat(v, 6, true);
  370. }
  371. }, {
  372. text: '开票金额',
  373. dataIndex: 'pd_auditbillamount',
  374. xtype: 'numbercolumn',
  375. width: (saas.util.BaseUtil.getBillOutSource("BillOutAPSource") == 'PRODIOAUTO')? 0.0:110,
  376. renderer: function(v, m, r) {
  377. return saas.util.BaseUtil.numberFixFormat(v, 2, true);
  378. }
  379. }, {
  380. text: '开票状态',
  381. dataIndex: 'pi_billstatus',
  382. width: (saas.util.BaseUtil.getBillOutSource("BillOutAPSource") == 'PRODIOAUTO')? 0.0:100
  383. }, {
  384. text: '备注',
  385. dataIndex: 'pd_remark',
  386. width: 250
  387. }]
  388. }
  389. });
  390. this.callParent(arguments);
  391. },
  392. });