master
lion 3 years ago
parent 8f47e59854
commit 9f3782c11b

@ -1,6 +1,6 @@
<template>
<div>
<xy-dialog ref="dialog" :width='80' :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增出库' : '编辑出库'" :form="form" :rules="rules" @submit="submit">
<xy-dialog ref="dialog" :width='80' :is-show.sync="isShow" type="form" :title="type === 'add' ? `新增${chukuType}出库` : `编辑${chukuType}出库`" :form="form" :rules="rules" @submit="submit">
<template v-slot:chukushijian>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -17,7 +17,7 @@
</div>
</div>
</template>
<template v-slot:chukuleixing>
<!-- <template v-slot:chukuleixing>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>出库类型
@ -33,7 +33,7 @@
</el-select>
</div>
</div>
</template>
</template> -->
<template v-slot:jieyongcangku>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -170,10 +170,10 @@
</div>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>借用/报废数量
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>出库数量
</div>
<div class="xy-table-item-content">
<el-input type="text" @blur='jieyong' v-model="mingxiObj.jieyongshuliang" placeholder="请填写借用/报废数量"
<el-input type="text" @blur='jieyong' v-model="mingxiObj.jieyongshuliang" placeholder="请填写出库数量"
style="width: 300px;"></el-input>
</div>
</div>
@ -241,14 +241,15 @@ export default {
type:'add',
id:'',
keyword:'',
chukuType:'',
tableName:'outbounds',
cangkuList:[],
lexingoptions:[{
label:'用',
value:'用'
label:'用',
value:'用'
},{
label:'报废',
value:'报废'
label:'处置',
value:'应急'
}],
huikuoptions:[
{
@ -274,10 +275,10 @@ export default {
required: true,
message: '请选择出库时间'
}],
chukuleixing: [{
required: true,
message: '请选择出库类型'
}],
// chukuleixing: [{
// required: true,
// message: ''
// }],
jieyongren: [{
required: true,
message: '请填写借用人'
@ -575,6 +576,7 @@ export default {
watch:{
isShow(newVal){
if(newVal){
this.form.chukuleixing = this.chukuType
if(this.type === 'editor'){
this.getDetail()
}

@ -2,13 +2,13 @@
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="出库管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<lx-header icon="md-apps" :text="`${chukuType}出库管理`" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="借用人搜索" />
<Button type="primary" @click="getindex"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['addoutbounds'].isShow = true,$refs['addoutbounds'].type = 'add'">添加</Button>
@click="$refs['addoutbounds'].isShow = true,$refs['addoutbounds'].type = 'add',$refs['addoutbounds'].chukuType = chukuType">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
@ -68,7 +68,8 @@
pageSize: 10,
pageIndex: 1,
keyword: ""
},
},
chukuType:'领用',
customForm: {
customFormId: "",
tableName: ""
@ -79,40 +80,47 @@
table: [{
label: '序号',
type: 'index',
fixed: 'left'
fixed: 'left',
width:80,
}, {
label: "出库时间",
width: 220,
width: 180,
prop: 'chukushijian',
align: 'left',
align: 'center',
fixed: 'left',
},
{
label: "出库类型",
width: 180,
prop: 'chukuleixing',
align: 'center',
},
{
label: "借用仓库",
width: 220,
width: 180,
prop: 'jieyongcangku',
align: 'left',
align: 'center',
},
{
label: "借用部门",
width: 220,
width: 180,
prop: 'jieyongbumen',
align: 'left',
align: 'center',
},
{
label: "借用人",
width: 220,
width: 180,
prop: 'jieyongren',
align: 'left',
align: 'center',
},
{
label: "记录人员",
width: 140,
prop: 'jilurenyuan'
width: 180,
prop: 'jilurenyuan',
align:'center'
},
{
label: "备注",
width: 200,
prop: 'beizhu',
align: 'left'
}
@ -125,7 +133,8 @@
page_size: this.select.pageSize,
page: this.select.pageIndex,
table_name: 'outbounds',
filter:[{"key":"jieyongren","op":"like","value":this.select.keyword}],
filter:[{"key":"jieyongren","op":"like","value":this.select.keyword},
{"key":"chukuleixing","op":"like","value":this.chukuType}],
})
this.list = res.data
this.total = res.total
@ -137,7 +146,8 @@
editorRuku(id, type) {
this.$refs['addoutbounds'].id = id
this.$refs['addoutbounds'].isShow = true
this.$refs['addoutbounds'].type = type
this.$refs['addoutbounds'].type = type
$refs['addoutbounds'].chukuType = chukuType
},
deleteRuku(row) {
// return
@ -203,7 +213,12 @@
this.form = res.data
},
},
mounted() {
mounted() {
if(this.$route.path){
let path = this.$route.path.split("_")[1]
this.chukuType = path=='receive'?'领用':(path=='desposition'?'处置':'应急')
}
// this.getField()
this.getindex()
}

@ -1,7 +1,21 @@
<template>
<div>
<xy-dialog ref="dialog" :width='80' :is-show.sync="isShow" type="form" :title="type === 'add' ? '新增入库' : '编辑入库'" :form="form"
<xy-dialog ref="dialog" :width='80' :is-show.sync="isShow" type="form" :title="type === 'add' ? `新增${rukuTypeName}入库` : `编辑${rukuTypeName}入库`" :form="form"
:rules="rules" @submit="submit">
<!-- <template v-slot:guanlianhetong v-if="form.rukuleixing=='采购'">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>关联合同
</div>
<div class="xy-table-item-content">
<el-select v-model="form.guanlianhetong" style="width: 300px;" placeholder="请选择">
<el-option v-for="item in lexingoptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</div>
</div>
</template> -->
<template v-slot:rukushijian>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -14,7 +28,7 @@
</div>
</div>
</template>
<template v-slot:rukuleixing>
<!-- <template v-slot:rukuleixing>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>入库类型
@ -26,7 +40,7 @@
</el-select>
</div>
</div>
</template>
</template> -->
<template v-slot:rukucangku>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -89,10 +103,10 @@
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>入库明细
</div>
<div class="xy-table-item-content">
<Button v-if="form.rukuleixing!=''" type="primary" icon="md-add" style="margin-bottom: 10px"
<Button type="primary" icon="md-add" style="margin-bottom: 10px"
@click="isShowMingxi=true">新增入库明细</Button>
<Button v-if="form.rukuleixing==''" type="primary" icon="md-add" style="margin-bottom: 10px"
@click="isShowMingxi=true">新增库明细</Button>
<!-- <Button v-if="form.rukuleixing==''" type="primary" icon="md-add" style="margin-bottom: 10px"
@click="isShowMingxi=true">新增库明细</Button> -->
<xy-table style="width: 75%" :height="260" :is-page="false" :list="mingxiList" :table-item="mingxiTable">
<template v-slot:btns>
<el-table-column label="操作" width="90" header-align="center" align="center">
@ -252,7 +266,9 @@
return {
isShow: false,
type: 'add',
id: '',
id: '',
rukuType:'',
rukuTypeName:'盘点',
tableName: 'stocks',
cangkuList: [],
lexingoptions: [{
@ -267,7 +283,8 @@
}],
rukupiciList:[],
form: {
rukushijian: '',
rukushijian: '',
// guanlianhetong:'',
rukuleixing: '',
rukucangku: '',
jingbanren: "",
@ -281,10 +298,10 @@
required: true,
message: '请选择入库时间'
}],
rukushijian: [{
required: true,
message: '请选择入库类型'
}],
// rukushijian: [{
// required: true,
// message: ''
// }],
jingbanren: [{
required: true,
message: '请填写经办人'
@ -441,13 +458,13 @@
this.isShowMingxi = true
},
showWuzi(type) {
if (this.form.rukuleixing == '') {
Message({
type: 'warning',
message: '请先选择入库类型'
})
return
}
// if (this.form.rukuleixing == '') {
// Message({
// type: 'warning',
// message: ''
// })
// return
// }
this.isShowWuzi = true
if (type == '回库') {
this.$nextTick(() => {
@ -609,7 +626,8 @@
})
this.form = {
rukushijian: res?.rukushijian,
rukuleixing: res?.rukuleixing,
rukuleixing: res?.rukuleixing,
rukucangku:res.rukucangku,
jingbanren: res?.jingbanren,
jilurenyuan: res?.jilurenyuan,
baoguanrenyuan: res?.baoguanrenyuan,
@ -721,7 +739,9 @@
},
watch: {
isShow(newVal) {
if (newVal) {
if (newVal) {
this.form.rukuleixing = this.rukuType
this.rukuTypeName = this.rukuType=='回库'?'归还':this.rukuType
if (this.type === 'editor') {
this.getDetail()
}

@ -2,14 +2,14 @@
<div style="padding: 0 20px">
<div ref="lxHeader">
<lx-header icon="md-apps" text="入库管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<lx-header icon="md-apps" :text="rukuType=='回库'?`归还入库管理`:`${rukuType}入库管理`" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="经办人搜索" />
<Button type="primary" @click="getindex"></Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['addRuku'].isShow = true,$refs['addRuku'].type = 'add'">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['addRuku'].isShow = true,$refs['addRuku'].type = 'add',$refs['addRuku'].rukuType = rukuType">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
</div>
@ -21,7 +21,7 @@
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<template slot-scope="scope">
<Button type="primary" size="small" @click="editorRuku(scope.row.id,'editor')"></Button>
<!-- <Button type="primary" size="small" @click="editorActivity(scope.row.id,'editor')"></Button>
<Button style="margin-left: 10px;" type="primary" size="small" @click="checkActivity(scope.row.id)"></Button>
@ -50,9 +50,13 @@
import {
Message
} from 'element-ui'
import imports from "@/views/component/imports.vue"
import { index as fieldIndex } from "@/api/system/customFormField";
import { getparameter } from "@/api/system/dictionary";
import imports from "@/views/component/imports.vue"
import {
index as fieldIndex
} from "@/api/system/customFormField";
import {
getparameter
} from "@/api/system/dictionary";
export default {
components: {
addRuku,
@ -64,53 +68,54 @@
pageSize: 10,
pageIndex: 1,
keyword: ""
},
rukuType:'',
customForm: {
customFormId: "",
tableName: "stocks"
},
customForm: {
customFormId: "",
tableName: ""
},
form:[],
form: [],
total: 0,
list: [],
table: [{
label:'序号',
type:'index',
fixed:'left'
},
{
label: "入库时间",
width: 180,
prop: 'rukushijian',
align: 'center'
},
{
label: "入库类型",
width: 180,
prop: 'rukuleixing',
align: 'center'
},
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width:80
},
{
label: "入库时间",
width: 180,
prop: 'rukushijian',
align: 'center'
},
{
label: "入库类型",
width: 180,
prop: 'rukuleixing',
align: 'center'
},
{
label: "经办人",
width: 120,
width: 180,
prop: 'jingbanren',
align: 'center'
},
{
label: "记录人员",
width: 120,
width: 180,
prop: 'jilurenyuan',
align: 'center'
},
{
label: "保管人员",
width: 120,
prop: 'baoguanrenyuan',
width: 180,
prop: 'baoguanrenyuan',
align: 'center'
},
{
label: "备注",
width: 200,
// width: 200,
prop: 'beizhu',
align: 'left'
}
@ -120,29 +125,40 @@
methods: {
async getindex() {
const res = await index({
page_size: this.select.pageSize,
page_size: this.select.pageSize,
page: this.select.pageIndex,
table_name: 'stocks',
filter:[{"key":"jingbanren","op":"like","value":this.select.keyword}],
filter: [{
"key": "jingbanren",
"op": "like",
"value": this.select.keyword
},
{
"key": "rukuleixing",
"op": "eq",
"value": this.rukuType
}
],
})
this.list = res.data
this.total = res.total
},
},
pageChange(e) {
this.select.pageIndex = e
},
editorRuku(id,type){
this.$refs['addRuku'].id = id
this.$refs['addRuku'].isShow = true
},
editorRuku(id, type) {
this.$refs['addRuku'].id = id
this.$refs['addRuku'].isShow = true
this.$refs['addRuku'].type = type
this.$refs['addRuku'].rukuType = this.rukuType
},
deleteRuku(row) {
console.log(row.id)
deleteRuku(row) {
console.log(row.id)
// return
destroy({
id: row.id,
table_name:this.customForm.tableName
id: row.id,
table_name: this.customForm.tableName
}).then(res => {
Message({
type: 'success',
@ -151,56 +167,67 @@
this.getindex()
})
},
//
async getField() {
if(this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form)
try {
let custom_form = JSON.parse(decode)
this.customForm.customFormId = custom_form.custom_form_id
this.customForm.tableName = custom_form.table_name
console.log("123",this.customForm)
// this.select.table_name = custom_form.table_name
}catch (err) {
console.warn(err)
}
}
const res = await fieldIndex({
page: 1,
page_size: 999,
custom_form_id: this.customForm.customFormId,
sort_name: 'sort',
sort_type: 'asc',
})
if(res.data && res.data instanceof Array) {
res.data.forEach(i => {
if (i.field) {
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.parameter_id
) {
getparameter({ id: i.parameter_id }).then((res) => {
i._paramters = res.detail ?? [];
});
}
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.link_table_name
) {
index({
page: 1,
page_size: 999,
table_name: i.link_table_name,
}).then((res) => {
i._paramters = res.data ?? [];
});
}
}
})
}
this.form = res.data
console.log(this.$route.meta.params,"---",this.$route)
return
if (this.$route.meta.params?.custom_form) {
let decode = decodeURIComponent(this.$route.meta.params?.custom_form)
try {
let custom_form = JSON.parse(decode)
this.customForm.customFormId = custom_form.custom_form_id
this.customForm.tableName = custom_form.table_name
console.log("123", this.customForm)
// this.select.table_name = custom_form.table_name
} catch (err) {
console.warn(err)
}
}
const res = await fieldIndex({
page: 1,
page_size: 999,
custom_form_id: this.customForm.customFormId,
sort_name: 'sort',
sort_type: 'asc',
})
if (res.data && res.data instanceof Array) {
res.data.forEach(i => {
if (i.field) {
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.parameter_id
) {
getparameter({
id: i.parameter_id
}).then((res) => {
i._paramters = res.detail ?? [];
});
}
if (
(i.edit_input === "checkbox" || i.edit_input === "radio" || i.edit_input === "select") &&
i.link_table_name
) {
index({
page: 1,
page_size: 999,
table_name: i.link_table_name,
}).then((res) => {
i._paramters = res.data ?? [];
});
}
}
})
}
this.form = res.data
},
},
mounted() {
if(this.$route.path){
let path = this.$route.path.split("_")[1]
console.log(path)
this.rukuType = path=='check'?'盘点':(path=='purchase'?'采购':'回库')
}
this.getField()
this.getindex()
}

Loading…
Cancel
Save