basic-data.js 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. /*******************************************************************************
  2. * Copyright(c) 2022 dongke All rights reserved. / Confidential
  3. * 类的信息:
  4. * 1.程序名称:
  5. * 编辑履历:
  6. * 作者 日期 版本 修改内容
  7. * 于继渤 2024-1-23 1.00 基础资料
  8. *******************************************************************************/
  9. Page({
  10. /**
  11. * 页面的初始数据
  12. */
  13. data: {
  14. sideKey: 0,
  15. listTitle: '',
  16. showPopup: false,
  17. leftData: [],
  18. showPopupItem: {},
  19. fieldData: {},
  20. statusItem: {
  21. text: '全部',
  22. value: -1
  23. },
  24. statusList: [
  25. { checked: false, text: '有效', value: 1},
  26. { checked: false, text: '无效', value: 0 },
  27. { checked: true, text: '全部', value: -1 },
  28. ], //状态
  29. fieldList: [
  30. {
  31. typeName: '仓库档案',
  32. warehouseCode: '仓库编码',
  33. warehouseName: '仓库名称',
  34. supervisorName: '仓库主管'
  35. },
  36. {
  37. typeName: '销售渠道',
  38. channelCode: '渠道编码',
  39. channelName: '渠道名称'
  40. },
  41. {
  42. typeName: '收入类别',
  43. incomeCode: '收入编码',
  44. incomeName: '收入名称'
  45. },
  46. {
  47. typeName: '支出类别',
  48. expenditureCode: '支出编码',
  49. expenditureName: '支出名称'
  50. },
  51. {
  52. typeName: '入库原因',
  53. reasonCode: '原因编码',
  54. reasonName: '原因名称'
  55. },
  56. {
  57. typeName: '出库原因',
  58. reasonCode: '原因编码',
  59. reasonName: '原因名称'
  60. },
  61. {
  62. typeName: '收付方式',
  63. paymentCode: '收付编码',
  64. paymentName: '收付名称'
  65. },
  66. ], //字段渲染
  67. // 渲染数据
  68. test00: [{
  69. warehouseCode: 'CK00001',
  70. warehouseName: '运营主仓',
  71. supervisorName: '王仓管员/15640556650',
  72. flagValue: true
  73. },
  74. {
  75. warehouseCode: 'CK00002',
  76. warehouseName: '红星店面仓库',
  77. supervisorName: '王店长/15640556650',
  78. flagValue: false
  79. },
  80. {
  81. warehouseCode: 'CK00003',
  82. warehouseName: '红星店面仓库',
  83. supervisorName: '王店长/15640556650',
  84. flagValue: true
  85. }],
  86. test01: [
  87. {
  88. channelCode: 'QD00001',
  89. channelName: '零售',
  90. flagValue: true
  91. },
  92. {
  93. channelCode: 'QD00002',
  94. channelName: '家装',
  95. flagValue: true
  96. },
  97. {
  98. channelCode: 'QD00003',
  99. channelName: '分销',
  100. flagValue: true
  101. },
  102. {
  103. channelCode: 'QD00004',
  104. channelName: '工程',
  105. flagValue: true
  106. },
  107. {
  108. channelCode: 'QD00005',
  109. channelName: '其他',
  110. flagValue: true
  111. }
  112. ],
  113. test02: [
  114. {
  115. incomeCode: 'SR00001',
  116. incomeName: '配送费',
  117. flagValue: true
  118. },
  119. {
  120. incomeCode: 'SR00002',
  121. incomeName: '安装费',
  122. flagValue: true
  123. },
  124. {
  125. incomeCode: 'SR00003',
  126. incomeName: '加工费',
  127. flagValue: true
  128. },
  129. {
  130. incomeCode: 'SR00004',
  131. incomeName: '拆旧费',
  132. flagValue: true
  133. },
  134. {
  135. incomeCode: 'SR00005',
  136. incomeName: '其他收入',
  137. flagValue: true
  138. }
  139. ],
  140. test03: [
  141. {
  142. expenditureCode: 'SR00001',
  143. expenditureName: '房租费',
  144. flagValue: true
  145. },
  146. {
  147. expenditureCode: 'SR00002',
  148. expenditureName: '水电费',
  149. flagValue: true
  150. },
  151. {
  152. expenditureCode: 'SR00003',
  153. expenditureName: '送货费',
  154. flagValue: true
  155. },
  156. {
  157. expenditureCode: 'SR00004',
  158. expenditureName: '员工工资',
  159. flagValue: true
  160. },
  161. {
  162. expenditureCode: 'SR00005',
  163. expenditureName: '促销活动费',
  164. flagValue: true
  165. }
  166. ],
  167. test04: [
  168. {
  169. reasonCode: 'RK00001',
  170. reasonName: '期初入库',
  171. flagValue: true
  172. },
  173. {
  174. reasonCode: 'RK00002',
  175. reasonName: '其他入库',
  176. flagValue: true
  177. },
  178. {
  179. reasonCode: 'RK00003',
  180. reasonName: '采购入库',
  181. flagValue: true
  182. },
  183. {
  184. reasonCode: 'RK00004',
  185. reasonName: '销售回库',
  186. flagValue: true
  187. }
  188. ],
  189. test05: [
  190. {
  191. reasonCode: 'CK00001',
  192. reasonName: '销售出库',
  193. flagValue: true
  194. },
  195. {
  196. reasonCode: 'CK00002',
  197. reasonName: '其他出库',
  198. flagValue: true
  199. },
  200. {
  201. reasonCode: 'CK00003',
  202. reasonName: '采购退货出库',
  203. flagValue: true
  204. },
  205. {
  206. reasonCode: 'CK00004',
  207. reasonName: '调货出库',
  208. flagValue: true
  209. }
  210. ],
  211. test06: [
  212. {
  213. paymentCode: 'SF00001',
  214. paymentName: '微信',
  215. flagValue: true
  216. },
  217. {
  218. paymentCode: 'SF00002',
  219. paymentName: '现金',
  220. flagValue: true
  221. },
  222. {
  223. paymentCode: 'SF00003',
  224. paymentName: '银行转账',
  225. flagValue: true
  226. },
  227. {
  228. paymentCode: 'SF00004',
  229. paymentName: '支付宝',
  230. flagValue: true
  231. }
  232. ],
  233. },
  234. dropdownSwitchCommit(e) {
  235. console.log(e)
  236. },
  237. /**
  238. * @desc : 分类切换
  239. * @author : 于继渤
  240. * @date : 2022/5/26 20:16
  241. */
  242. changeSidebar(e) {
  243. console.log(e)
  244. let id = this.data.leftData[e.detail].id
  245. let name = this.data.leftData[e.detail].name
  246. let fieldList = this.data.fieldList
  247. let tableData = this.data.tableData
  248. let sidebarList = fieldList.filter(res => {
  249. return res.typeName == name
  250. })
  251. if (name == '仓库档案') {
  252. tableData = this.data.test00
  253. }
  254. if (name == '销售渠道') {
  255. tableData = this.data.test01
  256. }
  257. if (name == '收入类别') {
  258. tableData = this.data.test02
  259. }
  260. if (name == '支出类别') {
  261. tableData = this.data.test03
  262. }
  263. if (name == '入库原因') {
  264. tableData = this.data.test04
  265. }
  266. if (name == '出库原因') {
  267. tableData = this.data.test05
  268. }
  269. if (name == '收付方式') {
  270. tableData = this.data.test06
  271. }
  272. this.setData({
  273. sideKey: e.detail,
  274. specsId: e.detail.id,
  275. fieldData: sidebarList[0],
  276. tableData: tableData
  277. })
  278. this.setData({
  279. searchText: ''
  280. })
  281. // 查询
  282. // this.doSearch()
  283. },
  284. /**
  285. * @desc : 左滑功能
  286. * @author : 于继渤
  287. * @date : 2024/1/23 9:16
  288. */
  289. onCloseDel(e) {
  290. console.log(e)
  291. },
  292. /**
  293. * @desc : 列表对象点击
  294. * @author : 于继渤
  295. * @date : 2024/1/23 9:16
  296. */
  297. toDetail(e) {
  298. console.log(e)
  299. let index = e.currentTarget.dataset.index
  300. let tableData = this.data.tableData
  301. this.setData({
  302. showPopup: true,
  303. showPopupItem: tableData[index]
  304. })
  305. },
  306. /**
  307. * @desc : 关闭弹窗
  308. * @author : 于继渤
  309. * @date : 2024/1/23 9:16
  310. */
  311. onClosePopup() {
  312. this.setData({
  313. showPopup: false
  314. })
  315. },
  316. /**
  317. * @desc : 新建
  318. * @author : 于继渤
  319. * @date : 2024/1/23 9:16
  320. */
  321. toAdd() {
  322. this.setData({
  323. showPopupItem: {},
  324. showPopup: true
  325. })
  326. },
  327. /**
  328. * 生命周期函数--监听页面加载
  329. */
  330. onLoad(options) {
  331. let _this = this;
  332. wx.getSystemInfo({
  333. success: function (res) {
  334. _this.setData({
  335. windowHeight: res.windowHeight,
  336. windowWidth: res.windowWidth
  337. })
  338. }
  339. })
  340. let leftData = [
  341. {
  342. id: 1,
  343. name: '仓库档案'
  344. },
  345. {
  346. id: 1,
  347. name: '销售渠道'
  348. },
  349. {
  350. id: 1,
  351. name: '收入类别'
  352. },
  353. {
  354. id: 1,
  355. name: '支出类别'
  356. },
  357. {
  358. id: 1,
  359. name: '入库原因'
  360. },
  361. {
  362. id: 1,
  363. name: '出库原因'
  364. },
  365. {
  366. id: 1,
  367. name: '收付方式'
  368. },
  369. ]
  370. let tableData = this.data.test00
  371. this.setData({
  372. leftData: leftData,
  373. tableData: tableData,
  374. listTitle: leftData[0].name,
  375. fieldData: this.data.fieldList[0]
  376. })
  377. },
  378. /**
  379. * 生命周期函数--监听页面初次渲染完成
  380. */
  381. onReady() {
  382. },
  383. /**
  384. * 生命周期函数--监听页面显示
  385. */
  386. onShow() {
  387. },
  388. /**
  389. * 生命周期函数--监听页面隐藏
  390. */
  391. onHide() {
  392. },
  393. /**
  394. * 生命周期函数--监听页面卸载
  395. */
  396. onUnload() {
  397. },
  398. /**
  399. * 页面相关事件处理函数--监听用户下拉动作
  400. */
  401. onPullDownRefresh() {
  402. },
  403. /**
  404. * 页面上拉触底事件的处理函数
  405. */
  406. onReachBottom() {
  407. },
  408. /**
  409. * 用户点击右上角分享
  410. */
  411. onShareAppMessage() {
  412. }
  413. })