|
@@ -251,8 +251,8 @@
|
|
<pagination
|
|
<pagination
|
|
v-show="total > 0"
|
|
v-show="total > 0"
|
|
:total="total"
|
|
:total="total"
|
|
- :page.sync="queryParams.pageNum"
|
|
|
|
- :limit.sync="queryParams.pageSize"
|
|
|
|
|
|
+ :page.sync="queryParams.page"
|
|
|
|
+ :limit.sync="queryParams.limit"
|
|
@pagination="getList" />
|
|
@pagination="getList" />
|
|
<el-dialog :visible.sync="isShowPrint" title="打印小票" width="400px">
|
|
<el-dialog :visible.sync="isShowPrint" title="打印小票" width="400px">
|
|
<div id="box" style="font-size: 12px;">
|
|
<div id="box" style="font-size: 12px;">
|
|
@@ -329,13 +329,13 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="服务分类">
|
|
<el-form-item label="服务分类">
|
|
<el-select v-model="form.serviceType" placeholder="请选择服务分类" style="width:100%">
|
|
<el-select v-model="form.serviceType" placeholder="请选择服务分类" style="width:100%">
|
|
- <el-option v-for="item in serviceType" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
|
|
+ <el-option v-for="item in serviceType" :key="item.type" :label="item.type" :value="item.type" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="颜色" prop="color">
|
|
<el-form-item label="颜色" prop="color">
|
|
<!-- <el-input v-model="form.color" placeholder="请输入颜色" /> -->
|
|
<!-- <el-input v-model="form.color" placeholder="请输入颜色" /> -->
|
|
<el-select v-model="form.color" placeholder="请选择服务颜色" style="width:100%">
|
|
<el-select v-model="form.color" placeholder="请选择服务颜色" style="width:100%">
|
|
- <el-option v-for="item in colorList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
|
|
+ <el-option v-for="item in colorList" :key="item.color" :label="item.color" :value="item.color" />
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="属性" prop="attribute">
|
|
<el-form-item label="属性" prop="attribute">
|
|
@@ -345,15 +345,17 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="数量" prop="count">
|
|
<el-form-item label="数量" prop="count">
|
|
- <el-input v-model="form.count" placeholder="请输入数量" type="number" @input="inputVal"/>
|
|
|
|
|
|
+ <el-input v-model="form.count" placeholder="请输入数量" type="number" disabled @input="inputVal"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="服务项目" prop="serviceItems">
|
|
<el-form-item label="服务项目" prop="serviceItems">
|
|
<!-- <el-input v-model="form.serviceItems" placeholder="请输入服务项目" /> -->
|
|
<!-- <el-input v-model="form.serviceItems" placeholder="请输入服务项目" /> -->
|
|
- <el-checkbox-group v-model="checkList" style="display: flex;" @change="changeCheckbox">
|
|
|
|
- <div v-for="(item,index) in serviceList" :key="index" style="margin-right: 20px;">
|
|
|
|
- <el-checkbox :label="item.route" :key="item.id"/>
|
|
|
|
- <el-input v-model="item.unitPrice" placeholder="价格" style="width: 50px;" @input="inputVal(item)"/></div>
|
|
|
|
|
|
+ <el-checkbox-group v-model="checkList" @change="changeCheckbox">
|
|
|
|
+ <div v-for="(item,index) in serviceList" :key="index" style="display: inline-block; width: 380px;">
|
|
|
|
+ <el-checkbox :label="item.route" :key="item.id" />
|
|
|
|
|
|
|
|
+ <el-input v-model="item.unitPrice" placeholder="价格" style="width: 70px;" @input="inputVal(item)"/>
|
|
|
|
+ <el-input v-model="item.total" placeholder="数量" style="width: 70px;" @input="inputVal(item)"/>
|
|
|
|
+ </div>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="金额" prop="money">
|
|
<el-form-item label="金额" prop="money">
|
|
@@ -406,6 +408,8 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { listServiceMangerType } from '@/api/unimall/serviceMangerType'
|
|
|
|
+import { listServiceMangerTypeColor } from '@/api/unimall/serviceMangerTypeColor'
|
|
import { listSalesSlip, getSalesSlip, delSalesSlip, addSalesSlip, updateSalesSlip, exportSalesSlip } from '@/api/unimall/salesSlip'
|
|
import { listSalesSlip, getSalesSlip, delSalesSlip, addSalesSlip, updateSalesSlip, exportSalesSlip } from '@/api/unimall/salesSlip'
|
|
import { listServiceManger } from '@/api/unimall/serviceManger'
|
|
import { listServiceManger } from '@/api/unimall/serviceManger'
|
|
import { listManagement } from '@/api/unimall/management'
|
|
import { listManagement } from '@/api/unimall/management'
|
|
@@ -420,10 +424,7 @@ export default {
|
|
// 其他配置项,
|
|
// 其他配置项,
|
|
},
|
|
},
|
|
cartNo: '',
|
|
cartNo: '',
|
|
- serviceType: [{
|
|
|
|
- name: '鞋类清洗',
|
|
|
|
- id: 1
|
|
|
|
- }],
|
|
|
|
|
|
+ serviceType: [],
|
|
attributeList: [{
|
|
attributeList: [{
|
|
name: '男款',
|
|
name: '男款',
|
|
id: 1
|
|
id: 1
|
|
@@ -436,13 +437,7 @@ export default {
|
|
name: '鞋类',
|
|
name: '鞋类',
|
|
id: 1
|
|
id: 1
|
|
}],
|
|
}],
|
|
- colorList: [{
|
|
|
|
- name: '黑色',
|
|
|
|
- id: 1
|
|
|
|
- }, {
|
|
|
|
- name: '白色',
|
|
|
|
- id: 2
|
|
|
|
- }
|
|
|
|
|
|
+ colorList: [
|
|
],
|
|
],
|
|
memberInfo: {},
|
|
memberInfo: {},
|
|
checkList: [],
|
|
checkList: [],
|
|
@@ -465,8 +460,8 @@ export default {
|
|
open: false,
|
|
open: false,
|
|
// 查询参数
|
|
// 查询参数
|
|
queryParams: {
|
|
queryParams: {
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
|
|
+ page: 1,
|
|
|
|
+ limit: 10,
|
|
companyId: undefined,
|
|
companyId: undefined,
|
|
serviceObject: undefined,
|
|
serviceObject: undefined,
|
|
serviceType: undefined,
|
|
serviceType: undefined,
|
|
@@ -505,15 +500,22 @@ export default {
|
|
console.log(this.serviceList)
|
|
console.log(this.serviceList)
|
|
const that = this
|
|
const that = this
|
|
this.form.money = 0
|
|
this.form.money = 0
|
|
|
|
+ this.form.count = 0
|
|
const getPlace = function(name) {
|
|
const getPlace = function(name) {
|
|
for (let k = 0; k<that.serviceList.length; k++) {
|
|
for (let k = 0; k<that.serviceList.length; k++) {
|
|
if (name==that.serviceList[k].route) {
|
|
if (name==that.serviceList[k].route) {
|
|
- return Number(that.serviceList[k].unitPrice)
|
|
|
|
|
|
+ return Number(that.serviceList[k].unitPrice)*that.serviceList[k].total
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (let i = 0; i<this.checkList.length; i++) {
|
|
for (let i = 0; i<this.checkList.length; i++) {
|
|
- this.form.money+=(Number(getPlace(this.checkList[i]))*this.form.count)
|
|
|
|
|
|
+ this.form.money+=(Number(getPlace(this.checkList[i])))
|
|
|
|
+ for (let k=0; k<this.serviceList.length; k++) {
|
|
|
|
+ if (this.checkList[i]==this.serviceList[k].route) {
|
|
|
|
+ this.form.count+=(Number(this.serviceList[k].total))
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
getSummaries(param) {
|
|
getSummaries(param) {
|
|
@@ -567,16 +569,23 @@ export default {
|
|
changeCheckbox(e) {
|
|
changeCheckbox(e) {
|
|
const that = this
|
|
const that = this
|
|
this.form.money = 0
|
|
this.form.money = 0
|
|
|
|
+ this.form.count = 0
|
|
console.log(this.checkList)
|
|
console.log(this.checkList)
|
|
const getPlace = function(name) {
|
|
const getPlace = function(name) {
|
|
for (let k = 0; k<that.serviceList.length; k++) {
|
|
for (let k = 0; k<that.serviceList.length; k++) {
|
|
if (name==that.serviceList[k].route) {
|
|
if (name==that.serviceList[k].route) {
|
|
- return that.serviceList[k].unitPrice
|
|
|
|
|
|
+ return that.serviceList[k].unitPrice*that.serviceList[k].total
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
for (let i = 0; i<this.checkList.length; i++) {
|
|
for (let i = 0; i<this.checkList.length; i++) {
|
|
- this.form.money+=(Number(getPlace(this.checkList[i]))*this.form.count)
|
|
|
|
|
|
+ this.form.money+=(Number(getPlace(this.checkList[i])))
|
|
|
|
+ for (let k=0; k<this.serviceList.length; k++) {
|
|
|
|
+ if (this.checkList[i]==this.serviceList[k].route) {
|
|
|
|
+ this.form.count+=(Number(this.serviceList[k].total))
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
/** 查询销售单列表 */
|
|
/** 查询销售单列表 */
|
|
@@ -587,8 +596,20 @@ export default {
|
|
this.total = response.data.data.count
|
|
this.total = response.data.data.count
|
|
this.loading = false
|
|
this.loading = false
|
|
})
|
|
})
|
|
- listServiceManger().then(response => {
|
|
|
|
|
|
+ listServiceManger().then(response => { debugger
|
|
|
|
+ for (let i = 0; i<response.data.data.items.length; i++) {
|
|
|
|
+ response.data.data.items[i].total = 1
|
|
|
|
+ }
|
|
|
|
+
|
|
this.serviceList = response.data.data.items
|
|
this.serviceList = response.data.data.items
|
|
|
|
+
|
|
|
|
+ console.log('s', this.serviceList)
|
|
|
|
+ })
|
|
|
|
+ listServiceMangerTypeColor().then(response => {
|
|
|
|
+ this.colorList = response.data.data.items
|
|
|
|
+ })
|
|
|
|
+ listServiceMangerType().then(response => {
|
|
|
|
+ this.serviceType = response.data.data.items
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 取消按钮
|
|
// 取消按钮
|
|
@@ -602,8 +623,8 @@ export default {
|
|
id: undefined,
|
|
id: undefined,
|
|
companyId: undefined,
|
|
companyId: undefined,
|
|
serviceObject: '鞋类',
|
|
serviceObject: '鞋类',
|
|
- serviceType: '鞋类清洗',
|
|
|
|
- color: '黑色',
|
|
|
|
|
|
+ serviceType: '',
|
|
|
|
+ color: '',
|
|
attribute: '男款',
|
|
attribute: '男款',
|
|
serviceItems: undefined,
|
|
serviceItems: undefined,
|
|
money: 0,
|
|
money: 0,
|
|
@@ -616,13 +637,13 @@ export default {
|
|
gmtUpdate: undefined,
|
|
gmtUpdate: undefined,
|
|
userId: undefined,
|
|
userId: undefined,
|
|
adminId: undefined,
|
|
adminId: undefined,
|
|
- count: 1
|
|
|
|
|
|
+ count: 0
|
|
}
|
|
}
|
|
this.resetForm('form')
|
|
this.resetForm('form')
|
|
},
|
|
},
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
handleQuery() {
|
|
- this.queryParams.pageNum = 1
|
|
|
|
|
|
+ this.queryParams.page = 1
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
@@ -655,6 +676,11 @@ export default {
|
|
const id = row.id || this.ids.join(',')
|
|
const id = row.id || this.ids.join(',')
|
|
getSalesSlip(id).then(response => {
|
|
getSalesSlip(id).then(response => {
|
|
this.form = response.data.data
|
|
this.form = response.data.data
|
|
|
|
+ this.checkList = []
|
|
|
|
+ const _list = this.form.serviceItems.split(',')
|
|
|
|
+ for (let i = 0; i<_list.length; i++) {
|
|
|
|
+ this.checkList.push(_list[i])
|
|
|
|
+ }
|
|
this.open = true
|
|
this.open = true
|
|
this.title = '修改销售单'
|
|
this.title = '修改销售单'
|
|
})
|
|
})
|
|
@@ -675,6 +701,7 @@ export default {
|
|
this.msgError('请勾选服务项目!')
|
|
this.msgError('请勾选服务项目!')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+ this.form.serviceItems = this.checkList.toString()
|
|
if (this.form.id != undefined) {
|
|
if (this.form.id != undefined) {
|
|
updateSalesSlip(this.form).then(response => {
|
|
updateSalesSlip(this.form).then(response => {
|
|
if (response.data) {
|
|
if (response.data) {
|
|
@@ -686,9 +713,8 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- this.form.serviceItems = this.checkList.toString()
|
|
|
|
addSalesSlip(this.form).then(response => {
|
|
addSalesSlip(this.form).then(response => {
|
|
- if (response.data) { debugger
|
|
|
|
|
|
+ if (response.data) {
|
|
this.phone = ''
|
|
this.phone = ''
|
|
this.checkList = []
|
|
this.checkList = []
|
|
this.msgSuccess('新增成功')
|
|
this.msgSuccess('新增成功')
|
|
@@ -760,4 +786,7 @@ export default {
|
|
.print-row{
|
|
.print-row{
|
|
margin-bottom: 20px;
|
|
margin-bottom: 20px;
|
|
}
|
|
}
|
|
|
|
+ .el-checkbox{
|
|
|
|
+ width: 180px;
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|