Blame view
src/store/modules/myLoveList.js
1.35 KB
87eade409 验光数据填充检测 |
1 2 3 4 |
import urlAlias from '../url' import request from '../request' const { |
31dea37da 新增验光单和修改验光单 |
5 6 |
mylovelist, myloveadd, |
089dce19d 支付修改 |
7 |
myloveupdate, |
87eade409 验光数据填充检测 |
8 9 10 |
} = urlAlias const state = { |
089dce19d 支付修改 |
11 |
loveList: [], |
87eade409 验光数据填充检测 |
12 13 14 15 16 |
} const mutations = { INIT: (state, data) => { state.loveList = data |
31dea37da 新增验光单和修改验光单 |
17 18 |
}, // 更新关心人验光单 |
87eade409 验光数据填充检测 |
19 20 21 |
UPDATE: (state, data) => { // state.loveList.push(data) // console.log('UPDATA=====>',data) |
089dce19d 支付修改 |
22 |
}, |
87eade409 验光数据填充检测 |
23 24 25 26 27 28 29 30 31 |
} const actions = { getLoveList({ commit }, param) { request({ url: mylovelist, data: param, success: (res) => { // console.log(res.data); |
1b4b4938a auto commit the c... |
32 |
commit('INIT', res.data.data.list) |
089dce19d 支付修改 |
33 |
}, |
87eade409 验光数据填充检测 |
34 |
}) |
31dea37da 新增验光单和修改验光单 |
35 36 |
}, addMylove({ commit }, param) { |
1b4b4938a auto commit the c... |
37 |
// console.log('myloveupdate-parm====>', param) |
089dce19d 支付修改 |
38 |
return new Promise((resolve) => request({ |
87eade409 验光数据填充检测 |
39 40 41 42 |
url: myloveadd, data: param, success: (res) => { console.log('addMylove-parm====>', param) |
1b4b4938a auto commit the c... |
43 |
// console.log(res.data) |
089dce19d 支付修改 |
44 |
resolve(res.data) |
87eade409 验光数据填充检测 |
45 |
// commit("ADD", args); |
089dce19d 支付修改 |
46 47 |
}, })) |
31dea37da 新增验光单和修改验光单 |
48 49 |
}, updateMylove({ commit }, param) { |
87eade409 验光数据填充检测 |
50 51 52 53 54 |
request({ url: myloveupdate, data: param, success: (res) => { console.log('myloveupdate-parm====>', param) |
1b4b4938a auto commit the c... |
55 |
// console.log(res) |
87eade409 验光数据填充检测 |
56 |
// commit("UPDATE", param); |
089dce19d 支付修改 |
57 |
}, |
31dea37da 新增验光单和修改验光单 |
58 |
}) |
089dce19d 支付修改 |
59 |
}, |
87eade409 验光数据填充检测 |
60 61 62 63 64 65 66 |
} export default { namespaced: true, state, mutations, |
089dce19d 支付修改 |
67 |
actions, |
87eade409 验光数据填充检测 |
68 |
} |