|
@@ -4,9 +4,9 @@
|
|
|
<el-form-item>
|
|
|
<div style="display:flex">
|
|
|
<el-input
|
|
|
- v-model="phone"
|
|
|
+ v-model="cartNo"
|
|
|
placeholder="
|
|
|
- 请输入手机号"
|
|
|
+ 请输入卡号"
|
|
|
clearable
|
|
|
size="small"
|
|
|
style="margin-right: 20px;width: 200px;"
|
|
@@ -32,6 +32,10 @@
|
|
|
<span>余额:</span>
|
|
|
<span>{{ memberInfo.money }}</span>
|
|
|
</div>
|
|
|
+ <div class="row">
|
|
|
+ <span>卡状态:</span>
|
|
|
+ <span>{{ memberInfo.status }}</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
@@ -185,28 +189,30 @@
|
|
|
size="mini"
|
|
|
@click="handleDelete">删除</el-button>
|
|
|
</el-col>
|
|
|
- <el-col :span="1.5">
|
|
|
+ <!-- <el-col :span="1.5">
|
|
|
<el-button
|
|
|
v-permission="['unimall:salesSlip:export']"
|
|
|
type="warning"
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
@click="handleExport">导出</el-button>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="salesSlipList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table v-loading="loading" :data="salesSlipList" :summary-method="getSummaries" show-summary @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<!-- <el-table-column label="" align="center" prop="id" />
|
|
|
<el-table-column label="" align="center" prop="companyId" /> -->
|
|
|
<el-table-column label="姓名" align="center" prop="remark1" />
|
|
|
<el-table-column label="电话" align="center" prop="remark2" />
|
|
|
+ <el-table-column label="卡号" align="center" prop="remark3" />
|
|
|
<el-table-column label="服务对象" align="center" prop="serviceObject" />
|
|
|
<el-table-column label="服务分类" align="center" prop="serviceType" />
|
|
|
<el-table-column label="颜色" align="center" prop="color" />
|
|
|
<el-table-column label="属性" align="center" prop="attribute" />
|
|
|
<el-table-column label="服务项目" align="center" prop="serviceItems" />
|
|
|
<el-table-column label="金额" align="center" prop="money" />
|
|
|
+ <el-table-column label="数量" align="center" prop="count" />
|
|
|
<!-- <el-table-column label="状态" align="center" prop="status" /> -->
|
|
|
|
|
|
<!-- <el-table-column label="备注3" align="center" prop="remark3" /> -->
|
|
@@ -249,7 +255,7 @@
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
@pagination="getList" />
|
|
|
<el-dialog :visible.sync="isShowPrint" title="打印小票" width="400px">
|
|
|
- <div id="box">
|
|
|
+ <div id="box" style="font-size: 12px;">
|
|
|
<div class="print-row">
|
|
|
<span>姓名:</span>
|
|
|
<span>{{ printData.remark1 }}</span>
|
|
@@ -258,6 +264,10 @@
|
|
|
<span>电话:</span>
|
|
|
<span>{{ printData.remark2 }}</span>
|
|
|
</div>
|
|
|
+ <div class="print-row">
|
|
|
+ <span>卡号:</span>
|
|
|
+ <span>{{ printData.remark3 }}</span>
|
|
|
+ </div>
|
|
|
<div class="print-row">
|
|
|
<span>服务对象:</span>
|
|
|
<span>{{ printData.serviceObject }}</span>
|
|
@@ -278,6 +288,10 @@
|
|
|
<span>服务项目:</span>
|
|
|
<span>{{ printData.serviceItems }}</span>
|
|
|
</div>
|
|
|
+ <div class="print-row">
|
|
|
+ <span>数量:</span>
|
|
|
+ <span>{{ printData.count }}</span>
|
|
|
+ </div>
|
|
|
<div class="print-row">
|
|
|
<span>金额:</span>
|
|
|
<span>{{ printData.money }}</span>
|
|
@@ -293,7 +307,7 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 添加或修改销售单对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="600px">
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="1000px">
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<!-- <el-form-item label="" prop="companyId">
|
|
|
<el-input v-model="form.companyId" placeholder="请输入" />
|
|
@@ -304,6 +318,9 @@
|
|
|
<el-form-item label="电话" prop="remark2">
|
|
|
<el-input v-model="form.remark2" placeholder="请输入电话" disabled/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="卡号" prop="remark3">
|
|
|
+ <el-input v-model="form.remark3" placeholder="请输入卡号" disabled/>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="服务对象" prop="serviceObject">
|
|
|
<!-- <el-input v-model="form.serviceObject" placeholder="请输入服务对象" /> -->
|
|
|
<el-select v-model="form.serviceObject" placeholder="请选择服务对象" style="width:100%">
|
|
@@ -327,10 +344,16 @@
|
|
|
<el-option v-for="item in attributeList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="数量" prop="count">
|
|
|
+ <el-input v-model="form.count" placeholder="请输入数量" type="number" @input="inputVal"/>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="服务项目" prop="serviceItems">
|
|
|
<!-- <el-input v-model="form.serviceItems" placeholder="请输入服务项目" /> -->
|
|
|
- <el-checkbox-group v-model="checkList" @change="changeCheckbox">
|
|
|
- <el-checkbox v-for="item in serviceList" :label="item.route" :key="item.id"/>
|
|
|
+ <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>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="金额" prop="money">
|
|
@@ -396,7 +419,7 @@ export default {
|
|
|
id: 'box'
|
|
|
// 其他配置项,
|
|
|
},
|
|
|
- phone: '',
|
|
|
+ cartNo: '',
|
|
|
serviceType: [{
|
|
|
name: '鞋类清洗',
|
|
|
id: 1
|
|
@@ -459,10 +482,13 @@ export default {
|
|
|
gmtCreate: undefined,
|
|
|
gmtUpdate: undefined,
|
|
|
userId: undefined,
|
|
|
- adminId: undefined
|
|
|
+ adminId: undefined,
|
|
|
+ cartNo: undefined
|
|
|
},
|
|
|
// 表单参数
|
|
|
- form: {},
|
|
|
+ form: {
|
|
|
+
|
|
|
+ },
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
deleteFlag: [
|
|
@@ -475,28 +501,73 @@ export default {
|
|
|
this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
+ inputVal(val) { debugger
|
|
|
+ console.log(this.serviceList)
|
|
|
+ const that = this
|
|
|
+ this.form.money = 0
|
|
|
+ const getPlace = function(name) {
|
|
|
+ for (let k = 0; k<that.serviceList.length; k++) {
|
|
|
+ if (name==that.serviceList[k].route) {
|
|
|
+ return Number(that.serviceList[k].unitPrice)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let i = 0; i<this.checkList.length; i++) {
|
|
|
+ this.form.money+=(Number(getPlace(this.checkList[i]))*this.form.count)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getSummaries(param) {
|
|
|
+ const { columns, data } = param
|
|
|
+ const sums = []
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '总价'
|
|
|
+ return
|
|
|
+ } else if (index==9) {
|
|
|
+ const values = data.map(item => Number(item[column.property]))
|
|
|
+ if (!values.every(value => isNaN(value))) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr)
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr
|
|
|
+ } else {
|
|
|
+ return prev
|
|
|
+ }
|
|
|
+ }, 0)
|
|
|
+ sums[index] += ' 元'
|
|
|
+ } else {
|
|
|
+ sums[index] = 'N/A'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ return sums
|
|
|
+ },
|
|
|
print(row) {
|
|
|
this.printData = row
|
|
|
this.isShowPrint = true
|
|
|
},
|
|
|
getMember() {
|
|
|
- listManagement({
|
|
|
- phone: this.phone
|
|
|
- }).then(response => {
|
|
|
- if (response.data.data.items.length!=0) {
|
|
|
- this.memberInfo = response.data.data.items[0]
|
|
|
- } else {
|
|
|
- this.msgError('暂无此会员')
|
|
|
- return
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.cartNo) {
|
|
|
+ listManagement({
|
|
|
+ cartNo: this.cartNo
|
|
|
+ }).then(response => {
|
|
|
+ if (response.data.data.items.length!=0) {
|
|
|
+ this.memberInfo = response.data.data.items[0]
|
|
|
+ } else {
|
|
|
+ this.msgError('暂无此会员')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.msgError('请输入会员卡号')
|
|
|
+ }
|
|
|
},
|
|
|
submitMember() {},
|
|
|
changeCheckbox(e) {
|
|
|
const that = this
|
|
|
this.form.money = 0
|
|
|
console.log(this.checkList)
|
|
|
- debugger
|
|
|
const getPlace = function(name) {
|
|
|
for (let k = 0; k<that.serviceList.length; k++) {
|
|
|
if (name==that.serviceList[k].route) {
|
|
@@ -505,7 +576,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
for (let i = 0; i<this.checkList.length; i++) {
|
|
|
- this.form.money+=getPlace(this.checkList[i])
|
|
|
+ this.form.money+=(Number(getPlace(this.checkList[i]))*this.form.count)
|
|
|
}
|
|
|
},
|
|
|
/** 查询销售单列表 */
|
|
@@ -544,7 +615,8 @@ export default {
|
|
|
gmtCreate: undefined,
|
|
|
gmtUpdate: undefined,
|
|
|
userId: undefined,
|
|
|
- adminId: undefined
|
|
|
+ adminId: undefined,
|
|
|
+ count: 1
|
|
|
}
|
|
|
this.resetForm('form')
|
|
|
},
|
|
@@ -575,6 +647,7 @@ export default {
|
|
|
this.title = '添加销售单'
|
|
|
this.form.remark1 = this.memberInfo.userName
|
|
|
this.form.remark2 = this.memberInfo.phone
|
|
|
+ this.form.remark3 = this.memberInfo.cartNo
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
@@ -590,6 +663,18 @@ export default {
|
|
|
submitForm: function () {
|
|
|
this.$refs['form'].validate(valid => {
|
|
|
if (valid) {
|
|
|
+ if (!this.form.count) {
|
|
|
+ this.msgError('数量不能为空!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.form.count<1) {
|
|
|
+ this.msgError('数量不能小于1!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.checkList.length<=0) {
|
|
|
+ this.msgError('请勾选服务项目!')
|
|
|
+ return
|
|
|
+ }
|
|
|
if (this.form.id != undefined) {
|
|
|
updateSalesSlip(this.form).then(response => {
|
|
|
if (response.data) {
|
|
@@ -614,7 +699,8 @@ export default {
|
|
|
serviceObject: 2,
|
|
|
money: this.form.money,
|
|
|
remark1: this.memberInfo.userName,
|
|
|
- remark2: this.memberInfo.phone
|
|
|
+ remark2: this.memberInfo.phone,
|
|
|
+ remark3: this.memberInfo.cartNo
|
|
|
|
|
|
}).then(response => {
|
|
|
if (response.data) {
|