basic-data.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  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. typeName: '客户来源',
  68. sourceCode: '来源编码',
  69. sourceName: '来源名称'
  70. },
  71. {
  72. typeName: '客户标签'
  73. },
  74. ], //字段渲染
  75. // 渲染数据
  76. test00: [{
  77. warehouseCode: 'CK00001',
  78. warehouseName: '运营主仓',
  79. supervisorName: '王仓管员/15640556650',
  80. flagValue: true,
  81. defFlag: true
  82. },
  83. {
  84. warehouseCode: 'CK00002',
  85. warehouseName: '红星店面仓库',
  86. supervisorName: '王店长/15640556650',
  87. flagValue: false
  88. },
  89. {
  90. warehouseCode: 'CK00003',
  91. warehouseName: '红星店面仓库',
  92. supervisorName: '王店长/15640556650',
  93. flagValue: true
  94. }],
  95. test01: [
  96. {
  97. channelCode: 'QD00001',
  98. channelName: '零售',
  99. flagValue: true,
  100. defFlag: true
  101. },
  102. {
  103. channelCode: 'QD00002',
  104. channelName: '家装',
  105. flagValue: true
  106. },
  107. {
  108. channelCode: 'QD00003',
  109. channelName: '分销',
  110. flagValue: true
  111. },
  112. {
  113. channelCode: 'QD00004',
  114. channelName: '工程',
  115. flagValue: true
  116. },
  117. {
  118. channelCode: 'QD00005',
  119. channelName: '其他',
  120. flagValue: true
  121. }
  122. ],
  123. test02: [
  124. {
  125. incomeCode: 'SR00001',
  126. incomeName: '配送费',
  127. flagValue: true,
  128. defFlag: true
  129. },
  130. {
  131. incomeCode: 'SR00002',
  132. incomeName: '安装费',
  133. flagValue: true
  134. },
  135. {
  136. incomeCode: 'SR00003',
  137. incomeName: '加工费',
  138. flagValue: true
  139. },
  140. {
  141. incomeCode: 'SR00004',
  142. incomeName: '拆旧费',
  143. flagValue: true
  144. },
  145. {
  146. incomeCode: 'SR00005',
  147. incomeName: '其他收入',
  148. flagValue: true
  149. }
  150. ],
  151. test03: [
  152. {
  153. expenditureCode: 'SR00001',
  154. expenditureName: '房租费',
  155. flagValue: true,
  156. defFlag: true
  157. },
  158. {
  159. expenditureCode: 'SR00002',
  160. expenditureName: '水电费',
  161. flagValue: true
  162. },
  163. {
  164. expenditureCode: 'SR00003',
  165. expenditureName: '送货费',
  166. flagValue: true
  167. },
  168. {
  169. expenditureCode: 'SR00004',
  170. expenditureName: '员工工资',
  171. flagValue: true
  172. },
  173. {
  174. expenditureCode: 'SR00005',
  175. expenditureName: '促销活动费',
  176. flagValue: true
  177. }
  178. ],
  179. test04: [
  180. {
  181. reasonCode: 'RK00001',
  182. reasonName: '期初入库',
  183. flagValue: true,
  184. defFlag: true
  185. },
  186. {
  187. reasonCode: 'RK00002',
  188. reasonName: '其他入库',
  189. flagValue: true
  190. },
  191. {
  192. reasonCode: 'RK00003',
  193. reasonName: '采购入库',
  194. flagValue: true
  195. },
  196. {
  197. reasonCode: 'RK00004',
  198. reasonName: '销售回库',
  199. flagValue: true
  200. }
  201. ],
  202. test05: [
  203. {
  204. reasonCode: 'CK00001',
  205. reasonName: '销售出库',
  206. flagValue: true,
  207. defFlag: true
  208. },
  209. {
  210. reasonCode: 'CK00002',
  211. reasonName: '其他出库',
  212. flagValue: true
  213. },
  214. {
  215. reasonCode: 'CK00003',
  216. reasonName: '采购退货出库',
  217. flagValue: true
  218. },
  219. {
  220. reasonCode: 'CK00004',
  221. reasonName: '调货出库',
  222. flagValue: true
  223. }
  224. ],
  225. test06: [
  226. {
  227. paymentCode: 'SF00001',
  228. paymentName: '微信',
  229. flagValue: true,
  230. defFlag: true
  231. },
  232. {
  233. paymentCode: 'SF00002',
  234. paymentName: '现金',
  235. flagValue: true
  236. },
  237. {
  238. paymentCode: 'SF00003',
  239. paymentName: '银行转账',
  240. flagValue: true
  241. },
  242. {
  243. paymentCode: 'SF00004',
  244. paymentName: '支付宝',
  245. flagValue: true
  246. }
  247. ],
  248. test07: [
  249. {
  250. sourceCode: 'QD00001',
  251. sourceName: '零售',
  252. flagValue: true,
  253. defFlag: true
  254. },
  255. {
  256. sourceCode: 'QD00002',
  257. sourceName: '家装',
  258. flagValue: true
  259. },
  260. {
  261. sourceCode: 'QD00003',
  262. sourceName: '分销',
  263. flagValue: true
  264. },
  265. {
  266. sourceCode: 'QD00004',
  267. sourceName: '工程',
  268. flagValue: true
  269. }
  270. ],
  271. test08: [
  272. {
  273. code: '客户级别',
  274. list:[
  275. {
  276. code:'A类',
  277. flagValue:true,
  278. },
  279. {
  280. code:'B类',
  281. flagValue:true,
  282. }
  283. ],
  284. },
  285. {
  286. code: '房屋类型',
  287. list:[
  288. {
  289. code:'两居室',
  290. flagValue:true,
  291. },
  292. {
  293. code:'三居室',
  294. flagValue:true,
  295. }
  296. ],
  297. },
  298. {
  299. code: '装修风格',
  300. list:[
  301. {
  302. code:'中式',
  303. flagValue:true,
  304. },
  305. {
  306. code:'欧式',
  307. flagValue:true,
  308. },
  309. ],
  310. },
  311. ],
  312. },
  313. dropdownSwitchCommit(e) {
  314. console.log(e)
  315. },
  316. /**
  317. * @desc : 分类切换
  318. * @author : 于继渤
  319. * @date : 2022/5/26 20:16
  320. */
  321. changeSidebar(e) {
  322. console.log(e)
  323. let id = this.data.leftData[e.detail].id
  324. let name = this.data.leftData[e.detail].name
  325. console.log(name)
  326. let fieldList = this.data.fieldList
  327. let tableData = this.data.tableData
  328. let sidebarList = fieldList.filter(res => {
  329. return res.typeName == name
  330. })
  331. if (name == '仓库档案') {
  332. tableData = this.data.test00
  333. }
  334. if (name == '销售渠道') {
  335. tableData = this.data.test01
  336. }
  337. if (name == '收入类别') {
  338. tableData = this.data.test02
  339. }
  340. if (name == '支出类别') {
  341. tableData = this.data.test03
  342. }
  343. if (name == '入库原因') {
  344. tableData = this.data.test04
  345. }
  346. if (name == '出库原因') {
  347. tableData = this.data.test05
  348. }
  349. if (name == '账户类别') {
  350. tableData = this.data.test06
  351. }
  352. if (name == '客户来源') {
  353. tableData = this.data.test07
  354. }
  355. if (name == '客户标签') {
  356. tableData = this.data.test08
  357. }
  358. this.setData({
  359. sideKey: e.detail,
  360. specsId: e.detail.id,
  361. fieldData: sidebarList[0],
  362. tableData: tableData
  363. })
  364. this.setData({
  365. searchText: ''
  366. })
  367. // 查询
  368. // this.doSearch()
  369. },
  370. /**
  371. * @desc : 左滑功能
  372. * @author : 于继渤
  373. * @date : 2024/1/23 9:16
  374. */
  375. onCloseDel(e) {
  376. console.log(e)
  377. },
  378. /**
  379. * @desc : 列表对象点击
  380. * @author : 于继渤
  381. * @date : 2024/1/23 9:16
  382. */
  383. toDetail(e) {
  384. console.log(e)
  385. let index = e.currentTarget.dataset.index
  386. let tableData = this.data.tableData
  387. this.setData({
  388. showPopup: true,
  389. showPopupItem: tableData[index]
  390. })
  391. },
  392. /**
  393. * @desc : 关闭弹窗
  394. * @author : 于继渤
  395. * @date : 2024/1/23 9:16
  396. */
  397. onClosePopup() {
  398. this.setData({
  399. showPopup: false
  400. })
  401. },
  402. /**
  403. * @desc : 新建
  404. * @author : 于继渤
  405. * @date : 2024/1/23 9:16
  406. */
  407. toAdd() {
  408. this.setData({
  409. showPopupItem: {},
  410. showPopup: true
  411. })
  412. },
  413. /**
  414. * 生命周期函数--监听页面加载
  415. */
  416. onLoad(options) {
  417. let _this = this;
  418. wx.getSystemInfo({
  419. success: function (res) {
  420. _this.setData({
  421. windowHeight: res.windowHeight,
  422. windowWidth: res.windowWidth
  423. })
  424. }
  425. })
  426. let leftData = [
  427. {
  428. id: 1,
  429. name: '仓库档案'
  430. },
  431. {
  432. id: 1,
  433. name: '销售渠道'
  434. },
  435. {
  436. id: 1,
  437. name: '收入类别'
  438. },
  439. {
  440. id: 1,
  441. name: '支出类别'
  442. },
  443. {
  444. id: 1,
  445. name: '入库原因'
  446. },
  447. {
  448. id: 1,
  449. name: '出库原因'
  450. },
  451. {
  452. id: 1,
  453. name: '账户类别'
  454. },
  455. {
  456. id: 1,
  457. name: '客户来源'
  458. },
  459. {
  460. id: 1,
  461. name: '客户标签'
  462. },
  463. ]
  464. let tableData = this.data.test00
  465. this.setData({
  466. leftData: leftData,
  467. tableData: tableData,
  468. listTitle: leftData[0].name,
  469. fieldData: this.data.fieldList[0]
  470. })
  471. },
  472. /**
  473. * 生命周期函数--监听页面初次渲染完成
  474. */
  475. onReady() {
  476. },
  477. /**
  478. * 生命周期函数--监听页面显示
  479. */
  480. onShow() {
  481. },
  482. /**
  483. * 生命周期函数--监听页面隐藏
  484. */
  485. onHide() {
  486. },
  487. /**
  488. * 生命周期函数--监听页面卸载
  489. */
  490. onUnload() {
  491. },
  492. /**
  493. * 页面相关事件处理函数--监听用户下拉动作
  494. */
  495. onPullDownRefresh() {
  496. },
  497. /**
  498. * 页面上拉触底事件的处理函数
  499. */
  500. onReachBottom() {
  501. },
  502. /**
  503. * 用户点击右上角分享
  504. */
  505. onShareAppMessage() {
  506. }
  507. })