You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
384 lines
12 KiB
384 lines
12 KiB
<template>
|
|
<div class="app-container">
|
|
<div v-show="viewState == 1">
|
|
<button-bar ref="btnbar" view-title="旧件入库管理" :btndisabled="btndisabled" @btnhandle="btnHandle"/>
|
|
<div class="main-content">
|
|
<div class="searchcon">
|
|
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
|
{{ searchxianshitit }}
|
|
</el-button>
|
|
<div v-show="isSearchShow" class="search">
|
|
<el-form :inline="true" class="tab-header">
|
|
<el-form-item label="维修单号">
|
|
<el-input v-model="queryParams.params.billNo" placeholder="" clearable/>
|
|
</el-form-item>
|
|
<el-form-item label="单据日期">
|
|
<el-date-picker v-model="queryParams.params.createTimeStart" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;" />
|
|
<span style="padding: 0 8px">至</span>
|
|
<el-date-picker v-model="queryParams.params.createTimeEnd" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 200px;" />
|
|
</el-form-item>
|
|
<el-form-item label="客户">
|
|
<el-input v-model="queryParams.params.customerName" placeholder="" clearable/>
|
|
</el-form-item>
|
|
<el-form-item label="车牌号">
|
|
<el-input v-model="queryParams.params.vehMark" placeholder="" clearable/>
|
|
</el-form-item>
|
|
<el-form-item label="车架号">
|
|
<el-input v-model="queryParams.params.vinNo" placeholder="" clearable/>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div class="btn" style="text-align: center;">
|
|
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
|
|
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Start 项目列表头部 -->
|
|
<div class="listtop">
|
|
<div class="tit">维修单列表</div>
|
|
</div>
|
|
<!-- End 项目列表头部 -->
|
|
<!-- Start 项目列表 -->
|
|
<div class="">
|
|
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%" @selection-change="selectionLineChangeHandle">
|
|
<el-table-column fixed width="50" type="selection" align="center"/>
|
|
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center"/>
|
|
<el-table-column label="维修单号" align="center">
|
|
<template slot-scope="scope">
|
|
<span class="bluezi" @click="showOrder(scope.row)">{{ scope.row.billNo }}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="taskName" label="环节" align="center"/>
|
|
<el-table-column prop="billTime" label="单据日期" align="center"/>
|
|
<el-table-column prop="customerName" label="客户名称" align="center"/>
|
|
<el-table-column prop="vehMark" label="车牌号" align="center"/>
|
|
<el-table-column prop="vinNo" label="车架号" align="center"/>
|
|
<el-table-column prop="shortss" label="旧件回收说明" align="center"/>
|
|
<el-table-column label="旧件照片" align="center">
|
|
<template slot-scope="scope">
|
|
<span class="bluezi" @click="showImage(scope.row.photos)">查看</span>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<!-- End 项目列表 -->
|
|
<div class="pages">
|
|
<div class="tit"/>
|
|
<!-- 翻页 -->
|
|
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current" :limit.sync="queryParams.size" class="pagination" @pagination="loadList"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- End 查询和其列表部分 -->
|
|
<!-- 新增修改部分组件 -->
|
|
<oldPartsRecoveryAdd v-show="viewState == 2 || viewState == 3" ref="divAdd" @doback="resetState" @reloadlist="loadList"/>
|
|
<repairbillInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" />
|
|
|
|
<el-dialog title="旧件照片" :visible.sync="dialogVisible" :before-close="handleClose">
|
|
<el-image style="width: 120px;height: 120px;" v-for="(item, index) in fileList" :key="index" :src="item" :preview-src-list="item" />
|
|
</el-dialog>
|
|
|
|
<el-dialog title="旧件回收登记" :visible.sync="dialogVisible2" :before-close="handleClose2">
|
|
<el-form ref="form_obj" class="formaddcopy02" :rules="rules" style="margin-top: -30px;" :model="orderInfo">
|
|
<el-row class="first_row">
|
|
<el-col :span="24">
|
|
<div class="span-sty">维修单号</div>
|
|
<el-form-item><span class="addinputInfo">{{ orderInfo.billNo }}</span></el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty"><span class="must">*</span> 旧件回收说明</div>
|
|
<el-form-item prop="shortss">
|
|
<el-input v-model="orderInfo.shortss" placeholder="" class="addinputw addinputInfo" style="padding-top: 5px;padding-bottom: 5px;" type="textarea" :rows="4" clearable/>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<div class="span-sty"><span class="must">*</span> 旧件照片</div>
|
|
<el-form-item prop="photos">
|
|
<upload-img ref="uploadImg" class="addinputInfo" :accept="accept" v-model="imgList" :limit="50" bucket="map" :upload-data="{ type: '0001' }" @change="backData"/>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
<div style="display: flex;flex-direction: row;width: 100%;justify-content: center;align-items: center;">
|
|
<el-button type="primary" style="margin-top: 20px;" @click="saveExamine">确 定</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import req from '@/api/storage/oldPartsRecovery.js'
|
|
import ButtonBar from '@/components/ButtonBar'
|
|
import Pagination from '@/components/pagination'
|
|
import oldPartsRecoveryAdd from './oldPartsRecoveryAdd.vue'
|
|
import repairbillInfo from '../../operation/repairbill/repairbillInfo'
|
|
import uploadImg from '@/components/uploadFile/uploadImg'
|
|
|
|
export default {
|
|
components: {
|
|
ButtonBar,
|
|
Pagination,
|
|
oldPartsRecoveryAdd,
|
|
repairbillInfo,
|
|
uploadImg
|
|
},
|
|
data() {
|
|
return {
|
|
dialogVisible: false,
|
|
dialogVisible2: false,
|
|
orderInfo: {},
|
|
fileList: [],
|
|
btndisabled: false,
|
|
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
|
isSearchShow: false,
|
|
searchxianshitit: '显示查询条件',
|
|
tableLoading: false,
|
|
dataList: [],
|
|
btnList: [
|
|
{
|
|
type: 'primary',
|
|
size: 'small',
|
|
icon: 'plus',
|
|
btnKey: 'toAdd',
|
|
btnLabel: '回收登记'
|
|
},
|
|
{
|
|
type: 'primary',
|
|
size: 'small',
|
|
icon: 'plus',
|
|
btnKey: 'toUp',
|
|
btnLabel: '上架'
|
|
},
|
|
{
|
|
type: 'info',
|
|
size: 'small',
|
|
icon: 'cross',
|
|
btnKey: 'doClose',
|
|
btnLabel: '关闭'
|
|
}
|
|
],
|
|
queryParams: {
|
|
current: 1,
|
|
size: 10,
|
|
total: 0,
|
|
params: {
|
|
billNo: '',
|
|
createTimeStart: '',
|
|
createTimeEnd: '',
|
|
vehMark: '',
|
|
customerName: '',
|
|
vinNo: '',
|
|
userSid: '',
|
|
orgPath: '',
|
|
menuUrl: ''
|
|
}
|
|
},
|
|
sids: [],
|
|
selectionList: [],
|
|
imgList: [],
|
|
accept: '.jpg,.jpeg,.png,.pdf,.JPG,.JPEG',
|
|
rules: {
|
|
shortss: [{ required: true, message: '回收说明不能为空', trigger: 'change' }],
|
|
photos: [{ required: true, message: '旧件不能为空', trigger: 'blur' }]
|
|
}
|
|
}
|
|
},
|
|
mounted() {
|
|
this.$refs['btnbar'].setButtonList(this.btnList)
|
|
},
|
|
created() {
|
|
this.loadList()
|
|
},
|
|
methods: {
|
|
backData(value) {
|
|
this.imgList = value
|
|
this.orderInfo.photos = []
|
|
for (var i = 0; i < this.imgList.length; i++) {
|
|
this.orderInfo.photos.push(this.imgList[i].url)
|
|
}
|
|
},
|
|
selectionLineChangeHandle(val) {
|
|
this.selectionList = val
|
|
const aa = []
|
|
val.forEach(element => {
|
|
aa.push(element.sid)
|
|
})
|
|
this.sids = aa
|
|
},
|
|
// 搜索条件效果
|
|
clicksearchShow() {
|
|
this.isSearchShow = !this.isSearchShow
|
|
if (this.isSearchShow) {
|
|
this.searchxianshitit = '隐藏查询条件'
|
|
} else {
|
|
this.searchxianshitit = '显示查询条件'
|
|
}
|
|
},
|
|
btnHandle(btnKey) {
|
|
switch (btnKey) {
|
|
case 'doDel':
|
|
this.doDel()
|
|
break
|
|
case 'toAdd':
|
|
this.toAdd()
|
|
break
|
|
case 'toUp':
|
|
this.toUp()
|
|
break
|
|
case 'doClose':
|
|
this.doClose()
|
|
break
|
|
default:
|
|
break
|
|
}
|
|
},
|
|
loadList() {
|
|
this.tableLoading = true
|
|
this.queryParams.params.userSid = window.sessionStorage.getItem('userSid')
|
|
this.queryParams.params.orgPath = window.sessionStorage.getItem('defaultOrgPath')
|
|
this.queryParams.params.menuUrl = this.$route.path
|
|
req.listPage(this.queryParams).then((resp) => {
|
|
this.tableLoading = false
|
|
if (resp.success) {
|
|
const data = resp.data
|
|
this.queryParams.total = data.total
|
|
this.dataList = data.records
|
|
} else {
|
|
// 根据resp.code进行异常情况处理
|
|
this.dataList = []
|
|
this.queryParams.total = 0
|
|
}
|
|
}).catch(() => {
|
|
this.tableLoading = false
|
|
})
|
|
},
|
|
// 序号
|
|
indexMethod(index) {
|
|
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
|
var pageindex = index + 1 + pagestart
|
|
return pageindex
|
|
},
|
|
dosearch() {
|
|
this.queryParams.current = 1
|
|
this.loadList()
|
|
},
|
|
resetQuery() {
|
|
this.queryParams = {
|
|
current: 1,
|
|
size: 10,
|
|
total: 0,
|
|
params: {
|
|
billNo: '',
|
|
createTimeStart: '',
|
|
createTimeEnd: '',
|
|
vehMark: '',
|
|
customerName: '',
|
|
vinNo: '',
|
|
userSid: '',
|
|
orgPath: '',
|
|
menuUrl: ''
|
|
}
|
|
}
|
|
this.loadList()
|
|
},
|
|
toAdd() {
|
|
if (this.selectionList.length !== 1) {
|
|
this.$message({
|
|
showClose: true,
|
|
type: 'warning',
|
|
message: '请选择一条记录操作.'
|
|
})
|
|
return
|
|
}
|
|
this.imgList = []
|
|
this.orderInfo = JSON.parse(JSON.stringify(this.selectionList[0]))
|
|
for (var i = 0; i < this.selectionList[0].photos.length; i++) {
|
|
this.imgList.push({
|
|
url: this.selectionList[0].photos[i]
|
|
})
|
|
}
|
|
this.$nextTick(() => {
|
|
this.$refs['form_obj'].clearValidate()
|
|
})
|
|
this.dialogVisible2 = true
|
|
},
|
|
toUp() {
|
|
if (this.selectionList.length !== 1) {
|
|
this.$message({
|
|
showClose: true,
|
|
type: 'warning',
|
|
message: '请选择一条记录操作.'
|
|
})
|
|
return
|
|
}
|
|
this.viewState = 2
|
|
this.$refs['divAdd'].showEdit(this.selectionList[0])
|
|
},
|
|
showImage(paths) {
|
|
this.fileList = paths
|
|
this.dialogVisible = true
|
|
},
|
|
handleClose() {
|
|
this.dialogVisible = false
|
|
},
|
|
saveExamine() {
|
|
this.$refs['form_obj'].validate((valid) => {
|
|
if (valid) {
|
|
req.saveorUpdateOldRegister(this.orderInfo).then((resp) => {
|
|
this.orderInfo = {}
|
|
this.imgList = []
|
|
this.loadList()
|
|
this.dialogVisible2 = false
|
|
}).catch(() => {
|
|
})
|
|
}
|
|
})
|
|
},
|
|
handleClose2() {
|
|
this.imgList = []
|
|
this.dialogVisible2 = false
|
|
},
|
|
showOrder(row) {
|
|
this.viewState = 4
|
|
this.$refs['divInfo'].showInfo({ sid: row.billSid })
|
|
},
|
|
doClose() {
|
|
this.$store.dispatch('tagsView/delView', this.$route)
|
|
this.$router.go(-1)
|
|
},
|
|
resetState() {
|
|
this.viewState = 1
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
<style scoped>
|
|
/deep/ .el-form-item__error {
|
|
margin-left: 120px !important;
|
|
}
|
|
|
|
.must {
|
|
color: #f00;
|
|
}
|
|
|
|
.span-sty {
|
|
width: 130px !important;
|
|
}
|
|
|
|
.addinputInfo {
|
|
margin-left: 120px !important;
|
|
}
|
|
|
|
.formaddcopy02 .el-row .el-col /deep/ .el-form-item .addinputw {
|
|
margin-left: 120px !important;
|
|
width: calc(100% - 115px);
|
|
}
|
|
|
|
.first_row {
|
|
border-top: 1px solid #E0E3EB;
|
|
}
|
|
</style>
|
|
|