Merge branch 'master' of http://122.51.230.86:3000/dianliang/lanan-system-vue
This commit is contained in:
commit
695ed397f2
@ -1,53 +1,61 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 创建会员等级
|
// 创建会员等级
|
||||||
export function createLevel(data) {
|
export function createLevel(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/member/level/create',
|
url: '/member/level/create',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新会员等级
|
// 更新会员等级
|
||||||
export function updateLevel(data) {
|
export function updateLevel(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/member/level/update',
|
url: '/member/level/update',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除会员等级
|
// 删除会员等级
|
||||||
export function deleteLevel(id) {
|
export function deleteLevel(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/member/level/delete?id=' + id,
|
url: '/member/level/delete?id=' + id,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得会员等级
|
// 获得会员等级
|
||||||
export function getLevel(id) {
|
export function getLevel(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/member/level/get?id=' + id,
|
url: '/member/level/get?id=' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获得会员等级分页
|
// 获得会员等级分页
|
||||||
export function getLevelPage(params) {
|
export function getLevelPage(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/member/level/page',
|
url: '/member/level/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 导出会员等级 Excel
|
// 导出会员等级 Excel
|
||||||
export function exportLevelExcel(params) {
|
export function exportLevelExcel(params) {
|
||||||
return request({
|
return request({
|
||||||
url: '/member/level/export-excel',
|
url: '/member/level/export-excel',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params,
|
params,
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 查询所有会员
|
||||||
|
export function getLevelAll(params) {
|
||||||
|
return request({
|
||||||
|
url: '/member/level/all',
|
||||||
|
method: 'get',
|
||||||
|
params,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -1 +1,11 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
const preUrl = '/repair/tickets'
|
||||||
|
|
||||||
|
export function createTickets(data){
|
||||||
|
return request({
|
||||||
|
url: preUrl + "/create",
|
||||||
|
method: "post",
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -39,7 +39,8 @@ export default {
|
|||||||
if (isExternal(real_src)) {
|
if (isExternal(real_src)) {
|
||||||
return real_src;
|
return real_src;
|
||||||
}
|
}
|
||||||
return process.env.VUE_APP_BASE_API + real_src;
|
|
||||||
|
return process.env.VUE_APP_IMAGE_URL + real_src;
|
||||||
},
|
},
|
||||||
realSrcList() {
|
realSrcList() {
|
||||||
if (!this.src) {
|
if (!this.src) {
|
||||||
|
@ -69,6 +69,16 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row :gutter="2">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="选择会员" prop="memberLevelId">
|
||||||
|
<el-select v-model="formData.memberLevelId" placeholder="请选择会员">
|
||||||
|
<el-option v-for="(item,index) in levelList" :key="item.id"
|
||||||
|
:label="item.name" :value="item.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="联系地址" prop="address">
|
<el-form-item label="联系地址" prop="address">
|
||||||
@ -144,6 +154,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {getLevelAll} from '@/api/member/level';
|
||||||
import * as CustomerMainApi from '@/api/base/customer';
|
import * as CustomerMainApi from '@/api/base/customer';
|
||||||
import { getServicePackageList } from "@/api/system/servicePackage";
|
import { getServicePackageList } from "@/api/system/servicePackage";
|
||||||
import ImageUpload from '@/components/ImageUpload';
|
import ImageUpload from '@/components/ImageUpload';
|
||||||
@ -158,8 +169,28 @@ export default {
|
|||||||
Editor,
|
Editor,
|
||||||
FileUpload
|
FileUpload
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
//初始化会员下拉
|
||||||
|
getLevelAll().then(
|
||||||
|
res => {
|
||||||
|
if (res.code==0)
|
||||||
|
{
|
||||||
|
this.levelList = res.data
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.$modal.msgError(res.msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
//会员下拉
|
||||||
|
levelList:[],
|
||||||
// 弹出层标题
|
// 弹出层标题
|
||||||
dialogTitle: "",
|
dialogTitle: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
@ -176,6 +207,7 @@ export default {
|
|||||||
serviceList: [],
|
serviceList: [],
|
||||||
// 表单参数
|
// 表单参数
|
||||||
formData: {
|
formData: {
|
||||||
|
memberLevelId: undefined,
|
||||||
id: undefined,
|
id: undefined,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
typeCode: '01',
|
typeCode: '01',
|
||||||
@ -219,6 +251,9 @@ export default {
|
|||||||
inviterType: [
|
inviterType: [
|
||||||
{ required: true, message: '请选择注册方式', trigger: 'change' },
|
{ required: true, message: '请选择注册方式', trigger: 'change' },
|
||||||
],
|
],
|
||||||
|
memberLevelId:[
|
||||||
|
{ required: true, message: '请选择会员', trigger: 'change' },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
// 性别数据字典
|
// 性别数据字典
|
||||||
sexDictDatas: getDictDatas(DICT_TYPE.DICT_SYS_USER_SEX),
|
sexDictDatas: getDictDatas(DICT_TYPE.DICT_SYS_USER_SEX),
|
||||||
|
@ -40,6 +40,8 @@
|
|||||||
<dict-tag :type="DICT_TYPE.DICT_SYS_USER_SEX" :value="scope.row.sex" />
|
<dict-tag :type="DICT_TYPE.DICT_SYS_USER_SEX" :value="scope.row.sex" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column width="80" label="会员等级" align="center" prop="levelName">
|
||||||
|
</el-table-column>
|
||||||
<el-table-column width="110" label="联系方式" align="center" prop="phoneNumber"/>
|
<el-table-column width="110" label="联系方式" align="center" prop="phoneNumber"/>
|
||||||
<el-table-column width="100" label="生日" align="center" prop="birthday">
|
<el-table-column width="100" label="生日" align="center" prop="birthday">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
|
@ -216,11 +216,7 @@ export default {
|
|||||||
password: [
|
password: [
|
||||||
{ required: true, message: '登录密码不能为空', trigger: 'blur' },
|
{ required: true, message: '登录密码不能为空', trigger: 'blur' },
|
||||||
{ min: 6, max: 20, message: '登录密码长度在6~20个字符', trigger: 'blur' },
|
{ min: 6, max: 20, message: '登录密码长度在6~20个字符', trigger: 'blur' },
|
||||||
{
|
|
||||||
pattern: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*()_+{}\[\]:;<>,.?~\\-])\S{6,}$/,
|
|
||||||
message: '登录密码必须由大小写字母、数字、特殊字符组成',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
workDate: [{ required: true, message: '工作日期不能为空', trigger: 'blur' }],
|
workDate: [{ required: true, message: '工作日期不能为空', trigger: 'blur' }],
|
||||||
joinedDate: [{ required: true, message: '入职日期不能为空', trigger: 'blur' }]
|
joinedDate: [{ required: true, message: '入职日期不能为空', trigger: 'blur' }]
|
||||||
|
@ -133,8 +133,7 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tenantCode:"lighting", // TODO 这里手动改还是不太合理
|
tenantCode:"lanan",
|
||||||
// tenantCode:"lanan",
|
|
||||||
codeUrl: "",
|
codeUrl: "",
|
||||||
//是否开启图形验证码
|
//是否开启图形验证码
|
||||||
captchaEnable: false,
|
captchaEnable: false,
|
||||||
|
@ -77,6 +77,17 @@
|
|||||||
</el-switch>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="是否重复参与" prop="isParticipate">
|
||||||
|
<el-switch
|
||||||
|
v-model="formData.isParticipate"
|
||||||
|
active-color="#13ce66"
|
||||||
|
inactive-color="#ff4949"
|
||||||
|
active-value="1"
|
||||||
|
inactive-value="0">
|
||||||
|
</el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
@ -120,6 +131,7 @@ export default {
|
|||||||
isRechRule: '0',
|
isRechRule: '0',
|
||||||
isPack:'0',
|
isPack:'0',
|
||||||
isCoupon:'0',
|
isCoupon:'0',
|
||||||
|
isParticipate:'0'
|
||||||
},
|
},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
formRules: {},
|
formRules: {},
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-select v-model="staffSelected" clearable filterable>
|
<el-select v-model="staffSelected" clearable filterable @blur="$emit('input-blur', $event)">
|
||||||
<el-option v-for="staff in staffList" :key="staff.id" :label="staff.name" :value="staff.id"/>
|
<el-option v-for="staff in staffList" :key="staff.id" :label="staff.name" :value="staff.id"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
|
@ -18,22 +18,74 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="规格" width="180" prop="model"/>
|
<el-table-column align="center" label="规格" width="180" prop="model"/>
|
||||||
<el-table-column align="center" label="编码" width="180" prop="code"/>
|
<el-table-column align="center" label="编码" width="180" prop="code"/>
|
||||||
<el-table-column align="center" label="数量" width="180" prop="count"/>
|
<el-table-column align="center" label="数量" width="180" prop="count">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.count"/>
|
||||||
|
<span class="item__txt">{{ scope.row.count }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column align="center" label="单位" width="180" prop="unit"/>
|
<el-table-column align="center" label="单位" width="180" prop="unit"/>
|
||||||
<el-table-column align="center" label="折扣" width="180"/>
|
<el-table-column align="center" label="单价" width="180" prop="price">
|
||||||
<el-table-column align="center" label="金额" width="180"/>
|
<div class="item" slot-scope="scope">
|
||||||
<el-table-column align="center" label="施工人员" width="180"/>
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.price"/>
|
||||||
<el-table-column align="center" label="销售人员" width="180"/>
|
<span class="item__txt">{{ scope.row.price }}</span>
|
||||||
<el-table-column align="center" label="类型" width="180"/>
|
</div>
|
||||||
<el-table-column align="center" label="账类" width="180"/>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="状态" width="180"/>
|
<el-table-column align="center" label="折扣" width="180" prop="discount">
|
||||||
<el-table-column align="center" label="备注" width="180"/>
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.discount"/>
|
||||||
|
<span class="item__txt">{{ scope.row.discount }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="金额" width="180" prop="totalPrice">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.totalPrice"/>
|
||||||
|
<span class="item__txt">{{ scope.row.totalPrice }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="施工人员" width="180" prop="repair">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<StaffChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.repair"
|
||||||
|
:select-width="'15rem'"/>
|
||||||
|
<span class="item__txt">{{ scope.row.repair ? scope.row.repair.name : scope.row.repair }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="销售人员" width="180" prop="sale">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<StaffChoose @input-blur="save(scope.row)" class="item__input" v-model="scope.row.sale"
|
||||||
|
:select-width="'15rem'"/>
|
||||||
|
<span class="item__txt">{{ scope.row.sale ? scope.row.sale.name : scope.row.sale }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="类型" width="180" prop="type">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.type"/>
|
||||||
|
<span class="item__txt">{{ scope.row.type }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="账类" width="180" prop="accountType">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.accountType"/>
|
||||||
|
<span class="item__txt">{{ scope.row.accountType }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="状态" width="180" prop="itemStatus">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag v-if="scope.row.itemStatus" :type="DICT_TYPE.REPAIR_ITEM_STATUS" v-model="scope.row.itemStatus"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="备注" width="180" prop="remark">
|
||||||
|
<div class="item" slot-scope="scope">
|
||||||
|
<el-input @blur="save(scope.row)" class="item__input" v-model="scope.row.remark"/>
|
||||||
|
<span class="item__txt">{{ scope.row.remark }}</span>
|
||||||
|
</div>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" align="center" width="150">
|
<el-table-column label="操作" fixed="right" align="center" width="150">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete"
|
<el-button size="mini" type="text" icon="el-icon-plus"
|
||||||
>新增
|
>新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete"
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDeleteItem(scope.$index)"
|
||||||
>删除
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@ -44,12 +96,13 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import PartChoose from "@/views/repair/Components/PartChoose.vue";
|
import PartChoose from "@/views/repair/Components/PartChoose.vue";
|
||||||
|
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "TicketItem",
|
name: "TicketItem",
|
||||||
components: {PartChoose},
|
components: {StaffChoose, PartChoose},
|
||||||
props:{
|
props: {
|
||||||
itemType:{
|
itemType: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'project',
|
default: 'project',
|
||||||
required: true
|
required: true
|
||||||
@ -60,14 +113,28 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
list: [{}],
|
list: [{}],
|
||||||
// 需要编辑的属性
|
// 需要编辑的属性
|
||||||
editProp: ["goods"],
|
editProp: ["goods", 'count', 'price', 'discount', 'repair', 'sale', 'remark', 'type', 'accountType'],
|
||||||
// 保存进入编辑的cell
|
// 保存进入编辑的cell
|
||||||
clickCellMap: {}
|
clickCellMap: {},
|
||||||
|
selectRepair: {},
|
||||||
|
selectSale: {},
|
||||||
|
formData: {
|
||||||
|
repair: null,
|
||||||
|
sale: null,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed:{
|
watch:{
|
||||||
getLabelName(){
|
list:{
|
||||||
switch (this.itemType){
|
handler(val){
|
||||||
|
this.$emit("tableData", val)
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
getLabelName() {
|
||||||
|
switch (this.itemType) {
|
||||||
case "project":
|
case "project":
|
||||||
return "维修项目";
|
return "维修项目";
|
||||||
case "part":
|
case "part":
|
||||||
@ -98,11 +165,13 @@ export default {
|
|||||||
handleCellClick(row, column, cell, event) {
|
handleCellClick(row, column, cell, event) {
|
||||||
const property = column.property
|
const property = column.property
|
||||||
if (this.editProp.includes(property)) {
|
if (this.editProp.includes(property)) {
|
||||||
// 保存cell
|
if (!row.id || property !== 'goods') {
|
||||||
this.saveCellClick(row, cell)
|
// 保存cell
|
||||||
cell.querySelector('.item__txt').style.display = 'none'
|
this.saveCellClick(row, cell)
|
||||||
cell.querySelector('.item__input').style.display = 'inline'
|
cell.querySelector('.item__txt').style.display = 'none'
|
||||||
cell.querySelector('input').focus()
|
cell.querySelector('.item__input').style.display = 'inline'
|
||||||
|
cell.querySelector('input').focus()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 取消编辑状态 */
|
/** 取消编辑状态 */
|
||||||
@ -122,7 +191,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 保存数据 */
|
/** 保存数据 */
|
||||||
save (row) {
|
save(row) {
|
||||||
|
// TODO 有BUG 更新表格
|
||||||
|
if (row.id){
|
||||||
|
row.itemStatus = row.repair ? "02" : "01"
|
||||||
|
row.totalPrice = row.count * row.price * (row.discount / 10)
|
||||||
|
}
|
||||||
const id = row.id
|
const id = row.id
|
||||||
// 取消本行所有cell的编辑状态
|
// 取消本行所有cell的编辑状态
|
||||||
this.clickCellMap[id].forEach(cell => {
|
this.clickCellMap[id].forEach(cell => {
|
||||||
@ -130,8 +204,21 @@ export default {
|
|||||||
})
|
})
|
||||||
this.clickCellMap[id] = []
|
this.clickCellMap[id] = []
|
||||||
},
|
},
|
||||||
getPart(data){
|
getPart(data) {
|
||||||
|
data = {
|
||||||
|
...data,
|
||||||
|
count: 1,
|
||||||
|
discount: 10,
|
||||||
|
remark: null,
|
||||||
|
itemStatus: '01',
|
||||||
|
totalPrice: data.price
|
||||||
|
}
|
||||||
this.list.splice(this.list.length - 1, 0, data)
|
this.list.splice(this.list.length - 1, 0, data)
|
||||||
|
},
|
||||||
|
handleDeleteItem(index) {
|
||||||
|
if (this.list[index].id) {
|
||||||
|
this.list.splice(index, 1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,12 +92,12 @@
|
|||||||
</template>
|
</template>
|
||||||
<el-input v-model="selectCar.newMaintenanceMileage"/>
|
<el-input v-model="selectCar.newMaintenanceMileage"/>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item :span="3">
|
<!-- <el-descriptions-item :span="3">-->
|
||||||
<template slot="label">
|
<!-- <template slot="label">-->
|
||||||
备注
|
<!-- 备注-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
<el-input v-model="formData.remark"/>
|
<!-- <el-input v-model="formData.remark"/>-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item>
|
<el-descriptions-item>
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
服务顾问
|
服务顾问
|
||||||
@ -129,9 +129,9 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<TicketItem item-type="project"/>
|
<TicketItem item-type="project" @tableData="projectData"/>
|
||||||
<TicketItem v-if="createTicketType" item-type="part"/>
|
<TicketItem v-if="createTicketType" item-type="part" @tableData="partData"/>
|
||||||
<TicketItem v-if="createTicketType" item-type="other"/>
|
<TicketItem v-if="createTicketType" item-type="other" @tableData="otherData"/>
|
||||||
<el-row :gutter="createTicketType ? 2 : 3" style="margin-top: 1rem">
|
<el-row :gutter="createTicketType ? 2 : 3" style="margin-top: 1rem">
|
||||||
<el-col :span="createTicketType ? 12 : 16">
|
<el-col :span="createTicketType ? 12 : 16">
|
||||||
<el-descriptions class="margin-top" :column="createTicketType ? 2 : 3" border :size="'medium'"
|
<el-descriptions class="margin-top" :column="createTicketType ? 2 : 3" border :size="'medium'"
|
||||||
@ -164,11 +164,11 @@
|
|||||||
<el-col v-if="createTicketType" :span="12">
|
<el-col v-if="createTicketType" :span="12">
|
||||||
<el-descriptions class="margin-top" :column="5" :size="'medium'"
|
<el-descriptions class="margin-top" :column="5" :size="'medium'"
|
||||||
style="margin-left: 1rem;margin-top: 1rem">
|
style="margin-left: 1rem;margin-top: 1rem">
|
||||||
<el-descriptions-item label="数量">0</el-descriptions-item>
|
<el-descriptions-item label="数量">{{ formData.count }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="项目">0</el-descriptions-item>
|
<el-descriptions-item label="项目">{{ formData.projectPrice }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="配件">0</el-descriptions-item>
|
<el-descriptions-item label="配件">{{ formData.partPrice }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="附加">0</el-descriptions-item>
|
<el-descriptions-item label="附加">{{ formData.otherPrice }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="合计">0</el-descriptions-item>
|
<el-descriptions-item label="合计">{{ formData.totalPrice }}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-else :span="8" style="margin-top:1rem;display: flex;justify-content: right">
|
<el-col v-else :span="8" style="margin-top:1rem;display: flex;justify-content: right">
|
||||||
@ -183,11 +183,12 @@
|
|||||||
<template slot="label">
|
<template slot="label">
|
||||||
备注
|
备注
|
||||||
</template>
|
</template>
|
||||||
<el-input/>
|
<el-input v-model="formData.remark"/>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" style="margin-top:1rem;display: flex;justify-content: right">
|
<el-col :span="12" style="margin-top:1rem;display: flex;justify-content: right">
|
||||||
|
<el-button type="success" @click="handleSave">登记保存</el-button>
|
||||||
<el-button type="danger">结算</el-button>
|
<el-button type="danger">结算</el-button>
|
||||||
<el-button type="success">完成</el-button>
|
<el-button type="success">完成</el-button>
|
||||||
<el-button type="primary">通知施工</el-button>
|
<el-button type="primary">通知施工</el-button>
|
||||||
@ -203,7 +204,8 @@ import UserChoose from "@/views/repair/Components/UserChoose.vue";
|
|||||||
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
|
import StaffChoose from "@/views/repair/Components/StaffChoose.vue";
|
||||||
import TicketItem from "@/views/repair/tickets/Components/TicketItem.vue";
|
import TicketItem from "@/views/repair/tickets/Components/TicketItem.vue";
|
||||||
import CarChoose from "@/views/repair/Components/CarChoose.vue";
|
import CarChoose from "@/views/repair/Components/CarChoose.vue";
|
||||||
import {parseTime} from "../../../../utils/ruoyi";
|
import {createUniqueCodeByHead} from "@/utils/createUniqueCode";
|
||||||
|
import {createTickets} from "@/api/repair/tickets/Tickets";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "UserInfo",
|
name: "UserInfo",
|
||||||
@ -236,15 +238,212 @@ export default {
|
|||||||
remark: null,
|
remark: null,
|
||||||
inTime: Date.now(),
|
inTime: Date.now(),
|
||||||
outTime: null,
|
outTime: null,
|
||||||
ticketTime: Date.now()
|
ticketTime: Date.now(),
|
||||||
|
projectPrice: 0,
|
||||||
|
partPrice: 0,
|
||||||
|
otherPrice: 0,
|
||||||
|
totalPrice: 0,
|
||||||
|
count: 0,
|
||||||
|
userId: null,
|
||||||
|
userName: null,
|
||||||
|
userMobile: null,
|
||||||
|
carId: null,
|
||||||
|
carNo: null,
|
||||||
|
carVin: null,
|
||||||
|
carBrandId: null,
|
||||||
|
carBrandName: null,
|
||||||
|
carBrandType: null,
|
||||||
|
adviserId: null,
|
||||||
|
adviserName: null,
|
||||||
|
payType: null,
|
||||||
|
repairAdvice: null,
|
||||||
|
qualityExplain: null,
|
||||||
|
ticketType: null,
|
||||||
|
itemList: [],
|
||||||
},
|
},
|
||||||
selectUser: {},
|
selectUser: {},
|
||||||
selectCar: {},
|
selectCar: {},
|
||||||
selectStaff: {},
|
selectStaff: {},
|
||||||
|
projectList: [],
|
||||||
|
partList: [],
|
||||||
|
otherList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
parseTime
|
projectData(data) {
|
||||||
|
// 去掉最后一行
|
||||||
|
this.projectList = [...data]
|
||||||
|
this.projectList.pop()
|
||||||
|
// 通知计算
|
||||||
|
this.computedData()
|
||||||
|
},
|
||||||
|
partData(data) {
|
||||||
|
// 去掉最后一行
|
||||||
|
this.partList = [...data]
|
||||||
|
this.partList.pop()
|
||||||
|
// 通知计算
|
||||||
|
this.computedData()
|
||||||
|
},
|
||||||
|
otherData(data) {
|
||||||
|
// 去掉最后一行
|
||||||
|
this.otherList = [...data]
|
||||||
|
this.otherList.pop()
|
||||||
|
// 通知计算
|
||||||
|
this.computedData()
|
||||||
|
},
|
||||||
|
computedData() {
|
||||||
|
const data = this.formData
|
||||||
|
this.formData = {
|
||||||
|
...data,
|
||||||
|
projectPrice: 0,
|
||||||
|
partPrice: 0,
|
||||||
|
otherPrice: 0,
|
||||||
|
totalPrice: 0,
|
||||||
|
count: 0
|
||||||
|
}
|
||||||
|
// 项目
|
||||||
|
if (this.projectList) {
|
||||||
|
this.formData.projectPrice = this.computeByItem(this.projectList)
|
||||||
|
}
|
||||||
|
// 配件
|
||||||
|
if (this.partList) {
|
||||||
|
this.formData.partPrice = this.computeByItem(this.partList)
|
||||||
|
}
|
||||||
|
// 其他
|
||||||
|
if (this.otherList) {
|
||||||
|
this.formData.otherPrice = this.computeByItem(this.otherList)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computeByItem(item) {
|
||||||
|
const count = item.reduce((x, y) => {
|
||||||
|
return x + y.count
|
||||||
|
}, 0)
|
||||||
|
const totalPrice = item.reduce((x, y) => {
|
||||||
|
return x + y.totalPrice
|
||||||
|
}, 0)
|
||||||
|
this.formData.count += parseInt(count)
|
||||||
|
this.formData.totalPrice += parseFloat(totalPrice)
|
||||||
|
return parseFloat(totalPrice)
|
||||||
|
},
|
||||||
|
// 登记保存
|
||||||
|
async handleSave() {
|
||||||
|
this.createInit()
|
||||||
|
this.createItemInit()
|
||||||
|
try {
|
||||||
|
// await createTickets(this.formData)
|
||||||
|
this.$modal.msgSuccess("新增成功")
|
||||||
|
this.init()
|
||||||
|
}catch{}
|
||||||
|
},
|
||||||
|
// 初始化
|
||||||
|
init(){
|
||||||
|
this.formData = {
|
||||||
|
endCheck: 1,
|
||||||
|
partDisposal: '01',
|
||||||
|
repairType: '01',
|
||||||
|
ticketNo: null,
|
||||||
|
remark: null,
|
||||||
|
inTime: Date.now(),
|
||||||
|
outTime: null,
|
||||||
|
ticketTime: Date.now(),
|
||||||
|
projectPrice: 0,
|
||||||
|
partPrice: 0,
|
||||||
|
otherPrice: 0,
|
||||||
|
totalPrice: 0,
|
||||||
|
count: 0,
|
||||||
|
userId: null,
|
||||||
|
userName: null,
|
||||||
|
userMobile: null,
|
||||||
|
carId: null,
|
||||||
|
carNo: null,
|
||||||
|
carVin: null,
|
||||||
|
carBrandId: null,
|
||||||
|
carBrandName: null,
|
||||||
|
carBrandType: null,
|
||||||
|
adviserId: null,
|
||||||
|
adviserName: null,
|
||||||
|
payType: null,
|
||||||
|
repairAdvice: null,
|
||||||
|
qualityExplain: null,
|
||||||
|
ticketType: null,
|
||||||
|
itemList: [],
|
||||||
|
}
|
||||||
|
this.selectUser ={}
|
||||||
|
this.selectCar = {}
|
||||||
|
this.selectStaff = {}
|
||||||
|
this.projectList = []
|
||||||
|
this.partList = []
|
||||||
|
this.otherList = []
|
||||||
|
},
|
||||||
|
// 新增基础信息init
|
||||||
|
createInit() {
|
||||||
|
// 生成工单号
|
||||||
|
this.formData.ticketNo = createUniqueCodeByHead("GD")
|
||||||
|
// 选择的用户
|
||||||
|
this.formData.userId = this.selectUser?.userId
|
||||||
|
this.formData.userName = this.selectUser?.cusName
|
||||||
|
this.formData.userMobile = this.selectUser?.phoneNumber
|
||||||
|
|
||||||
|
// 选择的车辆
|
||||||
|
this.formData.carId = this.selectCar?.id
|
||||||
|
this.formData.carNo = this.selectCar?.licenseNumber
|
||||||
|
this.formData.carVin = this.selectCar?.vin
|
||||||
|
this.formData.carBrandId = this.selectCar?.carBrand
|
||||||
|
this.formData.carBrandName = this.selectCar?.brandStr
|
||||||
|
this.formData.carBrandType = this.selectCar?.brandType
|
||||||
|
|
||||||
|
// 服务顾问
|
||||||
|
this.formData.adviserId = this.selectStaff?.id
|
||||||
|
this.formData.adviserName = this.selectStaff?.name
|
||||||
|
},
|
||||||
|
// 新增子表信息init
|
||||||
|
createItemInit() {
|
||||||
|
// 项目
|
||||||
|
this.formData.itemList = [...this.formData.itemList, ...this.formatItem("project", this.projectList)]
|
||||||
|
// 配件
|
||||||
|
this.formData.itemList = [...this.formData.itemList, ...this.formatItem("part", this.partList)]
|
||||||
|
// 其他
|
||||||
|
this.formData.itemList = [...this.formData.itemList, ...this.formatItem("other", this.otherList)]
|
||||||
|
},
|
||||||
|
// 子表信息预处理
|
||||||
|
formatItem(type, list) {
|
||||||
|
if (!(list && list.length > 0)){
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return list.map(item => {
|
||||||
|
const temp = {
|
||||||
|
...item,
|
||||||
|
itemName: item.name,
|
||||||
|
itemCount: item.count,
|
||||||
|
itemUnit: item.unit,
|
||||||
|
itemPrice: item.price,
|
||||||
|
itemDiscount: item.discount,
|
||||||
|
itemMoney: item.totalPrice,
|
||||||
|
repairId: item?.repair?.id,
|
||||||
|
repairName: item?.repair?.name,
|
||||||
|
saleId: item?.sale?.id,
|
||||||
|
saleName: item?.sale?.name,
|
||||||
|
itemTypeId: item?.type?.id,
|
||||||
|
remark: item.remark,
|
||||||
|
itemStatus: item.itemStatus,
|
||||||
|
}
|
||||||
|
switch (type) {
|
||||||
|
case 'project':
|
||||||
|
temp['itemType'] = "01"
|
||||||
|
break;
|
||||||
|
case 'part':
|
||||||
|
temp['itemType'] = "02"
|
||||||
|
break;
|
||||||
|
case 'other':
|
||||||
|
temp['itemType'] = "03"
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
temp[type + 'Id'] = item.id
|
||||||
|
return temp;
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user