|
|
@ -5,6 +5,7 @@ |
|
|
|
<div>{{ viewTitle }}</div> |
|
|
|
<div> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button> |
|
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="toService()">转维修单</el-button> |
|
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -17,7 +18,7 @@ |
|
|
|
<el-popover placement="right" width="600" trigger="click"> |
|
|
|
<div> |
|
|
|
<el-table :data="clientData" v-loading="clientLoading" highlight-current-row @current-change="clientCurrentChange"> |
|
|
|
<el-table-column fixed prop="vehMark" label="车辆拍照" align="center" width="130" /> |
|
|
|
<el-table-column fixed prop="vehMark" label="车辆牌照" align="center" width="130" /> |
|
|
|
<el-table-column prop="name" label="客户" align="center" width="100" /> |
|
|
|
<el-table-column prop="mobile" label="联系方式" align="center" min-width="300" /> |
|
|
|
<el-table-column prop="orgName" label="客户单位" align="center" width="100" /> |
|
|
@ -64,7 +65,13 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<div class="span-sty">预约日期</div> |
|
|
|
<el-form-item><el-date-picker class="addinputInfo" v-model="formobj.reserveStart" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" /></el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<div class="addinputInfo"> |
|
|
|
<el-date-picker v-model="formobj.reserveStart" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期" /> |
|
|
|
<span style="padding: 0 8px">至</span> |
|
|
|
<el-date-picker v-model="formobj.reserveEnd" value-format="yyyy-MM-dd" format="yyyy-MM-dd" type="date" placeholder="选择日期" /> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
@ -80,40 +87,39 @@ |
|
|
|
<i class="el-icon-delete" @click="serviceDelete(scope.$index)"></i> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="服务项目" align="center" min-width="200"> |
|
|
|
<el-table-column label="服务项目" align="center" width="300"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-popover placement="right" width="600" trigger="click"> |
|
|
|
<div> |
|
|
|
<el-table :data="serviceData" v-loading="serviceLoading" highlight-current-row @current-change="serviceCurrentChange($event, scope.row)"> |
|
|
|
<el-table-column fixed prop="goodsName" label="商品名称" align="center" width="130" /> |
|
|
|
<el-table-column prop="goodsCode" label="零件号" align="center" width="100" /> |
|
|
|
<el-table-column prop="goodsModel" label="车型" align="center" min-width="300" /> |
|
|
|
<el-table-column prop="warehouse" label="仓库" align="center" width="" /> |
|
|
|
<el-table-column fixed prop="serviceItem" label="项目名称" align="center" width="130" /> |
|
|
|
<el-table-column prop="sitemCode" label="项目编码" align="center" width="100" /> |
|
|
|
<el-table-column prop="hourPrice" label="工时单价" align="center" min-width="300" /> |
|
|
|
<el-table-column prop="hours" label="工时数" align="center" width="100" /> |
|
|
|
<el-table-column prop="price" label="销售价" align="center" width="100" /> |
|
|
|
<el-table-column prop="count" label="数量" align="center" width="100" /> |
|
|
|
</el-table> |
|
|
|
<el-pagination :page.sync="serviceQuery.current" :page-size="serviceQuery.size" layout="total, pager" :total="serviceQuery.total" /> |
|
|
|
</div> |
|
|
|
<el-input slot="reference" v-model="scope.row.goodsName" @input="serviceInput(scope.row.goodsName)" clearable placeholder="项目名称、拼音"/> |
|
|
|
<el-input slot="reference" v-model="scope.row.serviceItem" @input="serviceInput(scope.row.serviceItem)" clearable placeholder="项目名称、拼音"/> |
|
|
|
</el-popover> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="工时单价" align="center" width="130"> |
|
|
|
<el-table-column label="工时单价" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input @input="computeXSJ(scope.row)" v-model="scope.row.hourPrice" clearable placeholder="" /> |
|
|
|
<el-input @input="computeXSJ(scope.row)" @keyup.native="scope.row.hourPrice = getNumber(scope.row.hourPrice, 2)" v-model="scope.row.hourPrice" clearable placeholder="" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="工时数" align="center" width="100"> |
|
|
|
<el-table-column label="工时数" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input @input="computeXSJ(scope.row)" v-model="scope.row.hours" clearable placeholder="" /> |
|
|
|
<el-input @input="computeXSJ(scope.row)" @keyup.native="scope.row.hours = getNumber(scope.row.hours, 2)" v-model="scope.row.hours" clearable placeholder="" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="销售价" align="center" width="100"> |
|
|
|
<el-table-column label="销售价" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input @input="computeGSS(scope.row)" v-model="scope.row.price" clearable placeholder="" /> |
|
|
|
<el-input @input="computeGSS(scope.row)" @keyup.native="scope.row.price = getNumber(scope.row.price, 2)" v-model="scope.row.price" clearable placeholder="" /> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="备注" align="center" width="200"> |
|
|
|
<el-table-column label="备注" align="center" min-width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.remarks" clearable placeholder="" /> |
|
|
|
</template> |
|
|
@ -127,9 +133,11 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import req from '@/api/operation/preregistration' |
|
|
|
import maintenanceitem from '@/api/basicinformation/maintenanceitem' |
|
|
|
import { customerListPage } from '@/api/Common/dictcommons' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: '', |
|
|
|
name: 'PreregistrationAdd', |
|
|
|
data() { |
|
|
|
return { |
|
|
|
viewTitle: '', |
|
|
@ -157,7 +165,8 @@ export default { |
|
|
|
size: 2, |
|
|
|
total: 0, |
|
|
|
params: { |
|
|
|
name: '' |
|
|
|
sitemName: '', |
|
|
|
orgPath: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
serviceData: [], |
|
|
@ -197,10 +206,28 @@ export default { |
|
|
|
this.$refs['form_obj'].clearValidate() |
|
|
|
}) |
|
|
|
}, |
|
|
|
getNumber(val, limit) { |
|
|
|
val = val.replace(/[^0-9.]/g, '') // 保留数字 |
|
|
|
val = val.replace(/^00/, '0.') // 开头不能有两个0 |
|
|
|
val = val.replace(/^\./g, '0.') // 开头为小数点转换为0. |
|
|
|
val = val.replace(/\.{2,}/g, '.') // 两个以上的小数点转换成一个 |
|
|
|
val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.'); // 只保留一个小数点 |
|
|
|
/^0\d+/.test(val) ? val = val.slice(1) : '' // 两位以上数字开头不能为0 |
|
|
|
const str = '^(\\d+)\\.(\\d{' + limit + '}).*$' |
|
|
|
const reg = new RegExp(str) |
|
|
|
if (limit === 0) { |
|
|
|
// 不需要小数点 |
|
|
|
val = val.replace(reg, '$1') |
|
|
|
} else { |
|
|
|
// 通过正则保留小数点后指定的位数 |
|
|
|
val = val.replace(reg, '$1.$2') |
|
|
|
} |
|
|
|
return val |
|
|
|
}, |
|
|
|
clientInput(value) { |
|
|
|
this.clientQuery.params.queryName = value |
|
|
|
this.clientLoading = true |
|
|
|
req.customerListPage(this.clientQuery).then((response) => { |
|
|
|
customerListPage(this.clientQuery).then((response) => { |
|
|
|
if (response.success) { |
|
|
|
this.clientLoading = false |
|
|
|
this.clientData = response.data.records |
|
|
@ -213,9 +240,9 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
clientCurrentChange(value) { |
|
|
|
// this.formobj.customerName = value.name |
|
|
|
// this.formobj.vehMark = value.vehMark |
|
|
|
// this.formobj.mobile = value.mobile |
|
|
|
this.formobj.customerName = value.name |
|
|
|
this.formobj.vehMark = value.vehMark |
|
|
|
this.formobj.mobile = value.mobile |
|
|
|
document.body.click() |
|
|
|
}, |
|
|
|
// 在头部标题上添加“新增”图标 |
|
|
@ -246,9 +273,9 @@ export default { |
|
|
|
}, |
|
|
|
serviceInput(value) { |
|
|
|
this.serviceQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath') |
|
|
|
this.serviceQuery.params.name = value |
|
|
|
this.serviceQuery.params.sitemName = value |
|
|
|
this.serviceLoading = true |
|
|
|
req.listPageSales(this.serviceQuery).then((response) => { |
|
|
|
maintenanceitem.listPage(this.serviceQuery).then((response) => { |
|
|
|
if (response.success) { |
|
|
|
this.serviceLoading = false |
|
|
|
this.serviceData = response.data.records |
|
|
@ -297,6 +324,27 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
toService() { |
|
|
|
this.$refs['form_obj'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (this.formobj.sitemVos.length === 0) { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '表格不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.submitdisabled = true |
|
|
|
req.convertedRepairOrders(this.formobj).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' }) |
|
|
|
this.handleReturn('true') |
|
|
|
} else { |
|
|
|
this.submitdisabled = false |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.submitdisabled = false |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleReturn(isreload) { |
|
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
|
this.formobj = { |
|
|
|