入库相关

master
lion 6 months ago
parent eab24ede08
commit 32db54532f

@ -20,8 +20,7 @@
"avue-plugin-map": "^1.0.1",
"axios": "0.18.1",
"core-js": "3.6.5",
"echarts": "^5.2.0",
"echarts-gl": "^2.0.8",
"echarts": "^4.2.1",
"element-ui": "2.15.13",
"file-saver": "^2.0.5",
"js-cookie": "2.2.0",

@ -35,6 +35,15 @@ export function getparameteritem(number) {
})
}
export function getparameteritemMore(params) {
return request({
url: '/api/admin/parameter/show',
method: 'get',
params:params,
})
}
export function listparameter(param) {
return request({
url: '/api/admin/parameter/index',

@ -6,6 +6,10 @@ export default {
default:"normal"
//"normal" "form"
},
zIndex:{
type:Number,
default:1000
},
width:{
type:Number,
default:55
@ -88,7 +92,7 @@ export default {
footer slot:
footerContent
*/
const {cancelClick,okText,okClick,footerRender,width,type,$scopedSlots,rules,form,showChange,isShow,title} = this
const {zIndex,cancelClick,okText,okClick,footerRender,width,type,$scopedSlots,rules,form,showChange,isShow,title} = this
return (
<Modal
ok-text={okText}
@ -96,6 +100,7 @@ export default {
width={width}
title={title}
value={isShow}
z-index={zIndex}
on={{['on-visible-change']:showChange,['on-ok']:okClick}}
scopedSlots={{
default(){

@ -180,3 +180,44 @@ export function moneyRecovery(money){
return parseFloat(money.replace(/[^\d\.-]/g, ""));
}
export function requestToForm(requestObj, form) {
// 获取a对象中属性的顺序和值
let aKeys = Object.keys(form);
let aValues = aKeys.map(key => form[key]);
// 遍历b对象将属性等于a中属性值的对象深拷贝给a中的相应属性
for (let i = 0; i < aKeys.length; i++) {
let key = aKeys[i];
let value = aValues[i];
if (requestObj[key] === value) {
// 深拷贝对象
Object.assign(form, {
[key]: deepCopy(requestObj[key])
});
}
}
// 遍历b对象将b中独有的属性按照a的顺序插入到a中
for (let key in requestObj) {
if (!form[key]) {
// 深拷贝属性值
Object.assign(form, {
[key]: deepCopy(requestObj[key])
});
}
}
return form
}
export function buildTree(data, pid = 0) {
const tree = [];
for (const item of data) {
if (item.pid === pid) {
const children = buildTree(data, item.id);
if (children.length > 0) {
item.children = children;
}
tree.push(item);
}
}
return tree;
}

@ -43,7 +43,7 @@
<p>所在区域<span>{{item.suozaiquyu?item.suozaiquyu:''}}</span></p>
</div>
<div>
<p>建设年代<span>{{item.jiansheniandai?item.jiansheniandai:''}}</span></p>
<p>建设时间<span>{{item.jiansheniandai?item.jiansheniandai:''}}</span></p>
<p>仓库面积<span>{{item.cangkumianji?item.cangkumianji:''}}</span></p>
</div>
<div>
@ -127,7 +127,7 @@
align: 'center'
},
{
label: "规格型号",
label: "物资型号",
width: 180,
prop: 'guigexinghao',
align: 'left'

@ -0,0 +1,404 @@
<template>
<div>
<el-dialog :visible.sync="isShowMingxi" :modal="false" width='80%' title="新增明细">
<el-form :model="formData" :rules="rules" ref="form" label-width="100px">
<el-form-item label="物资编码" prop="wuzibianma">
<!-- 不是回库的 选择物资档案信息 -->
<template v-if="rukuleixing!='回库'">
<el-input v-model="formData.wuzibianma" @focus="showMaterial">
<el-button slot="append" @click="addMaterial"></el-button>
</el-input>
</template>
<!-- 回库选择 库存表数据 -->
<!-- <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" 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>
<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"
style="margin-left: 10px">选择</Button>
</div>
</div> -->
</el-form-item>
<el-form-item label="物资名称" prop="zichanmingcheng">
<el-input v-model="formData.zichanmingcheng" disabled></el-input>
</el-form-item>
<el-form-item label="物资类型" prop="wuzileixing">
<el-input v-model="formData.wuzileixing" disabled></el-input>
</el-form-item>
<el-form-item label="物资型号" prop="guigexinghao">
<el-input v-model="formData.guigexinghao" disabled></el-input>
</el-form-item>
<el-form-item label="物资规格" prop="wuziguige">
<el-input v-model="formData.wuziguige" disabled></el-input>
</el-form-item>
<el-form-item label="所属种类" prop="fenlei">
<el-input v-model="formData.fenleiName" disabled></el-input>
</el-form-item>
<el-form-item label="单位" prop="jiliangdanwei">
<el-input v-model="formData.jiliangdanwei" disabled></el-input>
</el-form-item>
<el-form-item label="在库数量" prop="zaikushuliang">
<el-input v-model="formData.zaikushuliang" disabled></el-input>
</el-form-item>
<el-form-item label="入库批次" prop="rukupici" v-if="formData.wuzileixing=='一类一码' && rukuleixing!='回库'">
<el-select style="width:100%" v-model="formData.rukupici"
filterable clearable allow-create default-first-option placeholder="请选择或新增入库批次">
<el-option v-for="item in rukupiciList" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="入库数量" prop="rukushuliang">
<el-input-number style="width:100%" v-model="formData.rukushuliang" :min="1"></el-input-number>
</el-form-item>
<el-form-item label="物资状态" prop="wuzizhuangtai">
<el-select style="width:100%" v-model="formData.wuzizhuangtai" placeholder="请选择物资状态">
<el-option v-for="item in paraOptions.materials_status" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="储备方式" prop="chubeifangshi">
<el-select style="width:100%" v-model="formData.chubeifangshi" placeholder="请选择储备方式">
<el-option v-for="item in paraOptions.material_reserve" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="生产日期" prop="shengchanriqi">
<el-date-picker style="width:100%" v-model="formData.shengchanriqi" value-format="yyyy-MM-dd" type="date" placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="入库日期" prop="rukuriqi">
<el-date-picker style="width:100%" v-model="formData.rukuriqi" value-format="yyyy-MM-dd" type="date" placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="所在仓库" prop="suozaicangku">
<el-select style="width:100%" v-model="formData.suozaicangku" placeholder="请选择所在仓库" @change="handleCkChange">
<el-option v-for="item in cangkuList" :key="item.id" :label="item.cangkumingcheng" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所在货架" prop="suozaihuojia">
<el-select style="width:100%" v-model="formData.suozaihuojia" placeholder="请选择所在货架">
<el-option v-for="item in huojiaList" :key="item.id" :label="item.huojiamingcheng" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="等级分类" prop="dengjifenlei">
<el-select style="width:100%" v-model="formData.dengjifenlei" placeholder="请选择等级分类">
<el-option v-for="item in paraOptions.materials_level" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="产权信息" prop="chanquanxinxi">
<el-select style="width:100%" v-model="formData.chanquanxinxi" placeholder="请选择产权信息">
<el-option v-for="item in paraOptions.materials_property" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="存放要求" prop="cunfangyaoqiu">
<el-input v-model="formData.cunfangyaoqiu"></el-input>
</el-form-item>
<el-form-item label="翻挆要求" prop="fanduoyaoqiu">
<el-input v-model="formData.fanduoyaoqiu"></el-input>
</el-form-item>
<el-form-item label="试车要求" prop="shicheyaoqiu">
<el-input v-model="formData.shicheyaoqiu"></el-input>
</el-form-item>
<el-form-item label="保养频次" prop="baoyangpinci">
<el-input v-model="formData.baoyangpinci"></el-input>
</el-form-item>
</el-form>
<div slot="footer" align="right">
<Button class="btn" size="default" type="default" @click="mingxiCancel"></Button>
<Button class="btn" size="default" type="primary" @click="mingxiConfirm"></Button>
</div>
</el-dialog>
<!-- 新增物资档案 -->
<addMater ref="addMater" @insert="insertMingxi"></addMater>
<!-- 选择物资档案 -->
<materialsSelect ref="materialsSelect" @refresh="selectMingxi"></materialsSelect>
</div>
</template>
<script>
import {
index,
} from "@/api/system/baseForm.js"
import {
getparameteritemMore
} from "@/api/system/dictionary.js"
import addMater from "@/views/materialfile/component/addMater.vue"
import materialsSelect from "@/views/component/materialsSelect.vue"
export default {
name: 'StockItemModal',
components:{
addMater,
materialsSelect
},
props: {
},
data() {
return {
isShowMingxi: false,
//
paraOptions:{
'materials_status':[],
'material_reserve':[],
'materials_property':[],
'materials_level':[],
// 'materials_fenlei':[],
},
cangkuList:[],
huojiaList:[],
rukuleixing:'',
formData: {
wuzibianma: '',
zichanmingcheng: '',
wuzileixing: '',
guigexinghao: '',
wuziguige:'',
fenlei: '',
jiliangdanwei: '',
zaikushuliang: '',
rukupici: '',
rukushuliang: '',
wuzizhuangtai:'',
chubeifangshi:'',
shengchanriqi: '',
rukuriqi:'',
suozaicangku:'',
suozaihuojia:'',
dengjifenlei:'',
chanquanxinxi:'',
cunfangyaoqiu:'',
fanduoyaoqiu:'',
shicheyaoqiu:'',
baoyangpinci:''
},
rukupiciList: [],
rules: {
wuzibianma: [{
required: true,
message: '请选择物资编码',
trigger: 'blur'
}],
rukushuliang: [{
required: true,
message: '请填写入库数量',
trigger: 'blur'
}],
rukupici: [{
required: true,
message: '请选择入库批次',
trigger: 'change'
}],
shengchanriqi: [{
required: true,
message: '请选择生产日期',
trigger: 'change'
}]
}
}
},
watch: {
// visible(val) {
// this.isShowMingxi = val
// if (val && this.editData.id) {
// this.formData = {
// ...this.editData
// }
// }
// },
// isShowMingxi(val) {
// if (!val) {
// this.$emit('update:visible', false)
// }
// }
},
created() {
this.getData()
this.getCangku()
},
methods: {
//
async getData(){
const res = await getparameteritemMore({
'number[0]':'materials_status', //
'number[1]':'material_reserve', //
'number[2]':'materials_property', //
'number[3]':'materials_level', //
// 'number[4]':'materials_fenlei', //
})
for(var k in this.paraOptions){
res.map(item=>{
if(item.number===k){
this.paraOptions[k] = item.detail
}
})
}
console.log(this.paraOptions)
},
//
async getPici() {
let res = await index({
page_size: 999,
page: 1,
table_name: 'inventorys',
filter: [{
"key": "wuzibianma",
"op": "eq",
"value": this.formData.wuzibianma
}]
})
this.rukupiciList = []
for (var m of res.data) {
this.rukupiciList.push({
value: m.rukupici,
label: m.rukupici
})
}
},
//
addMaterial() {
this.$refs['addMater'].zIndex = 2000
this.$refs['addMater'].isShow = true
this.$refs['addMater'].type = 'add'
this.$refs['addMater'].webType = 'insert'
},
//
insertMingxi(e){
console.log("e",e)
this.formData.wuzibianma = e.wuzibianma
this.formData.zichanmingcheng = e.zichanmingcheng
this.formData.wuzileixing = e.wuzileixing
this.formData.guigexinghao = e.guigexinghao
this.formData.wuziguige = e.wuziguige
this.formData.jiliangdanwei = e.jiliangdanwei
this.formData.fenlei = e.fenlei
this.formData.fenleiName = e.fenleiName
this.formData.zaikushuliang= 0
this.formData.rukupici = '第一批'
},
//
showMaterial(){
this.$refs.materialsSelect.isShowWuzi = true
},
selectMingxi(e){
this.formData.wuzibianma = e.wuzibianma
this.formData.zichanmingcheng = e.zichanmingcheng
this.formData.wuzileixing = e.wuzileixing
this.formData.guigexinghao = e.guigexinghao
this.formData.zaikushuliang= e.inventorys_total?e.inventorys_total:0
this.formData.wuziguige = e.wuziguige
this.formData.jiliangdanwei = e.jiliangdanwei
this.formData.fenlei = e.fenlei
this.formData.fenleiName = e.fenlei_parameter_details_id_relation?e.fenlei_parameter_details_id_relation.value:''
if (this.formData.wuzileixing == '一类一码') {
this.getPici()
}
},
//
handleCkChange(e){
this.getHuojia(e)
},
async getCangku() {
let res = await index({
page_size: 999,
page: 1,
table_name: 'materialstorages',
sort_name:'sort',
sort_type:'ASC',
})
this.cangkuList = res.data
},
async getHuojia(id) {
let res = await index({
page_size: 999,
page: 1,
table_name: 'shelfs',
filter: [{
key:'storage_id',
op:'eq',
value:id
}],
})
this.huojiaList = res.data
},
mingxiCancel() {
this.isShowMingxi = false
this.resetForm()
},
mingxiConfirm() {
this.$refs.form.validate(valid => {
console.log("valid", valid)
if (valid) {
this.$emit('refresh', this.formData)
this.isShowMingxi = false
this.resetForm()
} else {
this.isShowMingxi = true
return
}
})
},
resetForm(){
this.formData = {
wuzibianma: '',
zichanmingcheng: '',
wuzileixing: '',
guigexinghao: '',
wuziguige:'',
fenlei: '',
jiliangdanwei: '',
zaikushuliang: '',
rukupici: '',
rukushuliang: '',
wuzizhuangtai:'',
chubeifangshi:'',
shengchanriqi: '',
rukuriqi:'',
suozaicangku:'',
suozaihuojia:'',
dengjifenlei:'',
chanquanxinxi:'',
cunfangyaoqiu:'',
fanduoyaoqiu:'',
shicheyaoqiu:'',
baoyangpinci:''
}
},
}
}
</script>
<style scoped lang="scss">
.dialog-footer {
text-align: right;
}
.el-form {
display: flex;
align-items: center;
flex-wrap: wrap;
.el-form-item {
flex-basis: 50%;
}
}
</style>

@ -1,6 +1,6 @@
<template>
<div>
<el-dialog :visible.sync="dialogVisible" title="数据导入" width="740px">
<el-dialog style="z-index:10001" :visible.sync="dialogVisible" title="数据导入" width="740px">
<div class="title">模板下载</div>
<el-button
style="margin-top: 10px"

@ -0,0 +1,165 @@
<template>
<div>
<!-- 选择物资编号 -->
<Modal v-model="isShowWuzi" :z-index="10000" width="70" title="物资选择" :loading='showLoading'>
<div class="searchCompanys">
<el-input style="margin-right:10px" clearable type="text" @keyup.enter.native="getWuzi"
v-model="wuzibianmakeyword" placeholder="请输入物资编码查找库存"></el-input>
<el-input style="margin-right:10px" clearable type="text" @keyup.enter.native="getWuzi"
v-model="wuzimingchengkeyword" placeholder="请输入物资名称查找"></el-input>
<el-button type="primary" @click="getWuzi"></el-button>
</div>
<Table highlight-row ref="currentRowTable" :columns="wuziColumns" :data="wzList"
@on-current-change="wuziSelect" />
<Page :current="wuziPageIndex" :total="wuziTotal" simple
style="padding-top: 14px;display: flex;justify-content: center;" @on-change="wuziPageChange" />
<div slot="footer" align="right">
<Button class="btn" size="default" type="default" @click="mingxiCancel"></Button>
<Button class="btn" size="default" type="primary" @click="mingxiConfirm"></Button>
</div>
</Modal>
</div>
</template>
<script>
import {
index,
} from "@/api/system/baseForm.js"
export default {
data() {
return {
//
showLoading:false,
isShowWuzi: false,
wuziPageIndex: 1,
wuzibianmakeyword: '',
wuzimingchengkeyword: '',
wuziTotal: 0,
wzList: [],
selectItem:{},
wuziColumns: [{
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.wzList.forEach((items) => {
this.$set(items, 'isSelect', false)
});
this.wzList[params.index].isSelect = e;
}
}
})
])
}
}, {
title: '物资编码',
key: 'wuzibianma',
}, {
title: '物资名称',
key: 'zichanmingcheng',
}, {
title: '物资类型',
key: 'wuzileixing',
}, {
title: '所属种类',
key: 'fenlei_parameter_details_id_relation.value',
render: (h, params) => {
return h('div', [
h('strong', params.row.fenlei_parameter_details_id_relation?params.row.fenlei_parameter_details_id_relation.value:'')
]);
}
}, {
title: '物资型号',
key: 'guigexinghao',
}, {
title: '物资规格',
key: 'wuziguige',
}, {
title: '单位',
key: 'jiliangdanwei',
}],
}
},
watch: {
isShowWuzi(newVal) {
if (newVal) {
this.getWuzi()
}
}
},
methods: {
async getWuzi() {
this.showLoading = true
const res = await index({
page_size: 10,
page: this.wuziPageIndex,
table_name: 'material_infos',
filter: [{
"key": "zichanmingcheng",
"op": "like",
"value": this.wuzimingchengkeyword
}, {
"key": "wuzibianma",
"op": "like",
"value": this.wuzibianmakeyword
}]
})
for (var m of res.data) {
m.isSelect = false
}
this.wzList = res.data
this.wuziTotal = res.total
this.showLoading = false
console.log("res", this.wzList)
},
wuziSelect(e) {
console.log(e)
this.wzList.forEach((items) => {
this.$set(items, 'isSelect', false)
if (items.id == e.id) {
this.$set(items, 'isSelect', true)
}
});
this.selectItem = e
},
wuziPageChange(e) {
console.log("e", e)
this.wuziPageIndex = e
this.selectItem = {}
this.getWuzi()
},
mingxiConfirm(){
if(Object.keys(this.selectItem).length === 0){
this.isShowWuzi = false
return
}
this.$emit("refresh",this.selectItem)
this.isShowWuzi = false
},
mingxiCancel(){
this.selectItem = {}
this.wuziPageIndex = 1
this.isShowWuzi = false
}
}
}
</script>
<style scoped>
.searchCompanys {
display: flex;
justify-content: space-between;
margin-bottom: 15px;
}
</style>

@ -29,7 +29,7 @@
<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>规格型号
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>物资型号
</div>
<div class="xy-table-item-content">
<div style='width:300px'>

@ -166,7 +166,7 @@
}
},
{
label: "规格型号",
label: "物资型号",
prop: 'guigexinghao',
align: 'center',
width: 180,

@ -139,7 +139,7 @@
},
{
label: "规格型号",
label: "物资型号",
prop: 'guigexinghao',
align: 'center',
width: 180,

@ -152,7 +152,7 @@
}
},
{
label: "规格型号",
label: "物资型号",
prop: 'guigexinghao',
align: 'center',
width: 180,

@ -178,9 +178,9 @@
<Button type="primary" style="margin-left: 10px" @click="searchMaterials"></Button>
<Button style="margin-left: 10px" @click="resetMaterialSearch"></Button>
</div>
<el-table
<el-table
ref="materialTable"
:data="materialList"
:data="materialList"
v-loading="materialModal.loading"
@select="handleSelect"
@select-all="handleSelectAll"
@ -196,7 +196,7 @@
</el-table-column>
<el-table-column
prop="guigexinghao"
label="规格型号">
label="物资型号">
</el-table-column>
<el-table-column
prop="jiliangdanwei"
@ -214,8 +214,8 @@
width="100">
<template slot-scope="scope">
<div style="display: flex; gap: 8px; justify-content: center;">
<el-button
:type="isSelected(scope.row) ? 'warning' : 'success'"
<el-button
:type="isSelected(scope.row) ? 'warning' : 'success'"
size="small"
style="border-radius: 6px;"
@click="toggleMaterialSelection(scope.row, scope.$index)"
@ -298,7 +298,7 @@
<span class="value">{{ detailModal.data.material_info && detailModal.data.material_info.wuzibianma || '-' }}</span>
</div>
<div class="info-item">
<span class="label">规格型号</span>
<span class="label">物资型号</span>
<span class="value">{{ detailModal.data.material_info && detailModal.data.material_info.guigexinghao || '-' }}</span>
</div>
<div class="info-item">
@ -314,9 +314,9 @@
<div class="history-section">
<h3>盘点历史记录</h3>
<Table
:columns="detailColumns"
:data="detailModal.data.history || []"
<Table
:columns="detailColumns"
:data="detailModal.data.history || []"
:loading="detailModal.loading"
border
>
@ -399,9 +399,9 @@
<div class="inventory-list-section">
<h3>盘点物资列表</h3>
<Table
:columns="planDetailColumns"
:data="planDetailModal.inventoryList"
<Table
:columns="planDetailColumns"
:data="planDetailModal.inventoryList"
:loading="planDetailModal.loading"
border
>
@ -466,8 +466,8 @@ export default {
{ title: '计划名称', key: 'name' },
{ title: '开始日期', key: 'start_date' },
{ title: '结束日期', key: 'end_date' },
{
title: '状态',
{
title: '状态',
slot: 'status',
key: 'status'
},
@ -495,33 +495,33 @@ export default {
listLoading: false,
listColumns: [
{ title: '盘点单号', key: 'no' },
{
title: '所属计划',
{
title: '所属计划',
slot: 'planName',
key: 'material_infos_plan.name'
},
{
title: '盘点区域',
{
title: '盘点区域',
slot: 'area',
key: 'material_info.suozaicangku'
},
{
title: '执行人',
{
title: '执行人',
slot: 'executor',
key: 'responsible_admin.name'
},
{
title: '开始时间',
{
title: '开始时间',
slot: 'startTime',
key: 'material_infos_plan.start_date'
},
{
title: '完成时间',
{
title: '完成时间',
slot: 'endTime',
key: 'material_infos_plan.end_date'
},
{
title: '状态',
{
title: '状态',
slot: 'status',
key: 'status'
},
@ -544,11 +544,11 @@ export default {
rules: {
name: [{ required: true, message: '请输入计划名称', trigger: 'blur' }],
dateRange: [
{
required: true,
type: 'array',
min: 2,
message: '请选择计划日期',
{
required: true,
type: 'array',
min: 2,
message: '请选择计划日期',
trigger: 'change',
validator: (rule, value, callback) => {
if (!value || value.length !== 2) {
@ -580,10 +580,10 @@ export default {
materialColumns: [
{ type: 'selection', width: 60 },
{ title: '物资名称', key: 'zichanmingcheng' },
{ title: '规格型号', key: 'guigexinghao' },
{ title: '物资型号', key: 'guigexinghao' },
{ title: '单位', key: 'jiliangdanwei' },
{
title: '当前库存',
{
title: '当前库存',
key: 'inventorys_total',
render: (h, params) => {
return h('span', params.row.inventorys_total === null ? '0' : params.row.inventorys_total)
@ -612,20 +612,20 @@ export default {
total: 0
},
detailColumns: [
{
title: '盘点日期',
{
title: '盘点日期',
key: 'check_date',
width: 180,
align: 'center'
},
{
title: '盘点数量',
{
title: '盘点数量',
key: 'check_num',
width: 100,
align: 'center'
},
{
title: '状态',
{
title: '状态',
slot: 'status',
key: 'status',
width: 100,
@ -656,33 +656,33 @@ export default {
inventoryList: []
},
planDetailColumns: [
{
title: '物资名称',
{
title: '物资名称',
key: 'name',
minWidth: 150
},
{
title: '规格型号',
{
title: '物资型号',
key: 'spec',
width: 120
},
{
title: '单位',
{
title: '单位',
key: 'unit',
width: 80
},
{
title: '盘点数量',
{
title: '盘点数量',
key: 'checkQuantity',
width: 100
},
{
title: '盘点日期',
{
title: '盘点日期',
key: 'checkDate',
width: 150
},
{
title: '状态',
{
title: '状态',
slot: 'status',
width: 100
},
@ -743,12 +743,12 @@ export default {
const formData = new FormData();
formData.append('page', this.planSearch.pageIndex);
formData.append('page_size', this.planSearch.pageSize);
//
if (this.planSearch.keyword) {
formData.append('keyword', this.planSearch.keyword);
}
//
if (this.planSearch.status) {
const filterIndex = this.planSearch.keyword ? 1 : 0;
@ -756,11 +756,11 @@ export default {
formData.append(`filter[${filterIndex}][op]`, 'eq');
formData.append(`filter[${filterIndex}][value]`, this.planSearch.status);
}
//
if (this.planSearch.dateRange &&
this.planSearch.dateRange.length === 2 &&
this.planSearch.dateRange[0] &&
if (this.planSearch.dateRange &&
this.planSearch.dateRange.length === 2 &&
this.planSearch.dateRange[0] &&
this.planSearch.dateRange[1]) {
const formatDate = (date) => {
const d = new Date(date);
@ -914,12 +914,12 @@ export default {
const formData = new FormData();
formData.append('page', this.listSearch.pageIndex);
formData.append('page_size', this.listSearch.pageSize);
//
if (this.listSearch.keyword) {
formData.append('keyword', this.listSearch.keyword);
}
//
if (this.listSearch.planId) {
const filterIndex = this.listSearch.keyword ? 1 : 0;
@ -927,7 +927,7 @@ export default {
formData.append(`filter[${filterIndex}][op]`, 'eq');
formData.append(`filter[${filterIndex}][value]`, this.listSearch.planId);
}
//
if (this.listSearch.status) {
const filterIndex = (this.listSearch.keyword ? 1 : 0) + (this.listSearch.planId ? 1 : 0);
@ -1034,7 +1034,7 @@ export default {
},
handleSelect(selection, item) {
console.log('handleSelect called', selection, item);
//
const planId = this.materialModal.currentPlanId;
if (planId) {
@ -1043,7 +1043,7 @@ export default {
} else {
this.materialModal.selectedMaterialIds.delete(item.id);
}
//
this.$nextTick(() => {
if (this.$refs.materialTable) {
@ -1056,7 +1056,7 @@ export default {
},
handleSelectAll(selection) {
console.log('handleSelectAll called', selection);
const planId = this.materialModal.currentPlanId;
if (planId) {
//
@ -1071,7 +1071,7 @@ export default {
this.materialModal.selectedMaterialIds.delete(item.id);
});
}
//
this.$nextTick(() => {
if (this.$refs.materialTable) {
@ -1085,7 +1085,7 @@ export default {
},
toggleMaterialSelection(item, index) {
console.log('toggleMaterialSelection called', item, index);
//
if (!this.isSelected(item)) {
console.log('Adding to plan');
@ -1094,7 +1094,7 @@ export default {
console.log('Removing from plan');
this.materialModal.selectedMaterialIds.delete(item.id);
}
//
this.$nextTick(() => {
if (this.$refs.materialTable) {
@ -1132,7 +1132,7 @@ export default {
if (res && res.data) {
this.materialList = res.data;
this.materialModal.total = res.total || 0;
//
const planId = this.materialModal.currentPlanId;
if (planId) {
@ -1141,7 +1141,7 @@ export default {
this.materialList.forEach(item => {
if (item.material_infos_plan_link && item.material_infos_plan_link.length > 0) {
//
const hasMatchingPlan = item.material_infos_plan_link.some(link =>
const hasMatchingPlan = item.material_infos_plan_link.some(link =>
link.material_infos_plan_id === planId
);
if (hasMatchingPlan) {
@ -1165,18 +1165,18 @@ export default {
this.$Message.warning('请至少选择一项物资')
return
}
const planId = this.materialModal.currentPlanId
if (!this.planMaterials[planId]) {
this.planMaterials[planId] = []
}
selection.forEach(material => {
if (!this.planMaterials[planId].includes(material.id)) {
this.planMaterials[planId].push(material.id)
}
})
this.$Message.success(`已批量加入 ${selection.length} 项物资`)
this.searchMaterials()
},
@ -1186,14 +1186,14 @@ export default {
this.$Message.warning('请至少选择一项物资')
return
}
const planId = this.materialModal.currentPlanId
if (this.planMaterials[planId]) {
this.planMaterials[planId] = this.planMaterials[planId].filter(
id => !selection.some(m => m.id === id)
)
}
this.$Message.success(`已批量移出 ${selection.length} 项物资`)
this.searchMaterials()
},
@ -1287,7 +1287,7 @@ export default {
// ID
const selectedMaterialIds = Array.from(this.materialModal.selectedMaterialIds);
// formdata
const formData = new FormData();
formData.append('id', planId);
@ -1508,18 +1508,18 @@ export default {
width: 900px;
max-width: 90vw;
}
.ivu-modal-header {
padding: 16px 24px;
border-bottom: 1px solid #e8eaec;
.ivu-modal-header-inner {
font-size: 16px;
font-weight: 500;
color: #17233d;
}
}
.ivu-modal-body {
padding: 24px;
}
@ -1529,7 +1529,7 @@ export default {
.ivu-table-cell {
padding: 8px 16px;
}
.ivu-table-header {
th {
background: #f8f8f9;
@ -1537,7 +1537,7 @@ export default {
color: #17233d;
}
}
.ivu-table-tbody {
tr {
&:hover {
@ -1551,35 +1551,35 @@ export default {
.detail-content {
padding: 20px;
.detail-header {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
margin-bottom: 30px;
.detail-item {
.label {
font-weight: bold;
color: #666;
margin-right: 10px;
}
.value {
color: #333;
}
}
}
.material-info-section {
margin-bottom: 30px;
h3 {
margin: 0 0 15px 0;
font-size: 16px;
color: #17233d;
}
.material-info-content {
background: #f8f8f9;
padding: 20px;
@ -1587,21 +1587,21 @@ export default {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
.info-item {
.label {
font-weight: bold;
color: #666;
margin-right: 10px;
}
.value {
color: #333;
}
}
}
}
.history-section {
h3 {
margin: 0 0 15px 0;
@ -1615,21 +1615,21 @@ export default {
display: flex;
gap: 8px;
align-items: center;
.photo-item {
width: 40px;
height: 40px;
border-radius: 4px;
overflow: hidden;
cursor: pointer;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
.photo-more {
color: #666;
font-size: 12px;
@ -1656,29 +1656,29 @@ export default {
.plan-detail-content {
padding: 20px;
.detail-header {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
margin-bottom: 30px;
.detail-item {
.label {
font-weight: bold;
color: #666;
margin-right: 10px;
}
.value {
color: #333;
}
}
}
.inventory-list-section {
margin-bottom: 30px;
h3 {
margin: 0 0 15px 0;
font-size: 16px;
@ -1686,4 +1686,4 @@ export default {
}
}
}
</style>
</style>

@ -1,5 +1,5 @@
<template>
<div ref="chart" style="width:350px" class="bar3d-chart"></div>
<div ref="chart1" style="width:350px" class="bar3d-chart"></div>
</template>
<script>
@ -8,7 +8,7 @@
export default {
name: 'Bar3DChart',
mounted() {
this.chart = echarts.init(this.$refs.chart)
this.chart = echarts.init(this.$refs.chart1)
this.chart.setOption({
backgroundColor: 'transparent',
title: {

@ -65,7 +65,7 @@
prop: 'suozaiquyu',
width: 120,
}, {
label: '建设年代',
label: '建设时间',
prop: 'jiansheniandai',
width: 120,
}, {

@ -1,5 +1,5 @@
<template>
<div ref="chart" style="width:350px" class="bar3d-chart"></div>
<div ref="chart2" style="width:350px" class="bar3d-chart"></div>
</template>
<script>
@ -8,7 +8,7 @@
export default {
name: 'Pie3DChart',
mounted() {
this.chart = echarts.init(this.$refs.chart)
this.chart = echarts.init(this.$refs.chart2)
this.chart.setOption({
color:['#6340f3','#c740f1','#6dcde6'],
title: {

@ -127,10 +127,10 @@
<Table :columns="associateColumns" :data="associateList" :height="400" style="margin-top: 15px;">
<template slot-scope="{ row }" slot="action">
<div style="display: flex; gap: 8px; justify-content: center;">
<Button
<Button
v-if="row.equipment_maintain_config && row.equipment_maintain_config.id === currentRule.id"
type="error"
size="small"
type="error"
size="small"
ghost
style="border-radius: 6px;"
@click="toggleAssociation(row)"
@ -138,10 +138,10 @@
>
解除绑定
</Button>
<Button
<Button
v-else-if="row.equipment_maintain_config"
type="warning"
size="small"
type="warning"
size="small"
ghost
style="border-radius: 6px;"
@click="toggleAssociation(row)"
@ -149,10 +149,10 @@
>
重新绑定
</Button>
<Button
<Button
v-else
type="primary"
size="small"
type="primary"
size="small"
ghost
style="border-radius: 6px;"
@click="toggleAssociation(row)"
@ -284,7 +284,7 @@ export default {
minWidth: 120
},
{
title: '规格型号',
title: '物资型号',
key: 'guigexinghao',
minWidth: 120
},
@ -489,7 +489,7 @@ export default {
page: this.associateCurrentPage,
'show_relation[0]': 'equipmentMaintainConfig',
'show_relation[1]': 'materialInfo.materialstorage',
'materialstorages_cangkumingcheng': this.associateWarehouseName ? this.associateWarehouseName : '',
'materialstorages_suozaiquyu': this.select.area ? this.select.area : '',
'storehouses_id': this.select.storehouses_id ? this.select.storehouses_id : '',
@ -597,7 +597,7 @@ export default {
this.$message.error('获取仓库类型列表失败');
}
},
async getWarehouseAreas() {
try {
const res = await getparameteritem("area");
@ -609,7 +609,7 @@ export default {
this.$message.error('获取仓库区域列表失败');
}
},
async getWarehouseNames() {
try {
const res = await index({
@ -641,12 +641,12 @@ export default {
this.$message.error('获取仓库名称列表失败');
}
},
clearArea(e) {
this.select.area = e || '';
this.getWarehouseNames();
},
clearType(e) {
this.select.storehouses_id = e || '';
this.getWarehouseNames();
@ -657,7 +657,7 @@ export default {
formData.append('page', 1);
formData.append('page_size', 999);
formData.append('table_name', 'materialstorages');
const res = await index(formData);
if (res && res.data) {
this.allWarehouses = res.data;
@ -668,36 +668,36 @@ export default {
this.$message.error('获取仓库列表失败');
}
},
filterWarehouses() {
let filtered = [...this.allWarehouses];
//
if (this.select.storehouses_id) {
filtered = filtered.filter(warehouse =>
filtered = filtered.filter(warehouse =>
warehouse.storehouses_id === this.select.storehouses_id
);
}
//
if (this.select.area) {
filtered = filtered.filter(warehouse =>
filtered = filtered.filter(warehouse =>
warehouse.quyu_id === this.select.area
);
}
//
this.warehouseNames = filtered.map(warehouse => ({
value: warehouse.id,
label: warehouse.cangkumingcheng
}));
},
clearArea(e) {
this.select.area = e || '';
this.filterWarehouses();
},
clearType(e) {
this.select.storehouses_id = e || '';
this.filterWarehouses();

@ -1,6 +1,6 @@
<template>
<div>
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" :title="titleName" :form="form"
<xy-dialog ref="dialog" :zIndex="zIndex" :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">
@ -15,10 +15,10 @@
<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>名称
<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>
<el-input v-model="form.zichanmingcheng" placeholder="请填写资名称" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
@ -28,7 +28,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>物资类型
</div>
<div class="xy-table-item-content">
<el-select :disabled="type==='editor'?true:false" v-model="form.wuzileixing" style="width: 300px;" placeholder="请选择物资类型">
<el-select popper-class="select_popper" :disabled="type==='editor'?true:false" v-model="form.wuzileixing" style="width: 300px;"
placeholder="请选择物资类型">
<el-option
v-for="item in lexingList"
:key="item.value"
@ -39,26 +40,44 @@
</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-cascader
popper-class="select_popper"
style="width: 300px;"
v-model="form.fenlei"
:options="fenleiList"
@change="(e)=>{changePtree(e)}"
:props="{label:'value',value:'id'}"></el-cascader>
<!-- <el-input v-model="form.fenlei" placeholder="请填写所属种类" clearable style="width: 300px;"></el-input> -->
</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>规格型号
<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>
<el-input v-model="form.guigexinghao" placeholder="请填写物资型号" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:fenlei>
<template v-slot:wuziguige>
<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 v-model="form.fenlei" placeholder="请填写分类" clearable style="width: 300px;"></el-input>
<el-input v-model="form.wuziguige" 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">
@ -72,14 +91,14 @@
<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>计量单位
<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>
<el-input v-model="form.jiliangdanwei" placeholder="请填写单位" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
<template v-slot:storages_id>
<!-- <template v-slot:storages_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>所在仓库
@ -95,7 +114,7 @@
</el-select>
</div>
</div>
</template>
</template> -->
<!-- <template v-slot:suozaihuojia>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -113,7 +132,7 @@
</div>
</div>
</template> -->
<template v-slot:rukushijian>
<!-- <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>入库时间
@ -121,12 +140,10 @@
<div class="xy-table-item-content">
<el-input v-model="form.rukushijian" placeholder="请填写入库时间" clearable style="width: 300px;"></el-input>
<!-- <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> -->
<!-- <template v-slot:zichanyuanzhi>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -137,7 +154,7 @@
</div>
</div>
</template> -->
<template v-slot:shiyongnianxian>
<!-- <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>使用年限
@ -146,7 +163,7 @@
<el-input v-model="form.shiyongnianxian" placeholder="请填写使用年限" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>
</template> -->
<!-- <template v-slot:shiyongbumen>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -157,7 +174,7 @@
</div>
</div>
</template> -->
<template v-slot:shifouweigudingzichan>
<!-- <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>是否为固定资产
@ -173,8 +190,8 @@
</el-select>
</div>
</div>
</template>
<template v-slot:gudingzichanbianma v-if="form.shifouweigudingzichan==='是'">
</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>固定资产编码
@ -203,7 +220,7 @@
</el-upload>
</div>
</div>
</template>
</template> -->
<template v-slot:beizhu>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -216,7 +233,7 @@
</div>
</template>
<template v-slot:wuzidaima>
<!-- <template v-slot:wuzidaima>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;"></span>物资代码
@ -230,7 +247,7 @@
<template v-slot:yuanwuzimingcheng>
<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 v-model="form.yuanwuzimingcheng" placeholder="请输入" clearable
@ -281,7 +298,7 @@
style="width: 300px;"></el-input>
</div>
</div>
</template>
</template> -->
<!-- <template v-slot:shifouzhanshi>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -309,14 +326,20 @@
} from "@/api/system/baseForm.js"
import {
getWzbm
} from "@/api/mater.js"
} from "@/api/mater.js"
import {
getparameteritem,
} from "@/api/system/dictionary.js";
import {
Message
} from 'element-ui'
} from 'element-ui'
import {buildTree,requestToForm} from "@/utils/index.js"
export default {
data() {
return {
return {
fenleiList:[],
zIndex:1000,
isShow: false,
type: 'add',
id: '',
@ -340,33 +363,38 @@
}, {
label: '一物一码',
value: '一物一码'
}],
}],
fenleiName:'',
form: {
wuzibianma:'',
zichanmingcheng:'',
wuzileixing:'',
guigexinghao:'',
fenlei:'',
zhuangtai:'',
guigexinghao:'',
wuziguige:'',
jiliangdanwei:'',
suozaicangku:'',
storages_id:'',
suozaihuojia:'',
rukushijian:'',
zichanyuanzhi:'',
shiyongnianxian:'',
shiyongbumen:'',
shifouweigudingzichan:'',
gudingzichanbianma:'',
jishuziliao:[],
beizhu:'',
wuzidaima:'',
yuanwuzimingcheng:'',
shengchanriqi:'',
chubeifangshi:'',
zijinlaiyuan:'',
chubeicengji:'',
shifouzhanshi:''
// zhuangtai:'',
// suozaicangku:'',
// storages_id:'',
// suozaihuojia:'',
// rukushijian:'',
// zichanyuanzhi:'',
// shiyongnianxian:'',
// shiyongbumen:'',
// shifouweigudingzichan:'',
// gudingzichanbianma:'',
// jishuziliao:[],
// wuzidaima:'',
// yuanwuzimingcheng:'',
// shengchanriqi:'',
// chubeifangshi:'',
// zijinlaiyuan:'',
// chubeicengji:'',
// shifouzhanshi:''
},
rules: {
wuzibianma: [{
@ -375,20 +403,42 @@
}],
zichanmingcheng: [{
required: true,
message: '请输入名称'
message: '请输入资名称'
}],
wuzileixing: [{
required: true,
message: '请输入物资类型'
}],
fenlei: [{
required: true,
message: '请选择所属种类'
}]
}
}
},
created() {
this.getCangku()
this.getHuojia()
// this.getCangku()
// this.getHuojia()
this.getFenlei()
},
methods: {
methods: {
//
async getFenlei(){
const res = await getparameteritem('materials_fenlei')
this.beforeFenleiList = res.detail
this.fenleiList = buildTree(res.detail);
console.log("beforeFenleiList",this.beforeFenleiList)
},
changePtree(e,row){
console.log("e",e)
this.form.fenlei = e[e.length-1]
this.beforeFenleiList.map(item=>{
if(item.id===this.form.fenlei){
this.fenleiName = item.value
}
})
// this.fenleiName =
},
//
async getWzbms(){
const res = await getWzbm()
@ -415,14 +465,28 @@
id: this.id,
table_name: this.tableName
})
this.form = {
this.form = {
wuzibianma:'',
zichanmingcheng:'',
wuzileixing:'',
fenlei:'',
guigexinghao:'',
wuziguige:'',
jiliangdanwei:'',
beizhu:'',
wuzibianma:res?.wuzibianma,
zichanmingcheng:res?.zichanmingcheng,
wuzileixing:res?.wuzileixing,
fenlei:res.fenlei?parseFloat(res.fenlei):'',
guigexinghao:res?.guigexinghao,
fenlei:res?.fenlei,
zhuangtai:res?.zhuangtai,
wuziguige:res?.wuziguige,
jiliangdanwei:res?.jiliangdanwei,
beizhu:res?.beizhu,
zhuangtai:res?.zhuangtai,
suozaicangku:res?.suozaicangku,
storages_id:res.storages_id?parseInt(res.storages_id):'',
suozaihuojia:res?.suozaihuojia,
@ -433,7 +497,7 @@
shifouweigudingzichan:res?.shifouweigudingzichan,
gudingzichanbianma:res?.gudingzichanbianma,
jishuziliao:res?.jishuziliao,
beizhu:res?.beizhu,
wuzidaima:res?.wuzidaima,
yuanwuzimingcheng:res?.yuanwuzimingcheng,
shengchanriqi:res?.shengchanriqi,
@ -442,6 +506,12 @@
chubeicengji:res?.chubeicengji,
shifouzhanshi:res?.shifouzhanshi
}
if(res.fenlei_parameter_details_id_relation){
this.fenleiName = res.fenlei_parameter_details_id_relation.value
this.form.fenlei = res.fenlei_parameter_details_id_relation.pid>0?
[res.fenlei_parameter_details_id_relation.pid,res.fenlei_parameter_details_id_relation.id]:
[res.fenlei_parameter_details_id_relation.id]
}
if(res.jishuziliao_upload_details){
for(var j of res.jishuziliao_upload_details){
this.fileList.push({
@ -477,6 +547,9 @@
} else {
this.form.jishuziliao = []
}
if(Array.isArray(this.form.fenlei)){
this.form.fenlei = this.form.fenlei[this.form.fenlei.length-1]
}
// return
if (this.type === 'add') {
save({
@ -487,11 +560,16 @@
type: 'success',
message: '新增成功'
})
this.isShow = false
this.$emit('refresh')
console.log('add',res,this.form)
if(this.webType=='insert'){
this.$emit('insert',this.form)
}
this.$emit('insert',{
fenleiName:this.fenleiName,
...this.form
})
}
this.isShow = false
})
return
}
@ -542,7 +620,11 @@
}
</script>
<style lang="scss">
.select_popper{
z-index:9999!important
}
</style>
<style scoped lang="scss">
.mingxiwrap {
display: flex;

@ -6,9 +6,9 @@
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<Input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="关键词搜索" />
<Select v-model="select.storages_id" style="width: 200px;margin-right: 10px;" placeholder="所在仓库" clearable>
<!-- <Select v-model="select.storages_id" style="width: 200px;margin-right: 10px;" placeholder="所在仓库" clearable>
<Option v-for="item in cangkuList" :key="item.id" :value="item.id">{{ item.cangkumingcheng }}</Option>
</Select>
</Select> -->
<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>
@ -51,7 +51,7 @@
<el-drawer title="物资记录" :visible.sync="drawer" :direction="direction">
<div class="draw">
<div>物资编码{{detailObj.wuzibianma}}</div>
<div>名称{{detailObj.zichanmingcheng}}</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>
@ -139,7 +139,7 @@
align: 'center',
},
{
label: "名称",
label: "资名称",
width: 180,
prop: 'zichanmingcheng',
align: 'left'
@ -151,15 +151,21 @@
align: 'center'
},
{
label: "规格型号",
label: "物资型号",
width: 180,
prop: 'guigexinghao',
align: 'left'
},
{
label: "物资规格",
width: 180,
prop: 'wuziguige',
align: 'left'
},
{
label: "分类",
label: "所属种类",
width: 180,
prop: 'fenlei',
prop: 'fenlei_parameter_details_id_relation.value',
align: 'center'
},
// {
@ -169,53 +175,53 @@
// align: 'center'
// },
{
label: "计量单位",
label: "单位",
width: 180,
prop: 'jiliangdanwei',
align: 'center'
},
{
label: "所在仓库",
width: 180,
prop: 'storages_id_materialstorages_id_relation.cangkumingcheng',
align: 'center'
},
// {
// label: "",
// width: 180,
// prop: 'storages_id_materialstorages_id_relation.cangkumingcheng',
// align: 'center'
// },
// {
// label: "",
// width: 180,
// prop: 'suozaihuojia',
// align: 'center'
// },
{
label: "入库时间",
width: 180,
prop: 'rukushijian',
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: 'shiyongnianxian',
// align: 'center'
// },
// {
// label: "使",
// width: 180,
// prop: 'shiyongbumen',
// align: 'center'
// },
{
label: "是否为固定资产",
width: 180,
prop: 'shifouweigudingzichan',
align: 'center'
},
// {
// label: "",
// width: 180,
// prop: 'shifouweigudingzichan',
// align: 'center'
// },
{
label: "库存",
width: 180,
@ -232,7 +238,7 @@
}
},
mounted() {
this.getCangku()
// this.getCangku()
this.getField()
this.getindex()
},
@ -256,11 +262,11 @@
"op": "like",
"value": this.select.keyword
},
{
"key": "storages_id",
"op": "eq",
"value": this.select.storages_id?this.select.storages_id:''
},
// {
// "key": "storages_id",
// "op": "eq",
// "value": this.select.storages_id?this.select.storages_id:''
// },
],
})

@ -145,10 +145,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" v-model="mingxiObj.guigexinghao" placeholder="请选择规格型号" disabled
<el-input type="text" v-model="mingxiObj.guigexinghao" placeholder="请选择物资型号" disabled
style="width: 300px;"></el-input>
</div>
</div>
@ -335,7 +335,7 @@
width: 180
},
{
label: "规格型号",
label: "物资型号",
prop: "guigexinghao",
width: 180
}, {

@ -12,7 +12,7 @@
<td>物资名称</td>
<td>领用时间</td>
<td>数量</td>
<td>规格型号</td>
<td>物资型号</td>
<td>业务科室</td>
<td>备注</td>
</tr>

@ -8,11 +8,12 @@
<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.storage_id" style="width:300px" placeholder="请选择">
<div class="xy-table-item-content">
{{cangkumingcheng}}
<!-- <el-select v-model="form.storage_id" style="width:300px" placeholder="请选择">
<el-option v-for="item in StorageList" :key="item.id" :label="item.cangkumingcheng" :value="item.id">
</el-option>
</el-select>
</el-select> -->
</div>
</div>
</template>
@ -79,7 +80,8 @@
isShow: false,
type: 'add',
id: '',
tableName: 'shelfs',
tableName: 'shelfs',
cangkumingcheng:'',
StorageList: [],
form: {
storage_id: '',
@ -103,13 +105,18 @@
},
created() {
},
methods: {
methods: {
setStorage(id,name){
this.form.storage_id = id
this.cangkumingcheng = name
},
async getDetail() {
const res = await show({
id: this.id,
table_name: this.tableName
})
this.$integrateData(this.form, res)
this.cangkumingcheng = res.storage_id_materialstorages_id_relation.cangkumingcheng
this.form.area_x = res.area_x?res.area_x:0
this.form.area_y = res.area_y?res.area_y:0
},

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
<template>
<div v-if="detail">
<!-- 合同详情-->
<xy-dialog :is-show.sync="isShowDetail" type="normal" title="详情" class="contract-detail">
<xy-dialog :zIndex="10000" :is-show.sync="isShowDetail" type="normal" title="详情" class="contract-detail">
<template v-slot:normalContent>
<div class="base-info">
<div class="base-info-title">项目基本信息</div>
@ -373,7 +373,7 @@
getOatoken().then(res=>{
this.wuziguanli_oatoken =res.oatoken
})
}
}
</script>

@ -1,40 +1,49 @@
<template>
<div>
<div class="button-wrap">
<Button type="primary" @click="editorRuku('','add','采购')"></Button>
<Button type="primary" @click="editorRuku('','add','请示')"></Button>
<Button type="primary" @click="editorRuku('','add','盘点')"></Button>
<Button type="primary" @click="editorRuku('','add','回库')"></Button>
</div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="rukuType=='回库'?`归还入库管理`:`${rukuType}入库管理`" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<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="经办人搜索" />
<Select v-model="select.rukuleixing" style="width: 200px;margin-right: 10px;" placeholder="入库类型" clearable>
<Option v-for="item in rukuTypeList" :key="item.id" :value="item.id">{{ item.value }}</Option>
</Select>
<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',
$refs['addRuku'].rukuType = rukuType
$refs['addRuku'].authName =authName">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$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">
:table-item="table">
<template v-slot:guanlianjilu>
<el-table-column label="关联记录" width="260" header-align="left">
<template slot-scope="scope">
<div v-for="item in rukuTypeList">
<div v-if="scope.row.rukuleixing===item.id">
{{item.prop?scope.row[item.prop]:''}}
</div>
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<el-table-column fixed="right" label="操作" width="120" header-align="center">
<template slot-scope="scope">
<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> -->
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteRuku(scope.row)">
<Button type="primary" size="small" @click="editorRuku(scope.row.id,'editor',scope.row.rukuleixing)"></Button>
<Poptip transfer confirm title="确认要删除该入库记录?入库明细将一同删除。" @on-ok="deleteRuku(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</div>
</template>
</el-table-column>
</template>
@ -80,18 +89,33 @@
select: {
pageSize: 10,
pageIndex: 1,
keyword: ""
keyword: "",
rukuleixing:'',
},
rukuType:'',
rukuTypeList:{
purchase:'采购',
return:'回库',
check:'盘点',
data:"数据校对",
mock:'模拟盘点',
ask:'请示',
yingji:'应急采购'
},
rukuTypeList:[{
id:'采购',
value:'采购入库',
prop:'caigouhetong'
},{
id:'请示',
value:'请示入库',
prop:'qingshiliucheng'
},{
id:'盘点',
value:'盘点入库'
},{
id:'回库',
value:'归还入库'
}],
// rukuTypeList:{
// purchase:'',
// return:'',
// check:'',
// data:"",
// mock:'',
// ask:'',
// yingji:''
// },
customForm: {
customFormId: "",
tableName: "stocks"
@ -106,7 +130,7 @@
width:80
},
{
label: "入库时间",
label: "入库日期",
width: 180,
prop: 'rukushijian',
align: 'center',
@ -119,6 +143,12 @@
width: 180,
prop: 'rukuleixing',
align: 'center'
},
{
label: "关联记录",
width: 240,
prop: 'guanlianjilu',
align: 'left',
},
{
label: "经办人",
@ -127,23 +157,23 @@
align: 'center'
},
{
label: "记录人",
label: "记录人",
width: 180,
prop: 'jilurenyuan',
align: 'center'
},
{
label: "保管人",
label: "保管人",
width: 180,
prop: 'baoguanrenyuan',
align: 'center'
},
{
label: "固定资产编号",
width: 180,
prop: 'gudingzichanbianhao',
align: 'center'
},
// {
// label: "",
// width: 180,
// prop: 'gudingzichanbianhao',
// align: 'center'
// },
{
label: "备注",
width: 240,
@ -182,7 +212,7 @@
{
"key": "rukuleixing",
"op": "eq",
"value": this.rukuType
"value": this.select.rukuleixing?this.select.rukuleixing:''
}
],
})
@ -195,12 +225,14 @@
this.select.pageIndex = e
this.getindex()
},
editorRuku(id, type) {
this.$refs['addRuku'].id = id
this.$refs['addRuku'].type = type
this.$refs['addRuku'].isShow = true
// this.$refs['addRuku'].getDetail()
this.$refs['addRuku'].rukuType = this.rukuType
editorRuku(id, type,rukuleixing) {
if(id){
this.$refs['addRuku'].id = id
}
this.$refs['addRuku'].type = type
this.$refs['addRuku'].authName = this.authName
this.$refs['addRuku'].rukuType = rukuleixing
this.$refs['addRuku'].isShow = true
},
deleteRuku(row) {
console.log(row.id)
@ -219,30 +251,30 @@
},
},
mounted() {
if(this.$route.path){
let path = this.$route.path.split("_")[1]
console.log(path)
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> )
}
})
}
}
}
}
// if(this.$route.path){
// let path = this.$route.path.split("_")[1]
// console.log(path)
// 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> )
// }
// })
// }
// }
// }
// }
this.getUserName()
this.getindex()
}
@ -250,5 +282,10 @@
}
</script>
<style scoped lang="scss">
<style scoped lang="scss">
.button-wrap{
button{
margin-right:10px;
}
}
</style>

@ -23,8 +23,8 @@
</div>
<div class="form-row">
<div class="xy-table-item type-dialog-item">
<div class="xy-table-item-label">规格型号</div>
<div class="xy-table-item-content"><Input v-model="form.model" style="width:100%;" placeholder="请输入规格型号" /></div>
<div class="xy-table-item-label">物资型号</div>
<div class="xy-table-item-content"><Input v-model="form.model" style="width:100%;" placeholder="请输入物资型号" /></div>
</div>
<div class="xy-table-item type-dialog-item">
<div class="xy-table-item-label">数量</div>
@ -283,4 +283,4 @@ export default {
line-height: 1;
padding-top: 0;
}
</style>
</style>

@ -53,10 +53,10 @@
<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>规格型号
<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>
<el-input v-model="form.guigexinghao" placeholder="请填写物资型号" clearable style="width: 300px;"></el-input>
</div>
</div>
</template>

@ -3,7 +3,7 @@
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="form" :title="type==='add'?'新增':'编辑'" :form="form"
:rules="rules" @submit="submit">
<template v-slot:storehouses_id>
<!-- <template v-slot:storehouses_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>仓库类型
@ -15,7 +15,7 @@
</el-select>
</div>
</div>
</template>
</template> -->
<template v-slot:cangkumingcheng>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -36,6 +36,16 @@
</div>
</div>
</template>
<template v-slot:sort>
<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 style="width:300px" type="number" v-model="form.sort"></el-input>
</div>
</div>
</template>
<template v-slot:suozaiquyu>
<div class="xy-table-item">
@ -53,7 +63,7 @@
<template v-slot:jiansheniandai>
<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-date-picker style="width:300px" value-format="yyyy" format="yyyy" v-model="form.jiansheniandai"
@ -185,7 +195,8 @@
form: {
storehouses_id: '',
cangkumingcheng: '',
cangkubianma: '',
cangkubianma: '',
sort:0,
suozaiquyu: '',
jiansheniandai: '',
cangkumianji: '',
@ -199,10 +210,10 @@
quyu_id: ''
},
rules: {
type_id: [{
required: true,
message: '请填写仓库名称'
}],
// type_id: [{
// required: true,
// message: ''
// }],
cangkumingcheng: [{
required: true,
message: '请填写仓库名称'
@ -241,7 +252,8 @@
id: this.id,
table_name: this.tableName
})
this.$integrateData(this.form, res)
this.$integrateData(this.form, res)
this.form.sort = res.sort?res.sort:0
this.mapform = [res.jingdu, res.weidu, res.cangkudizhi]
if(res.image_id_uploads_id_relation){
this.fileList.push(res.image_id_uploads_id_relation)

@ -0,0 +1,145 @@
<template>
<div>
<xy-dialog ref="dialog" :width='70' :is-show.sync="isShow" type="normal" :title="titleName">
<template v-slot:normalContent>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;margin-bottom:10px">
<Input v-model="select.huojiamingcheng" style="width: 200px;margin-right: 10px;" placeholder="名称搜索" />
<Button type="primary" @click="select.page=1,getList()"></Button>
<Button type="primary" style="margin-left: 10px;" @click="$refs['addShelf'].type='add',
$refs['addShelf'].setStorage(storage_id,titleName),
$refs['addShelf'].isShow=true">添加</Button>
</div>
<xy-table :list="list" :total="total" @pageSizeChange="pageSizeChange" @pageIndexChange="pageChange"
:table-item="table">
<template v-slot:btns>
<el-table-column fixed="right" label="操作" align="center" width="120" header-align="center">
<template slot-scope="scope">
<div>
<Button type="primary" size="small" @click="$refs['addShelf'].type='editor',
$refs['addShelf'].id=scope.row.id,
$refs['addShelf'].isShow=true">编辑</Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delRow(scope.row.id)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip>
</div>
</template>
</el-table-column>
</template>
</xy-table>
<addShelf ref="addShelf" @refresh="getList"></addShelf>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
index,
destroy
} from "@/api/system/baseForm.js"
import addShelf from '@/views/shelf/components/addShelf.vue'
import {
getparameteritem
} from "@/api/system/dictionary.js"
export default {
components: {
addShelf,
},
data() {
return {
isShow:false,
titleName:'',
storage_id:'',
select: {
page: 1,
page_size: 10,
huojiamingcheng: '',
table_name: 'shelfs',
},
total: 0,
list: [],
StorageList:[],
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80,
},{
label: '货架名称',
prop: 'huojiamingcheng',
// width: 120,
}, {
label: '创建日期',
prop: 'created_at',
width: 120,
formatter: (cell, data, value) => {
return value ? value.substring(0, 10) : ''
}
}],
}
},
created() {
// this.getStorageList()
},
watch:{
isShow(newVal){
if(newVal){
console.log("this.storage_id",this.storage_id)
this.getList()
}else{
this.storage_id = ''
this.titleName = ''
this.list = []
this.total = 0
}
},
},
methods: {
async getList() {
const res = await index({
...this.select,
filter: [{
key:'huojiamingcheng',
op:'like',
value:this.select.huojiamingcheng
},{
key:'storage_id',
op:'eq',
value:this.storage_id
}],
})
this.list = res.data
this.total = res.total
},
pageChange(e) {
this.select.page = e
this.getList()
},
pageSizeChange(e){
this.select.page_size = e
this.getList()
},
delRow(id) {
if (id) {
destroy({
id: id,
table_name: this.select.table_name,
}).then(res => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
})
}
},
}
}
</script>
<style>
</style>

@ -12,7 +12,7 @@
<Button type="primary" style="margin-left: 8px;" @click="resetSelect"></Button>
<Button type="primary" style="margin-left: 8px;" @click="getWarehouseList"></Button>
<Button type="primary" style="margin-left: 8px;" @click="handleAdd"></Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
</div>
@ -80,7 +80,7 @@
{ label: '资产名称', prop: 'name', minWidth: 120 },
{ label: '国标分类', prop: 'category', minWidth: 120 },
{ label: '类别名称', prop: 'category_name', minWidth: 120 },
{ label: '规格型号', prop: 'model', minWidth: 120 },
{ label: '物资型号', prop: 'model', minWidth: 120 },
{ label: '数量', prop: 'quantity', minWidth: 80 },
{ label: '计量单位', prop: 'unit', minWidth: 80 },
{ label: '购置时间', prop: 'purchase_date', minWidth: 120 },

@ -146,7 +146,7 @@
align: 'left'
},
{
label: "规格型号",
label: "物资型号",
width: 120,
prop: 'guigexinghao',
align: 'center'

@ -91,7 +91,7 @@
prop: 'suozaiquyu',
width: 120,
}, {
label: '建设年代',
label: '建设时间',
prop: 'jiansheniandai',
width: 120,
}, {

@ -14,7 +14,7 @@
<Button type="primary" @click="select.page=1,getList()"></Button>
<Button type="primary" style="margin-left: 10px;" @click="$refs['addStorage'].type='add',
$refs['addStorage'].typelist = typelist,
$refs['addStorage'].isShow=true">添加</Button>
$refs['addStorage'].isShow=true">添加</Button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
</div>
@ -23,7 +23,17 @@
</div>
<xy-table :list="list" :total="total" @pageSizeChange="pageSizeChange" @pageIndexChange="pageChange"
:table-item="table">
:table-item="table">
<template v-slot:huojia>
<el-table-column label="货架信息" align="center" width="120" header-align="center">
<template slot-scope="scope">
<div>
<Button type="primary" size="small" @click="showHuojia(scope.row)"></Button>
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column fixed="right" label="操作" align="center" width="120" header-align="center">
<template slot-scope="scope">
@ -40,7 +50,8 @@
</template>
</xy-table>
<addStorage ref="addStorage" @refresh="getList"></addStorage>
<addStorage ref="addStorage" @refresh="getList"></addStorage>
<shelf ref="shelf"></shelf>
</div>
</template>
@ -54,10 +65,12 @@
import addStorage from './components/addStorage.vue'
import {
getparameteritem
} from "@/api/system/dictionary.js"
} from "@/api/system/dictionary.js"
import shelf from './components/shelf.vue'
export default {
components: {
addStorage,
addStorage,
shelf
},
data() {
@ -84,24 +97,31 @@
prop: 'cangkumingcheng',
align: 'left',
fixed: 'left'
}, {
label: '仓库类型',
prop: 'storehouses_id_storehouses_id_relation.name',
align: 'center',
width: 120,
},
// {
// label: '',
// prop: 'cangkubianma',
// align: 'left',
// width: 240
// {
// label: '',
// prop: 'storehouses_id_storehouses_id_relation.name',
// align: 'center',
// width: 120,
// },
{
label: '仓库编码',
prop: 'cangkubianma',
align: 'left',
width: 240
},
{
label: '货架信息',
prop: 'huojia',
align: 'center',
width: 120
},
{
label: '所在区域',
prop: 'suozaiquyu',
width: 120,
}, {
label: '建设年代',
label: '建设时间',
prop: 'jiansheniandai',
width: 120,
}, {
@ -114,7 +134,7 @@
prop: 'cangkumianji',
width: 120,
}, {
label: '负责人',
label: '管理员姓名',
prop: 'fuzeren',
width: 120,
}, {
@ -122,12 +142,9 @@
prop: 'lianxidianhua',
width: 120,
}, {
label: '创建日期',
prop: 'created_at',
label: '排序',
prop: 'sort',
width: 120,
formatter: (cell, data, value) => {
return value ? value.substring(0, 10) : ''
}
}],
}
},
@ -167,7 +184,9 @@
},
async getList() {
const res = await index({
...this.select,
...this.select,
sort_name:'sort',
sort_type:'ASC',
filter: [{
key:'cangkumingcheng',
op:'like',
@ -192,6 +211,11 @@
pageSizeChange(e){
this.select.page_size = e
this.getList()
},
showHuojia(row){
this.$refs.shelf.titleName = row.cangkumingcheng
this.$refs.shelf.storage_id = row.id
this.$refs.shelf.isShow = true
},
delRow(id) {
if (id) {

@ -1,333 +1,412 @@
<template>
<div class="container">
<!-- 查询配置 -->
<div>
<div ref="lxHeader">
<LxHeader icon="md-apps" text="字典数据" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Button type="primary" @click="load"></Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增字典</Button>
</div>
</slot>
</LxHeader>
</div>
<div class="table-tree">
<el-table :data="tableData" :height="tableHeight" class="v-table" style="width: 100%;margin-bottom: 20px;"
row-key="id" border default-expand-all :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="number" label="字典编码" sortable width="180">
</el-table-column>
<el-table-column prop="name" label="字典名称" sortable width="220">
</el-table-column>
<el-table-column prop="remark" label="备注" sortable>
</el-table-column>
<el-table-column prop="sort" align="center" label="排序" sortable width="80">
</el-table-column>
<el-table-column fixed="right" label="操作" width="300">
<template slot-scope="scope">
<Button type="primary" @click="addchildren(scope.row)" size="small" style="margin-left: 10px;"
ghost>下一级</Button>
<Button type="error" @click="del(scope.row)" size="small" style="margin-left: 10px;" ghost>删除</Button>
<Button type="primary" @click="edit(scope.row)" size="small" style="margin-left: 10px;" ghost>编辑</Button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<el-dialog title="字典编辑" :visible.sync="dialogFormVisible" width="80%">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="上级id">
<el-input v-model="form.pid" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="上级">
<el-input v-model="form.pname" disabled autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="字典编码" prop="number">
<el-input v-model="form.number" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="字典名称" prop="name">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否启用" prop="status">
<el-select v-model="form.status">
<el-option label="启用" value="1"></el-option>
<el-option label="不启用" value="0"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="排序">
<el-input v-model="form.sort" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
<div class="table-tree">
<div style="display: flex;justify-content: flex-end;margin-right: 20px;margin-bottom: 10px;">
<Button type="primary" @click="addRow()" size="small" style="margin-left: 10px;" ghost>新增参数</Button>
</div>
<el-table :data="this.form.detail_list" height="400" class="v-table" style="width: 100%;margin-bottom: 20px;">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="id" align="center" label="主健ID" width="120">
</el-table-column>
<el-table-column prop="value" label="数据值Text" width="320">
<template slot-scope="scope">
<el-input v-model="scope.row.value" >
</el-input>
</template>
</el-table-column>
<el-table-column prop="sort" align="center" label="排序" width="80">
<template slot-scope="scope">
<el-input v-model="scope.row.sort" >
</el-input>
</template>
</el-table-column>
<el-table-column prop="status" align="center" label="状态" width="180">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" >
</el-switch>
</template>
<template>
<div class="container">
<!-- 查询配置 -->
<div style="padding: 0px 20px">
<div ref="lxHeader">
<LxHeader icon="md-apps" text="字典数据" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<Button type="primary" @click="load"></Button>
<Button type="primary" @click="edit()" style="margin-left: 10px">新增字典</Button>
</div>
</slot>
</LxHeader>
</div>
<div class="table-tree">
<el-table :data="tableData" :height="tableHeight" class="v-table" style="width: 100%;margin-bottom: 20px;"
row-key="id" border :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="number" label="字典编码" sortable width="180">
</el-table-column>
<el-table-column prop="name" label="字典名称" sortable width="220">
</el-table-column>
<el-table-column prop="remark" label="备注" sortable>
</el-table-column>
<el-table-column prop="sort" align="center" label="排序" sortable width="80">
</el-table-column>
<el-table-column fixed="right" label="操作" width="300">
<template slot-scope="scope">
<Button type="primary" @click="addchildren(scope.row)" size="small" style="margin-left: 10px;"
ghost>下一级</Button>
<Button type="error" @click="del(scope.row)" size="small" style="margin-left: 10px;" ghost>删除</Button>
<Button type="primary" @click="edit(scope.row)" size="small" style="margin-left: 10px;" ghost>编辑</Button>
</template>
</el-table-column>
</el-table>
</div>
</div>
<el-dialog title="字典编辑" :visible.sync="dialogFormVisible" width="80%">
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="上级">
<el-input v-model="form.pname" disabled autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="字典编码" prop="number">
<el-input v-model="form.number" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="字典名称" prop="name">
<el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="是否启用" prop="status">
<el-select v-model="form.status">
<el-option label="启用" value="1"></el-option>
<el-option label="不启用" value="0"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="排序">
<el-input v-model="form.sort" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" autocomplete="off"></el-input>
</el-form-item>
</el-col>
</el-row>
<div class="table-tree">
<div style="display: flex;justify-content: flex-end;margin-right: 20px;margin-bottom: 10px;">
<Button type="primary" @click="addRow()" size="small" style="margin-left: 10px;" ghost>新增参数</Button>
</div>
<el-table :data="this.form.detail_list"
row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" height="400" class="v-table"
style="width: 100%;margin-bottom: 20px;">
<el-table-column type="index" align="center">
</el-table-column>
<el-table-column prop="id" align="center" label="主健ID" width="120">
</el-table-column>
<el-table-column prop="remark" label="备注">
<el-table-column prop="value" label="父级" width="320">
<template slot-scope="scope">
<el-input v-model="scope.row.remark" >
</el-input>
<el-cascader
v-model="scope.row.pid"
:options="pTreeData"
@change="(e)=>{changePtree(e,scope.row)}"
:props="{label:'value',value:'id',checkStrictly: true }"></el-cascader>
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
</el-table-column>
<el-table-column prop="value" label="数据值Text" width="320">
<template slot-scope="scope">
<el-input v-model="scope.row.value" />
</el-input>
</template>
</el-table-column>
<el-table-column prop="sort" align="center" label="排序" width="80">
<template slot-scope="scope">
<el-input v-model="scope.row.sort" />
</el-input>
</template>
</el-table-column>
<el-table-column prop="status" align="center" label="状态" width="180">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" />
</el-switch>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注">
<template slot-scope="scope">
<el-input v-model="scope.row.remark" />
</el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
<template slot-scope="scope">
<Button type="error" @click="delRow(scope.row,scope.$index)" size="small" style="margin-left: 10px;"
ghost>删除</Button>
</template>
</el-table-column>
</el-table>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')"> </el-button>
<el-button type="primary" @click="submitForm('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
<!-- <Button type="primary" @click="addRow()" size="small" style="margin-left: 10px;" ghost>新增参数</Button> -->
<Button type="error" @click="delRow(scope.row, scope.$index)" size="small" style="margin-left: 10px;"
ghost>删除</Button>
</template>
</el-table-column>
</el-table>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="resetForm('form')"> </el-button>
<el-button type="primary" @click="submitForm('form')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import LxHeader from "@/components/LxHeader/index.vue";
import {
save,
listparameter,
del,
store,
getparameter,
delDetail
} from "../../api/system/dictionary.js";
export default {
components: {
LxHeader
},
created() {
this.initLoad();
this.load();
},
mounted() {},
data() {
import {buildTree,requestToForm} from "@/utils/index.js"
import {
save,
listparameter,
del,
store,
getparameter,
delDetail
} from "../../api/system/dictionary.js";
export default {
components: {
LxHeader
},
created() {
this.initLoad();
this.load();
},
mounted() {},
data() {
return {
dialogFormVisible: false,
rowShow:false,
dialogFormVisible: false,
formLabelWidth: "120px",
form: {
pname: "根级别",
number: "",
id: "",
pid: "0",
name: "",
status: "1",
sort: 0,
remark: "",
detail_list: [{
id: "",
value: "",
sort: "1",
status: true,
remark: ""
}]
},
rules: {
name: [{
required: true,
message: '请输入菜单名称',
trigger: 'blur'
}],
url: [{
required: true,
message: '请输入菜单路径',
trigger: 'blur'
}],
visible: [{
required: true,
message: '请选择是否显示',
trigger: 'blur'
}],
},
tableHeight: 0,
//
searchFields: {
KeyWord: ""
},
tableData: []
}
},
methods: {
addRow() {
var len = this.form.detail_list.length;
objid:'',
pTreeData:[],
form: {
pname: "根级别",
number: "",
id: "",
pid: "0",
name: "",
status: "1",
sort: 0,
remark: "",
detail_list: [{
id: "",
value: "",
sort: "1",
status: true,
remark: ""
}]
},
rules: {
name: [{
required: true,
message: '请输入菜单名称',
trigger: 'blur'
}],
url: [{
required: true,
message: '请输入菜单路径',
trigger: 'blur'
}],
visible: [{
required: true,
message: '请选择是否显示',
trigger: 'blur'
}],
},
tableHeight: 0,
//
searchFields: {
KeyWord: ""
},
tableData: []
}
},
methods: {
addRow() {
var len = this.form.detail_list.length;
this.form.detail_list.push({
value: "",
sort: len + 1,
status: true,
remark: ""
})
},
delRow(obj, index) {
if (obj.id) {
delDetail(obj.id).then(response => {
this.$message.success("操作成功");
this.form.detail_list.splice(index, 1);
}).catch(error => {
//reject(error)
this.$message.error("操作失败");
})
} else {
this.form.detail_list.splice(index, 1);
}
pid:0,
value: "",
sort: len + 1,
status: true,
remark: ""
})
},
initLoad() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
changePtree(e,row){
console.log("e",e)
this.$set(row,'pid',e[e.length-1])
},
load() {
var that = this;
listparameter().then(response => {
that.tableData = response.data;
}).catch(error => {
//reject(error)
delRow(node) {
let that = this
this.$confirm('确认删除该节点?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (node.id) {
delDetail(node.id).then(response => {
that.$message.success("操作成功");
that.info(that.objid);
}).catch(error => {
//reject(error)
that.$message.error("操作失败");
})
} else {
that.info(that.objid);
}
})
},
// delRow(obj, index) {
// if (obj.id) {
// delDetail(obj.id).then(response => {
},
// this.$message.success("");
// this.form.detail_list.splice(index, 1);
// }).catch(error => {
// //reject(error)
// this.$message.error("");
// })
// } else {
// console.log("123",index,this.form.detail_list,this.form.detail_list.splice(index, 1))
// this.form.detail_list.splice(index, 1);
// }
// },
initLoad() {
var that = this;
var clientHeight = document.documentElement.clientHeight
var lxHeader_height = 96.5; //
var paginationHeight = 37; //
var topHeight = 50; //
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
that.tableHeight = tableHeight;
},
load() {
var that = this;
listparameter({
is_tree:1
}).then(response => {
that.tableData = response.data;
}).catch(error => {
//reject(error)
})
},
show(obj) {
this.clientHeight = document.documentElement.clientHeight - 84 - 110;
this.dialogViewVisible = true;
this.info(obj);
},
info(obj) {
var that = this;
getparameter({
id: obj.id
}).then(response => {
for (var m of response.detail) {
m.status = m.status == 1;
}
response.detail_list = response.detail;
let result = Object.assign(that.form, response);
that.form.status = result.status.toString();
}).catch(error => {
//reject(error)
})
},
edit(obj) {
this.form = this.$options.data().form;
this.clientHeight = document.documentElement.clientHeight - 84 - 110;
this.objid = obj
console.log("this.objid",obj)
this.clientHeight = document.documentElement.clientHeight - 84 - 110;
this.dialogViewVisible = true;
this.info(obj);
},
info(obj) {
var that = this;
getparameter({
id: obj.id
}).then(response => {
for (var m of response.detail) {
m.status = m.status == 1;
}
response.detail_list = buildTree(response.detail);
console.log("this.buildTree(response.detail)",buildTree(response.detail))
let result = requestToForm(response,that.form);
that.form = result
that.pTreeData = []
that.pTreeData = requestToForm(response.detail_list,that.pTreeData)
that.pTreeData.unshift({
id:0,
value:'根目录'
})
that.form.detail_list = response.detail_list
}).catch(error => {
//reject(error)
})
},
edit(obj) {
this.form = this.$options.data().form;
this.clientHeight = document.documentElement.clientHeight - 84 - 110;
if (obj) {
var that = this;
that.info(obj);
} else {}
this.dialogFormVisible = true;
},
addchildren(obj) {
this.form = this.$options.data().form
if (obj) {
this.form.pname = obj.name;
this.form.pid = obj.id;
this.dialogFormVisible = true;
}
},
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
that.objid = obj
that.info(obj);
} else {}
this.dialogFormVisible = true;
},
addchildren(obj) {
this.form = this.$options.data().form
if (obj) {
this.form.pname = obj.name;
this.form.pid = obj.id;
this.dialogFormVisible = true;
}
},
submitForm(formName) {
var that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
if (that.form.id) {
save(that.form).then(response => {
console.log(response)
this.$Message.success('操作成功');
that.dialogFormVisible = false;
that.load();
}).catch(error => {})
} else {
store(that.form).then(response => {
console.log(response)
this.$Message.success('操作成功');
that.dialogFormVisible = false;
that.load();
}).catch(error => {})
}
let _arr = this.treeToFlat(that.form.detail_list)
console.log("that.form.detail_list",that.form.detail_list)
save({
...that.form,
detail_list:_arr
}).then(response => {
console.log(response)
this.$Message.success('操作成功');
that.dialogFormVisible = false;
that.load();
}).catch(error => {})
} else {
store(that.form).then(response => {
console.log(response)
this.$Message.success('操作成功');
that.dialogFormVisible = false;
that.load();
}).catch(error => {})
}
} else {
this.$Message.error('数据校验失败');
return false;
}
});
},
treeToFlat(tree, result = []) {
tree.forEach(node => {
//
const flatNode = { ...node };
} else {
this.$Message.error('数据校验失败');
return false;
// children
delete flatNode.children;
//
result.push(flatNode);
//
if (node.children && node.children.length > 0) {
this.treeToFlat(node.children, result);
}
});
},
resetForm(formName) {
var that = this;
this.$refs[formName].resetFields();
that.dialogFormVisible = false;
},
del(obj) {
var that = this;
if (obj) {
this.$Modal.confirm({
title: '确认要删除数据?',
onOk: () => {
del(obj.id).then(response => {
this.$Message.success('操作成功');
that.load();
}).catch(error => {
console.log(error)
reject(error)
})
},
onCancel: () => {
//this.$Message.info('Clicked cancel');
}
});
}
},
}
};
return result;
},
resetForm(formName) {
var that = this;
this.$refs[formName].resetFields();
that.dialogFormVisible = false;
},
del(obj) {
var that = this;
if (obj) {
this.$Modal.confirm({
title: '确认要删除数据?',
onOk: () => {
del({
id: obj.id
}).then(response => {
this.$Message.success('操作成功');
that.load();
}).catch(error => {
console.log(error)
reject(error)
})
},
onCancel: () => {
//this.$Message.info('Clicked cancel');
}
});
}
},
}
};
</script>

Loading…
Cancel
Save