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.
201 lines
6.4 KiB
201 lines
6.4 KiB
<template>
|
|
<div class="app-container">
|
|
<div>
|
|
<div class="tab-header webtop">
|
|
<div>{{ title }}</div>
|
|
<div>
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveSubmit">提交</el-button>
|
|
<el-button type="info" size="small" icon="el-icon-close" @click="handleReturn()">关闭</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="listconadd" style="padding-bottom: 50px;">
|
|
<el-form ref="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
|
|
<div class="titwu">货物解货质押出库</div>
|
|
<el-row style="border-top: 1px solid #e0e3eb">
|
|
<el-col :span="4" class="trightb">
|
|
<el-form-item class="trightb_item">
|
|
<span slot="label">项目名称</span>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-form-item class="trightb_item">
|
|
<el-select v-model="formobj.projectName" @change="projectChange" placeholder="请选择" clearable >
|
|
<el-option v-for="(item,i) in projectSidList" :key="i" :label="item.entryName" :value="item.entryName"></el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="4" class="trightb">
|
|
<el-form-item class="trightb_item">
|
|
<span slot="label">申请日期</span>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="8" class="trightb_item">
|
|
<el-form-item class="trightb_item">
|
|
<el-date-picker v-model="formobj.createTime" type="date" style="width:100%" value-format="yyyy-MM-dd" placeholder="选择日期">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="4" class="trightb">
|
|
<el-form-item class="trightb_item">
|
|
<span slot="label">仓库名称</span>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-form-item class="trightb_item">
|
|
<el-input v-model="formobj.warehouseName" placeholder="" style="width:100%" class="addinputw" clearable />
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="4" class="trightb">
|
|
<el-form-item class="trightb_item">
|
|
<span slot="label">申请人</span>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="8">
|
|
<el-form-item class="trightb_item">
|
|
<el-input v-model="formobj.createByName" placeholder="" style="width:100%" class="addinputw" clearable />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
<el-row>
|
|
<el-col :span="4" class="trightb">
|
|
<el-form-item class="trightb_item">
|
|
<span slot="label">货物价值</span>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="20">
|
|
<el-form-item class="trightb_item">
|
|
<el-input v-model="formobj.goodsValue" placeholder="" style="width:100%" class="addinputw" clearable />
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-row>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import req from '@/api/Jzcksq/jzcksq'
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
title: '',
|
|
submitdisabled: false,
|
|
projectSidList: [],
|
|
formobj: {
|
|
userSid: '',
|
|
createByName: '',
|
|
projectName: '',
|
|
projectSid: '',
|
|
warehouseName: '',
|
|
warehouseSid: '',
|
|
goodsValue: '',
|
|
createTime: ''
|
|
}
|
|
}
|
|
},
|
|
created() {
|
|
this.projectSidList = JSON.parse(window.sessionStorage.getItem('projectSidList'))
|
|
},
|
|
methods: {
|
|
showAdd() {
|
|
this.title = '【新增】货物解货质押出库'
|
|
this.$nextTick(() => {
|
|
this.$refs['dataForm'].clearValidate()
|
|
})
|
|
this.formobj.userSid = window.sessionStorage.getItem('userSid')
|
|
},
|
|
showEdit(row) {
|
|
this.title = '【编辑】货物解货质押出库'
|
|
this.$nextTick(() => {
|
|
this.$refs['dataForm'].clearValidate()
|
|
})
|
|
req.fetchDetailsBySid({ sid: row.sid }).then((resp) => {
|
|
if (resp.success) {
|
|
this.formobj = resp.data
|
|
}
|
|
})
|
|
},
|
|
projectChange(value) {
|
|
const choose = this.projectSidList.filter((item) => item.entryName === value)
|
|
if (choose !== null && choose.length > 0) {
|
|
this.formobj.projectSid = choose[0].sid
|
|
} else {
|
|
this.formobj.projectSid = ''
|
|
}
|
|
},
|
|
saveOrUpdate() {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
if (valid) {
|
|
this.submitdisabled = true
|
|
req.sealrecordSave(this.formobj).then((resp) => {
|
|
if (resp.success) {
|
|
this.$message({ showClose: true, type: 'success', message: '保存成功' })
|
|
this.handleReturn('true')
|
|
} else {
|
|
this.submitdisabled = false
|
|
}
|
|
}).catch(() => {
|
|
this.submitdisabled = false
|
|
})
|
|
}
|
|
})
|
|
},
|
|
saveSubmit() {
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
if (valid) {
|
|
this.submitdisabled = true
|
|
req.sealrecordSubmit(this.formobj).then((resp) => {
|
|
if (resp.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 = {
|
|
userSid: '',
|
|
createByName: '',
|
|
projectName: '',
|
|
projectSid: '',
|
|
warehouseName: '',
|
|
warehouseSid: '',
|
|
goodsValue: '',
|
|
createTime: ''
|
|
}
|
|
this.submitdisabled = false
|
|
this.$refs['dataForm'].resetFields()
|
|
this.$emit('doback')
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.trightb {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.trightb_item {
|
|
padding-top: 5px;
|
|
}
|
|
|
|
.span {
|
|
margin-left: 50px;
|
|
font-size: 15px;
|
|
font-weight: 400;
|
|
}
|
|
</style>
|
|
|