Browse Source

完善预约登记

master
yunuo970428 1 year ago
parent
commit
f3da410930
  1. 10
      yxt-as-ui/src/api/Common/dictcommons.js
  2. 8
      yxt-as-ui/src/api/operation/preregistration.js
  3. 96
      yxt-as-ui/src/views/operation/preregistration/preregistrationAdd.vue

10
yxt-as-ui/src/api/Common/dictcommons.js

@ -152,3 +152,13 @@ export function selSubjectInfo(data) {
}) })
} }
//
// 查询分页列表 -- 客户列表
export function customerListPage(params) {
return request({
url: '/v1/crmcustomer/customerListPage',
method: 'post',
data: params,
headers: { 'Content-Type': 'application/json' }
})
}

8
yxt-as-ui/src/api/operation/preregistration.js

@ -39,5 +39,13 @@ export default {
data: data, data: data,
headers: { 'Content-Type': 'application/json' } headers: { 'Content-Type': 'application/json' }
}) })
},
convertedRepairOrders: function(data) {
return request({
url: '/as/v1/asbusreservebill/convertedRepairOrders',
method: 'post',
data: data,
headers: { 'Content-Type': 'application/json' }
})
} }
} }

96
yxt-as-ui/src/views/operation/preregistration/preregistrationAdd.vue

@ -5,6 +5,7 @@
<div>{{ viewTitle }}</div> <div>{{ viewTitle }}</div>
<div> <div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button> <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> <el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div> </div>
</div> </div>
@ -17,7 +18,7 @@
<el-popover placement="right" width="600" trigger="click"> <el-popover placement="right" width="600" trigger="click">
<div> <div>
<el-table :data="clientData" v-loading="clientLoading" highlight-current-row @current-change="clientCurrentChange"> <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="name" label="客户" align="center" width="100" />
<el-table-column prop="mobile" label="联系方式" align="center" min-width="300" /> <el-table-column prop="mobile" label="联系方式" align="center" min-width="300" />
<el-table-column prop="orgName" label="客户单位" align="center" width="100" /> <el-table-column prop="orgName" label="客户单位" align="center" width="100" />
@ -64,7 +65,13 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="span-sty">预约日期</div> <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-col>
</el-row> </el-row>
<el-row> <el-row>
@ -80,40 +87,39 @@
<i class="el-icon-delete" @click="serviceDelete(scope.$index)"></i> <i class="el-icon-delete" @click="serviceDelete(scope.$index)"></i>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="服务项目" align="center" min-width="200"> <el-table-column label="服务项目" align="center" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<el-popover placement="right" width="600" trigger="click"> <el-popover placement="right" width="600" trigger="click">
<div> <div>
<el-table :data="serviceData" v-loading="serviceLoading" highlight-current-row @current-change="serviceCurrentChange($event, scope.row)"> <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 fixed prop="serviceItem" label="项目名称" align="center" width="130" />
<el-table-column prop="goodsCode" label="零件号" align="center" width="100" /> <el-table-column prop="sitemCode" label="项目编码" align="center" width="100" />
<el-table-column prop="goodsModel" label="车型" align="center" min-width="300" /> <el-table-column prop="hourPrice" label="工时单价" align="center" min-width="300" />
<el-table-column prop="warehouse" label="仓库" align="center" width="" /> <el-table-column prop="hours" label="工时数" align="center" width="100" />
<el-table-column prop="price" 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-table>
<el-pagination :page.sync="serviceQuery.current" :page-size="serviceQuery.size" layout="total, pager" :total="serviceQuery.total" /> <el-pagination :page.sync="serviceQuery.current" :page-size="serviceQuery.size" layout="total, pager" :total="serviceQuery.total" />
</div> </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> </el-popover>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工时单价" align="center" width="130"> <el-table-column label="工时单价" align="center" width="150">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="工时数" align="center" width="100"> <el-table-column label="工时数" align="center" width="150">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="销售价" align="center" width="100"> <el-table-column label="销售价" align="center" width="150">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" width="200"> <el-table-column label="备注" align="center" min-width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.remarks" clearable placeholder="" /> <el-input v-model="scope.row.remarks" clearable placeholder="" />
</template> </template>
@ -127,9 +133,11 @@
<script> <script>
import req from '@/api/operation/preregistration' import req from '@/api/operation/preregistration'
import maintenanceitem from '@/api/basicinformation/maintenanceitem'
import { customerListPage } from '@/api/Common/dictcommons'
export default { export default {
name: '', name: 'PreregistrationAdd',
data() { data() {
return { return {
viewTitle: '', viewTitle: '',
@ -157,7 +165,8 @@ export default {
size: 2, size: 2,
total: 0, total: 0,
params: { params: {
name: '' sitemName: '',
orgPath: ''
} }
}, },
serviceData: [], serviceData: [],
@ -197,10 +206,28 @@ export default {
this.$refs['form_obj'].clearValidate() 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) { clientInput(value) {
this.clientQuery.params.queryName = value this.clientQuery.params.queryName = value
this.clientLoading = true this.clientLoading = true
req.customerListPage(this.clientQuery).then((response) => { customerListPage(this.clientQuery).then((response) => {
if (response.success) { if (response.success) {
this.clientLoading = false this.clientLoading = false
this.clientData = response.data.records this.clientData = response.data.records
@ -213,9 +240,9 @@ export default {
}) })
}, },
clientCurrentChange(value) { clientCurrentChange(value) {
// this.formobj.customerName = value.name this.formobj.customerName = value.name
// this.formobj.vehMark = value.vehMark this.formobj.vehMark = value.vehMark
// this.formobj.mobile = value.mobile this.formobj.mobile = value.mobile
document.body.click() document.body.click()
}, },
// //
@ -246,9 +273,9 @@ export default {
}, },
serviceInput(value) { serviceInput(value) {
this.serviceQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath') this.serviceQuery.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
this.serviceQuery.params.name = value this.serviceQuery.params.sitemName = value
this.serviceLoading = true this.serviceLoading = true
req.listPageSales(this.serviceQuery).then((response) => { maintenanceitem.listPage(this.serviceQuery).then((response) => {
if (response.success) { if (response.success) {
this.serviceLoading = false this.serviceLoading = false
this.serviceData = response.data.records 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) { handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist') if (isreload === 'true') this.$emit('reloadlist')
this.formobj = { this.formobj = {

Loading…
Cancel
Save