
11 changed files with 1254 additions and 53 deletions
@ -0,0 +1,332 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="viewState == 1"> |
|||
<button-bar view-title="调车开票申请管理" ref="btnbar" :btndisabled="btndisabled" @btnhandle="btnHandle"/> |
|||
<div class="main-content"> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="isSearchShow = !isSearchShow"> |
|||
{{ isSearchShow ? '隐藏查询条件' : '显示查询条件' }} |
|||
</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form :inline="true" class="tab-header"> |
|||
<el-form-item label="调帐类型"> |
|||
<el-select v-model="listQuery.params.purchaseType" placeholder="请选择" clearable class="addinputw"> |
|||
<el-option v-for="item in purchaseType_list" :key="item.dictKey" :label="item.dictValue" |
|||
:value="item.dictKey"/> |
|||
</el-select> |
|||
<!-- <el-input v-model="listQuery.params.vin" placeholder="请输入车架号" clearable/>--> |
|||
</el-form-item> |
|||
<el-form-item label="调出分公司"> |
|||
<el-select v-model="listQuery.params.purchaseType" placeholder="请选择" clearable class="addinputw"> |
|||
<el-option v-for="item in purchaseType_list" :key="item.dictKey" :label="item.dictValue" |
|||
:value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="调入分公司"> |
|||
<el-select v-model="listQuery.params.purchaseType" placeholder="请选择" clearable class="addinputw"> |
|||
<el-option v-for="item in purchaseType_list" :key="item.dictKey" :label="item.dictValue" |
|||
:value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="申请日期:"> |
|||
<el-date-picker v-model="listQuery.params.applicationStartDate" class="filter-item" type="date" |
|||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择"/> |
|||
<label>至</label> |
|||
<el-date-picker v-model="listQuery.params.applicationEndDate" class="filter-item" type="date" |
|||
format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="请选择"/> |
|||
</el-form-item> |
|||
</el-form> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" @click="getList">查询</el-button> |
|||
<el-button type="primary" @click="resetQuery">重置</el-button> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!--Start 项目列表头部--> |
|||
<div class="listtop"> |
|||
<div class="tit">调车开票申请列表</div> |
|||
<pageye v-show="dataList.length > 0" :total="listQuery.total" :page.sync="listQuery.current" |
|||
:limit.sync="listQuery.size" class="pagination" @pagination="loadList"/> |
|||
</div> |
|||
<!--End 项目列表头部--> |
|||
<!--Start 项目列表--> |
|||
<div class=""> |
|||
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" |
|||
@selection-change="handleSelectionChange"> |
|||
<el-table-column width="50px" type="selection" align="center"/> |
|||
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column label="操作" align="center" width="160px" class-name="small-padding fixed-width"> |
|||
<template slot-scope="{row}"><!-- v-show="row.showInspectedBtn" --> |
|||
<el-button size="mini" type="primary" @click="handleEdit(row)">办理</el-button> |
|||
<el-button size="mini" type="primary" @click="handleCheck(row)">查看</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column width="140px" prop="vin" label="申请日期" align="center"/> |
|||
<el-table-column width="120px" prop="model" label="调账类型" align="center"/> |
|||
<el-table-column prop="purchaseType" label="调出分公司" align="center"/> |
|||
<el-table-column prop="dispatchedDate" label="调入分公司" align="center"/> |
|||
</el-table> |
|||
</div> |
|||
<!--End 项目列表--> |
|||
<div class="pages"> |
|||
<div class="tit"/> |
|||
<!-- 翻页 --> |
|||
<pagination |
|||
v-show="dataList.length > 0" |
|||
:total="listQuery.total" |
|||
:page.sync="listQuery.current" |
|||
:limit.sync="listQuery.size" |
|||
class="pagination" |
|||
@pagination="loadList" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!--End 查询和其列表部分--> |
|||
<!--新增修改部分组件--> |
|||
<diaocheshenqing-add v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" |
|||
@reloadlist="getList"/> |
|||
<!-- 详情部分组件 --> |
|||
<diaocheshenqing-info v-show="viewState == 4" ref="divinfo" @doback="resetState"/> |
|||
|
|||
|
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import ButtonBar from '@/components/ButtonBar' |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import diaocheshenqingAdd from '@/views/supplychain/diaochekaipiaoshenqingguanli/diaocheshenqingAdd' |
|||
import diaocheshenqingInfo from '@/views/supplychain/diaochekaipiaoshenqingguanli/diaocheshenqingInfo' |
|||
import { selectCarInspectedList, typeValues } from '@/api/supplychain/yancheguanli' |
|||
import { getUseOrgByUserSid, selectModelName } from '@/api/cheliang/basevehicle' |
|||
import { deleteCarTransfer } from '@/api/supplychain/cunfangdidianbiangeng' |
|||
|
|||
export default { |
|||
name: 'diaocheshenqing', |
|||
components: { |
|||
ButtonBar, |
|||
Pagination, |
|||
pageye, |
|||
diaocheshenqingAdd, |
|||
diaocheshenqingInfo |
|||
}, |
|||
data() { |
|||
return { |
|||
btndisabled: false, |
|||
viewState: 1, // 1、列表 2、添加 3、修改 4、查看 |
|||
isSearchShow: false, |
|||
tableLoading: false, |
|||
dataList: [], |
|||
useOrg_list: [], |
|||
modelName_list: [], |
|||
purchaseType_list: [], |
|||
useOrg: '', // 使用组织 |
|||
useOrgSid: '', // 使用组织sid |
|||
listQuery: { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
vin: '', |
|||
model: '', |
|||
purchaseType: '', |
|||
userSid: window.sessionStorage.getItem('userSid') |
|||
} |
|||
}, |
|||
btnList: [ |
|||
{ |
|||
type: 'primary', |
|||
size: 'small', |
|||
icon: 'plus', |
|||
btnKey: 'toAdd', |
|||
btnLabel: '新增' |
|||
}, |
|||
{ |
|||
type: 'danger', |
|||
size: 'small', |
|||
icon: 'del', |
|||
btnKey: 'doDel', |
|||
btnLabel: '删除' |
|||
}, |
|||
{ |
|||
type: 'info', |
|||
size: 'small', |
|||
icon: 'cross', |
|||
btnKey: 'doClose', |
|||
btnLabel: '关闭' |
|||
} |
|||
], |
|||
multipleSelection: [] |
|||
} |
|||
}, |
|||
created() { |
|||
this.getList() |
|||
this.getType() |
|||
}, |
|||
mounted() { |
|||
this.$refs['btnbar'].setButtonList(this.btnList) |
|||
}, |
|||
methods: { |
|||
resetState() { |
|||
this.viewState = 1 |
|||
}, |
|||
btnHandle(btnKey) { |
|||
console.log('XXXXXXXXXXXXXXX ' + btnKey) |
|||
switch (btnKey) { |
|||
case 'toAdd': |
|||
this.toAdd() |
|||
break |
|||
case 'doDel': |
|||
this.doDel() |
|||
break |
|||
case 'doClose': |
|||
this.doClose() |
|||
break |
|||
default: |
|||
break |
|||
} |
|||
}, |
|||
toAdd() { |
|||
this.viewState = 2 |
|||
this.$refs['divadd'].showAdd() |
|||
}, |
|||
doDel() { |
|||
if (this.multipleSelection.length === 0) { |
|||
this.$message({ |
|||
showClose: true, type: 'error', message: '请选择至少一条记录进行删除操作' |
|||
}) |
|||
return |
|||
} |
|||
const _this = this |
|||
const tip = '请确认是否删除所选 ' + this.multipleSelection.length + ' 条记录?' |
|||
this.$confirm(tip, '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
const loading = this.$loading({ |
|||
lock: true, |
|||
text: 'Loading', |
|||
spinner: 'el-icon-loading', |
|||
background: 'rgba(0, 0, 0, 0.7)' |
|||
}) |
|||
// const sids = this.sids.join() |
|||
deleteCarTransfer(this.sids).then(resp => { |
|||
if (resp.success) { |
|||
loading.close() |
|||
_this.$message({ type: 'success', message: resp.msg, showClose: true }) |
|||
_this.loadList() |
|||
} else { |
|||
loading.close() |
|||
} |
|||
}).catch(e => { |
|||
loading.close() |
|||
}) |
|||
}).catch(() => { |
|||
loading.close() |
|||
}) |
|||
}, |
|||
handleEdit(row) { |
|||
this.viewState = 2 |
|||
this.$refs['divadd'].showAdd(row) |
|||
}, |
|||
handleCheck(row) { |
|||
this.$refs['divinfo'].showInfo(row) |
|||
console.log('详情回显', row) |
|||
this.viewState = 4 |
|||
}, |
|||
handleSelectionChange(row) { |
|||
this.multipleSelection = row |
|||
const aa = [] |
|||
row.forEach((element) => { |
|||
aa.push(element.sid) |
|||
}) |
|||
this.sids = aa |
|||
console.log('勾选的数据', this.sids) |
|||
}, |
|||
getList() { |
|||
this.listQuery.current = 1 |
|||
this.loadList() |
|||
}, |
|||
resetQuery() { |
|||
this.listQuery = { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
vin: '', |
|||
model: '', |
|||
purchaseType: '', |
|||
userSid: window.sessionStorage.getItem('userSid') |
|||
} |
|||
} |
|||
this.getList() |
|||
}, |
|||
loadList() { |
|||
const _this = this |
|||
this.tableLoading = true |
|||
selectCarInspectedList(this.listQuery) |
|||
.then(resp => { |
|||
_this.tableLoading = false |
|||
const data = resp.data |
|||
_this.listQuery.total = data.total |
|||
_this.dataList = data.records |
|||
for (var i = 0; i < this.dataList.length; i++) { |
|||
if (this.dataList[i].inspectedType == '1') { |
|||
this.dataList[i].inspectedType = '待验车' |
|||
} else { |
|||
this.dataList[i].inspectedType = '已验车' |
|||
} |
|||
} |
|||
}) |
|||
.catch(() => { |
|||
_this.tableLoading = false |
|||
}) |
|||
}, |
|||
getType() { |
|||
typeValues({ |
|||
type: 'purchaseOrderType ' |
|||
}).then((response) => { |
|||
if (response.code === '200' && response.data) { |
|||
this.purchaseType_list = response.data |
|||
} |
|||
}) |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
doClose() { |
|||
this.$store.dispatch('tagsView/delView', this.$route) |
|||
this.$router.go(-1) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.searchbtn { |
|||
border: #2cab69 1px solid; |
|||
color: #2cab69; |
|||
} |
|||
|
|||
.btn { |
|||
padding: 15px 0 15px 0; |
|||
border: 1px solid #e0e3eb; |
|||
background: white; |
|||
} |
|||
|
|||
.tab-header { |
|||
background-color: #edf1f7; |
|||
padding: 8px 20px; |
|||
margin-bottom: 0 !important; |
|||
} |
|||
|
|||
.tab-header /deep/ .el-form-item { |
|||
margin-bottom: 10px; |
|||
} |
|||
</style> |
@ -0,0 +1,359 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div v-show="isXuanche === false"> |
|||
<!--标题按钮部分开始--> |
|||
<div class="tab-header webtop"> |
|||
<!--标题--> |
|||
<div>{{ viewTitle }}</div> |
|||
<!--start 添加修改按钮--> |
|||
<div> |
|||
<el-button |
|||
type="primary" |
|||
size="small" |
|||
:disabled="submitdisabled" |
|||
@click="dialogStatus === 'add' ? saveAdd() : saveEdit()" |
|||
>保存 |
|||
</el-button> |
|||
<el-button type="primary" size="small" :disabled="disabled" @click="handleSubmit()">提交 |
|||
</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">返回</el-button> |
|||
</div> |
|||
<!--end 添加修改按钮--> |
|||
<!--end 详情按钮--> |
|||
</div> |
|||
<!--标题按钮部分结束--> |
|||
<!--Start 新增修改部分--> |
|||
<div class="listconadd"><!-- --> |
|||
<div class="title">调车开票申请</div> <!--:rules="rules"--> |
|||
<el-form ref="dataForm" :model="temp" :rules="rules" :inline="true" label-width="120px"> |
|||
<div class="invoiceadd" style="margin-top: 5px;"> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<el-form-item prop="reason" label="调账类型"> |
|||
<el-select v-model="temp.accadjTypeValue" placeholder="请选择" clearable class="addinputw"> |
|||
<el-option v-for="item in accadjTypeValue_list" :key="item.dictKey" :label="item.dictValue" |
|||
:value="item.dictKey"/> |
|||
</el-select> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item prop="money" label="调出分公司"> |
|||
<el-input v-model="temp.money" placeholder="请输入" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item prop="money" label="调入分公司"> |
|||
<el-input v-model="temp.money" placeholder="请输入" class="addinputw" clearable/> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</div> |
|||
<div class="addtable"> |
|||
<div class="tabletitle"> |
|||
<div class="titlename"> |
|||
申请车辆列表 |
|||
</div> |
|||
<el-button size="medium" type="primary" @click="handleyudingcheliang" class="btntopbluebut">选择车辆 |
|||
</el-button> |
|||
</div> |
|||
<template class="tablelist"> |
|||
<el-table :data="list" border style="width: 100%" :index="index"> |
|||
<el-table-column align="center" label="序号" type="index" width="50"/> |
|||
<el-table-column label="操作" align="center" width="250px" class-name="small-padding fixed-width"> |
|||
<template slot-scope="scope"> |
|||
<el-button size="mini" type="danger" |
|||
@click="dataDelete(scope.row,scope.$index,list[scope.$index])">删除 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="车型名称" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.modelName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="常用配置" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.configName }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="车架号" align="center"> |
|||
<template slot-scope="scope" @click=""> |
|||
<span>{{ scope.row.vinNo }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="内销价格" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.inboundDate }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="发票类型" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.inboundDate" placeholder="请输入" class="addinputw" |
|||
:readonly="depositVehicleList[scope.$index].inboundDate"/> |
|||
<!-- <span>{{scope.row.inboundDate}}</span>--> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="开票金额" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.inboundDate" placeholder="请输入" class="addinputw" readonly |
|||
@keyup.native="scope.row.inboundDate = oninput(scope.row.inboundDate,2)" |
|||
:readonly="scope.row.inboundDate"/> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="开票单位" align="center"> |
|||
<template slot-scope="scope"> |
|||
<el-input v-model="scope.row.inboundDate" placeholder="请输入" class="addinputw" readonly |
|||
:readonly="scope.row.inboundDate"/> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="开票信息图片" align="center"> |
|||
<template slot-scope="scope"> |
|||
<upload ref="uploadImg" v-model="scope.row.imgList" :limit="1" bucket="map" |
|||
:upload-data="{type:'0001'}"/> |
|||
<!-- <span>{{scope.row.inboundDate}}</span>--> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="备注" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.inboundDate }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</template> |
|||
</div> |
|||
</el-form> |
|||
</div> |
|||
<!--End 添加修改部分--> |
|||
</div> |
|||
<diaochecheliang-list ref="xuanChe" v-show="isXuanche === true" @handleVehicle="selectVehicle" |
|||
@doback="resetState"/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import diaochecheliangList from '@/views/supplychain/diaochekaipiaoshenqingguanli/relation/cheliangList' |
|||
import Upload from '@/components/uploadFile/uploadImg.vue' |
|||
import req from '@/api/supplychain/purchasereturntowarehouse' |
|||
|
|||
export default { |
|||
name: 'diaocheshenqingAdd', |
|||
components: { |
|||
diaochecheliangList, |
|||
Upload |
|||
}, |
|||
data() { |
|||
return { |
|||
isXuanche: false, |
|||
viewTitle: '', |
|||
dialogStatus: '', |
|||
index: 0, |
|||
list: [], |
|||
depositVehicleList: [], |
|||
accadjTypeValue_list: [], |
|||
// 表单数据 |
|||
temp: { |
|||
sid: '', // 一条数据的sid |
|||
applicationCode: '', |
|||
name: '', |
|||
createTime: '', |
|||
money: '', |
|||
userSid: '', // 用户人sid |
|||
detailsList: [] |
|||
}, |
|||
rules: { |
|||
// money: [{ required: true, message: '费用不能为空', trigger: 'blur' }] |
|||
}, |
|||
submitdisabled: false, // 保存按钮 |
|||
disabled: false // 提交按钮 |
|||
} |
|||
}, |
|||
methods: { |
|||
// 输入数字正则 |
|||
oninput(val, limit = 0) { |
|||
val = val.replace(/[^\d.]/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 |
|||
}, |
|||
// 明细表添加一行数据 |
|||
handleyudingcheliang() { |
|||
this.isXuanche = true |
|||
const vinNoList = [] |
|||
this.list.forEach(element => { |
|||
vinNoList.push(element.vinNo) |
|||
}) |
|||
this.$refs['xuanChe'].loadVinNo(vinNoList) |
|||
}, |
|||
resetState() { |
|||
this.isXuanche = false |
|||
}, |
|||
selectVehicle(depositVehicleList) { |
|||
console.log('depositVehicleList', depositVehicleList) |
|||
this.depositVehicleList = depositVehicleList |
|||
for (var i = 0; i < depositVehicleList.length; i++) { |
|||
this.list.push({ |
|||
configName: depositVehicleList[i].configName, |
|||
configSid: depositVehicleList[i].configSid, |
|||
inboundDate: depositVehicleList[i].priceDate, |
|||
modelName: depositVehicleList[i].vehicleAlias, |
|||
vinNo: depositVehicleList[i].vinNo |
|||
}) |
|||
} |
|||
console.log('车辆表数据', this.list) |
|||
}, |
|||
// 明细表删除一行数据 |
|||
dataDelete(index, row) { |
|||
console.log('index', index) |
|||
console.log('row', row) |
|||
this.list.splice(index, 1) |
|||
}, |
|||
|
|||
// 返回(===既判断又赋值) |
|||
handleReturn(isreload) { |
|||
if (isreload === 'true') this.$emit('reloadlist') |
|||
this.temp = { |
|||
sid: '', |
|||
applicationCode: '', |
|||
name: '', |
|||
createTime: '', |
|||
userSid: '', |
|||
detailsList: [] |
|||
}, |
|||
this.list = [] |
|||
this.$refs['dataForm'].resetFields() |
|||
this.$emit('doback') |
|||
}, |
|||
|
|||
showAdd() { |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].clearValidate() |
|||
}) |
|||
this.temp.name = window.sessionStorage.getItem('name') |
|||
this.temp.userSid = window.sessionStorage.getItem('userSid') |
|||
req.detailsInfo(this.temp.sid).then(resp => { |
|||
const data = resp.data |
|||
this.temp.applicationCode = data.applicationCode |
|||
this.temp.createTime = data.createTime |
|||
}).catch(e => { |
|||
this.submitdisabled = false |
|||
}) |
|||
this.dialogStatus = 'add' |
|||
this.viewTitle = '【新增】调车开票申请' |
|||
}, |
|||
|
|||
showEdit(sid, nodeState) { |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].clearValidate() |
|||
}) |
|||
this.dialogStatus = 'edit' |
|||
this.viewTitle = '【编辑】调车开票申请' |
|||
req.detailsInfo({ |
|||
sid: sid |
|||
}).then(resp => { |
|||
if (resp.success) { |
|||
const data = resp.data |
|||
this.temp = data |
|||
this.list = data.voList |
|||
// ---修改名称 先把temp对象转化成json字符串做替换字符串操作,再转化成temp对象--- |
|||
this.temp = JSON.parse(JSON.stringify(this.temp).replace(/voList/g, 'detailsList') |
|||
) |
|||
console.log('编辑初始化', this.temp) |
|||
} |
|||
}).catch(e => { |
|||
this.submitdisabled = false |
|||
}) |
|||
if (nodeState == '' || nodeState == '发起订单') { |
|||
this.disabled = false |
|||
} else { |
|||
this.disabled = true |
|||
} |
|||
}, |
|||
saveAdd() { |
|||
const _this = this |
|||
this.$refs['dataForm'].validate(valid => { |
|||
if (valid) { |
|||
this.submitdisabled = true |
|||
this.temp.detailsList = this.list |
|||
req.save(this.temp).then(resp => { |
|||
this.submitdisabled = false |
|||
if (resp.success) { |
|||
if (resp.success) { |
|||
_this.handleReturn('true') |
|||
} |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} else { |
|||
return false |
|||
} |
|||
}) |
|||
}, |
|||
saveEdit() { |
|||
const _this = this |
|||
this.$refs['dataForm'].validate(valid => { |
|||
if (valid) { |
|||
this.submitdisabled = true |
|||
req.save(this.temp).then(resp => { |
|||
this.submitdisabled = false |
|||
if (resp.success) { |
|||
if (resp.success) { |
|||
_this.handleReturn('true') |
|||
} |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
} else { |
|||
return false |
|||
} |
|||
}) |
|||
}, |
|||
handleSubmit() { |
|||
const _this = this |
|||
this.$refs['dataForm'].validate(valid => { |
|||
if (valid) { |
|||
this.submitdisabled = true |
|||
this.$confirm('是否确定提交该业务', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
this.temp.detailsList = this.list |
|||
req.submitVehicleReturn(this.temp).then(resp => { |
|||
this.submitdisabled = false |
|||
if (resp.success) { |
|||
if (resp.success) { |
|||
_this.handleReturn('true') |
|||
} |
|||
} |
|||
}).catch(() => { |
|||
this.submitdisabled = false |
|||
}) |
|||
}) |
|||
} else { |
|||
return false |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.title { |
|||
padding: 28px 0; |
|||
} |
|||
</style> |
@ -0,0 +1,13 @@ |
|||
<template> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'diaocheshenqingInfo' |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -0,0 +1,373 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<div> |
|||
<div class="tab-header webtop"> |
|||
<div>调车车辆列表</div> |
|||
<div> |
|||
<el-button type="primary" size="small" @click="handleConfirm()">确定</el-button> |
|||
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button> |
|||
</div> |
|||
</div> |
|||
<div class="webcon"> |
|||
<div class="searchcon"> |
|||
<el-button size="small" class="searchbtn" @click="clicksearchShow">{{ searchxianshitit }}</el-button> |
|||
<div v-show="isSearchShow" class="search"> |
|||
<el-form ref="listQueryform" :model="listQuery" label-width="130px" class="tab-header"> |
|||
<el-form-item label="车架号"> |
|||
<el-input v-model="listQuery.params.vin" placeholder="请输入车架号" clearable/> |
|||
</el-form-item> |
|||
<el-form-item label="调车类型"> |
|||
<el-select v-model="listQuery.params.purchaseType" placeholder="请选择" clearable class="addinputw"> |
|||
<el-option v-for="item in purchaseType_list" :key="item.dictKey" :label="item.dictValue" |
|||
:value="item.dictKey"/> |
|||
</el-select> |
|||
<!-- <el-input v-model="listQuery.params.vin" placeholder="请输入车架号" clearable/>--> |
|||
</el-form-item> |
|||
<el-divider/> |
|||
<div class="btn" style="text-align: center;"> |
|||
<el-button type="primary" @click="handleFilter">查询</el-button> |
|||
<el-button type="primary" @click="handleReset">重置</el-button> |
|||
</div> |
|||
</el-form> |
|||
</div> |
|||
</div> |
|||
<div class="listtop"> |
|||
<div class="tit">现车库存列表</div> |
|||
<pageye v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" |
|||
class="pagination" @pagination="getList"/> |
|||
</div> |
|||
<div class=""> |
|||
<el-table ref="multipleTable" :key="tableKey" v-loading="listLoading" :data="list" border style="width: 100%" |
|||
@selection-change="handleSelectionChange"> |
|||
<el-table-column width="50px" type="selection" align="center"/> |
|||
<el-table-column width="80px" label="序号" type="index" :index="indexMethod" align="center"/> |
|||
<el-table-column label="车架号" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.vinNo }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="调车类型" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.color }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="调出分公司" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.location }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="调入分公司" align="center"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ scope.row.guidedPrice }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<div class="pages"> |
|||
<div class="tit"/> |
|||
<!-- 翻页 --> |
|||
<pagination v-show="total>0" :total="total" :page.sync="listQuery.current" :limit.sync="listQuery.size" |
|||
class="pagination" @pagination="getList"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import Pagination from '@/components/pagination' |
|||
import pageye from '@/components/pagination/pageye' |
|||
import req from '@/api/supplychain/purchasereturntowarehouse' |
|||
|
|||
export default { |
|||
name: 'diaochecheliangList', |
|||
components: { |
|||
Pagination, |
|||
pageye |
|||
}, |
|||
data() { |
|||
return { |
|||
createPage: '', |
|||
dialogVisible: false, // 弹窗 |
|||
isSearchShow: false, |
|||
searchxianshitit: '显示查询条件', |
|||
btndisabled: false, |
|||
viewState: 1, // 1、列表 2、添加-车辆预定 3、编辑 4、查看 5、订金-定金收取 |
|||
// 查询 ----------- |
|||
carbrand_list: [], // 品牌 |
|||
vehicleFunction_list: [], // 功能 |
|||
productLine_list: [], // 系列 |
|||
gearboxType_list: [], // 变速箱 |
|||
driveForm_list: [], // 驱动 |
|||
emissionStandard_list: [], // 排放标准 |
|||
power_list: [], // 马力 |
|||
fuelType_list: [], // 燃料 |
|||
vehicleVersion_list: [], // 版本 |
|||
tableKey: 0, |
|||
list: [], |
|||
sids: [], |
|||
total: 1, |
|||
FormLoading: false, |
|||
listLoading: false, |
|||
listQuery: { |
|||
current: 1, |
|||
size: 20, |
|||
params: { |
|||
carbrand: '', |
|||
driveForm: '', |
|||
emissionStandard: '', |
|||
fuelType: '', |
|||
gearboxType: '', |
|||
lockedState: '', |
|||
power: '', |
|||
productLine: '', |
|||
vehicleState: '', |
|||
vehicleType: '', |
|||
vehicleVersion: '' |
|||
} |
|||
}, |
|||
selectDate: undefined, |
|||
temp: {}, // 添加和编辑 |
|||
vinNoList: [], |
|||
depositVehicleList: [], |
|||
visible: true, |
|||
hetongdanganguanliInfoShow: false |
|||
// ------------------------------------ |
|||
} |
|||
}, |
|||
methods: { |
|||
// 初始化 |
|||
init() { |
|||
this.handleFilter() |
|||
this.getType() |
|||
}, |
|||
// 搜索条件效果 |
|||
clicksearchShow() { |
|||
this.isSearchShow = !this.isSearchShow |
|||
if (this.isSearchShow) { |
|||
this.searchxianshitit = '隐藏查询条件' |
|||
} else { |
|||
this.searchxianshitit = '显示查询条件' |
|||
} |
|||
}, |
|||
// 重置 |
|||
handleReset() { |
|||
this.listQuery = { |
|||
current: 1, |
|||
size: 20, |
|||
params: { |
|||
carbrand: '', |
|||
driveForm: '', |
|||
emissionStandard: '', |
|||
fuelType: '', |
|||
gearboxType: '', |
|||
lockedState: '', |
|||
power: '', |
|||
productLine: '', |
|||
vehicleState: '', |
|||
vehicleType: '', |
|||
vehicleVersion: '' |
|||
} |
|||
} |
|||
}, |
|||
// 勾选 |
|||
handleSelectionChange(row) { |
|||
console.log('row', row) |
|||
this.depositVehicleList = row |
|||
const aa = [] |
|||
row.forEach((element) => { |
|||
aa.push(element.sid) |
|||
}) |
|||
this.sids = aa |
|||
console.log('选择sid', this.sids) |
|||
}, |
|||
// 品牌下拉 |
|||
getType() { |
|||
// 品牌下拉 |
|||
req.selectBrand().then((res) => { |
|||
if (res.code === '200') { |
|||
this.carbrand_list = res.data |
|||
console.log('下拉框请求品牌', res.data) |
|||
} |
|||
}) |
|||
// 功能 |
|||
req.pullDown({ |
|||
type: 'vehicleFunction' |
|||
}).then((res) => { |
|||
if (res.code === '200') { |
|||
this.vehicleFunction_list = res.data |
|||
console.log('下拉框请求功能', res.data) |
|||
} |
|||
}) |
|||
// 系列 |
|||
req.pullDown({ |
|||
type: 'productLine' |
|||
}).then((res) => { |
|||
if (res.code === '200') { |
|||
this.productLine_list = res.data |
|||
console.log('下拉框请求系列', res.data) |
|||
} |
|||
}) |
|||
// 变速箱 |
|||
req.pullDown({ |
|||
type: 'gearbox' |
|||
}).then((res) => { |
|||
if (res.code === '200') { |
|||
this.gearboxType_list = res.data |
|||
console.log('下拉框请求变速箱', res.data) |
|||
} |
|||
}) |
|||
// 驱动 |
|||
req.pullDown({ |
|||
type: 'driver' |
|||
}).then((res) => { |
|||
if (res.code === '200') { |
|||
this.driveForm_list = res.data |
|||
console.log('下拉框请求驱动', res.data) |
|||
} |
|||
}) |
|||
// 排放标准 |
|||
req.pullDown({ |
|||
type: 'emissionStandard' |
|||
}).then((res) => { |
|||
if (res.code === '200') { |
|||
this.emissionStandard_list = res.data |
|||
console.log('下拉框请求排放标准', res.data) |
|||
} |
|||
}) |
|||
// 马力 |
|||
req.pullDown({ |
|||
type: 'horsepower' |
|||
}).then((res) => { |
|||
if (res.code === '200') { |
|||
this.power_list = res.data |
|||
console.log('下拉框请求马力', res.data) |
|||
} |
|||
}) |
|||
// 燃料 |
|||
req.pullDown({ |
|||
type: 'fuelType' |
|||
}).then((res) => { |
|||
if (res.code === '200') { |
|||
this.fuelType_list = res.data |
|||
console.log('下拉框请求燃料', res.data) |
|||
} |
|||
}) |
|||
// 版本 |
|||
req.pullDown({ |
|||
type: 'vehicleVersion' |
|||
}).then((res) => { |
|||
if (res.code === '200') { |
|||
this.vehicleVersion_list = res.data |
|||
console.log('下拉框请求版本', res.data) |
|||
} |
|||
}) |
|||
|
|||
}, |
|||
changeCarbrand(value) { |
|||
let bb = {} |
|||
this.carbrand_list.forEach((e) => { |
|||
// eslint-disable-next-line eqeqeq |
|||
if (e.dictKey == value) { |
|||
bb = { |
|||
name: e.dictValue, |
|||
key: e.dictKey, |
|||
sid: e.sid |
|||
} |
|||
} |
|||
}) |
|||
this.listQuery.params.carbrand = bb.name |
|||
console.log('name', this.listQuery.params.carbrand) |
|||
}, |
|||
// 确认 |
|||
handleConfirm() { |
|||
if (this.sids.length > 0) { |
|||
if (this.vinNoList.length > 0) { |
|||
console.log('已选择的数据', this.vinNoList) |
|||
for (var i = 0; i < this.vinNoList.length; i++) { |
|||
for (var j = 0; j < this.depositVehicleList.length; j++) { |
|||
if (this.vinNoList[i] == this.depositVehicleList[j].vinNo) { |
|||
const index = this.depositVehicleList.findIndex(val => { |
|||
return this.depositVehicleList[j].vinNo === this.vinNoList[i] |
|||
}) |
|||
this.depositVehicleList.splice(index, 1) |
|||
console.log('进入if判断', index) |
|||
} |
|||
} |
|||
} |
|||
|
|||
} |
|||
this.$emit('handleVehicle', this.depositVehicleList) |
|||
this.$nextTick(() => { |
|||
this.$refs.multipleTable.clearSelection() |
|||
}) |
|||
this.handleReturn() |
|||
} else { |
|||
this.$notify({ |
|||
title: '提示', |
|||
message: '没有选择车辆!', |
|||
type: 'error', |
|||
duration: 2000 |
|||
}) |
|||
return |
|||
} |
|||
}, |
|||
// 返回 |
|||
handleReturn() { |
|||
this.$emit('doback') // 到父页面 |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.listQuery.current - 1) * this.listQuery.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 查询列表信息 |
|||
getList() { |
|||
this.listLoading = true |
|||
req.pagerList({ |
|||
current: this.listQuery.current, |
|||
size: this.listQuery.size, |
|||
params: { |
|||
modelName: this.listQuery.modelName, |
|||
carModel: this.listQuery.carModel, |
|||
brandName: this.listQuery.brandName |
|||
} |
|||
}).then((response) => { |
|||
console.log('列表查询结果:', response) |
|||
this.listLoading = false |
|||
if ( |
|||
response.code === '200' && |
|||
response.data && |
|||
response.data.total > 0 |
|||
) { |
|||
this.list = response.data.records |
|||
this.total = response.data.total |
|||
} else { |
|||
this.list = [] |
|||
this.total = 0 |
|||
} |
|||
}) |
|||
}, |
|||
// 查询按钮 |
|||
handleFilter() { |
|||
this.listQuery.current = 1 |
|||
this.getList() |
|||
}, |
|||
// 排除已选信息 |
|||
loadVinNo(vinNoList) { |
|||
this.vinNoList = vinNoList |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.el-form-item .el-form-item__label { |
|||
width: 100% !important; |
|||
} |
|||
|
|||
.el-form-item__content label { |
|||
padding: 0 5px; |
|||
} |
|||
</style> |
@ -0,0 +1,13 @@ |
|||
<template> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'tiaozhangshenqingguanli' |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -0,0 +1,13 @@ |
|||
<template> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'tiaozhangshenqingguanliAdd' |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
@ -0,0 +1,13 @@ |
|||
<template> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'tiaozhangshenqingguanliInfo' |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
Loading…
Reference in new issue