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.
620 lines
21 KiB
620 lines
21 KiB
<template>
|
|
<div>
|
|
<div class="tab-header webtop">
|
|
<!-- 标题 -->
|
|
<div>{{title}}旧件处理申请</div>
|
|
<!-- start 添加修改按钮 -->
|
|
<div>
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit">提交</el-button>
|
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
|
</div>
|
|
<!-- end 添加修改按钮 -->
|
|
<!-- end 详情按钮 -->
|
|
</div>
|
|
<div class="listconadd">
|
|
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
|
|
<div class="title">
|
|
<div>基础信息</div>
|
|
</div>
|
|
<el-row class="first_row">
|
|
|
|
<el-col :span="8">
|
|
<div class="span-sty">申请人</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.createByName }}</span></el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<div class="span-sty">申请部门</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.deptName }}</span></el-form-item>
|
|
</el-col>
|
|
|
|
<!-- <el-col :span="12">
|
|
<div class="span-sty">单据编号</div>
|
|
<el-form-item><span class="addinputInfo">{{ formobj.billNo }}</span></el-form-item>
|
|
</el-col> -->
|
|
<el-col :span="8">
|
|
<div class="span-sty"><span class="must">*</span> 申请日期</div>
|
|
<el-form-item prop="createTime">
|
|
<el-date-picker v-model="formobj.createTime" class="addinputw addinputInfo" type="date"
|
|
value-format="yyyy-MM-dd" placeholder="选择日期">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="8">
|
|
<div class="span-sty"><span class="must">*</span> 处理原因</div>
|
|
<el-form-item prop="handleReasonValue">
|
|
<el-select v-model="formobj.handleReasonValue" placeholder="请选择" class="addinputw addinputInfo" @change="selectHandleReason">
|
|
<el-option v-for="(item,i) in handleReasonList" :key="i" :label="item.name" :value="item.sid"
|
|
>
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
<el-col :span="16">
|
|
<div class="span-sty"><span class="must">*</span> 处理方式</div>
|
|
<el-form-item prop="handleModeValue">
|
|
<el-select v-model="formobj.handleModeValue" placeholder="请选择" class="addinputw addinputInfo" @change="selectHandleMode">
|
|
<el-option v-for="(item,i) in handleModeList" :key="i" :label="item.name" :value="item.sid"
|
|
>
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<el-row>
|
|
|
|
<el-col :span="24">
|
|
<div class="span-sty">备注</div>
|
|
<el-form-item>
|
|
<el-input v-model="formobj.remarks" placeholder="" class="addinputw addinputInfo" 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="imgList">
|
|
<upload-img ref="uploadImg" class="addinputw" v-model="imgList" :limit="50" bucket="map"
|
|
:upload-data="{ type: '0001' }" @change="backData" />
|
|
</el-form-item>
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
<div class="title titleOne">
|
|
<div>商品列表</div>
|
|
<el-button type="primary" size="mini" @click="importDetail()">选择旧件</el-button>
|
|
</div>
|
|
|
|
<el-table v-loading="listLoading" :data="formobj.asOldparthandleList" border>
|
|
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
|
<el-table-column fixed label="操作" align="center" width="100">
|
|
<template slot-scope="scope">
|
|
<el-button type="primary" size="mini" @click="deleteAsOldparthandle(scope.row)">删除</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<!-- <el-table-column align="center" width="100" :render-header="commodityHeader">
|
|
<template slot-scope="scope">
|
|
<i class="el-icon-delete" @click="commodityDelete(scope.$index)"></i>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="商品名称" align="center" min-width="200">
|
|
<template slot-scope="scope">
|
|
<el-popover placement="right" width="900" trigger="click">
|
|
<div>
|
|
<el-table :data="commodityData" v-loading="commodityLoading" highlight-current-row
|
|
@current-change="commodityCurrentChange($event, scope.row)">
|
|
<el-table-column fixed prop="goodsSpuName" label="商品名称" align="center" />
|
|
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
|
<el-table-column prop="goodsSkuOwnSpec" label="厂家" align="center" />
|
|
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
|
|
<el-table-column prop="unit" label="单位" align="center" />
|
|
</el-table>
|
|
<el-pagination :page.sync="commodityQuery.current" :page-size="commodityQuery.size"
|
|
layout="total, pager" :total="commodityQuery.total" />
|
|
</div>
|
|
<el-input slot="reference" v-model="scope.row.goodsSkuName"
|
|
@input="commodityInput(scope.row.goodsSkuName)" clearable placeholder="商品名称" />
|
|
</el-popover>
|
|
</template>
|
|
</el-table-column> -->
|
|
<!-- <el-table-column prop="vinNo" label="车架号" align="center" /> -->
|
|
<el-table-column prop="goodsSkuId" label="商品ID" align="center" />
|
|
<el-table-column prop="goodsSkuName" label="商品名称" align="center" />
|
|
<el-table-column prop="goodsSkuCode" label="商品编码" align="center" />
|
|
<!-- <el-table-column prop="supplierName" label="厂家" align="center" /> -->
|
|
<el-table-column prop="supplierName" label="供应商" align="center" />
|
|
<el-table-column prop="goodsSkuOwnSpec" label="规格" align="center" />
|
|
<el-table-column prop="unit" label="单位" align="center" />
|
|
<el-table-column prop="warehouseName" label="仓库" align="center" />
|
|
<el-table-column prop="warehouseRackCode" label="库位" align="center" />
|
|
<el-table-column label="数量" align="center" width="180">
|
|
<template slot-scope="scope">
|
|
<el-input ref="focusAssumptionInput" v-model="scope.row.count" clearable placeholder=""
|
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" />
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
</el-form>
|
|
|
|
</div>
|
|
|
|
<el-dialog title="选择旧件商品" :visible.sync="dialogVisible" :before-close="handleClose">
|
|
|
|
<el-form :inline="true" class="tab-header" style="margin-top: -30px;">
|
|
<el-form-item label="商品名称">
|
|
<el-input v-model="queryParams.params.goodsName" placeholder="" clearable />
|
|
</el-form-item>
|
|
<el-form-item label="商品编码">
|
|
<el-input v-model="queryParams.params.goodsSkuCode" placeholder="" clearable />
|
|
</el-form-item>
|
|
<el-form-item label="仓库">
|
|
<el-input v-model="queryParams.params.warehouseName" placeholder="" clearable />
|
|
</el-form-item>
|
|
<el-form-item label="库位">
|
|
<el-input v-model="queryParams.params.warehouseRackCode" placeholder="" clearable />
|
|
</el-form-item>
|
|
<el-form-item label="供应商">
|
|
<el-input v-model="queryParams.params.supplierName" placeholder="" clearable />
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
<div class="btn" style="text-align: center; margin-top: 20px;">
|
|
<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>
|
|
|
|
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%;margin-top: 20px;"
|
|
@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 prop="goodsID" label="商品ID" width="150" align="center" />
|
|
<el-table-column prop="goodsSpuName" label="商品名称" width="120" align="center" />
|
|
<el-table-column prop="goodsSkuCode" label="商品编码" width="100" align="center" />
|
|
<el-table-column prop="goodsSkuOwnSpec" label="规格" width="100" align="center" />
|
|
<el-table-column prop="unit" label="单位" width="100" align="center" />
|
|
<el-table-column prop="warehouseName" label="仓库" width="150" align="center" />
|
|
<el-table-column prop="warehouseRackCode" label="库位" width="120" align="center" />
|
|
<el-table-column prop="supplierName" label="供应商" width="120" align="center" />
|
|
<el-table-column prop="count" label="库存数量" width="100" align="center" />
|
|
</el-table>
|
|
<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 class="btn" style="text-align: center; margin-top: 20px;">
|
|
<el-button type="primary" size="mini" @click="addDialogList()">确认</el-button>
|
|
<el-button type="primary" size="mini" @click="handleClose()">关闭</el-button>
|
|
</div>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import req from '@/api/storage/oldPartsCope.js'
|
|
import uploadImg from '@/components/uploadFile/uploadImg'
|
|
import {
|
|
getOrgSidByPath
|
|
} from '@/api/Common/dictcommons'
|
|
|
|
export default {
|
|
components: {
|
|
uploadImg
|
|
},
|
|
data() {
|
|
return {
|
|
dialogVisible: false,
|
|
title: '【新增】',
|
|
orderInfo: {},
|
|
tableLoading: false,
|
|
loadList: false,
|
|
listLoading: false,
|
|
submitdisabled: false,
|
|
formobj: {
|
|
"sid": "",
|
|
"remarks": "",
|
|
"createBySid": window.sessionStorage.getItem('userSid'),
|
|
"createByName": window.sessionStorage.getItem('name'),
|
|
"deptSid": window.sessionStorage.getItem('departmentSid'),
|
|
"deptName": window.sessionStorage.getItem('departmentName'),
|
|
"createTime": "",
|
|
"billNo": "",
|
|
"filePaths": [],
|
|
"useOrgSid": '',
|
|
"useOrgName": '',
|
|
"procDefId": "",
|
|
"nodeId": "",
|
|
"procInstId": "",
|
|
"nodeState": "",
|
|
"taskId": "",
|
|
"finishTime": "",
|
|
"asOldparthandleList": [
|
|
|
|
]
|
|
},
|
|
hideUploadBtn: false,
|
|
|
|
// commodity商品
|
|
commodityKey: 1,
|
|
commodityLoading: false,
|
|
commodityQuery: {
|
|
current: 1,
|
|
size: 2,
|
|
total: 0,
|
|
params: {
|
|
name: '',
|
|
inOrg: "",
|
|
outOrg: ""
|
|
}
|
|
},
|
|
commodityData: [],
|
|
isUpdata: false,
|
|
imgList: [],
|
|
handleModeList: [{
|
|
name: '处理方式1',
|
|
sid: "1"
|
|
},
|
|
{
|
|
name: '处理方式2',
|
|
sid: "2"
|
|
}
|
|
],
|
|
handleReasonList: [{
|
|
name: '处理原因1',
|
|
sid: "1"
|
|
},
|
|
{
|
|
name: '处理原因2',
|
|
sid: "2"
|
|
}
|
|
],
|
|
selectionList: [],
|
|
queryParams: {
|
|
current: 1,
|
|
size: 10,
|
|
total: 0,
|
|
params: {
|
|
"goodsName": "",
|
|
"goodsSkuCode": "",
|
|
"warehouseName": "",
|
|
"warehouseRackCode": "",
|
|
"supplierName": "",
|
|
}
|
|
},
|
|
dataList: [],
|
|
rules: {
|
|
createTime: [{
|
|
required: true,
|
|
message: '申请日期不能为空',
|
|
trigger: 'change'
|
|
}],
|
|
handleReasonValue: [{
|
|
required: true,
|
|
message: '处理原因不能为空',
|
|
trigger: 'change'
|
|
}],
|
|
handleModeValue: [{
|
|
required: true,
|
|
message: '处理方式不能为空',
|
|
trigger: 'change'
|
|
}],
|
|
filePaths: [{
|
|
required: true,
|
|
message: '附件不能为空',
|
|
trigger: 'blur'
|
|
}],
|
|
}
|
|
}
|
|
},
|
|
created() {
|
|
getOrgSidByPath({
|
|
orgPath: window.sessionStorage.getItem('defaultOrgPath')
|
|
}).then((res) => {
|
|
if (res.success) {
|
|
this.formobj.createOrgSid = res.data
|
|
this.formobj.useOrgSid = res.data
|
|
}
|
|
})
|
|
},
|
|
methods: {
|
|
|
|
|
|
selectHandleReason(val) {
|
|
console.log('>>>>>>>>>selectHandleReason', val)
|
|
const choose = this.handleReasonList.filter((item) => item.sid == val)
|
|
console.log('>>>>>>>>>selectHandleReason', choose)
|
|
this.formobj.handleReasonValue = choose[0].name
|
|
this.formobj.handleReasonKey = choose[0].sid
|
|
},
|
|
selectHandleMode(val) {
|
|
const choose = this.handleModeList.filter((item) => item.sid == val)
|
|
console.log('>>>>>>>>>selectHandleMode', choose)
|
|
this.formobj.handleModeValue = choose[0].name
|
|
this.formobj.handleModeKey = choose[0].sid
|
|
},
|
|
|
|
|
|
indexMethod(index) {
|
|
return Number(index) + 1
|
|
},
|
|
dosearch() {
|
|
this.queryParams.current = 1
|
|
this.importDetail()
|
|
},
|
|
resetQuery() {
|
|
this.queryParams = {
|
|
current: 1,
|
|
size: 10,
|
|
total: 0,
|
|
params: {
|
|
"goodsName": "",
|
|
"goodsSkuCode": "",
|
|
"warehouseName": "",
|
|
"warehouseRackCode": "",
|
|
"supplierName": "",
|
|
}
|
|
}
|
|
this.importDetail()
|
|
},
|
|
|
|
importDetail() {
|
|
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.handleGoodsListPage(this.queryParams).then((resp) => {
|
|
this.tableLoading = false
|
|
this.dialogVisible = true
|
|
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
|
|
})
|
|
|
|
},
|
|
selectionLineChangeHandle(val) {
|
|
this.selectionList = val
|
|
|
|
},
|
|
addDialogList() {
|
|
|
|
for (var i = 0; i < this.selectionList.length; i++) {
|
|
|
|
var item = {
|
|
count: this.selectionList[i].count,
|
|
goodsSkuCode: this.selectionList[i].goodsSkuCode,
|
|
goodsSkuId: this.selectionList[i].goodsID,
|
|
goodsSkuName: this.selectionList[i].goodsSpuName,
|
|
goodsSkuOwnSpec: this.selectionList[i].goodsSkuOwnSpec,
|
|
mainSid: '',
|
|
sid: '',
|
|
supplierName: this.selectionList[i].supplierName,
|
|
unit: this.selectionList[i].unit,
|
|
vinNo: '',
|
|
warehouseName: this.selectionList[i].warehouseName,
|
|
warehouseRackCode: this.selectionList[i].warehouseRackCode,
|
|
warehouseRackSid: this.selectionList[i].warehouseRackSid,
|
|
warehouseSid: this.selectionList[i].warehouseSid,
|
|
}
|
|
|
|
|
|
this.formobj.asOldparthandleList.push(item)
|
|
}
|
|
this.dialogVisible = false
|
|
},
|
|
handleClose() {
|
|
this.dialogVisible = false
|
|
},
|
|
deleteAsOldparthandle(row) {
|
|
const index = this.formobj.asOldparthandleList.findIndex((item) => item === row)
|
|
console.log("index》》》》", index)
|
|
this.formobj.asOldparthandleList.splice(index, 1)
|
|
|
|
},
|
|
saveOrUpdate() {
|
|
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
|
|
|
this.$refs['form_obj'].validate((valid) => {
|
|
if (valid) {
|
|
this.submitdisabled = true
|
|
req.save(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
|
|
})
|
|
}
|
|
})
|
|
},
|
|
submit() {
|
|
|
|
|
|
if (this.formobj.asOldparthandleList.length == 0) {
|
|
this.$message({
|
|
showClose: true,
|
|
type: 'warning',
|
|
message: '旧件申请列表不能为空'
|
|
})
|
|
return
|
|
}
|
|
|
|
for (var i = 0; i < this.formobj.asOldparthandleList.length; i++) {
|
|
if (Number(this.formobj.asOldparthandleList[i].count) == 0) {
|
|
this.$message({
|
|
showClose: true,
|
|
type: 'warning',
|
|
message: '旧件数量不能为空'
|
|
})
|
|
return
|
|
}
|
|
}
|
|
|
|
this.$refs['form_obj'].validate((valid) => {
|
|
if (valid) {
|
|
this.submitdisabled = true
|
|
req.submit(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.imgList = []
|
|
this.formobj = {
|
|
"sid": "",
|
|
"remarks": "",
|
|
"createBySid": "",
|
|
"createByName": "",
|
|
"createDeptSid": "",
|
|
"createDeptName": "",
|
|
"createTime": "",
|
|
"billNo": "",
|
|
"filePaths": [],
|
|
"useOrgSid": "",
|
|
"useOrgName": "",
|
|
"orgSidPath": "",
|
|
"procDefId": "",
|
|
"nodeId": "",
|
|
"procInstId": "",
|
|
"nodeState": "",
|
|
"taskId": "",
|
|
"finishTime": "",
|
|
"asOldparthandleList": []
|
|
}
|
|
this.submitdisabled = false
|
|
this.isUpdata = false
|
|
this.$emit('doback')
|
|
},
|
|
|
|
showAdd() {
|
|
this.title = "【新增】"
|
|
this.isUpdata = false
|
|
this.$nextTick(() => {
|
|
this.$refs['form_obj'].clearValidate()
|
|
})
|
|
},
|
|
showEdit(row) {
|
|
this.$nextTick(() => {
|
|
this.$refs['form_obj'].clearValidate()
|
|
})
|
|
this.title = "【修改】"
|
|
this.isUpdata = true
|
|
var params = {
|
|
sid: row.sid
|
|
}
|
|
|
|
req.init(row.sid)
|
|
.then(resp => {
|
|
if (resp.success) {
|
|
this.formobj = resp.data
|
|
|
|
for (var i = 0; i < resp.data.filePaths.length; i++) {
|
|
this.imgList.push({
|
|
url: resp.data.filePaths[i].url
|
|
})
|
|
}
|
|
|
|
}
|
|
})
|
|
.catch(e => {
|
|
this.formobj = {}
|
|
})
|
|
},
|
|
|
|
backData(value) {
|
|
console.log('backData》》》》', value)
|
|
console.log('imgList', this.imgList)
|
|
|
|
for (var i = 0; i < this.imgList.length; i++) {
|
|
this.formobj.filePaths.push(this.imgList[i].url)
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
</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;
|
|
}
|
|
|
|
.titleOne {
|
|
padding: 7px;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
</style>
|
|
|