QueryPanel1.js 14 KB

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