lion 3 years ago
parent 625669fcf9
commit 3bd2c3970d

@ -2,15 +2,15 @@
ENV='development'
# base api
#VUE_APP_BASE_API = http://192.168.60.99:9004/
#VUE_APP_UPLOAD_API = http://192.168.60.99:9004/api/admin/upload-file
#VUE_APP_OA_URL = http://192.168.60.18:2021
#VUE_APP_OA_URL_TYPE = '{"领用":"37","处置":"38","应急":"39"}'
VUE_APP_BASE_API = http://192.168.60.99:9004/
VUE_APP_UPLOAD_API = http://192.168.60.99:9004/api/admin/upload-file
VUE_APP_OA_URL = http://192.168.60.18:2021
VUE_APP_OA_URL_TYPE = '{"领用":"37","处置":"38","应急":"39"}'
VUE_APP_BASE_API = http://hd-wuziguanli-test.ali251.langye.net/
VUE_APP_UPLOAD_API = http://hd-wuziguanli-test.ali251.langye.net/api/admin/upload-file
VUE_APP_OA_URL= http://suzhouhedaooa.langye.net
VUE_APP_OA_URL_TYPE = '{"领用":"31","处置":"32","应急":"33"}'
#VUE_APP_BASE_API = http://hd-wuziguanli-test.ali251.langye.net/
#VUE_APP_UPLOAD_API = http://hd-wuziguanli-test.ali251.langye.net/api/admin/upload-file
#VUE_APP_OA_URL= http://suzhouhedaooa.langye.net
#VUE_APP_OA_URL_TYPE = '{"领用":"31","处置":"32","应急":"33"}'

@ -10,7 +10,7 @@ VUE_APP_OA_URL_TYPE = '{"领用":"37","处置":"38","应急":"39"}'
#VUE_APP_BASE_API = http://hd-wuziguanli-test.ali251.langye.net/
#VUE_APP_UPLOAD_API = http://hd-wuziguanli-test.ali251.langye.net/api/admin/upload-file
#VUE_APP_OA_URL= http://suzhouhedaooa.langye.net
#VUE_APP_OA_URL_TYPE = '{"领用":"31","处置":"32","应急":"33"}'
#VUE_APP_OA_URL_TYPE = '{"领用":"31","处置":"32"}'

@ -0,0 +1,9 @@
import request from '@/utils/request'
export function getWzbm() {
return request({
url: '/api/admin/other/wuzibianma',
method: 'get'
})
}

@ -17,6 +17,7 @@ if(window.location.origin.indexOf('localhost')>-1){
}else{
baseUrl = window.location.origin + '/'
}
const service = axios.create({
baseURL: baseUrl, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests

@ -0,0 +1,305 @@
<template>
<div>
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" title="库存明细" :form="form"
:rules="rules" @submit="submit">
<template v-slot:wuzibianma>
<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">
<div style='width:300px'>
{{form.wuzibianma}}
</div>
</div>
</div>
</template>
<template v-slot:zichanmingcheng>
<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">
<div style='width:300px'>
{{form.zichanmingcheng}}
</div>
</div>
</div>
</template>
<template v-slot:guigexinghao>
<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">
<div style='width:300px'>
{{form.wuzibianma}}
</div>
</div>
</div>
</template>
<template v-slot:wuzileixing>
<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">
<div style='width:300px'>
{{form.wuzibianma}}
</div>
</div>
</div>
</template>
<template v-slot:jiliangdanwei>
<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">
<div style='width:300px'>
{{form.jiliangdanwei}}
</div>
</div>
</div>
</template>
<template v-slot:rukushuliang>
<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-input v-model="form.rukushuliang" placeholder="请填写入库数量" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:zaikushuliang>
<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-input v-model="form.zaikushuliang" placeholder="请填写在库数量" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:rukupici>
<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-input v-model="form.rukupici" placeholder="请填写入库批次" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:gudingzichanbianhao>
<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">
<div style='width:300px'>
{{form.gudingzichanbianhao}}
</div>
</div>
</div>
</template>
<template v-slot:suozaicangku>
<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">
<div style='width:300px'>
{{form.suozaicangku}}
</div>
</div>
</div>
</template>
<template v-slot:suozaihuojia>
<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">
<div style='width:300px'>
{{form.suozaihuojia}}
</div>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
index,
show
} from "@/api/system/baseForm.js"
import {
Message
} from 'element-ui'
export default {
data() {
return {
isShow: false,
type: 'add',
id: '',
tableName:'inventorys',
form: {
wuzibianma:'',
zichanmingcheng:'',
guigexinghao:'',
wuzileixing:'',
jiliangdanwei:'',
rukushuliang:'',
zaikushuliang:'',
rukupici:'',
gudingzichanbianhao:'',
suozaicangku:'',
suozaihuojia:''
},
rules: {
},
}
},
created() {
},
methods: {
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.form = {
wuzibianma:res.wuzibianma_material_infos_wuzibianma_relation?.wuzibianma,
zichanmingcheng:res.wuzibianma_material_infos_wuzibianma_relation?.zichanmingcheng,
guigexinghao:res.wuzibianma_material_infos_wuzibianma_relation?.guigexinghao,
wuzileixing:res.wuzibianma_material_infos_wuzibianma_relation?.wuzileixing,
jiliangdanwei:res.wuzibianma_material_infos_wuzibianma_relation?.jiliangdanwei,
rukushuliang:res?.rukushuliang,
zaikushuliang:res?.zaikushuliang,
rukupici:res?.rukupici,
gudingzichanbianhao:res.wuzibianma_material_infos_wuzibianma_relation?.gudingzichanbianhao,
suozaicangku:res.wuzibianma_material_infos_wuzibianma_relation?.suozaicangku,
suozaihuojia:res.wuzibianma_material_infos_wuzibianma_relation?.suozaihuojia
}
},
submit() {
if (this.type === 'editor') {
save({
id: this.id,
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑成功'
})
this.isShow = false
this.$emit('refresh')
})
}
},
},
watch: {
isShow(newVal) {
if (newVal) {
this.getDetail()
} else {
this.id = ''
this.type = ''
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
.mingxiwrap {
display: flex;
flex-wrap: wrap;
}
.mingxiwrap .xy-table-item {
margin-bottom: 10px
}
.searchCompanys {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
}
::v-deep .searchCompanys .el-input {
width: 82%
}
.xy-table-item-label {
width: 160px;
}
.img__delete {
transform: scale(0.8, 0.8);
position: absolute;
top: 4px;
right: 4px;
}
::v-deep .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar {
width: 80px !important;
display: block;
border-radius: 6px;
}
::v-deep .xy-table-item-label {
width: 160px !important;
}
::v-deep .el-date-editor .el-range-separator {
width: auto !important;
}
::v-deep .el-input-number .el-input__inner {
text-align: left !important;
}
</style>

@ -5,12 +5,27 @@
<lx-header icon="md-apps" text="库存管理" 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>
<div class="selector-item">
<span class="selector-item__label">资产名称</span>
<Input v-model="select.keyword" style="width: 120px;margin-right: 10px;" placeholder="资产名称搜索" />
</div>
<div class="selector-item">
<span class="selector-item__label">入库数量</span>
<Input clearable v-model="select.rmin" style="width: 60px;margin:0 3px" placeholder="" />
<span class="selector-item__label"></span>
<Input clearable v-model="select.rmax" style="width: 60px;margin:0 3px" placeholder="" />
</div>
<div class="selector-item">
<span class="selector-item__label">在库数量</span>
<Input clearable v-model="select.min" style="width: 60px;margin:0 3px" placeholder="" />
<span class="selector-item__label"></span>
<Input clearable v-model="select.max" style="width: 60px;margin:0 3px" placeholder="" />
</div>
<Button type="primary" style="margin-left: 10px;" @click="getindex"></Button>
<Button type="primary" style="margin-left: 10px;" @click="toprint"></Button>
<Button type="primary" style="margin-left: 10px;"
@click="toprint">打印</Button>
<Button type="primary" style="margin-left: 10px;"
@click="exportExcel(new Date().getTime().toString())">导出</Button>
@click="exportExcel(new Date().getTime().toString())">导出</Button>
</div>
@ -18,30 +33,27 @@
</lx-header>
</div>
<xy-table :list="list" v-loading="loading" :total="total" @selection-change="selectionChange" @pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange"
:table-item="table" :auths='[]'>
<template v-slot:btns>
<div></div>
<!-- <el-table-column fixed="right" label="操作" width="260" header-align="center">
<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>
<Button type="primary" size="small" style="margin-left: 10px;" @click="editorActivity(scope.row.id,'copy')"></Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteRuku(scope.row)">
<xy-table :list="list" v-loading="loading" :total="total" @selection-change="selectionChange"
@pageSizeChange="e => select.pageSize = e" @pageIndexChange="pageChange" :table-item="table" :auths='[]'>
<template v-slot:btns >
<!-- <div></div> -->
<el-table-column v-if="isCkName=='仓库管理员'||roleName=='系统管理员'" fixed="right" label="操作" width="180" header-align="center">
<template slot-scope="scope">
<Button type="primary" size="small" @click="editorIn(scope.row.id,'editor')"></Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteIn(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</template>
</el-table-column> -->
</el-table-column>
</template>
</xy-table>
<!-- <addRuku ref="addRuku" @refresh="getindex"></addRuku> -->
<div class="code" v-if="showcode" @click="closeCode">
<div id="qrCode" ref="qrCodeDiv"></div>
</div>
<addInventorys ref="addInventorys" @refresh="getindex"></addInventorys>
<div class="code" v-if="showcode" @click="closeCode">
<div id="qrCode" ref="qrCodeDiv"></div>
</div>
<imports :table-name="customForm.tableName" :form-info="form" ref="imports" @refresh="getindex"></imports>
@ -52,232 +64,355 @@
import {
index,
destroy
} from "@/api/system/baseForm.js"
// import addRuku from "./component/addRuku.vue"
} from "@/api/system/baseForm.js"
import {
getInfo
} from "@/api/user.js"
import addInventorys from "./components/addInventorys.vue"
import QRCode from 'qrcodejs2';
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 * as XLSX from "xlsx";
import { saveAs } from "file-saver";
import imports from "@/views/component/imports.vue"
import {
index as fieldIndex
} from "@/api/system/customFormField";
import {
getparameter
} from "@/api/system/dictionary";
import * as XLSX from "xlsx";
import {
saveAs
} from "file-saver";
import Cookies from 'js-cookie'
export default {
components: {
imports
imports,
addInventorys
},
data() {
return {
loading:false,
return {
loading: false,
userName:'',
authName:'',
roleName:'',
isCkName:'',
select: {
pageSize: 10,
pageIndex: 1,
keyword: "",
is_export:0
},
showcode:false,
customForm: {
customFormId: "",
tableName: ""
},
form:[],
keyword: "",
is_export: 0,
min: '',
max: '',
rmin: '',
rmax: ''
},
showcode: false,
customForm: {
customFormId: "",
tableName: "inventorys"
},
form: [],
total: 0,
list: [],
table: [
{
type:'selection'
},{
label:'序号',
type:'index',
fixed:'left',
width:80,
},
{
label: "物资编码",
width: 180,
prop: 'wuzibianma',
align: 'center'
},
{
label: "固定资产编号",
width: 180,
prop: 'gudingzichanbianhao',
align: 'center'
},
{
label: "资产名称",
prop: 'zichanmingcheng',
align: 'center'
},
{
label: "规格型号",
prop: 'guigexinghao',
align: 'center',
width: 180
},
table: [{
type: 'selection'
}, {
label: '序号',
type: 'index',
fixed: 'left',
width: 80,
},
{
label: "物资编码",
width: 180,
prop: 'wuzibianma',
align: 'center',
formatter: (cell, data, value, index) => {
if(cell.wuzibianma_material_infos_wuzibianma_relation?.wuzibianma){
return cell.wuzibianma_material_infos_wuzibianma_relation.wuzibianma
}else{
return value
}
}
},
{
label: "资产名称",
prop: 'zichanmingcheng',
align: 'center',
formatter: (cell, data, value, index) => {
if(cell.wuzibianma_material_infos_wuzibianma_relation?.zichanmingcheng){
return cell.wuzibianma_material_infos_wuzibianma_relation.zichanmingcheng
}else{
return value
}
}
},
{
label: "规格型号",
prop: 'guigexinghao',
align: 'center',
width: 180,
formatter: (cell, data, value, index) => {
if(cell.wuzibianma_material_infos_wuzibianma_relation?.guigexinghao){
return cell.wuzibianma_material_infos_wuzibianma_relation.guigexinghao
}else{
return value
}
}
},
{
label: "物资类型",
width: 120,
prop: 'wuzileixing',
align: 'center'
align: 'center',
formatter: (cell, data, value, index) => {
if(cell.wuzibianma_material_infos_wuzibianma_relation?.wuzileixing){
return cell.wuzibianma_material_infos_wuzibianma_relation.wuzileixing
}else{
return value
}
}
},
{
label: "计量单位",
width: 120,
prop: 'jiliangdanwei',
align: 'center'
align: 'center',
formatter: (cell, data, value, index) => {
if(cell.wuzibianma_material_infos_wuzibianma_relation?.jiliangdanwei){
return cell.wuzibianma_material_infos_wuzibianma_relation.jiliangdanwei
}else{
return value
}
}
},
{
label: "入库数量",
width: 120,
prop: 'rukushuliang'
},
{
label: "在库数量",
width: 120,
prop: 'zaikushuliang'
},
{
label: "入库批次",
width: 120,
prop: 'rukupici'
},
{
label: "所在仓库",
width: 180,
prop: 'suozaicangku'
},
{
label: "所在货架",
width: 180,
prop: 'suozaihuojia'
},
// {
// label: "",
// width: 180,
// prop: 'erweima',
// customFn: (row) => {
// return (<Button type='primary' size='small'
// on=
// {
// {
// ["click"]: (e) => (this.showCode(e, row))
// }
// }
// ></Button>)
// }
},
{
label: "在库数量",
width: 120,
prop: 'zaikushuliang'
},
{
label: "入库批次",
width: 120,
prop: 'rukupici'
},
{
label: "固定资产编号",
width: 180,
prop: 'gudingzichanbianhao',
align: 'center',
formatter: (cell, data, value, index) => {
if(cell.wuzibianma_material_infos_wuzibianma_relation?.gudingzichanbianhao){
return cell.wuzibianma_material_infos_wuzibianma_relation.gudingzichanbianhao
}else{
return value
}
}
},
{
label: "所在仓库",
width: 180,
prop: 'suozaicangku',
formatter: (cell, data, value, index) => {
if(cell.wuzibianma_material_infos_wuzibianma_relation?.suozaicangku){
return cell.wuzibianma_material_infos_wuzibianma_relation.suozaicangku
}else{
return value
}
}
},
{
label: "所在货架",
width: 180,
prop: 'suozaihuojia',
formatter: (cell, data, value, index) => {
if(cell.wuzibianma_material_infos_wuzibianma_relation?.suozaihuojia){
return cell.wuzibianma_material_infos_wuzibianma_relation.suozaihuojia
}else{
return value
}
}
},
// {
// label: "",
// width: 180,
// prop: 'erweima',
// customFn: (row) => {
// return (<Button type='primary' size='small'
// on=
// {
// {
// ["click"]: (e) => (this.showCode(e, row))
// }
// }
// ></Button>)
// }
// },
],
printObj:[],
printArr:[]
],
printObj: [],
printArr: []
}
},
mounted() {
this.getField()
this.getindex()
this.getUserName()
},
methods: {
selectionChange(e){
console.log(e)
let _arrs = []
if(e.length>0){
for(var m of e){
_arrs.push(m.id)
}
console.log(_arrs)
// this.printObj = e
this.printArr = _arrs.join(",")
}
},
toprint(){
if(this.printArr.length<1){
Message({
type: 'warning',
message: '请先选择'
})
return
}
// let _obj = JSON.parse(JSON.stringify(this.printObj))
// let _objs = []
// for(var m of this.printObj){
// _objs.push({
// 'wuzibianma':encodeURI(encodeURI(m['wuzibianma'])),
// 'zichanmingcheng':encodeURI(encodeURI(m['zichanmingcheng'])),
// 'wuzileixing':encodeURI(encodeURI(m['wuzileixing']))
// })
// }
// Cookies.remove('objs')
// Cookies.set('objs',JSON.stringify(_objs))
window.open('/admin/print.html?ids='+this.printArr,'_blank')
},
async exportExcel(sheetName) {
const res = await index(Object.assign(this.select,{ page: 1,page_size: 9999,table_name: 'inventorys'}))
if(res.data){
let headers = this.form.map(i => {
return {
key: i.field,
title: i.name
async getUserName(){
getInfo().then(res => {
console.log("res",res)
this.userName = res.username
this.authName = res.name
for(var k of res.role){
if(k.name=='系统管理员'){
this.roleName = k.name
}
})
const data = res.data.map(row => headers.map(header => row[header.key]));
data.unshift(headers.map(header => header.title));
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
const wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' });
saveAs(new Blob([wbout], { type: 'application/octet-stream' }), `${sheetName}.xlsx`);
}
},
showCode(e,row){
console.log(e,row)
this.showcode = true
this.$nextTick(function(){
new QRCode(this.$refs.qrCodeDiv, {
text: row.wuzibianma+'-'+row.id,
width: 200,
height: 200,
colorDark: "#333333", //
colorLight: "#ffffff", //
correctLevel: QRCode.CorrectLevel.L//L/M/H
})
})
if(k.name=='仓库管理员'){
this.isCkName = '仓库管理员'
}
}
},
closeCode(){
this.$refs.qrCodeDiv.innerHTML = ""
this.showcode = false
}).catch(error => {})
},
selectionChange(e) {
console.log(e)
let _arrs = []
if (e.length > 0) {
for (var m of e) {
_arrs.push(m.id)
}
console.log(_arrs)
// this.printObj = e
this.printArr = _arrs.join(",")
}
},
toprint() {
if (this.printArr.length < 1) {
Message({
type: 'warning',
message: '请先选择'
})
return
}
// let _obj = JSON.parse(JSON.stringify(this.printObj))
// let _objs = []
// for(var m of this.printObj){
// _objs.push({
// 'wuzibianma':encodeURI(encodeURI(m['wuzibianma'])),
// 'zichanmingcheng':encodeURI(encodeURI(m['zichanmingcheng'])),
// 'wuzileixing':encodeURI(encodeURI(m['wuzileixing']))
// })
// }
// Cookies.remove('objs')
// Cookies.set('objs',JSON.stringify(_objs))
window.open('/admin/print.html?ids=' + this.printArr, '_blank')
},
async exportExcel(sheetName) {
const res = await index(Object.assign(this.select, {
page: 1,
page_size: 9999,
table_name: 'inventorys'
}))
if (res.data) {
let headers = this.form.map(i => {
return {
key: i.field,
title: i.name
}
})
const data = res.data.map(row => headers.map(header => row[header.key]));
data.unshift(headers.map(header => header.title));
const wb = XLSX.utils.book_new();
const ws = XLSX.utils.aoa_to_sheet(data);
XLSX.utils.book_append_sheet(wb, ws, sheetName);
const wbout = XLSX.write(wb, {
bookType: 'xlsx',
bookSST: true,
type: 'array'
});
saveAs(new Blob([wbout], {
type: 'application/octet-stream'
}), `${sheetName}.xlsx`);
}
},
async getindex() {
this.loading = true
showCode(e, row) {
console.log(e, row)
this.showcode = true
this.$nextTick(function() {
new QRCode(this.$refs.qrCodeDiv, {
text: row.wuzibianma + '-' + row.id,
width: 200,
height: 200,
colorDark: "#333333", //
colorLight: "#ffffff", //
correctLevel: QRCode.CorrectLevel.L //L/M/H
})
})
},
closeCode() {
this.$refs.qrCodeDiv.innerHTML = ""
this.showcode = false
},
async getindex() {
this.loading = true
let min = this.select.min?this.select.min:1
let max = this.select.max?this.select.max:99999
let rmin = this.select.rmin?this.select.rmin:1
let rmax = this.select.rmax?this.select.rmax:99999
const res = await index({
page_size: this.select.pageSize,
page: this.select.pageIndex,
table_name: 'inventorys',
// is_export:this.select.is_export,
filter:[{"key":"zichanmingcheng","op":"like","value":this.select.keyword}],
table_name: 'inventorys',
// is_export:this.select.is_export,
filter: [{
"key": "zichanmingcheng",
"op": "like",
"value": this.select.keyword,
},
{
"key": "rukushuliang",
"op": "range",
"value": rmin + "," + rmax,
},
{
"key": "zaikushuliang",
"op": "range",
"value": min + "," + max,
},
],
})
this.list = res.data
this.total = res.total
this.total = res.total
this.loading = false
},
},
pageChange(e) {
this.select.pageIndex = e
this.select.pageIndex = e
this.getindex()
},
editorRuku(id,type){
this.$refs['addRuku'].id = id
this.$refs['addRuku'].isShow = true
this.$refs['addRuku'].type = type
},
deleteRuku(row) {
console.log(row.id)
editorIn(id, type) {
this.$refs['addInventorys'].id = id
this.$refs['addInventorys'].isShow = true
this.$refs['addInventorys'].type = type
},
deleteIn(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',
@ -285,79 +420,77 @@
})
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
},
},
mounted() {
this.getField()
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
},
}
}
</script>
<style scoped lang="scss">
.code{
position: absolute;
left:0;
top:0;
background: rgba(0, 0, 0, 0.5);
width:100%;
height:100%;
z-index:9999
}
#qrCode{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
<style scoped lang="scss">
.code {
position: absolute;
left: 0;
top: 0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
z-index: 9999
}
#qrCode {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>

@ -0,0 +1,521 @@
<template>
<div>
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" :title="titleName" :form="form"
:rules="rules" @submit="submit">
<template v-slot:wuzibianma>
<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-input v-model="form.wuzibianma" placeholder="请填写物资编码" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:zichanmingcheng>
<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-input v-model="form.zichanmingcheng" placeholder="请填写资产名称" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:wuzileixing>
<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.wuzileixing" style="width: 300px;" placeholder="请选择物资类型">
<el-option
v-for="item in lexingList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:guigexinghao>
<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-input v-model="form.guigexinghao" placeholder="请填写规格型号" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:fenlei>
<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-input v-model="form.fenlei" placeholder="请填写分类" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:zhuangtai>
<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-input v-model="form.zhuangtai" placeholder="请填写状态" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:jiliangdanwei>
<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-input v-model="form.jiliangdanwei" placeholder="请填写计量单位" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:suozaicangku>
<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.suozaicangku" style="width: 300px;" placeholder="请选择所在仓库">
<el-option
v-for="item in cangkuList"
:key="item.cangkumingcheng"
:label="item.cangkumingcheng"
:value="item.cangkumingcheng">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:suozaihuojia>
<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-input v-model="form.suozaihuojia" placeholder="请填写所在货架" clearable style="width: 300px;"></el-input>
<!-- <el-select v-model="form.suozaihuojia" style="width: 300px;" placeholder="请选择所在货架">
<el-option
v-for="item in huojiaList"
:key="item.huojiamingcheng"
:label="item.huojiamingcheng"
:value="item.huojiamingcheng">
</el-option>
</el-select> -->
</div>
</div>
</template>
<template v-slot:rukushijian>
<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-date-picker style="width: 300px;" v-model="form.rukushijian" type="date" placeholder="选择入库时间"
value-format="yyyy-MM-dd">
</el-date-picker>
</div>
</div>
</template>
<template v-slot:zichanyuanzhi>
<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-input v-model="form.zichanyuanzhi" placeholder="请填写资产原值" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:shiyongnianxian>
<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-input v-model="form.shiyongnianxian" placeholder="请填写使用年限" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:shiyongbumen>
<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-input v-model="form.shiyongbumen" placeholder="请填写使用部门" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:shifouweigudingzichan>
<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.shifouweigudingzichan" style="width: 300px;" placeholder="请选择是否为固定资产">
<el-option
v-for="item in isGuding"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:gudingzichanbianma v-if="form.shifouweigudingzichan==='是'">
<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-input v-model="form.gudingzichanbianma" placeholder="请填写固定资产编码" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:jishuziliao v-if="form.shifouweigudingzichan==='是'">
<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-upload
class="upload-demo"
:action="action"
:on-success="handleSuccess"
:on-remove="handleRemove"
multiple
:limit="10"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
</el-upload>
</div>
</div>
</template>
<template v-slot:beizhu>
<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-input type="textarea" v-model="form.beizhu" placeholder="请输入备注" clearable
style="width: 300px;"></el-input>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
save,
index,
show
} from "@/api/system/baseForm.js"
import {
getWzbm
} from "@/api/mater.js"
import {
Message
} from 'element-ui'
export default {
data() {
return {
isShow: false,
type: 'add',
id: '',
webType:'',
titleName: '',
action:`${process.env.VUE_APP_UPLOAD_API}`,
fileList:[],
tableName: 'material_infos',
cangkuList:[],
huojiaList:[],
isGuding: [{
label: '是',
value: '是'
}, {
label: '否',
value: '否'
}],
lexingList:[{
label: '一类一码',
value: '一类一码'
}, {
label: '一物一码',
value: '一物一码'
}],
form: {
wuzibianma:'',
zichanmingcheng:'',
wuzileixing:'',
guigexinghao:'',
fenlei:'',
zhuangtai:'',
jiliangdanwei:'',
suozaicangku:'',
suozaihuojia:'',
rukushijian:'',
zichanyuanzhi:'',
shiyongnianxian:'',
shiyongbumen:'',
shifouweigudingzichan:'',
gudingzichanbianma:'',
jishuziliao:[],
beizhu:''
},
rules: {
wuzibianma: [{
required: true,
message: '请输入物资编码'
}],
zichanmingcheng: [{
required: true,
message: '请输入资产名称'
}],
wuzileixing: [{
required: true,
message: '请输入物资类型'
}]
}
}
},
created() {
this.getCangku()
// this.getHuojia()
},
methods: {
//
async getWzbms(){
const res = await getWzbm()
this.form.wuzibianma = res
},
async getHuojia() {
let res = await index({
page_size: 999,
page: 1,
table_name: 'shelfs',
})
this.huojiaList = res.data
},
async getCangku() {
let res = await index({
page_size: 999,
page: 1,
table_name: 'materialstorages',
})
this.cangkuList = res.data
},
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.form = {
wuzibianma:res?.wuzibianma,
zichanmingcheng:res?.zichanmingcheng,
wuzileixing:res?.wuzileixing,
guigexinghao:res?.guigexinghao,
fenlei:res?.fenlei,
zhuangtai:res?.zhuangtai,
jiliangdanwei:res?.jiliangdanwei,
suozaicangku:res?.suozaicangku,
suozaihuojia:res?.suozaihuojia,
rukushijian:res?.rukushijian,
zichanyuanzhi:res?.zichanyuanzhi,
shiyongnianxian:res?.shiyongnianxian,
shiyongbumen:res?.shiyongbumen,
shifouweigudingzichan:res?.shifouweigudingzichan,
gudingzichanbianma:res?.gudingzichanbianma,
jishuziliao:res?.jishuziliao,
beizhu:res?.beizhu
}
if(res.jishuziliao_upload_details){
for(var j of res.jishuziliao_upload_details){
this.fileList.push({
id:j.id,
name:j.original_name,
url:j.url
})
}
}
},
submit() {
// return
console.log(this.fileList)
this.form.jishuziliao = []
if (this.fileList.length > 0) {
for (var g of this.fileList) {
if (g.response) {
this.form.jishuziliao.push(g.response.id)
} else {
this.form.jishuziliao.push(g.id)
}
}
} else {
this.form.jishuziliao = []
}
// return
if (this.type === 'add') {
save({
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '新增成功'
})
this.isShow = false
this.$emit('refresh')
if(this.webType=='insert'){
this.$emit('insert',this.form)
}
})
return
}
if (this.type === 'editor') {
save({
id: this.id,
table_name: this.tableName,
...this.form
}).then(res => {
Message({
type: 'success',
message: '编辑成功'
})
this.isShow = false
this.$emit('refresh')
})
}
},
handleRemove(file, fileList) {
this.fileList = fileList
},
handleSuccess(response, file, fileList) {
this.fileList = fileList
},
},
watch: {
isShow(newVal) {
if (newVal) {
this.titleName = this.type === 'add' ? `新增物资` : `编辑物资`
if (this.type === 'editor') {
this.getDetail()
}else{
this.getWzbms()
}
// if(this.webType=='insert'){
// console.log("insert")
// }
} else {
this.id = ''
this.type = ''
this.fileList = []
this.webType = ''
this.$refs['dialog'].reset()
}
}
}
}
</script>
<style scoped lang="scss">
.mingxiwrap {
display: flex;
flex-wrap: wrap;
}
.mingxiwrap .xy-table-item {
margin-bottom: 10px
}
.searchCompanys {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
}
::v-deep .searchCompanys .el-input {
width: 82%
}
.xy-table-item-label {
width: 160px;
}
.img__delete {
transform: scale(0.8, 0.8);
position: absolute;
top: 4px;
right: 4px;
}
::v-deep .avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
::v-deep .avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
::v-deep .el-upload--picture-card {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px !important;
height: 80px !important;
line-height: 80px !important;
text-align: center;
}
::v-deep .avatar {
width: 80px !important;
display: block;
border-radius: 6px;
}
::v-deep .xy-table-item-label {
width: 160px !important;
}
::v-deep .el-date-editor .el-range-separator {
width: auto !important;
}
::v-deep .el-input-number .el-input__inner {
text-align: left !important;
}
</style>

@ -0,0 +1,355 @@
<template>
<div>
<div ref="lxHeader">
<lx-header icon="md-apps" text="物资档案管理" 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['addMater'].isShow = true,$refs['addMater'].type = 'add'">添加</Button>
<Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="getField(),$refs['imports'].show()">导入</Button>
</div>
</slot>
</lx-header>
</div>
<xy-table :list="list" :total="total" v-loading="loading" @pageSizeChange="e => select.pageSize = e"
@pageIndexChange="pageChange" :table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<div>
<Button type="primary" size="small" @click="showMater(scope.row.id)"></Button>
<Button type="primary" size="small" style="margin-left: 10px;"
@click="editorMater(scope.row.id,'editor')">编辑</Button>
<!-- <Button type="primary" size="small" @click="editorMater(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>
<Button type="primary" size="small" style="margin-left: 10px;" @click="editorActivity(scope.row.id,'copy')"></Button> -->
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteMater(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</div>
</template>
</el-table-column>
</template>
</xy-table>
<addMater ref="addMater" @refresh="getindex"></addMater>
<imports :table-name="customForm.tableName" :form-info="importForm" ref="imports" @refresh="getindex"></imports>
<el-drawer title="物资记录" :visible.sync="drawer" :direction="direction">
<div class="draw">
<div>物资编码{{detailObj.wuzibianma}}</div>
<div>资产名称{{detailObj.zichanmingcheng}}</div>
<div v-if="detailArr.length>0">
<el-timeline-item v-for="(item, index) in detailArr" :key="index" :timestamp="item.date">
<div>
<p>操作{{item.caozuo}}</p>
<p>人员{{item.jingbanren}}</p>
<p>批次{{item.pici}}</p>
<p>数量{{item.shuliang}}</p>
<!-- <p>库存{{item.kucun}}</p> -->
</div>
</el-timeline-item>
</div>
<div v-else>
暂无操作记录
</div>
</div>
</el-drawer>
</div>
</template>
<script>
import {
index,
destroy,
show
} from "@/api/system/baseForm.js"
import addMater from "./component/addMater.vue"
import {
Message
} from 'element-ui'
import {
getInfo
} from "@/api/user.js"
import imports from "@/views/component/imports.vue"
import {
index as fieldIndex
} from "@/api/system/customFormField";
import {
getparameter
} from "@/api/system/dictionary";
export default {
components: {
addMater,
imports
},
data() {
return {
authName: '',
roleName: '',
loading: false,
drawer: false,
direction: 'rtl',
detailObj: {},
detailArr: [],
select: {
pageSize: 10,
pageIndex: 1,
keyword: ""
},
customForm: {
customFormId: 1,
tableName: "material_infos"
},
form: [],
importForm: [],
total: 0,
list: [],
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80
},
{
label: "物资编码",
width: 120,
prop: 'wuzibianma',
align: 'center',
},
{
label: "资产名称",
width: 180,
prop: 'zichanmingcheng',
align: 'left'
},
{
label: "物资类型",
width: 180,
prop: 'wuzileixing',
align: 'center'
},
{
label: "规格型号",
width: 180,
prop: 'guigexinghao',
align: 'left'
},
{
label: "分类",
width: 180,
prop: 'fenlei',
align: 'center'
},
{
label: "状态",
width: 180,
prop: 'zhuangtai',
align: 'center'
},
{
label: "计量单位",
width: 180,
prop: 'jiliangdanwei',
align: 'center'
},
{
label: "所在仓库",
width: 180,
prop: 'suozaicangku',
align: 'center'
},
{
label: "所在货架",
width: 180,
prop: 'suozaihuojia',
align: 'center'
},
{
label: "入库时间",
width: 180,
prop: 'rukushijian',
align: 'center'
},
{
label: "资产原值",
width: 180,
prop: 'zichanyuanzhi',
align: 'center'
},
{
label: "使用年限",
width: 180,
prop: 'shiyongnianxian',
align: 'center'
},
{
label: "使用部门",
width: 180,
prop: 'shiyongbumen',
align: 'center'
},
{
label: "是否为固定资产",
width: 180,
prop: 'shifouweigudingzichan',
align: 'center'
},
{
label: "备注",
width: 240,
prop: 'beizhu',
align: 'left'
}
]
}
},
methods: {
async getindex() {
this.loading = true
const res = await index({
page_size: this.select.pageSize,
page: this.select.pageIndex,
table_name: this.customForm.tableName,
filter: [{
"key": "zichanmingcheng",
"op": "like",
"value": this.select.keyword
}],
})
this.list = res.data
this.total = res.total
this.loading = false
},
pageChange(e) {
this.select.pageIndex = e
this.getindex()
},
editorMater(id, type) {
this.$refs['addMater'].id = id
this.$refs['addMater'].type = type
this.$refs['addMater'].isShow = true
},
showMater(id) {
this.getDetail(id)
},
async getDetail(id) {
const res = await show({
id: id,
table_name: this.customForm.tableName
})
let _arr = []
if (res.item_details.length > 0) {
for (var k of res.item_details) {
if (k.stocks_id) {
_arr.push({
caozuo: '入库',
jingbanren: k.jingbanren,
date: k.rukushijian,
pici: k.rukupici,
shuliang: k.rukushuliang,
kucun: k.inventorys_zaikushuliang ? k.inventorys_zaikushuliang : 0,
})
} else if (k.outbounds_id) {
_arr.push({
caozuo: '出库',
jingbanren: k.jilurenyuan,
date: k.chukushijian,
pici: k.rukupici,
shuliang: k.jieyongshuliang,
kucun: k.inventorys_zaikushuliang ? k.inventorys_zaikushuliang : 0,
})
}
}
}
this.detailArr = _arr
this.detailObj = res
this.drawer = true
},
deleteMater(row) {
destroy({
id: row.id,
table_name: this.customForm.tableName
}).then(res => {
Message({
type: 'success',
message: '删除成功'
})
this.getindex()
})
},
async getField() {
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.importForm = res.data
?.filter((i) => i.list_show)
.map((i) => {
return i
})
},
},
mounted() {
this.getindex()
}
}
</script>
<style scoped>
/deep/ .draw{
padding-left:20px;
}
/deep/ .draw>div{
font-size: 20px;
margin:15px 0
}
/deep/ .el-timeline-item{
list-style: none;
}
</style>

@ -109,8 +109,10 @@
<xy-table style="width: 50%" :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">
<template v-slot:default="scope">
<Button size="small" type="primary" ghost @click="mingxiList.splice(scope.$index, 1)">删除</Button>
<template v-slot:default="scope">
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delMingxiList(scope.$index,scope.row)">
<Button size="small" type="primary" ghost>删除</Button>
</Poptip>
</template>
</el-table-column>
</template>
@ -118,10 +120,6 @@
</div>
</div>
</template>
</xy-dialog>
<!-- 新增明细 -->
<Modal v-model="isShowMingxi" width='600' title="新增明细" :loading='showLoading' @on-cancel='mingxiCancel'
@ -236,7 +234,8 @@
import {
save,
index,
show
show,
destroy
} from "@/api/system/baseForm.js"
import {
Message
@ -473,6 +472,27 @@
this.mingxiObj = this.mingxiList[index]
this.mingxiIndex = index + 1 // 0=false
this.isShowMingxi = true
},
//
delMingxiList(index,row){
if(row.id){
destroy({
id:row.id,
table_name:'outbounds_items'
}).then(res=>{
Message({
type: 'success',
message: '删除成功'
})
this.mingxiList.splice(index, 1)
})
}else{
Message({
type: 'success',
message: '删除成功'
})
this.mingxiList.splice(index, 1)
}
},
showWuzi() {
console.log("123")
@ -685,4 +705,4 @@
::v-deep .el-input-number .el-input__inner {
text-align: left !important;
}
</style>
</style>

@ -258,7 +258,8 @@
// return
destroy({
id: row.id,
table_name: 'outbounds'
table_name: 'outbounds',
destroy_relation:['id_outbounds_items_outbounds_id_relation'],
}).then(res => {
Message({
type: 'success',

@ -25,6 +25,17 @@
style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:yingjicaigou 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-input type="text" @focus="isShowYj=true" v-model="form.yingjicaigou" placeholder="请选择应急采购请示流程"
style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:gudingzichanbianhao>
<div class="xy-table-item">
@ -131,7 +142,7 @@
</div>
</div>
</template>
<template v-slot:zuozhengwenjian v-if="form.pandianleixing!='正常盘点'">
<template v-slot:zuozhengwenjian v-if="rukuTypeName=='盘点' && form.pandianleixing!='正常盘点'">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>佐证文件
@ -167,8 +178,10 @@
<xy-table style="width: 60%" :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">
<template v-slot:default="scope">
<Button size="small" type="primary" ghost @click="mingxiList.splice(scope.$index, 1)">删除</Button>
<template v-slot:default="scope">
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delMingxiList(scope.$index,scope.row)">
<Button size="small" type="primary" ghost>删除</Button>
</Poptip>
</template>
</el-table-column>
</template>
@ -190,7 +203,9 @@
</div>
<div class="xy-table-item-content" style="display: flex;align-items: center;">
<el-input v-if="form.rukuleixing!=''" type="text" @focus="showWuzi" v-model="mingxiObj.wuzibianma"
placeholder="请选择物资编码" style="width: 300px;"></el-input>
placeholder="请选择物资编码" style="width: 300px;"></el-input>
<Button @click='showMater' v-if="form.rukuleixing!=''" type="primary" icon="md-add"
style="margin-left: 10px">新增</Button>
<el-input v-if="form.rukuleixing==''" @change='getKucunShow' ref='huikubianma' type="text"
v-model="mingxiObj.wuzibianma" placeholder="请扫码获取回库物资编码" style="width: 300px;"></el-input>
<Button @click='showWuzi("回库")' v-if="form.rukuleixing==''" type="primary" icon="md-add"
@ -311,10 +326,23 @@
<Page :current="qsPageIndex" :total="qsTotal" simple
style="padding-top: 14px;display: flex;justify-content: center;" @on-change="qsPageChange" />
</Modal>
<!-- 选择应急采购请示流程 -->
<Modal v-model="isShowYj" title="应急采购请示选择" width='70%' @on-cancel='yjCancel' @on-ok='yjComfirm'>
<div class="searchCompanys">
<el-input type="text" @keyup.enter.native="getYj" v-model="yjkeyword" placeholder="请输入关键词查找"></el-input>
<el-button type="primary" @click="getYj"></el-button>
</div>
<Table highlight-row ref="currentRowTable" :columns="yjColumns" :data="yjList" @on-current-change="yjSelect" />
<Page :current="yjPageIndex" :total="qsTotal" simple
style="padding-top: 14px;display: flex;justify-content: center;" @on-change="yjPageChange" />
</Modal>
<detailContract ref='detailContract'></detailContract>
<imports :table-name="importstableName" :istrueimport='false' :form-info="importForm" ref="imports"
@importdata='getimportData'></imports>
@importdata='getimportData'></imports>
<addMater ref="addMater" @insert="insertMingxi"></addMater>
</div>
</template>
@ -323,7 +351,8 @@
import {
save,
index,
show
show,
destroy
} from "@/api/system/baseForm.js"
import {
index as getContract,
@ -338,10 +367,12 @@
import {
index as fieldIndex
} from "@/api/system/customFormField";
import {getToken} from "@/utils/auth";
import {getToken} from "@/utils/auth";
import addMater from "@/views/materialfile/component/addMater.vue"
export default {
components: {
detailContract,
detailContract,
addMater,
imports
},
data() {
@ -372,7 +403,8 @@
pandianList:[{label:'正常盘点',value:'正常盘点'},{label:'外部调拨',value:'外部调拨'},{label:'其他',value:'其他'}],
form: {
caigouhetong: '',
qingshiliucheng:"",
qingshiliucheng:"",
yingjicaigou:'',
gudingzichanbianhao: '',
rukushijian: '',
// caigouhetong:'',
@ -396,10 +428,10 @@
required: true,
message: '请选择入库时间'
}],
pandianleixing: [{
required: true,
message: '请选择盘点类型'
}],
// pandianleixing: [{
// required: true,
// message: ''
// }],
jingbanren: [{
required: true,
message: '请填写经办人'
@ -608,7 +640,58 @@
}
}, '查看详情')
}
}],
}],
//
isShowYj:false,
yjList: [],
yjkeyword: '',
yjPageIndex: 1,
yjTotal: 0,
editYj: '',
yjColumns: [{
width: 60,
_isChecked: false,
key: "isSelect",
resizable: true,
render: (h, params) => {
return h('div', [
h('Radio', {
props: {
value: params.row.isSelect
},
on: {
'on-change': (e) => {
this.yjList.forEach((items) => {
this.$set(items, 'isSelect', false)
});
this.yjList[params.index].isSelect = e;
}
}
})
])
}
}, {
title: '名称',
key: 'title',
}, {
title: '查看',
key: '',
width: 100,
render: (h, params) => {
return h('span', {
style: {
color: '#0077CC',
cursor: 'pointer'
},
on: {
'click': (e) => {
this.toYjFollow(params.row.belongs_id)
// @click=","
}
}
}, '查看详情')
}
}]
}
},
created() {
@ -708,13 +791,11 @@
//
async getQs() {
let res = await getQingShi({
// table:'qingshiruku',
table:'qingshi',
page:this.qsPageIndex,
status:1,
keyword:this.qskeyword
// page_size: 10,
// page: this.htPageIndex,
// keyword: this.htkeyword,
})
for (var m of res.data.flow.data) {
m.isSelect = false
@ -753,6 +834,56 @@
async toQsFollow(id){
// let res = await getOatoken()
let url =
`${process.env.VUE_APP_OA_URL}/admin/flow/view/${id}?wuziguanli_oatoken=${this.wuziguanli_oatoken}`
console.log("url",url)
let seeBuy = window.open(url, 'seeBuy','location=0')
},
//
async getYj() {
let res = await getQingShi({
table:'yingjicaigou',
page:this.yjPageIndex,
status:1,
keyword:this.yjkeyword
})
for (var m of res.data.flow.data) {
m.isSelect = false
}
this.yjList = res.data.flow.data
this.yjTotal = res.data.flow.total
// this.hetongoptions = res.data
},
yjCancel() {
this.yjList.forEach((items) => {
this.$set(items, 'isSelect', false)
});
this.form.yingjicaigou = this.editYj
},
yjSelect(e) {
this.yjList.forEach((items) => {
this.$set(items, 'isSelect', false)
if (items.id == e.id) {
this.$set(items, 'isSelect', true)
}
});
},
yjComfirm() {
this.yjList.forEach((items) => {
if (items.isSelect == true) {
this.form.yingjicaigou = items.title
this.editYj = items.title
}
});
},
yjPageChange(e) {
this.yjPageIndex = e
this.getYj()
},
async toYjFollow(id){
// let res = await getOatoken()
let url =
`${process.env.VUE_APP_OA_URL}/admin/flow/view/${id}?wuziguanli_oatoken=${this.wuziguanli_oatoken}`
console.log("url",url)
@ -812,6 +943,46 @@
this.mingxiObj = this.mingxiList[index]
this.mingxiIndex = index + 1 // 0=false
this.isShowMingxi = true
},
//
async delMingxiList(index,row){
let isDel = false
let isDels = false
let id = row.id
let stocks_items_id = row.stocks_items_id
if(row.id){
await destroy({
id:id,
table_name:'stocks_item_links'
}).then(res=>{
isDel = true
})
await destroy({
id:stocks_items_id,
table_name:'stocks_items'
}).then(res=>{
isDels = true
})
if(isDel && isDels){
Message({
type: 'success',
message: '删除成功'
})
this.mingxiList.splice(index, 1)
}else{
Message({
type: 'warning',
message: '删除失败'
})
}
}else{
Message({
type: 'success',
message: '删除成功'
})
this.mingxiList.splice(index, 1)
}
},
showWuzi(type) {
this.isShowWuzi = true
@ -823,6 +994,22 @@
} else {
this.getWuzi()
}
},
//
showMater(){
this.$refs['addMater'].isShow = true
this.$refs['addMater'].type = 'add'
this.$refs['addMater'].webType = 'insert'
},
insertMingxi(e){
console.log("e",e)
this.mingxiObj.wuzibianma = e.wuzibianma
this.mingxiObj.zichanmingcheng = e.zichanmingcheng
this.mingxiObj.wuzileixing = e.wuzileixing
this.mingxiObj.guigexinghao = e.guigexinghao
this.mingxiObj.jiliangdanwei = e.jiliangdanwei
this.mingxiObj.fenlei = e.fenlei
this.mingxiObj.rukupici = '第一批'
},
getList() {
if (this.form.rukuleixing == '回库') {
@ -995,10 +1182,15 @@
this.editQs = res?.qingshiliucheng
this.mingxiList = []
for(var r of res.id_stocks_item_links_stocks_id_relation){
this.mingxiList.push(JSON.parse(r.yuanshishuju))
let yuanshishuju = JSON.parse(r.yuanshishuju)
yuanshishuju['id'] = r.id
yuanshishuju['stocks_items_id'] = r.stocks_items_id
this.mingxiList.push(yuanshishuju)
}
console.log("this.mingxiList",this.mingxiList)
this.fileList = []
for(var f of res.zuozhengwenjian_upload_details){
let _lists = res.zuozhengwenjian_upload_details?res.zuozhengwenjian_upload_details:[]
for(var f of _lists){
this.fileList.push({
name: f?.original_name,
url: f?.url,
@ -1103,6 +1295,9 @@
}
if (this.rukuType == '请示') {
this.getQs()
}
if (this.rukuType == '应急采购') {
this.getYj()
}
if (this.type === 'editor') {
this.getDetail()

@ -24,8 +24,9 @@
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.jingbanren==authName||roleName=='系统管理员'">
<div v-if="scope.row.jingbanren==authName||roleName=='系统管理员'||isCkName=='仓库管理员'">
<Button type="primary" size="small" @click="editorRuku(scope.row.id,'editor')"></Button>
<!-- <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>
<Button type="primary" size="small" style="margin-left: 10px;" @click="editorActivity(scope.row.id,'copy')"></Button> -->
@ -74,6 +75,7 @@
return {
authName:'',
roleName:'',
isCkName:'',
loading:false,
select: {
pageSize: 10,
@ -87,7 +89,8 @@
check:'盘点',
data:"数据校对",
mock:'模拟盘点',
ask:'请示'
ask:'请示',
yingji:'应急采购'
},
customForm: {
customFormId: "",
@ -101,12 +104,6 @@
type: 'index',
fixed: 'left',
width:80
},
{
label: "固定资产编号",
width: 180,
prop: 'gudingzichanbianhao',
align: 'center'
},
{
label: "入库时间",
@ -140,6 +137,12 @@
width: 180,
prop: 'baoguanrenyuan',
align: 'center'
},
{
label: "固定资产编号",
width: 180,
prop: 'gudingzichanbianhao',
align: 'center'
},
{
label: "备注",
@ -157,6 +160,9 @@
if(k.name=='系统管理员'){
this.roleName = k.name
}
if(k.name=='仓库管理员'){
this.isCkName = '仓库管理员'
}
}
this.authName = res.name
}).catch(error => {})
@ -201,7 +207,8 @@
// return
destroy({
id: row.id,
table_name: this.customForm.tableName
table_name: this.customForm.tableName,
destroy_relation:['id_stocks_item_links_stocks_id_relation','id_stocks_items_stocks_id_relation'],
}).then(res => {
Message({
type: 'success',
@ -218,6 +225,21 @@
for(var k in this.rukuTypeList){
if(path==k){
this.rukuType = this.rukuTypeList[k]
if(this.rukuType=='采购'||this.rukuType=='请示'||this.rukuType=='应急采购'){
let rowname = ''
rowname = this.rukuType=='采购'? 'caigouhetong':(this.rukuType=='请示'?'qingshiliucheng':(this.rukuType=='应急采购'?'yingjicaigou':''))
this.table.unshift( {
label: "关联记录",
width: 240,
prop: 'caigouhetong',
align: 'left',
customFn: (row) => {
return ( <div>
{row[rowname]}
</div> )
}
})
}
}
}
}

Loading…
Cancel
Save