diff --git a/src/api/biz/garbageBag.js b/src/api/biz/garbageBag.js index 4891568..e538b3f 100644 --- a/src/api/biz/garbageBag.js +++ b/src/api/biz/garbageBag.js @@ -5,7 +5,7 @@ // 入库出库记录查询 export function getBoundList(params) { return request({ - url: '/sanitation/wastebin/listPage', + url: '/gc/garbageBag/listPage', method: 'get', params }) @@ -14,7 +14,7 @@ // 入库 export function inbound(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/garbageBag/inbound', method: 'post', params }) @@ -22,7 +22,7 @@ // 出库 export function outbound(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/garbageBag/outbound', method: 'post', params }) diff --git a/src/api/biz/garbageBag.js b/src/api/biz/garbageBag.js index 4891568..e538b3f 100644 --- a/src/api/biz/garbageBag.js +++ b/src/api/biz/garbageBag.js @@ -5,7 +5,7 @@ // 入库出库记录查询 export function getBoundList(params) { return request({ - url: '/sanitation/wastebin/listPage', + url: '/gc/garbageBag/listPage', method: 'get', params }) @@ -14,7 +14,7 @@ // 入库 export function inbound(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/garbageBag/inbound', method: 'post', params }) @@ -22,7 +22,7 @@ // 出库 export function outbound(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/garbageBag/outbound', method: 'post', params }) diff --git a/src/api/biz/member.js b/src/api/biz/member.js index 05b0576..1333c60 100644 --- a/src/api/biz/member.js +++ b/src/api/biz/member.js @@ -6,26 +6,24 @@ // 会员查询 export function getMemberListPage(params) { return request({ - url: '/sanitation/staff/listPage', + url: '/gc/member/listPage', method: 'get', params }) } // 会员查询 -export function getMemberList(pid) { +export function getMemberScoreList(params) { return request({ - url: '/sanitation/staff/list', + url: '/gc/member/scoreDetail', method: 'get', - params: { - pid: pid - } + params }) } // 添加会员 export function addMember(params) { return request({ - url: '/sanitation/staff/add', + url: '/gc/member/add', method: 'post', params, paramsSerializer: params => { @@ -36,7 +34,7 @@ // 修改会员 export function updateMember(params) { return request({ - url: '/sanitation/staff/update', + url: '/gc/member/update', method: 'post', params, paramsSerializer: params => { @@ -47,7 +45,7 @@ // 删除会员 export function delMember(ids) { return request({ - url: '/sanitation/staff/delete', + url: '/gc/member/delete', method: 'post', params: { ids @@ -57,23 +55,15 @@ } }) } -// 会员出勤记录查询 -export function getAttendanceList(params) { - return request({ - url: '/sanitation/staff/attendanceList', - method: 'get', - params - }) -} -// 会员出勤记录查询 -export function exportAttendanceList(params, config) { +// 新增积分 +export function addScore(params) { return request({ - url: '/sanitation/staff/attendance/export', - method: 'get', - timeout: 120000, + url: '/gc/member/addScore', + method: 'post', params, - ...config, - responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } }) } diff --git a/src/api/biz/garbageBag.js b/src/api/biz/garbageBag.js index 4891568..e538b3f 100644 --- a/src/api/biz/garbageBag.js +++ b/src/api/biz/garbageBag.js @@ -5,7 +5,7 @@ // 入库出库记录查询 export function getBoundList(params) { return request({ - url: '/sanitation/wastebin/listPage', + url: '/gc/garbageBag/listPage', method: 'get', params }) @@ -14,7 +14,7 @@ // 入库 export function inbound(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/garbageBag/inbound', method: 'post', params }) @@ -22,7 +22,7 @@ // 出库 export function outbound(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/garbageBag/outbound', method: 'post', params }) diff --git a/src/api/biz/member.js b/src/api/biz/member.js index 05b0576..1333c60 100644 --- a/src/api/biz/member.js +++ b/src/api/biz/member.js @@ -6,26 +6,24 @@ // 会员查询 export function getMemberListPage(params) { return request({ - url: '/sanitation/staff/listPage', + url: '/gc/member/listPage', method: 'get', params }) } // 会员查询 -export function getMemberList(pid) { +export function getMemberScoreList(params) { return request({ - url: '/sanitation/staff/list', + url: '/gc/member/scoreDetail', method: 'get', - params: { - pid: pid - } + params }) } // 添加会员 export function addMember(params) { return request({ - url: '/sanitation/staff/add', + url: '/gc/member/add', method: 'post', params, paramsSerializer: params => { @@ -36,7 +34,7 @@ // 修改会员 export function updateMember(params) { return request({ - url: '/sanitation/staff/update', + url: '/gc/member/update', method: 'post', params, paramsSerializer: params => { @@ -47,7 +45,7 @@ // 删除会员 export function delMember(ids) { return request({ - url: '/sanitation/staff/delete', + url: '/gc/member/delete', method: 'post', params: { ids @@ -57,23 +55,15 @@ } }) } -// 会员出勤记录查询 -export function getAttendanceList(params) { - return request({ - url: '/sanitation/staff/attendanceList', - method: 'get', - params - }) -} -// 会员出勤记录查询 -export function exportAttendanceList(params, config) { +// 新增积分 +export function addScore(params) { return request({ - url: '/sanitation/staff/attendance/export', - method: 'get', - timeout: 120000, + url: '/gc/member/addScore', + method: 'post', params, - ...config, - responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } }) } diff --git a/src/api/biz/wastebin.js b/src/api/biz/wastebin.js index c804587..95ab09f 100644 --- a/src/api/biz/wastebin.js +++ b/src/api/biz/wastebin.js @@ -25,7 +25,7 @@ // 添加垃圾桶 export function addWastebin(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/wastebin/add', method: 'post', params }) @@ -33,7 +33,7 @@ // 修改垃圾桶机构 export function updateWastebin(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/wastebin/update', method: 'post', params }) @@ -41,7 +41,7 @@ // 删除垃圾桶机构 export function delWastebin(ids) { return request({ - url: '/sanitation/wastebin/delete', + url: '/gc/wastebin/delete', method: 'post', params: { ids diff --git a/src/api/biz/garbageBag.js b/src/api/biz/garbageBag.js index 4891568..e538b3f 100644 --- a/src/api/biz/garbageBag.js +++ b/src/api/biz/garbageBag.js @@ -5,7 +5,7 @@ // 入库出库记录查询 export function getBoundList(params) { return request({ - url: '/sanitation/wastebin/listPage', + url: '/gc/garbageBag/listPage', method: 'get', params }) @@ -14,7 +14,7 @@ // 入库 export function inbound(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/garbageBag/inbound', method: 'post', params }) @@ -22,7 +22,7 @@ // 出库 export function outbound(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/garbageBag/outbound', method: 'post', params }) diff --git a/src/api/biz/member.js b/src/api/biz/member.js index 05b0576..1333c60 100644 --- a/src/api/biz/member.js +++ b/src/api/biz/member.js @@ -6,26 +6,24 @@ // 会员查询 export function getMemberListPage(params) { return request({ - url: '/sanitation/staff/listPage', + url: '/gc/member/listPage', method: 'get', params }) } // 会员查询 -export function getMemberList(pid) { +export function getMemberScoreList(params) { return request({ - url: '/sanitation/staff/list', + url: '/gc/member/scoreDetail', method: 'get', - params: { - pid: pid - } + params }) } // 添加会员 export function addMember(params) { return request({ - url: '/sanitation/staff/add', + url: '/gc/member/add', method: 'post', params, paramsSerializer: params => { @@ -36,7 +34,7 @@ // 修改会员 export function updateMember(params) { return request({ - url: '/sanitation/staff/update', + url: '/gc/member/update', method: 'post', params, paramsSerializer: params => { @@ -47,7 +45,7 @@ // 删除会员 export function delMember(ids) { return request({ - url: '/sanitation/staff/delete', + url: '/gc/member/delete', method: 'post', params: { ids @@ -57,23 +55,15 @@ } }) } -// 会员出勤记录查询 -export function getAttendanceList(params) { - return request({ - url: '/sanitation/staff/attendanceList', - method: 'get', - params - }) -} -// 会员出勤记录查询 -export function exportAttendanceList(params, config) { +// 新增积分 +export function addScore(params) { return request({ - url: '/sanitation/staff/attendance/export', - method: 'get', - timeout: 120000, + url: '/gc/member/addScore', + method: 'post', params, - ...config, - responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } }) } diff --git a/src/api/biz/wastebin.js b/src/api/biz/wastebin.js index c804587..95ab09f 100644 --- a/src/api/biz/wastebin.js +++ b/src/api/biz/wastebin.js @@ -25,7 +25,7 @@ // 添加垃圾桶 export function addWastebin(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/wastebin/add', method: 'post', params }) @@ -33,7 +33,7 @@ // 修改垃圾桶机构 export function updateWastebin(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/wastebin/update', method: 'post', params }) @@ -41,7 +41,7 @@ // 删除垃圾桶机构 export function delWastebin(ids) { return request({ - url: '/sanitation/wastebin/delete', + url: '/gc/wastebin/delete', method: 'post', params: { ids diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 62cc439..8fc8e50 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -79,7 +79,7 @@ -
+
{ @@ -36,7 +34,7 @@ // 修改会员 export function updateMember(params) { return request({ - url: '/sanitation/staff/update', + url: '/gc/member/update', method: 'post', params, paramsSerializer: params => { @@ -47,7 +45,7 @@ // 删除会员 export function delMember(ids) { return request({ - url: '/sanitation/staff/delete', + url: '/gc/member/delete', method: 'post', params: { ids @@ -57,23 +55,15 @@ } }) } -// 会员出勤记录查询 -export function getAttendanceList(params) { - return request({ - url: '/sanitation/staff/attendanceList', - method: 'get', - params - }) -} -// 会员出勤记录查询 -export function exportAttendanceList(params, config) { +// 新增积分 +export function addScore(params) { return request({ - url: '/sanitation/staff/attendance/export', - method: 'get', - timeout: 120000, + url: '/gc/member/addScore', + method: 'post', params, - ...config, - responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } }) } diff --git a/src/api/biz/wastebin.js b/src/api/biz/wastebin.js index c804587..95ab09f 100644 --- a/src/api/biz/wastebin.js +++ b/src/api/biz/wastebin.js @@ -25,7 +25,7 @@ // 添加垃圾桶 export function addWastebin(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/wastebin/add', method: 'post', params }) @@ -33,7 +33,7 @@ // 修改垃圾桶机构 export function updateWastebin(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/wastebin/update', method: 'post', params }) @@ -41,7 +41,7 @@ // 删除垃圾桶机构 export function delWastebin(ids) { return request({ - url: '/sanitation/wastebin/delete', + url: '/gc/wastebin/delete', method: 'post', params: { ids diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 62cc439..8fc8e50 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -79,7 +79,7 @@
-
+
当前库存
-
{{currentBags}}
+
{{ currentBags }}
入库
@@ -140,26 +140,31 @@ fetchData() { this.listLoading = true const that = this - this.list = [ - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' } - ] - this.currentBags = this.list[0].remain - this.list = this.list.map(item => { - return { ...item, typeName: item.type === '1' ? '入库' : '出库' } - }) - this.total = this.list.length - that.listLoading = false - // getBoundList(this.listQuery).then(response => { - // that.list = response.data.rows - // that.total = response.data.total - // that.listLoading = false + // this.list = [ + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' } + // ] + // this.currentBags = this.list[0].remain + // this.list = this.list.map(item => { + // return { ...item, typeName: item.type === '1' ? '入库' : '出库' } // }) + // this.total = this.list.length + that.listLoading = false + getBoundList(this.listQuery).then(response => { + that.list = response.data.rows + this.list = this.list.map(item => { + return { ...item, typeName: item.type === '1' ? '入库' : '出库' } + }) + that.total = response.data.total + this.currentBags = this.list[0].remain + that.listLoading = false + }) }, // 点击编辑 inbound() { diff --git a/src/api/biz/garbageBag.js b/src/api/biz/garbageBag.js index 4891568..e538b3f 100644 --- a/src/api/biz/garbageBag.js +++ b/src/api/biz/garbageBag.js @@ -5,7 +5,7 @@ // 入库出库记录查询 export function getBoundList(params) { return request({ - url: '/sanitation/wastebin/listPage', + url: '/gc/garbageBag/listPage', method: 'get', params }) @@ -14,7 +14,7 @@ // 入库 export function inbound(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/garbageBag/inbound', method: 'post', params }) @@ -22,7 +22,7 @@ // 出库 export function outbound(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/garbageBag/outbound', method: 'post', params }) diff --git a/src/api/biz/member.js b/src/api/biz/member.js index 05b0576..1333c60 100644 --- a/src/api/biz/member.js +++ b/src/api/biz/member.js @@ -6,26 +6,24 @@ // 会员查询 export function getMemberListPage(params) { return request({ - url: '/sanitation/staff/listPage', + url: '/gc/member/listPage', method: 'get', params }) } // 会员查询 -export function getMemberList(pid) { +export function getMemberScoreList(params) { return request({ - url: '/sanitation/staff/list', + url: '/gc/member/scoreDetail', method: 'get', - params: { - pid: pid - } + params }) } // 添加会员 export function addMember(params) { return request({ - url: '/sanitation/staff/add', + url: '/gc/member/add', method: 'post', params, paramsSerializer: params => { @@ -36,7 +34,7 @@ // 修改会员 export function updateMember(params) { return request({ - url: '/sanitation/staff/update', + url: '/gc/member/update', method: 'post', params, paramsSerializer: params => { @@ -47,7 +45,7 @@ // 删除会员 export function delMember(ids) { return request({ - url: '/sanitation/staff/delete', + url: '/gc/member/delete', method: 'post', params: { ids @@ -57,23 +55,15 @@ } }) } -// 会员出勤记录查询 -export function getAttendanceList(params) { - return request({ - url: '/sanitation/staff/attendanceList', - method: 'get', - params - }) -} -// 会员出勤记录查询 -export function exportAttendanceList(params, config) { +// 新增积分 +export function addScore(params) { return request({ - url: '/sanitation/staff/attendance/export', - method: 'get', - timeout: 120000, + url: '/gc/member/addScore', + method: 'post', params, - ...config, - responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } }) } diff --git a/src/api/biz/wastebin.js b/src/api/biz/wastebin.js index c804587..95ab09f 100644 --- a/src/api/biz/wastebin.js +++ b/src/api/biz/wastebin.js @@ -25,7 +25,7 @@ // 添加垃圾桶 export function addWastebin(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/wastebin/add', method: 'post', params }) @@ -33,7 +33,7 @@ // 修改垃圾桶机构 export function updateWastebin(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/wastebin/update', method: 'post', params }) @@ -41,7 +41,7 @@ // 删除垃圾桶机构 export function delWastebin(ids) { return request({ - url: '/sanitation/wastebin/delete', + url: '/gc/wastebin/delete', method: 'post', params: { ids diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 62cc439..8fc8e50 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -79,7 +79,7 @@
-
+
当前库存
-
{{currentBags}}
+
{{ currentBags }}
入库
@@ -140,26 +140,31 @@ fetchData() { this.listLoading = true const that = this - this.list = [ - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' } - ] - this.currentBags = this.list[0].remain - this.list = this.list.map(item => { - return { ...item, typeName: item.type === '1' ? '入库' : '出库' } - }) - this.total = this.list.length - that.listLoading = false - // getBoundList(this.listQuery).then(response => { - // that.list = response.data.rows - // that.total = response.data.total - // that.listLoading = false + // this.list = [ + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' } + // ] + // this.currentBags = this.list[0].remain + // this.list = this.list.map(item => { + // return { ...item, typeName: item.type === '1' ? '入库' : '出库' } // }) + // this.total = this.list.length + that.listLoading = false + getBoundList(this.listQuery).then(response => { + that.list = response.data.rows + this.list = this.list.map(item => { + return { ...item, typeName: item.type === '1' ? '入库' : '出库' } + }) + that.total = response.data.total + this.currentBags = this.list[0].remain + that.listLoading = false + }) }, // 点击编辑 inbound() { diff --git a/src/views/garbageBag/inbound.vue b/src/views/garbageBag/inbound.vue index f1e2299..3451d0a 100644 --- a/src/views/garbageBag/inbound.vue +++ b/src/views/garbageBag/inbound.vue @@ -73,24 +73,24 @@ this.$refs['dataForm'].validate((valid) => { console.log(this.dataForm) if (valid) { - this.$message.success('入库成功') - this.resetForm() - this.$refs['dataForm'].clearValidate() - this.canEdit = true - this.dialogFormVisible = false - this.$emit('watchChild') - // inbound(this.dataForm).then(response => { - // if (response.code === 200) { - // this.$message.success('入库成功') - // this.resetForm() - // this.$refs['dataForm'].clearValidate() - // this.canEdit = true - // this.dialogFormVisible = false - // this.$emit('watchChild') - // } - // }).catch((e) => { - // this.canEdit = true - // }) + // this.$message.success('入库成功') + // this.resetForm() + // this.$refs['dataForm'].clearValidate() + // this.canEdit = true + // this.dialogFormVisible = false + // this.$emit('watchChild') + inbound(this.dataForm).then(response => { + if (response.code === 200) { + this.$message.success('入库成功') + this.resetForm() + this.$refs['dataForm'].clearValidate() + this.canEdit = true + this.dialogFormVisible = false + this.$emit('watchChild') + } + }).catch((e) => { + this.canEdit = true + }) } else { this.canEdit = true } diff --git a/src/api/biz/garbageBag.js b/src/api/biz/garbageBag.js index 4891568..e538b3f 100644 --- a/src/api/biz/garbageBag.js +++ b/src/api/biz/garbageBag.js @@ -5,7 +5,7 @@ // 入库出库记录查询 export function getBoundList(params) { return request({ - url: '/sanitation/wastebin/listPage', + url: '/gc/garbageBag/listPage', method: 'get', params }) @@ -14,7 +14,7 @@ // 入库 export function inbound(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/garbageBag/inbound', method: 'post', params }) @@ -22,7 +22,7 @@ // 出库 export function outbound(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/garbageBag/outbound', method: 'post', params }) diff --git a/src/api/biz/member.js b/src/api/biz/member.js index 05b0576..1333c60 100644 --- a/src/api/biz/member.js +++ b/src/api/biz/member.js @@ -6,26 +6,24 @@ // 会员查询 export function getMemberListPage(params) { return request({ - url: '/sanitation/staff/listPage', + url: '/gc/member/listPage', method: 'get', params }) } // 会员查询 -export function getMemberList(pid) { +export function getMemberScoreList(params) { return request({ - url: '/sanitation/staff/list', + url: '/gc/member/scoreDetail', method: 'get', - params: { - pid: pid - } + params }) } // 添加会员 export function addMember(params) { return request({ - url: '/sanitation/staff/add', + url: '/gc/member/add', method: 'post', params, paramsSerializer: params => { @@ -36,7 +34,7 @@ // 修改会员 export function updateMember(params) { return request({ - url: '/sanitation/staff/update', + url: '/gc/member/update', method: 'post', params, paramsSerializer: params => { @@ -47,7 +45,7 @@ // 删除会员 export function delMember(ids) { return request({ - url: '/sanitation/staff/delete', + url: '/gc/member/delete', method: 'post', params: { ids @@ -57,23 +55,15 @@ } }) } -// 会员出勤记录查询 -export function getAttendanceList(params) { - return request({ - url: '/sanitation/staff/attendanceList', - method: 'get', - params - }) -} -// 会员出勤记录查询 -export function exportAttendanceList(params, config) { +// 新增积分 +export function addScore(params) { return request({ - url: '/sanitation/staff/attendance/export', - method: 'get', - timeout: 120000, + url: '/gc/member/addScore', + method: 'post', params, - ...config, - responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } }) } diff --git a/src/api/biz/wastebin.js b/src/api/biz/wastebin.js index c804587..95ab09f 100644 --- a/src/api/biz/wastebin.js +++ b/src/api/biz/wastebin.js @@ -25,7 +25,7 @@ // 添加垃圾桶 export function addWastebin(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/wastebin/add', method: 'post', params }) @@ -33,7 +33,7 @@ // 修改垃圾桶机构 export function updateWastebin(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/wastebin/update', method: 'post', params }) @@ -41,7 +41,7 @@ // 删除垃圾桶机构 export function delWastebin(ids) { return request({ - url: '/sanitation/wastebin/delete', + url: '/gc/wastebin/delete', method: 'post', params: { ids diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 62cc439..8fc8e50 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -79,7 +79,7 @@
-
+
当前库存
-
{{currentBags}}
+
{{ currentBags }}
入库
@@ -140,26 +140,31 @@ fetchData() { this.listLoading = true const that = this - this.list = [ - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' } - ] - this.currentBags = this.list[0].remain - this.list = this.list.map(item => { - return { ...item, typeName: item.type === '1' ? '入库' : '出库' } - }) - this.total = this.list.length - that.listLoading = false - // getBoundList(this.listQuery).then(response => { - // that.list = response.data.rows - // that.total = response.data.total - // that.listLoading = false + // this.list = [ + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' } + // ] + // this.currentBags = this.list[0].remain + // this.list = this.list.map(item => { + // return { ...item, typeName: item.type === '1' ? '入库' : '出库' } // }) + // this.total = this.list.length + that.listLoading = false + getBoundList(this.listQuery).then(response => { + that.list = response.data.rows + this.list = this.list.map(item => { + return { ...item, typeName: item.type === '1' ? '入库' : '出库' } + }) + that.total = response.data.total + this.currentBags = this.list[0].remain + that.listLoading = false + }) }, // 点击编辑 inbound() { diff --git a/src/views/garbageBag/inbound.vue b/src/views/garbageBag/inbound.vue index f1e2299..3451d0a 100644 --- a/src/views/garbageBag/inbound.vue +++ b/src/views/garbageBag/inbound.vue @@ -73,24 +73,24 @@ this.$refs['dataForm'].validate((valid) => { console.log(this.dataForm) if (valid) { - this.$message.success('入库成功') - this.resetForm() - this.$refs['dataForm'].clearValidate() - this.canEdit = true - this.dialogFormVisible = false - this.$emit('watchChild') - // inbound(this.dataForm).then(response => { - // if (response.code === 200) { - // this.$message.success('入库成功') - // this.resetForm() - // this.$refs['dataForm'].clearValidate() - // this.canEdit = true - // this.dialogFormVisible = false - // this.$emit('watchChild') - // } - // }).catch((e) => { - // this.canEdit = true - // }) + // this.$message.success('入库成功') + // this.resetForm() + // this.$refs['dataForm'].clearValidate() + // this.canEdit = true + // this.dialogFormVisible = false + // this.$emit('watchChild') + inbound(this.dataForm).then(response => { + if (response.code === 200) { + this.$message.success('入库成功') + this.resetForm() + this.$refs['dataForm'].clearValidate() + this.canEdit = true + this.dialogFormVisible = false + this.$emit('watchChild') + } + }).catch((e) => { + this.canEdit = true + }) } else { this.canEdit = true } diff --git a/src/views/garbageBag/outbound.vue b/src/views/garbageBag/outbound.vue index 146e31a..86332da 100644 --- a/src/views/garbageBag/outbound.vue +++ b/src/views/garbageBag/outbound.vue @@ -91,24 +91,24 @@ this.$refs['dataForm'].validate((valid) => { console.log(this.dataForm) if (valid) { - this.$message.success('出库成功') - this.resetForm() - this.$refs['dataForm'].clearValidate() - this.canEdit = true - this.dialogFormVisible = false - this.$emit('watchChild') - // outbound(this.dataForm).then(response => { - // if (response.code === 200) { - // this.$message.success('入库成功') - // this.resetForm() - // this.$refs['dataForm'].clearValidate() - // this.canEdit = true - // this.dialogFormVisible = false - // this.$emit('watchChild') - // } - // }).catch((e) => { - // this.canEdit = true - // }) + // this.$message.success('出库成功') + // this.resetForm() + // this.$refs['dataForm'].clearValidate() + // this.canEdit = true + // this.dialogFormVisible = false + // this.$emit('watchChild') + outbound(this.dataForm).then(response => { + if (response.code === 200) { + this.$message.success('入库成功') + this.resetForm() + this.$refs['dataForm'].clearValidate() + this.canEdit = true + this.dialogFormVisible = false + this.$emit('watchChild') + } + }).catch((e) => { + this.canEdit = true + }) } else { this.canEdit = true } diff --git a/src/api/biz/garbageBag.js b/src/api/biz/garbageBag.js index 4891568..e538b3f 100644 --- a/src/api/biz/garbageBag.js +++ b/src/api/biz/garbageBag.js @@ -5,7 +5,7 @@ // 入库出库记录查询 export function getBoundList(params) { return request({ - url: '/sanitation/wastebin/listPage', + url: '/gc/garbageBag/listPage', method: 'get', params }) @@ -14,7 +14,7 @@ // 入库 export function inbound(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/garbageBag/inbound', method: 'post', params }) @@ -22,7 +22,7 @@ // 出库 export function outbound(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/garbageBag/outbound', method: 'post', params }) diff --git a/src/api/biz/member.js b/src/api/biz/member.js index 05b0576..1333c60 100644 --- a/src/api/biz/member.js +++ b/src/api/biz/member.js @@ -6,26 +6,24 @@ // 会员查询 export function getMemberListPage(params) { return request({ - url: '/sanitation/staff/listPage', + url: '/gc/member/listPage', method: 'get', params }) } // 会员查询 -export function getMemberList(pid) { +export function getMemberScoreList(params) { return request({ - url: '/sanitation/staff/list', + url: '/gc/member/scoreDetail', method: 'get', - params: { - pid: pid - } + params }) } // 添加会员 export function addMember(params) { return request({ - url: '/sanitation/staff/add', + url: '/gc/member/add', method: 'post', params, paramsSerializer: params => { @@ -36,7 +34,7 @@ // 修改会员 export function updateMember(params) { return request({ - url: '/sanitation/staff/update', + url: '/gc/member/update', method: 'post', params, paramsSerializer: params => { @@ -47,7 +45,7 @@ // 删除会员 export function delMember(ids) { return request({ - url: '/sanitation/staff/delete', + url: '/gc/member/delete', method: 'post', params: { ids @@ -57,23 +55,15 @@ } }) } -// 会员出勤记录查询 -export function getAttendanceList(params) { - return request({ - url: '/sanitation/staff/attendanceList', - method: 'get', - params - }) -} -// 会员出勤记录查询 -export function exportAttendanceList(params, config) { +// 新增积分 +export function addScore(params) { return request({ - url: '/sanitation/staff/attendance/export', - method: 'get', - timeout: 120000, + url: '/gc/member/addScore', + method: 'post', params, - ...config, - responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + paramsSerializer: params => { + return qs.stringify(params, { indices: false }) + } }) } diff --git a/src/api/biz/wastebin.js b/src/api/biz/wastebin.js index c804587..95ab09f 100644 --- a/src/api/biz/wastebin.js +++ b/src/api/biz/wastebin.js @@ -25,7 +25,7 @@ // 添加垃圾桶 export function addWastebin(params) { return request({ - url: '/sanitation/wastebin/add', + url: '/gc/wastebin/add', method: 'post', params }) @@ -33,7 +33,7 @@ // 修改垃圾桶机构 export function updateWastebin(params) { return request({ - url: '/sanitation/wastebin/update', + url: '/gc/wastebin/update', method: 'post', params }) @@ -41,7 +41,7 @@ // 删除垃圾桶机构 export function delWastebin(ids) { return request({ - url: '/sanitation/wastebin/delete', + url: '/gc/wastebin/delete', method: 'post', params: { ids diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index 62cc439..8fc8e50 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -79,7 +79,7 @@
-
+
当前库存
-
{{currentBags}}
+
{{ currentBags }}
入库
@@ -140,26 +140,31 @@ fetchData() { this.listLoading = true const that = this - this.list = [ - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, - { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' } - ] - this.currentBags = this.list[0].remain - this.list = this.list.map(item => { - return { ...item, typeName: item.type === '1' ? '入库' : '出库' } - }) - this.total = this.list.length - that.listLoading = false - // getBoundList(this.listQuery).then(response => { - // that.list = response.data.rows - // that.total = response.data.total - // that.listLoading = false + // this.list = [ + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '2', num: 200, remain: 2000, useTime: '2021-05-07', useType: '日常', useArea: '活力大道', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' }, + // { type: '1', num: 200, remain: 2000, useTime: '', useType: '', useArea: '', recyclable: '可回收', ts: '2021-05-07 12:00:00' } + // ] + // this.currentBags = this.list[0].remain + // this.list = this.list.map(item => { + // return { ...item, typeName: item.type === '1' ? '入库' : '出库' } // }) + // this.total = this.list.length + that.listLoading = false + getBoundList(this.listQuery).then(response => { + that.list = response.data.rows + this.list = this.list.map(item => { + return { ...item, typeName: item.type === '1' ? '入库' : '出库' } + }) + that.total = response.data.total + this.currentBags = this.list[0].remain + that.listLoading = false + }) }, // 点击编辑 inbound() { diff --git a/src/views/garbageBag/inbound.vue b/src/views/garbageBag/inbound.vue index f1e2299..3451d0a 100644 --- a/src/views/garbageBag/inbound.vue +++ b/src/views/garbageBag/inbound.vue @@ -73,24 +73,24 @@ this.$refs['dataForm'].validate((valid) => { console.log(this.dataForm) if (valid) { - this.$message.success('入库成功') - this.resetForm() - this.$refs['dataForm'].clearValidate() - this.canEdit = true - this.dialogFormVisible = false - this.$emit('watchChild') - // inbound(this.dataForm).then(response => { - // if (response.code === 200) { - // this.$message.success('入库成功') - // this.resetForm() - // this.$refs['dataForm'].clearValidate() - // this.canEdit = true - // this.dialogFormVisible = false - // this.$emit('watchChild') - // } - // }).catch((e) => { - // this.canEdit = true - // }) + // this.$message.success('入库成功') + // this.resetForm() + // this.$refs['dataForm'].clearValidate() + // this.canEdit = true + // this.dialogFormVisible = false + // this.$emit('watchChild') + inbound(this.dataForm).then(response => { + if (response.code === 200) { + this.$message.success('入库成功') + this.resetForm() + this.$refs['dataForm'].clearValidate() + this.canEdit = true + this.dialogFormVisible = false + this.$emit('watchChild') + } + }).catch((e) => { + this.canEdit = true + }) } else { this.canEdit = true } diff --git a/src/views/garbageBag/outbound.vue b/src/views/garbageBag/outbound.vue index 146e31a..86332da 100644 --- a/src/views/garbageBag/outbound.vue +++ b/src/views/garbageBag/outbound.vue @@ -91,24 +91,24 @@ this.$refs['dataForm'].validate((valid) => { console.log(this.dataForm) if (valid) { - this.$message.success('出库成功') - this.resetForm() - this.$refs['dataForm'].clearValidate() - this.canEdit = true - this.dialogFormVisible = false - this.$emit('watchChild') - // outbound(this.dataForm).then(response => { - // if (response.code === 200) { - // this.$message.success('入库成功') - // this.resetForm() - // this.$refs['dataForm'].clearValidate() - // this.canEdit = true - // this.dialogFormVisible = false - // this.$emit('watchChild') - // } - // }).catch((e) => { - // this.canEdit = true - // }) + // this.$message.success('出库成功') + // this.resetForm() + // this.$refs['dataForm'].clearValidate() + // this.canEdit = true + // this.dialogFormVisible = false + // this.$emit('watchChild') + outbound(this.dataForm).then(response => { + if (response.code === 200) { + this.$message.success('入库成功') + this.resetForm() + this.$refs['dataForm'].clearValidate() + this.canEdit = true + this.dialogFormVisible = false + this.$emit('watchChild') + } + }).catch((e) => { + this.canEdit = true + }) } else { this.canEdit = true } diff --git a/src/views/memberManage/addScore.vue b/src/views/memberManage/addScore.vue index 0f6e318..6226542 100644 --- a/src/views/memberManage/addScore.vue +++ b/src/views/memberManage/addScore.vue @@ -29,14 +29,14 @@ - + - + @@ -51,7 +51,7 @@