inoutStatistics.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. <template>
  2. <div class="app-container">
  3. <formComponent
  4. :formOption="formOption"
  5. :dataList="dataList"
  6. :inDex="inDex"
  7. ref="avatar"
  8. @submitForm="submitForm"
  9. @returnToForm="returnToForm"
  10. />
  11. <listComponent
  12. :tableData="tableData"
  13. @modify="modification"
  14. @deletion="deletion"
  15. @buttonList="buttonList"
  16. @showSearch="showSearch"
  17. @feedback="feedback"
  18. @getList="getList"
  19. :hasPermi="hasPermi"
  20. :tatolLabel="tatolLabel"
  21. :isItHidden="isItHidden"
  22. :customButton="customButton"
  23. :listStyle="listStyle"
  24. :queryList="queryList"
  25. :setRowList="setRowList"
  26. />
  27. <!-- <el-pagination-->
  28. <!-- style="float: right;margin-top: 10px"-->
  29. <!-- @size-change="handleSizeChange"-->
  30. <!-- @current-change="handleCurrentChange"-->
  31. <!-- :page-sizes="[10, 20, 30, 50]"-->
  32. <!-- :page-size="this.formDataList.pageSize"-->
  33. <!-- background-->
  34. <!-- layout="sizes, prev, pager, next"-->
  35. <!-- :total="total">-->
  36. <!-- </el-pagination>-->
  37. <div style="float: right">
  38. <pagination
  39. v-show="total > 0"
  40. :total="total"
  41. :page.sync="formDataList.pageNum"
  42. :limit.sync="formDataList.pageSize"
  43. :page-sizes="[10,100,200,500,1000]"
  44. @pagination="getList"
  45. />
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import { select } from '@/api/system/set'
  51. import{ queryData, company, productName, listExport} from '@/api/reportAnalysis/inoutStatistics'
  52. import Cookies from 'js-cookie'
  53. export default {
  54. name: 'salesStatistics',
  55. data(){
  56. return{
  57. tatolLabel:['数量'],
  58. dataList:{
  59. fBilltype:[{ label: '出库',value:'CK'},{ label: '入库',value:'RK'}],
  60. fFeeType:[],
  61. fFeeid:[],
  62. fCorpid:[],
  63. fBillstatus:[{label:'全部',value:''},{label:'入账',value:'1'},{label:'未入账',value:'2'},]
  64. },
  65. tableData:[],
  66. setRowList:[],
  67. isItHidden: true,
  68. queryList: {
  69. tableName: '出入库统计',
  70. columnList: []
  71. },
  72. hasPermi:{
  73. lookup:['anpin:stockControl:query'],
  74. disappear:['anpin:stockControl:remove']
  75. },
  76. customButton: [
  77. {
  78. type: 'primary',
  79. size: 'mini',
  80. icon: 'el-icon-edit',
  81. name: '导出',
  82. disabled: false,
  83. hasPermi:['anpin:stockControl:tWarehouseInorOutExcePorrt']
  84. }
  85. ],
  86. inDex: 4,
  87. total:0,
  88. formDataList:{
  89. pageSize:10,
  90. pageNum:1,
  91. },
  92. listStyle: [
  93. {
  94. surface: '1',
  95. label: 'serialNumber',
  96. name: '序号',
  97. checked: 0,
  98. width: 100,
  99. onabort: ''
  100. },{
  101. surface: '2',
  102. label: 'fBilltypeName',
  103. name: '出入库类别',
  104. checked: 0,
  105. width: 100,
  106. onabort: ''
  107. },
  108. {
  109. surface: '3',
  110. label: 'fBsdate',
  111. name: '进货时间',
  112. checked: 0,
  113. width: 100,
  114. onabort: ''
  115. },
  116. {
  117. surface: '4',
  118. label: 'fFeetype',
  119. name: '货物类别',
  120. checked: 0,
  121. width: 100,
  122. onabort: ''
  123. },{
  124. surface: '5',
  125. label: 'feeName',
  126. name: '产品名称',
  127. checked: 0,
  128. width: 100,
  129. onabort: ''
  130. },
  131. {
  132. surface: '6',
  133. label: 'fCurrencyName',
  134. name: '规格',
  135. checked: 0,
  136. width: 100,
  137. onabort: ''
  138. },
  139. {
  140. surface: '7',
  141. label: 'fQty',
  142. name: '数量',
  143. checked: 0,
  144. width: 100,
  145. onabort: ''
  146. },
  147. {
  148. surface: '8',
  149. label: 'corpName',
  150. name: '供货商',
  151. checked: 0,
  152. width: 100,
  153. onabort: ''
  154. },
  155. {
  156. surface: '9',
  157. label: 'fManage',
  158. name: '供货人',
  159. checked: 0,
  160. width: 100,
  161. onabort: ''
  162. },
  163. {
  164. surface: '10',
  165. label: 'fTel',
  166. name: '联系电话',
  167. checked: 0,
  168. width: 100,
  169. onabort: ''
  170. },
  171. {
  172. surface: '11',
  173. label: 'tProductdate',
  174. name: '生产日期',
  175. checked: 0,
  176. width: 100,
  177. onabort: ''
  178. },{
  179. surface: '12',
  180. label: 'fLotno',
  181. name: '批号',
  182. checked: 0,
  183. width: 100,
  184. onabort: ''
  185. },
  186. {
  187. surface: '13',
  188. label: 'quality',
  189. name: '保质期限',
  190. checked: 0,
  191. width: 100,
  192. onabort: ''
  193. },
  194. {
  195. surface: '14',
  196. label: 'fStoreEnvName',
  197. name: '保存条件',
  198. checked: 0,
  199. width: 100,
  200. onabort: ''
  201. },
  202. {
  203. surface: '15',
  204. label: 'fIsfillesName',
  205. name: '索证索票',
  206. checked: 0,
  207. width: 100,
  208. onabort: ''
  209. },
  210. {
  211. surface: '16',
  212. label: 'purchaseName',
  213. name: '采购人',
  214. checked: 0,
  215. width: 100,
  216. onabort: ''
  217. },
  218. {
  219. surface: '17',
  220. label: 'checkoutName',
  221. name: '感官',
  222. checked: 0,
  223. width: 100,
  224. onabort: ''
  225. },
  226. {
  227. surface: '18',
  228. label: 'checkoutName',
  229. name: '数量',
  230. checked: 0,
  231. width: 100,
  232. onabort: ''
  233. },
  234. {
  235. surface: '19',
  236. label: 'checkName',
  237. name: '验收人',
  238. checked: 0,
  239. width: 100,
  240. onabort: ''
  241. }
  242. ],
  243. formOption:[
  244. {
  245. span: 6,
  246. label: 'fBilltype',
  247. name: '统计类型',
  248. inputType: 1,
  249. width: 200,
  250. labelSize: '80',
  251. rules: [{ required: false, message: ' ' }]
  252. },
  253. {
  254. span: 6,
  255. label: 'fCorpid',
  256. name: '供应商',
  257. inputType: 1,
  258. width: 200,
  259. labelSize: '80',
  260. rules: [{ required: false, message: ' ' }]
  261. },
  262. {
  263. span: 6,
  264. label: 'cLoadDate',
  265. name: '统计期间',
  266. inputType: 3,
  267. width: 240,
  268. labelSize: '82',
  269. rules: [{ required: false, message: ' ' }]
  270. },
  271. {
  272. span: 6,
  273. label: 'fFeeType',
  274. name: '物资类别',
  275. inputType: 1,
  276. width: 200,
  277. labelSize: '80',
  278. rules: [{ required: false, message: ' ' }]
  279. },
  280. {
  281. span: 6,
  282. label: 'fFeeid',
  283. name: '产品名称',
  284. inputType: 1,
  285. width: 200,
  286. labelSize: '80',
  287. rules: [{ required: false, message: ' ' }]
  288. },
  289. {
  290. span: 6,
  291. label: 'fBillstatus',
  292. name: '状态',
  293. inputType: 1,
  294. width: 200,
  295. labelSize: '80',
  296. rules: [{ required: false, message: ' ' }]
  297. },
  298. ]
  299. }
  300. },
  301. created() {
  302. this.queryList.columnList = this.listStyle
  303. this.getDicts("data_cost_attribute").then((response) => {
  304. for(let item in response.data){
  305. this.dataList.fFeeType.push({
  306. value: response.data[item].dictValue,
  307. label:response.data[item].dictLabel
  308. })
  309. }
  310. });
  311. company(1).then(res => {
  312. for (let item in res.data) {
  313. this.dataList.fCorpid.push({
  314. label: res.data[item].fName,
  315. value: res.data[item].fId
  316. })
  317. }
  318. console.log(this.dataList)
  319. })
  320. productName().then(res => {
  321. console.log(res)
  322. if (res.code === 200) {
  323. for (let item in res.rows) {
  324. this.dataList.fFeeid.push({
  325. label: res.rows[item].fName,
  326. value: res.rows[item].fId,
  327. })
  328. }
  329. }
  330. })
  331. let data = {
  332. tableName: this.queryList.tableName,
  333. userId: Cookies.get('userName')
  334. }
  335. this.getRow(data)
  336. this.getList()
  337. },
  338. methods:{
  339. getRow(data,list) {
  340. select(data).then((res) => {
  341. if (res.data.length != 0) {
  342. this.queryList.columnList = res.data.filter((e) => e.checked == 0)
  343. this.queryList.columnList = res.data
  344. this.setRowList = res.data
  345. this.queryList.columnList = this.queryList.columnList.filter((e) => e.checked == 0)
  346. // this.waitFor = true
  347. } else {
  348. this.$set(this.queryList, 'columnList', this.$options.data().listStyle)
  349. this.setRowList = this.$options.data().listStyle
  350. }
  351. this.isItHidden = true
  352. // this.inDex = this.formOption.length
  353. this.inDex = 4
  354. })
  355. },
  356. //修改
  357. modification(scope) {
  358. console.log(scope)
  359. },
  360. //删除
  361. deletion(scope){},
  362. //所以按钮
  363. buttonList(row){
  364. console.log(row)
  365. switch (row.name){
  366. case '导出':
  367. const queryParams = this.formDataList;
  368. this.$confirm("是否确认导出所有出入库数据项?", "警告", {
  369. confirmButtonText: "确定",
  370. cancelButtonText: "取消",
  371. type: "warning",
  372. })
  373. .then(function () {
  374. return listExport(queryParams);
  375. })
  376. .then((response) => {
  377. this.download(response.msg);
  378. });
  379. break
  380. }
  381. },
  382. // 显示搜索条件、点击后会调用此方法
  383. showSearch() {
  384. console.log('到我了')
  385. this.searchWhether = !this.searchWhether
  386. },
  387. //搜索、重置、展开
  388. feedback(res) {
  389. console.log(res)
  390. if (res == '展开') {
  391. if (this.inDex == 4) {
  392. this.inDex = this.formOption.length
  393. } else {
  394. this.inDex = 4
  395. }
  396. } else if (res == '搜索') {
  397. this.$refs.avatar.submitForm()
  398. } else if (res == '重置') {
  399. this.$refs.avatar.form = {}
  400. this.$refs.avatar.submitForm()
  401. }
  402. },
  403. //点击刷新会调用此方法
  404. getList() {
  405. console.log('到我了2')
  406. // this.feedback('重置')
  407. this.query(this.formDataList)
  408. },
  409. //查询主页列数据
  410. query(data) {
  411. queryData(data).then(res => {
  412. this.tableData = res.rows
  413. this.total = res.total
  414. console.log(this.total)
  415. })
  416. },
  417. submitForm() {
  418. this.formDataList = this.$refs.avatar.form
  419. this.query(this.formDataList)
  420. },
  421. returnToForm(row) {
  422. console.log(row, 111)
  423. },
  424. //分页
  425. handleSizeChange(val) {
  426. this.formDataList.pageSize = val
  427. this.query(this.formDataList)
  428. },
  429. handleCurrentChange(val) {
  430. this.formDataList.pageNum = val
  431. this.query(this.formDataList)
  432. },
  433. }
  434. }
  435. </script>
  436. <style scoped lang="scss">
  437. .app-container ::v-deep .el-form-item {
  438. margin-bottom: 4px;
  439. }
  440. </style>