master
lion 4 months ago
parent 701687d767
commit cd2c0b8b67

@ -56,6 +56,8 @@
var stocks_items = printObj['stocks_items']&&printObj['stocks_items'].length>0?printObj['stocks_items'][0]:''
var chanquan = stocks_items.chanquanxinxi_detail?stocks_items.chanquanxinxi_detail.value:'市河道处'
var gudingzichanbianma = printObj['gudingzichanbianma']? printObj['gudingzichanbianma']:''
var jiliangdanwei = printObj['jiliangdanwei']? printObj['jiliangdanwei']:''
$(".wrap").append("<li id='page" + index + "' style='width: 9cm; height: 5cm;font-size: 16px;font-weight:bold;background-color: #fff;'>" +
"<p style='text-align:center;margin-bottom:0;padding-top:5px;'><span style='text-align:left;display:inline-block;width:3cm'>"+printDate+"</span>"+
@ -67,11 +69,11 @@
"<p style='margin:0'>物资名称:"+printObj['zichanmingcheng']+"</p>"+
"<p style='margin:0'>规格:"+guige+"</p>"+
"<p style='margin:0'>型号:"+xinghao+"</p>"+
"<p style='margin:0'><span>批次:"+printObj['rukupici']+"</span><span>数量:</span>"+printObj['total_num']+"</p>"+
"<p style='margin:0'>批内序号:"+shunxuhao+"</p>"+
"<p style='margin:0'><span>批次:"+printObj['rukupici']+"</span><span>"+(printObj['wuzileixing']==='一物一码'?'同批数量:':'数量:')+"</span>"+printObj['total_num']+jiliangdanwei+"</p>"+
"<p style='margin:0'>"+(printObj['wuzileixing']==='一物一码'?'批内序号:'+shunxuhao:'')+"</p>"+
"</div>"+
"</div>"+
"<p style='padding:15px;padding-top:0;margin:0;text-align:left'>"+(gudingzichanbianma?'固定资产编码'+gudingzichanbianma:'')+"</p>"+
"<p style='padding:15px;padding-top:0;margin:0;text-align:left'>"+(gudingzichanbianma?'固定资产编码:'+gudingzichanbianma:'')+"</p>"+
"</li>")
// createCode("#page" + index, printObj)

@ -1,5 +1,21 @@
import request from '@/utils/request'
function customParamsSerializer(params) {
let result = ''
for (const key in params) {
if (params.hasOwnProperty(key)) {
if (Array.isArray(params[key])) {
params[key].forEach((item, index) => {
result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`
})
} else {
result += `${key}=${params[key]}&`
}
}
}
return result.slice(0, -1)
}
// 绑定/更新物资与运维规则的关系
export function saveStocksItem(data) {
return request({
@ -8,3 +24,39 @@ export function saveStocksItem(data) {
data
})
}
export function index(params, isLoading = false) {
return request({
method: 'get',
url: '/api/admin/stocks-item/index',
params,
paramsSerializer: customParamsSerializer,
isLoading
})
}
export function show(params, isLoading = true) {
return request({
method: 'get',
url: '/api/admin/stocks-item/show',
params,
isLoading
})
}
export function save(data) {
return request({
method: 'post',
url: '/api/admin/stocks-item/save',
data
})
}
export function destroy(params) {
return request({
method: 'get',
url: '/api/admin/stocks-item/destroy',
params
})
}

@ -158,7 +158,9 @@ export default {
methods: {
async getFenlei() {
const res = await getFenleilist({
tree: 1
tree: 1,
sort_type:'ASC',
sort_name:'sort'
})
this.fenleiList = this.removeEmptyChildren(res)
},

@ -117,7 +117,9 @@
methods: {
async getFenlei() {
const res = await getFenleilist({
tree: 1
tree: 1,
sort_type:'ASC',
sort_name:'sort'
})
this.fenleiList = this.removeEmptyChildren(res)
},

@ -0,0 +1,307 @@
<template>
<div>
<el-dialog :visible.sync="isShowMingxi" :modal="false" width="80%" title="编辑明细">
<el-form ref="form" :model="formData" :rules="rules" label-width="100px">
<!-- <el-form-item label="物资名称" prop="zichanmingcheng">
<el-input v-model="formData.zichanmingcheng" disabled />
</el-form-item>
<el-form-item label="所属种类" prop="fenlei">
<el-input v-model="formData.fenleiName" disabled />
</el-form-item>
<el-form-item label="物资类型" prop="wuzileixing">
<el-input v-model="formData.wuzileixing" disabled />
</el-form-item>
<el-form-item label="物资型号" prop="guigexinghao">
<el-input v-model="formData.guigexinghao" disabled />
</el-form-item>
<el-form-item label="物资规格" prop="wuziguige">
<el-input v-model="formData.wuziguige" disabled />
</el-form-item>
<el-form-item label="单位" prop="jiliangdanwei">
<el-input v-model="formData.jiliangdanwei" disabled />
</el-form-item>
<el-form-item label="储备年限" prop="chubeinianxian">
<el-input v-model="formData.chubeinianxian" disabled />
</el-form-item>
<el-form-item label="存放要求" prop="cunfangyaoqiu">
<el-input v-model="formData.cunfangyaoqiu" disabled />
</el-form-item>
<el-form-item label="维护要求" prop="weihuyaoqiu">
<el-input v-model="formData.weihuyaoqiu" disabled />
</el-form-item>
<el-form-item label="保养频次" prop="equipment_maintain_config_id">
<el-select disabled v-model="formData.equipment_maintain_config_id" popper-class="select_popper"
style="width: 100%;" placeholder="请选择保养频次" clearable>
<el-option v-for="item in configList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="在库数量" prop="zaikushuliang">
<el-input v-model="formData.zaikushuliang" disabled />
</el-form-item>
<el-form-item label="入库批次" prop="rukupici">
<el-input v-model="formData.rukupici" disabled />
</el-form-item>
<el-form-item label="入库数量" prop="rukushuliang">
<el-input-number v-model="formData.rukushuliang" disabled style="width:100%" :min="0" />
</el-form-item> -->
<el-form-item label="生产日期" prop="shengchanriqi">
<el-date-picker v-model="formData.shengchanriqi" style="width:100%"
value-format="yyyy-MM-dd" type="date" placeholder="选择日期" />
</el-form-item>
<el-form-item label="入库日期" prop="rukuriqi">
<el-date-picker v-model="formData.rukuriqi" style="width:100%" value-format="yyyy-MM-dd"
type="date" placeholder="选择日期" />
</el-form-item>
<el-form-item label="物资状态" prop="wuzizhuangtai">
<el-select v-model="formData.wuzizhuangtai" style="width:100%" placeholder="请选择物资状态">
<el-option v-for="item in paraOptions.materials_status" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="所在仓库" prop="suozaicangku">
<el-select v-model="formData.suozaicangku" style="width:100%" placeholder="请选择所在仓库"
@change="handleCkChange">
<el-option v-for="item in cangkuList" :key="item.id" :label="item.cangkumingcheng" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="所在货架" prop="suozaihuojia">
<el-select v-model="formData.suozaihuojia" style="width:100%" placeholder="请选择所在货架">
<el-option v-for="item in huojiaList" :key="item.id" :label="item.huojiamingcheng" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="储备方式" prop="chubeifangshi">
<el-select v-model="formData.chubeifangshi" style="width:100%" placeholder="请选择储备方式">
<el-option v-for="item in paraOptions.material_reserve" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="等级分类" prop="dengjifenlei">
<el-select v-model="formData.dengjifenlei" style="width:100%" placeholder="请选择等级分类">
<el-option v-for="item in paraOptions.materials_level" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="产权信息" prop="chanquanxinxi">
<el-select v-model="formData.chanquanxinxi" style="width:100%" placeholder="请选择产权信息">
<el-option v-for="item in paraOptions.materials_property" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="是否为固定资产" prop="shifouweigudingzichan">
<el-select v-model="formData.shifouweigudingzichan" style="width:100%" placeholder="请选择">
<el-option v-for="item in [{id:'',value:''},{id:'',value:''}]" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="固定资产编码" prop="gudingzichanbianma">
<el-input v-model="formData.gudingzichanbianma" />
</el-form-item>
</el-form>
<div slot="footer" align="right">
<Button class="btn" size="default" type="default" @click="mingxiCancel"></Button>
<Button style="margin-left:10px" class="btn" size="default" type="primary" @click="mingxiConfirm"></Button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
show,
save
} from '@/api/inventory.js'
import {
index
} from '@/api/system/baseForm.js'
import { getMaintainConfigList } from '@/api/maintenance/maintenance.js'
import {
getparameteritemMore
} from '@/api/system/dictionary.js'
export default {
data() {
return {
isShowMingxi: false,
id:'',
rules: {},
configList: [],
//
paraOptions: {
'materials_status': [],
'material_reserve': [],
'materials_property': [],
'materials_level': []
// 'materials_fenlei':[],
},
cangkuList: [],
huojiaList: [],
formData: {
// wuzibianma: '',
// zichanmingcheng: '',
// wuzileixing: '',
// guigexinghao: '',
// wuziguige: '',
// fenlei: '',
// jiliangdanwei: '',
// zaikushuliang: '',
// rukupici: '',
// rukushuliang: '',
// wuzizhuangtai: '',
// chubeifangshi: '',
// chubeinianxian: '',
shengchanriqi: '',
rukuriqi: '',
wuzizhuangtai: '',
suozaicangku: '',
suozaihuojia: '',
dengjifenlei: '',
chanquanxinxi: '',
cunfangyaoqiu: '',
weihuyaoqiu: '',
// equipment_maintain_config_id: '',
shifouweigudingzichan: '',
gudingzichanbianma: ''
},
}
},
created() {
this.getData()
this.getCangku()
// this.getConfig()
},
watch:{
isShowMingxi(val){
if(val){
this.getDetail()
}else{
this.id = ''
this.formData = {}
}
}
},
methods: {
mingxiCancel() {
},
mingxiConfirm() {
save({
id:this.id,
...this.formData
}).then(res=>{
this.$message.success('更新成功')
this.$emit("refresh")
this.isShowMingxi = false
})
},
//
async getConfig() {
try {
const res = await getMaintainConfigList({
page: 1,
page_size: 999
//
})
if (res && res.data) {
this.configList = res.data
}
} catch (e) {
this.$message.error('获取运维规则列表失败')
}
},
//
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 getCangku() {
const res = await index({
page_size: 999,
page: 1,
table_name: 'materialstorages',
sort_name: 'sort',
sort_type: 'ASC',
filter: [{
key: 'shifouzili',
op: 'eq',
value: '是'
}]
})
this.cangkuList = res.data
},
//
handleCkChange(e) {
this.getHuojia(e)
},
async getHuojia(id) {
const res = await index({
page_size: 999,
page: 1,
table_name: 'shelfs',
filter: [{
key: 'storage_id',
op: 'eq',
value: id
}]
})
// this.formData.suozaihuojia = ''
this.huojiaList = res.data
},
async getDetail(id) {
const res = await show({
id:this.id
})
this.formData = {
// wuzibianma: res.wuzibianma?res.wuzibianma:'',
// zichanmingcheng: res.zichanmingcheng?res.zichanmingcheng:'',
// wuzileixing: res.wuzileixing?res.wuzileixing:'',
// guigexinghao: res.guigexinghao?res.guigexinghao:'',
// wuziguige: res.wuziguige?res.wuziguige:'',
// fenlei: res.fenlei?res.fenlei:'',
// jiliangdanwei: res.jiliangdanwei?res.jiliangdanwei:'',
// zaikushuliang: res.zaikushuliang?res.zaikushuliang:'',
// rukupici: res.rukupici?res.rukupici:'',
// rukushuliang: res.rukushuliang?res.rukushuliang:'',
wuzizhuangtai: res.wuzizhuangtai?res.wuzizhuangtai:'',
// chubeifangshi: res.chubeifangshi?res.chubeifangshi:'',
// chubeinianxian: res.chubeinianxian?res.chubeinianxian:'',
shengchanriqi: res.shengchanriqi?res.shengchanriqi:'',
rukuriqi: res.rukuriqi?res.rukuriqi:'',
suozaicangku: res.suozaicangku?parseFloat(res.suozaicangku):'',
suozaihuojia: res.suozaihuojia?parseFloat(res.suozaihuojia):'',
dengjifenlei: res.dengjifenlei?res.dengjifenlei:'',
chanquanxinxi: res.chanquanxinxi?res.chanquanxinxi:'',
cunfangyaoqiu: res.cunfangyaoqiu?res.cunfangyaoqiu:'',
weihuyaoqiu: res.weihuyaoqiu?res.weihuyaoqiu:'',
wuzizhuangtai: res.wuzizhuangtai?res.wuzizhuangtai:'',
// equipment_maintain_config_id: res.equipment_maintain_config_id?res.equipment_maintain_config_id:'',
shifouweigudingzichan: res.shifouweigudingzichan?res.shifouweigudingzichan:'',
gudingzichanbianma: res.gudingzichanbianma?res.gudingzichanbianma:''
}
if (this.formData.suozaicangku) {
this.handleCkChange(this.formData.suozaicangku)
}
},
}
}
</script>
<style>
</style>

@ -23,10 +23,19 @@
</el-select>
</div>
<div class="selector-item">
<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="select.rukuriqi" placeholder="请选择入库日期"></el-date-picker>
<el-date-picker type="daterange"
range-separator="至"
start-placeholder="入库日期开始"
end-placeholder="入库日期结束"
format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="select.rukuriqi"></el-date-picker>
</div>
<div class="selector-item">
<el-date-picker format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="select.rukuriqi" placeholder="请选择生产日期"></el-date-picker>
<el-date-picker format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="生产日期开始"
end-placeholder="生产日期结束"
value-format="yyyy-MM-dd" v-model="select.shengchanriqi"></el-date-picker>
</div>
<div class="selector-item">
<el-select clearable v-model="select.wuzizhuangtai" style="width:100%" placeholder="请选择物资状态">
@ -89,11 +98,13 @@
<template v-slot:btns>
<!-- <div></div> -->
<el-table-column v-if="isPandian==='pandian' && (isCkName==''||roleName=='')" fixed="right"
<!-- <div></div> isPandian==='pandian' && -->
<el-table-column v-if="(isCkName==''||roleName=='')" fixed="right"
align="center" label="操作" width="120" header-align="center">
<template slot-scope="scope">
<Button type="primary" size="small" @click="editorIn(scope.row.id,'editor')"></Button>
<!-- <Button type="primary" size="small" @click="editorIn(scope.row.id,'editor')"></Button> -->
<Button type="primary" size="small" @click="editorStocks(scope.row.id)"></Button>
<!-- -->
<!-- <Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteIn(scope.row)">
<Button type="primary" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip> -->
@ -108,7 +119,7 @@
<div v-if="showcode" class="code" @click="closeCode">
<div id="qrCode" ref="qrCodeDiv" />
</div>
<editStockItem ref="editStockItem" @refresh="getindex"></editStockItem>
<imports ref="imports" :table-name="customForm.tableName" :form-info="form" @refresh="getindex" />
</div>
@ -129,7 +140,8 @@
import {
getInfo
} from '@/api/user.js'
import addInventorys from './components/addInventorys.vue'
import addInventorys from './components/addInventorys.vue'
import editStockItem from './components/editStockItem.vue'
import QRCode from 'qrcodejs2'
import {
Message
@ -148,11 +160,13 @@
import Cookies from 'js-cookie'
import {
getparameteritemMore
} from '@/api/system/dictionary.js'
} from '@/api/system/dictionary.js'
export default {
components: {
imports,
addInventorys
addInventorys,
editStockItem
},
data() {
return {
@ -254,20 +268,20 @@
{
label: '物资型号',
prop: 'guigexinghao',
prop: 'wuzibianma_material_infos_wuzibianma_relation.guigexinghao',
align: 'center',
width: 180
},
{
label: '物资规格',
prop: 'wuziguige',
prop: 'wuzibianma_material_infos_wuzibianma_relation.wuziguige',
align: 'center',
width: 180
},
{
label: '单位',
width: 120,
prop: 'jiliangdanwei',
prop: 'wuzibianma_material_infos_wuzibianma_relation.jiliangdanwei',
align: 'center'
}
]
@ -285,9 +299,8 @@
label: '在库数量',
width: 120,
prop: 'zaikushuliang',
customFn: (row) => {
console.log("row",row)
return (<span>{row.row.total_num}{row.row.jiliangdanwei?row.row.jiliangdanwei:''}</span>)
customFn: (row) => {
return (<span>{row.row.zaikushuliang}{row.row.jiliangdanwei?row.row.jiliangdanwei:''}</span>)
}
},
{
@ -295,7 +308,6 @@
width: 180,
prop: 'shunxuhao',
customFn: (row) => {
console.log("row",row)
return (<span>{row.row.shunxuhao?row.row.shunxuhao:''}</span>)
}
},
@ -314,225 +326,79 @@
multiHd: [{
label: '生产日期',
width: 120,
prop: 'stocks_items_info.shengchanriqi'
prop: 'shengchanriqi'
},
{
label: '入库日期',
width: 120,
prop: 'stocks_items_info.rukuriqi'
prop: 'rukuriqi'
},
{
label: '物资状态',
width: 120,
prop: 'stocks_items_info.wuzizhuangtai_detail.value'
prop: 'wuzizhuangtai_detail.value'
},
{
label: '储备方式',
width: 120,
prop: 'stocks_items_info.chubeifangshi_detail.value'
prop: 'chubeifangshi_detail.value'
},
{
label: '所在仓库',
width: 120,
prop: 'stocks_items_info.materialstorages.cangkumingcheng'
prop: 'materialstorages.cangkumingcheng'
},
{
label: '所在货架',
width: 120,
prop: 'stocks_items_info.shelfs.huojiamingcheng'
prop: 'shelfs.huojiamingcheng'
},
{
label: '等级分类',
width: 120,
prop: 'stocks_items_info.dengjifenlei_detail.value'
prop: 'dengjifenlei_detail.value'
},
{
label: '产权信息',
width: 120,
prop: 'stocks_items_info.chanquanxinxi_detail.value'
}, {
prop: 'chanquanxinxi_detail.value'
},{
label: '是否为固定资产',
width: 120,
prop: 'shifouweigudingzichan',
},{
label: '固定资产编码',
width: 120,
prop: 'gudingzichanbianma',
}, {
label: '储备年限',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.chubeinianxian'
prop: 'chubeinianxian'
}, {
label: '存放要求',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.cunfangyaoqiu'
prop: 'cunfangyaoqiu'
},
{
label: '维护要求',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.weihuyaoqiu'
prop: 'weihuyaoqiu'
},
{
label: '保养频次',
width: 120,
prop: 'wuzibianma_material_infos_wuzibianma_relation.equipment_maintain_config.name'
},{
label: '是否为固定资产',
width: 120,
prop: 'shifouweigudingzichan',
customFn: (scope) => {
return h(
'el-popover',
{
props: {
title: '请选择',
placement: 'bottom-start',
width: 250
}
},
[
h(
'el-select',
{
style: { width: '100%' },
props: {
value: scope.row.shifouweigudingzichan,
placeholder: '请选择',
clearable:true
},
on: {
input: val => {
scope.row.shifouweigudingzichan = val;
}
}
},
[{id:'是',value:'是'},{id:'否',value:'否'}].map(item => {
return h(
'el-option',
{
props: {
value: item.id,
label: item.name
}
}
);
})
),
h(
'div',
{
style: { textAlign: 'right', marginTop: '5px' }
},
[
h(
'el-button',
{
props: {
type: 'primary',
size: 'small'
},
on: {
click: () => {
//
this.updateGd(scope.row.id,scope.row.shifouweigudingzichan)
}
}
},
'确认'
)
]
),
h(
'div',
{
slot: 'reference'
},
[
h('span', scope.row.shifouweigudingzichan ? scope.row.shifouweigudingzichan : ''),
h('i', { class: 'el-icon-edit' })
]
)
]
);
}
},{
label: '固定资产编码',
width: 120,
prop: 'gudingzichanbianma',
customFn: (scope) => {
return h(
'el-popover',
{
props: {
title: '请输入',
placement: 'bottom-start',
width: 250
}
},
[
h(
'el-input',
{
style: { width: '100%' },
props: {
value: scope.row.gudingzichanbianma,
},
on: {
input: val => {
scope.row.gudingzichanbianma = val;
}
}
},
),
h(
'div',
{
style: { textAlign: 'right', marginTop: '5px' }
},
[
h(
'el-button',
{
props: {
type: 'primary',
size: 'small'
},
on: {
click: () => {
//
this.updateGdbm(scope.row.id,scope.row.gudingzichanbianma)
}
}
},
'确认'
)
]
),
h(
'div',
{
slot: 'reference'
},
[
h('span', scope.row.gudingzichanbianma ? scope.row.gudingzichanbianma : ''),
h('i', { class: 'el-icon-edit' })
]
)
]
);
}
prop: 'equipment_maintain_config.name'
}]
}
],
// <el-form-item label="" prop="shifouweigudingzichan">
// <el-select v-model="formData.chanquanxinxi" :disabled="hasPici" style="width:100%" placeholder="">
// <el-option v-for="item in [{id:'',value:''},{id:'',value:''}]" :key="item.id" :label="item.value"
// :value="item.id" />
// </el-select>
// </el-form-item>
// <el-form-item label="" prop="gudingzichanbianma">
// <el-input v-model="formData.gudingzichanbianma"/>
// </el-form-item>
],
printObj: [],
printArr: [],
// selection
mergeColumnRange: {
start: 1, //
end: 11 //
end: 8 //
}
}
},
@ -619,8 +485,7 @@
this.spanArr.push(1)
this.position = 0
} else {
if (item.wuzibianma_material_infos_wuzibianma_relation.wuzibianma ===
data[this.position].wuzibianma_material_infos_wuzibianma_relation.wuzibianma) {
if (item.wuzibianma === data[this.position].wuzibianma_material_infos_wuzibianma_relation.wuzibianma) {
this.spanArr[this.position] += 1
this.spanArr.push(0)
} else {
@ -754,7 +619,9 @@
},
async getFenlei() {
const res = await getFenleilist({
tree: 1
tree: 1,
sort_type:'ASC',
sort_name:'sort'
})
this.fenleiList = this.removeEmptyChildren(res)
},
@ -800,8 +667,11 @@
chanquanxinxi:this.select.chanquanxinxi,
chubeifangshi:this.select.chubeifangshi,
suozaicangku:this.select.suozaicangku,
rukuriqi:this.select.rukuriqi,
shengchanriqi:this.select.shengchanriqi,
start_rukuriqi:this.select.rukuriqi?this.select.rukuriqi[0]:'',
end_rukuriqi:this.select.rukuriqi?this.select.rukuriqi[1]:'',
start_shengchanriqi:this.select.shengchanriqi?this.select.shengchanriqi[0]:'',
end_shengchanriqi:this.select.shengchanriqi?this.select.shengchanriqi[1]:'',
// shengchanriqi:this.select.shengchanriqi?this.select.shengchanriqi.join(","):'',
dengjifenlei:this.select.dengjifenlei,
// is_export:this.select.is_export,
filter: [
@ -828,11 +698,14 @@
]
})
//
let stocks_items_arr = []
res.list.data.map(item => {
stocks_items_arr = item.stocks_items.filter(f => f.rukupici === item.rukupici)
item.stocks_items_info = stocks_items_arr.length > 0 ? stocks_items_arr[0] : {}
})
// let stocks_items_arr = []
// res.list.data.map(item => {
// stocks_items_arr = item.stocks_items.filter(f => f.id === item.stocks_item_id)
// console.log("stocks_items_arr",stocks_items_arr)
// item.stocks_items_info = stocks_items_arr.length > 0 ? stocks_items_arr[0] : {},
// console.log("item.stocks_items_info",item.stocks_items_info)
// })
this.list = res.list.data
this.total = res.list.total
this.loading = false
@ -850,6 +723,10 @@
this.$refs['addInventorys'].id = id
this.$refs['addInventorys'].isShow = true
this.$refs['addInventorys'].type = type
},
editorStocks(id){
this.$refs['editStockItem'].id = id
this.$refs['editStockItem'].isShowMingxi = true
},
deleteIn(row) {
console.log(row.id)

File diff suppressed because it is too large Load Diff

@ -115,6 +115,21 @@
{{ (scope.row.responsible_admin && scope.row.responsible_admin.name) || '-' }}
</template>
</el-table-column>
<el-table-column
label="运维内容"
min-width="150"
align="center"
>
<template slot-scope="scope">
<span v-if="scope.row.equipment_maintain_config_id && scope.row.equipment_maintain_config && scope.row.equipment_maintain_config.name">
{{ scope.row.equipment_maintain_config.name }}
</span>
<span v-else-if="scope.row.content">
{{ scope.row.content }}
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column
label="状态"
min-width="100"
@ -294,6 +309,12 @@
<FormItem label="计划维护日期" prop="planned_maintenance_date">
<DatePicker v-model="createForm.planned_maintenance_date" type="date" placeholder="请选择计划维护日期" style="width: 100%" />
</FormItem>
<FormItem label="截止日期" prop="end_date">
<DatePicker v-model="createForm.end_date" type="date" placeholder="请选择截止日期" style="width: 100%" />
</FormItem>
<FormItem label="维护内容" prop="content">
<Input v-model="createForm.content" type="textarea" :rows="4" placeholder="请输入维护内容" />
</FormItem>
</Form>
<template slot="footer">
<Button @click="closeCreateModal"></Button>
@ -313,15 +334,16 @@
<div class="associate-content">
<div class="associate-toolbar">
<Input v-model="materialSearch" placeholder="搜索物资名称..." style="width: 250px; margin-right: 10px;" clearable />
<Select v-model="select.storehouses_id" style="width: 120px; margin-right: 10px;" clearable placeholder="仓库类型" @on-change="getWarehouseNames">
<Option v-for="item in warehouseTypes" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
<Select v-model="select.area" style="width: 120px; margin-right: 10px;" clearable placeholder="所在区域" @on-change="getWarehouseNames">
<Option v-for="item in warehouseAreas" :key="item.id" :value="item.value">{{ item.value }}</Option>
</Select>
<Select v-model="materialWarehouseName" style="width: 120px; margin-right: 10px;" clearable placeholder="仓库名称">
<Option v-for="warehouse in warehouseNames" :key="warehouse.value" :value="warehouse.label">{{ warehouse.label }}</Option>
</Select>
<el-cascader
size="small"
v-model="associateFenlei"
:options="fenleiList"
:props="{label:'name',value:'id'}"
placeholder="选择分类"
style="width: 250px; margin-right: 10px;"
clearable
@change="changeAssociateFenlei"
/>
<Button type="primary" @click="searchMaterials"></Button>
<Button style="margin-left: 8px;" @click="resetMaterialSearch"></Button>
</div>
@ -343,7 +365,7 @@
<div class="pagination-container">
<el-pagination
:current-page="materialPageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-sizes="[10, 20, 30, 50, 100]"
:page-size="materialPageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="materialTotal"
@ -362,15 +384,16 @@ import { getOperationList, saveOperation, getOperationDetail } from '@/api/maint
import { getStorehouseTypeList } from '@/api/system/storehouseType'
import { getparameteritem } from '@/api/system/dictionary.js'
import { index } from '@/api/system/baseForm.js'
import { index as getFenleilist } from '@/api/fenlei.js'
import request from '@/utils/request'
import {
download
import {
download
} from "@/utils/downloadRequest";
import qs from 'qs'
import * as XLSX from 'xlsx'
import {
saveAs
} from 'file-saver'
import * as XLSX from 'xlsx'
import {
saveAs
} from 'file-saver'
import Cookies from 'js-cookie'
export default {
components: {
@ -416,7 +439,9 @@ export default {
createForm: {
material_id: '',
material_name: '',
planned_maintenance_date: ''
planned_maintenance_date: '',
end_date: '',
content: ''
},
createFormRules: {
material_id: [
@ -446,6 +471,27 @@ export default {
}
}
}
],
end_date: [
{
required: true,
message: '请选择截止日期',
trigger: 'change',
validator: (rule, value, callback) => {
if (!value) {
callback(new Error('请选择截止日期'))
} else {
callback()
}
}
}
],
content: [
{
required: true,
message: '请输入维护内容',
trigger: 'blur'
}
]
},
materialOptions: [],
@ -504,33 +550,73 @@ export default {
showMaterialModal: false,
materialSearch: '',
materialWarehouseName: '',
materialPageSize: 10,
materialPageSize: 30,
materialPageIndex: 1,
materialTotal: 0,
materialColumns: [
{
title: '物资名称',
key: 'zichanmingcheng',
minWidth: 180
},
{
title: '所属种类',
key: 'fenlei_detail',
minWidth: 180,
render: (h, params) => {
const relation = params.row.fenlei_detail
return h('span', relation && relation.name ? relation.name : '-')
}
},
{
title: '物资类型',
key: 'wuzileixing',
minWidth: 120
},
// {
// title: '',
// key: 'wuzibianma',
// minWidth: 120
// },
{
title: '物资型号',
key: 'guigexinghao',
minWidth: 120
},
{
title: '仓库名称',
key: 'material_info',
title: '物资规格',
key: 'wuziguige',
minWidth: 120
},
{
title: '单位',
key: 'jiliangdanwei',
minWidth: 80
},
{
title: '储备年限',
key: 'chubeinianxian',
minWidth: 80
},
{
title: '存放要求',
key: 'cunfangyaoqiu',
minWidth: 120
},
{
title: '维护要求',
key: 'weihuyaoqiu',
minWidth: 120
},
{
title: '保养频次',
key: 'equipment_maintain_config_id_equipment_maintain_configs_id_relation',
minWidth: 120,
render: (h, params) => {
return h('span', params.row.material_info?.suozaicangku || '')
const relation = params.row.equipment_maintain_config_id_equipment_maintain_configs_id_relation
return h('span', relation && relation.name ? relation.name : '-')
}
},
{
title: '备注',
key: 'beizhu',
minWidth: 240
},
{
title: '操作',
slot: 'action',
@ -542,9 +628,8 @@ export default {
}
],
materialList: [],
warehouseTypes: [],
warehouseAreas: [],
warehouseNames: []
associateFenlei: '',
fenleiList: []
}
},
watch: {
@ -558,9 +643,7 @@ export default {
},
created() {
this.getList()
this.getWarehouseTypes()
this.getWarehouseAreas()
this.getWarehouseNames()
this.getFenlei()
},
mounted() {
this.calcTableHeight()
@ -630,7 +713,9 @@ export default {
this.createForm = {
material_id: '',
material_name: '',
planned_maintenance_date: ''
planned_maintenance_date: '',
end_date: '',
content: ''
}
},
pageChange(e) {
@ -877,7 +962,9 @@ export default {
}
const data = {
material_info_id: this.createForm.material_id,
planned_maintenance_date: this.formatDate(this.createForm.planned_maintenance_date)
planned_maintenance_date: this.formatDate(this.createForm.planned_maintenance_date),
end_date: this.formatDate(this.createForm.end_date),
content: this.createForm.content
}
const res = await saveOperation(data)
if (res) {
@ -891,6 +978,7 @@ export default {
},
openMaterialModal() {
this.showMaterialModal = true
this.getFenlei()
this.searchMaterials()
},
async searchMaterials() {
@ -901,17 +989,19 @@ export default {
'show_relation[0]': 'equipmentMaintainConfig',
'show_relation[1]': 'materialInfo.materialstorage',
'materialstorages_cangkumingcheng': this.materialWarehouseName ? this.materialWarehouseName : '',
'materialstorages_suozaiquyu': this.select.area ? this.select.area : '',
'storehouses_id': this.select.storehouses_id ? this.select.storehouses_id : '',
'filter[0][key]': 'zichanmingcheng',
'filter[0][op]': 'like',
'filter[0][value]': this.materialSearch ? this.materialSearch : '',
'filter[1][key]': 'wuzileixing',
'filter[1][op]': 'eq',
'filter[1][value]': '一物一码'
// 'filter[1][key]': 'wuzileixing',
// 'filter[1][op]': 'eq',
// 'filter[1][value]': ''
}
//
if (this.associateFenlei) {
data['filter[2][key]'] = 'fenlei'
data['filter[2][op]'] = 'eq'
data['filter[2][value]'] = this.associateFenlei
}
const res = await request({
url: '/api/admin/material-infos/index',
@ -955,26 +1045,11 @@ export default {
},
resetMaterialSearch() {
this.materialSearch = ''
this.select.storehouses_id = ''
this.select.area = ''
this.materialWarehouseName = ''
this.associateFenlei = ''
this.materialPageIndex = 1
this.searchMaterials()
},
async getWarehouseTypes() {
try {
const res = await getStorehouseTypeList({
page: 1,
page_size: 999
})
if (res && res.data) {
this.warehouseTypes = res.data
}
} catch (e) {
console.error('获取仓库类型列表失败:', e)
this.$Message.error('获取仓库类型列表失败')
}
},
async getWarehouseAreas() {
try {
const res = await getparameteritem('area')
@ -1017,6 +1092,45 @@ export default {
this.$Message.error('获取仓库名称列表失败')
}
},
async getFenlei() {
try {
const res = await getFenleilist({
tree: 1,
sort_type: 'ASC',
sort_name: 'sort'
})
if (res) {
this.fenleiList = this.removeEmptyChildren(res)
}
} catch (e) {
console.error('获取分类列表失败:', e)
this.$Message.error('获取分类列表失败')
}
},
changeAssociateFenlei(e) {
if (e) {
this.associateFenlei = e[e.length - 1]
} else {
this.associateFenlei = ''
}
},
removeEmptyChildren(node) {
if (Array.isArray(node)) {
return node.map(child => {
if (child.children) {
//
child.children = this.removeEmptyChildren(child.children);
// children
if (child.children.length === 0) {
delete child.children;
}
}
return child;
});
}
return [];
},
async exportExcel(sheetName) {
let export_fields ={}
@ -1062,9 +1176,9 @@ export default {
//
}
// const res = await getOperationList(params)
download(
'/api/admin/equipment-operation/index',
'get', params,
download(
'/api/admin/equipment-operation/index',
'get', params,
`运维记录${sheetName}.xlsx`)
} catch (e) {
this.$message.error('导出维护记录失败')

@ -123,42 +123,61 @@
<div class="associate-content">
<div class="associate-toolbar">
<Input v-model="associateSearch" placeholder="搜索物资名称..." style="width: 250px; margin-right: 10px;" clearable />
<Select v-model="select.storehouses_id" style="width: 120px; margin-right: 10px;" clearable placeholder="仓库类型" @on-change="getWarehouseNames">
<el-cascader
size="small"
v-model="associateFenlei"
:options="fenleiList"
:props="{label:'name',value:'id'}"
placeholder="选择分类"
style="width: 250px; margin-right: 10px;"
clearable
@change="changeAssociateFenlei"
/>
<!-- <Select v-model="select.storehouses_id" style="width: 120px; margin-right: 10px;" clearable placeholder="仓库类型" @on-change="getWarehouseNames">
<Option v-for="item in warehouseTypes" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
<Select v-model="select.area" style="width: 120px; margin-right: 10px;" clearable placeholder="所在区域" @on-change="getWarehouseNames">
</Select> -->
<!-- <Select v-model="select.area" style="width: 120px; margin-right: 10px;" clearable placeholder="所在区域" @on-change="getWarehouseNames">
<Option v-for="item in warehouseAreas" :key="item.id" :value="item.value">{{ item.value }}</Option>
</Select>
<Select v-model="associateWarehouseName" style="width: 120px; margin-right: 10px;" clearable placeholder="仓库名称">
</Select> -->
<!-- <Select v-model="associateWarehouseName" style="width: 120px; margin-right: 10px;" clearable placeholder="仓库名称">
<Option v-for="warehouse in warehouseNames" :key="warehouse.value" :value="warehouse.label">{{ warehouse.label }}</Option>
</Select>
</Select> -->
<Button type="primary" @click="searchMaterialsPost"></Button>
<Button style="margin-left: 8px;" @click="resetAssociateSearch"></Button>
</div>
<Table :columns="associateColumns" :data="associateList" :height="400" style="margin-top: 15px;">
<div class="batch-operations" style="margin-bottom: 15px;">
<Button type="primary" @click="batchAssociate" :disabled="!hasSelectedItems || isAssociating || isDisassociating" :loading="isAssociating">
{{ isAssociating ? '关联中...' : '批量关联' }}
</Button>
<Button type="error" style="margin-left: 8px;" @click="batchDisassociate" :disabled="!hasSelectedItems || isAssociating || isDisassociating" :loading="isDisassociating">
{{ isDisassociating ? '取消关联中...' : '批量取消关联' }}
</Button>
<span style="margin-left: 15px; color: #666;">已选择 {{ selectedItems.length }} </span>
</div>
<Table :columns="associateColumns" :data="associateList" :height="400" style="margin-top: 15px;" @on-selection-change="handleSelectionChange">
<template slot="action" slot-scope="{ row }">
<div style="display: flex; gap: 8px; justify-content: center;">
<!--
<Button
v-if="row.equipment_maintain_config && row.equipment_maintain_config.id === currentRule.id"
type="error"
v-else-if="row.equipment_maintain_config"
type="warning"
size="small"
ghost
style="border-radius: 6px;"
:title="row.equipment_maintain_config ? `已关联规则: ${row.equipment_maintain_config.name}` : ''"
@click="toggleAssociation(row)"
>
解除绑定
</Button>
重新绑定
</Button> -->
<Button
v-else-if="row.equipment_maintain_config"
type="warning"
v-if="isMaterialAssociated(row)"
type="error"
size="small"
ghost
style="border-radius: 6px;"
:title="row.equipment_maintain_config ? `已关联规则: ${row.equipment_maintain_config.name}` : ''"
@click="toggleAssociation(row)"
>
重新绑定
解除绑定
</Button>
<Button
v-else
@ -176,7 +195,7 @@
<div class="pagination-container">
<el-pagination
:current-page="associateCurrentPage"
:page-sizes="[10, 20, 50, 100]"
:page-sizes="[10, 20, 30, 50, 100]"
:page-size="associatePageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="associateTotal"
@ -198,6 +217,7 @@ import { saveMaintainConfig, getMaintainConfigList, deleteMaintainConfig } from
import { saveStocksItem } from '@/api/stocks-item.js'
import request from '@/utils/request'
import qs from 'qs'
import { index as getFenleilist } from '@/api/fenlei.js'
export default {
components: {
@ -244,7 +264,12 @@ export default {
{ label: '起始日期设定', prop: 'start_standard', minWidth: 160, formatter: row => this.startStandardOptions.find(opt => opt.value == row.start_standard)?.label || row.start_standard },
// { label: '()', prop: 'advance_days', minWidth: 120 },
// { label: '()', prop: 'advance_days', minWidth: 120 },
{ label: '已用于物资数', prop: 'stocks_items_count', minWidth: 120 },
{
label: '已用于物资数',
prop: 'equipment_maintain_config_material_infos',
minWidth: 120,
formatter: row => row.equipment_maintain_config_material_infos ? row.equipment_maintain_config_material_infos.length : 0
},
{ label: '未完成时下次计划', prop: 'next_plan_type', minWidth: 160, formatter: row => this.nextPlanOptions.find(opt => opt.value == row.next_plan_type)?.label || row.next_plan_type }
],
tableHeight: 550,
@ -279,33 +304,104 @@ export default {
},
associateSearch: '',
associateWarehouseName: '',
associatePageSize: 100,
associatePageSize: 30,
associateCurrentPage: 1,
associateTotal: 0,
associateFenlei: '',
fenleiList: [],
associateColumns: [
{
type: 'selection',
width: 60,
align: 'center'
},
{
title: '已关联规则',
key: 'equipment_maintain_config_material_infos',
minWidth: 180,
render: (h, params) => {
const relations = params.row.equipment_maintain_config_material_infos
if (!relations || relations.length === 0) {
return h('span', '-')
}
//
if (relations.length === 1) {
const rule = relations[0]
return h('span', rule.equipment_maintain_config && rule.equipment_maintain_config.name ? rule.equipment_maintain_config.name : '-')
} else {
//
const ruleElements = relations.map(rule => {
const ruleName = rule.equipment_maintain_config && rule.equipment_maintain_config.name ? rule.equipment_maintain_config.name : '-'
return h('div', { style: 'line-height: 1.5; margin-bottom: 2px;' }, ruleName)
})
return h('div', ruleElements)
}
}
},
{
title: '物资名称',
key: 'zichanmingcheng',
minWidth: 180
},
{
title: '所属种类',
key: 'fenlei_detail',
minWidth: 180,
render: (h, params) => {
const relation = params.row.fenlei_detail
return h('span', relation && relation.name ? relation.name : '-')
}
},
{
title: '物资类型',
key: 'wuzileixing',
minWidth: 120
},
// {
// title: '',
// key: 'wuzibianma',
// minWidth: 120
// },
{
title: '物资型号',
key: 'guigexinghao',
minWidth: 120
},
{
title: '仓库名称',
key: 'material_info',
title: '物资规格',
key: 'wuziguige',
minWidth: 120
},
{
title: '单位',
key: 'jiliangdanwei',
minWidth: 80
},
{
title: '储备年限',
key: 'chubeinianxian',
minWidth: 80
},
{
title: '存放要求',
key: 'cunfangyaoqiu',
minWidth: 120
},
{
title: '维护要求',
key: 'weihuyaoqiu',
minWidth: 120
},
{
title: '保养频次',
key: 'equipment_maintain_config_id_equipment_maintain_configs_id_relation',
minWidth: 120,
render: (h, params) => {
return h('span', params.row.material_info?.suozaicangku || '')
const relation = params.row.equipment_maintain_config_id_equipment_maintain_configs_id_relation
return h('span', relation && relation.name ? relation.name : '-')
}
},
{
title: '备注',
key: 'beizhu',
minWidth: 240
},
{
title: '操作',
slot: 'action',
@ -323,7 +419,13 @@ export default {
warehouseAreas: [],
warehouseNames: [],
allWarehouses: [],
currentWarehouseNames: []
currentWarehouseNames: [],
selectedItems: [],
hasSelectedItems: false,
isSelecting: false,
isAssociating: false,
isDisassociating: false,
selectionTimer: null
}
},
watch: {
@ -347,6 +449,10 @@ export default {
},
beforeDestroy() {
window.removeEventListener('resize', this.calcTableHeight)
//
if (this.selectionTimer) {
clearTimeout(this.selectionTimer)
}
},
methods: {
async getList() {
@ -463,15 +569,29 @@ export default {
this.currentRule = row
//
this.associateSearch = ''
this.associateFenlei = ''
this.select.storehouses_id = ''
this.select.area = ''
this.associateWarehouseName = ''
this.associateCurrentPage = 1
//
this.selectedItems = []
this.hasSelectedItems = false
//
this.isAssociating = false
this.isDisassociating = false
//
this.showAssociateModal = false
this.$nextTick(() => {
this.showAssociateModal = true
this.loadAssociations()
this.getFenlei()
//
this.associateCurrentPage = 1
//
this.associateList = []
this.associateTotal = 0
//
this.searchMaterialsPost()
})
},
@ -485,6 +605,52 @@ export default {
})
}
},
async getFenlei() {
try {
const res = await getFenleilist({
tree: 1,
sort_type: 'ASC',
sort_name: 'sort'
})
this.fenleiList = this.removeEmptyChildren(res)
} catch (e) {
console.error('获取分类列表失败:', e)
this.$message.error('获取分类列表失败')
}
},
changeAssociateFenlei(e) {
if (e) {
this.associateFenlei = e[e.length - 1]
} else {
this.associateFenlei = ''
}
},
// children=[]
removeEmptyChildren(node) {
if (Array.isArray(node)) {
return node.map(child => {
if (child.children) {
//
child.children = this.removeEmptyChildren(child.children);
// children
if (child.children.length === 0) {
delete child.children;
}
}
return child;
});
}
return [];
},
//
isMaterialAssociated(material) {
if (!this.currentRule || !this.currentRule.equipment_maintain_config_material_infos) {
return false
}
return this.currentRule.equipment_maintain_config_material_infos.some(
item => item.material_info_id === material.id
)
},
saveAssociations() {
const serialized = {}
this.ruleAssociations.forEach((materials, ruleId) => {
@ -507,11 +673,18 @@ export default {
'filter[0][key]': 'zichanmingcheng',
'filter[0][op]': 'like',
'filter[0][value]': this.associateSearch ? this.associateSearch : '',
'filter[1][key]': 'wuzileixing',
'filter[1][op]': 'eq',
'filter[1][value]': '一物一码'
// 'filter[1][key]': 'wuzileixing',
// 'filter[1][op]': 'eq',
// 'filter[1][value]': ''
}
//
if (this.associateFenlei) {
data['filter[1][key]'] = 'fenlei'
data['filter[1][op]'] = 'eq'
data['filter[1][value]'] = this.associateFenlei
}
const res = await request({
url: '/api/admin/material-infos/index',
method: 'post',
@ -526,15 +699,44 @@ export default {
selected: this.ruleAssociations.get(this.currentRule.id)?.has(material.id) || false
}))
this.associateTotal = res.total
//
this.selectedItems = []
this.hasSelectedItems = false
}
} catch (e) {
console.error('获取防汛物资列表失败:', e)
this.$message.error('获取防汛物资列表失败')
console.error('获取物资种类列表失败:', e)
this.$message.error('获取物资种类失败')
}
},
async toggleAssociation(row) {
if (!this.currentRule) return
let equipment_maintain_config_material_infos = this.currentRule.equipment_maintain_config_material_infos
console.log("this.currentRule",this.currentRule,row)
const targetIndex = this.currentRule.equipment_maintain_config_material_infos.findIndex(
item => item.material_info_id === row.id
);
// 3. -1
console.log("targetIndex",targetIndex)
if (targetIndex !== -1) {
equipment_maintain_config_material_infos.splice(targetIndex, 1); // splice(, )
}else{
equipment_maintain_config_material_infos.push({
material_info_id:row.id,
equipment_maintain_config_time:''
})
}
console.log("equipment_maintain_config_material_infos",equipment_maintain_config_material_infos)
// return
await saveMaintainConfig({
id:this.currentRule.id,
equipment_maintain_config_material_infos:equipment_maintain_config_material_infos
})
this.$message.success('操作成功')
this.getList()
this.searchMaterialsPost()
return
if (row.equipment_maintain_config?.id === this.currentRule.id) {
//
try {
@ -550,9 +752,22 @@ export default {
} else {
//
try {
await saveStocksItem({
id: row.id,
equipment_maintain_config_id: this.currentRule.id
// await saveStocksItem({
// id: row.id,
// equipment_maintain_config_id: this.currentRule.id
// })
let equipment_maintain_config_material_infos = []
if(this.currentRule.material_info.length>0){
}else{
equipment_maintain_config_material_infos.push({
material_info_id:row.id,
equipment_maintain_config_time:''
})
}
await saveMaintainConfig({
id:this.currentRule.id,
})
this.$message.success('已成功绑定物资')
this.searchMaterialsPost()
@ -574,10 +789,108 @@ export default {
},
handleAssociateSubmit() {
this.showAssociateModal = false
//
this.associateList = []
this.associateTotal = 0
this.associateCurrentPage = 1
this.selectedItems = []
this.hasSelectedItems = false
this.getList()
},
handleAssociateCancel() {
this.showAssociateModal = false
//
this.associateList = []
this.associateTotal = 0
this.associateCurrentPage = 1
this.selectedItems = []
this.hasSelectedItems = false
},
handleSelectionChange(selection) {
//
if (this.selectionTimer) {
clearTimeout(this.selectionTimer)
}
this.selectionTimer = setTimeout(() => {
this.selectedItems = selection
this.hasSelectedItems = selection.length > 0
}, 100)
},
async batchAssociate() {
if (this.selectedItems.length === 0) {
this.$message.warning('请先选择需要关联的物资')
return
}
this.isAssociating = true
try {
let equipment_maintain_config_material_infos = [...(this.currentRule.equipment_maintain_config_material_infos || [])]
//
this.selectedItems.forEach(item => {
const existingIndex = equipment_maintain_config_material_infos.findIndex(
existing => existing.material_info_id === item.id
)
if (existingIndex === -1) {
equipment_maintain_config_material_infos.push({
material_info_id: item.id,
equipment_maintain_config_time: ''
})
}
})
await saveMaintainConfig({
id: this.currentRule.id,
equipment_maintain_config_material_infos: equipment_maintain_config_material_infos
})
this.$message.success(`批量关联成功,共关联 ${this.selectedItems.length} 项物资`)
this.selectedItems = []
this.hasSelectedItems = false
this.getList()
this.searchMaterialsPost()
} catch (e) {
this.$message.error('批量关联失败')
} finally {
this.isAssociating = false
}
},
async batchDisassociate() {
if (this.selectedItems.length === 0) {
this.$message.warning('请先选择需要取消关联的物资')
return
}
this.isDisassociating = true
try {
let equipment_maintain_config_material_infos = [...(this.currentRule.equipment_maintain_config_material_infos || [])]
//
this.selectedItems.forEach(item => {
const existingIndex = equipment_maintain_config_material_infos.findIndex(
existing => existing.material_info_id === item.id
)
if (existingIndex !== -1) {
equipment_maintain_config_material_infos.splice(existingIndex, 1)
}
})
await saveMaintainConfig({
id: this.currentRule.id,
equipment_maintain_config_material_infos: equipment_maintain_config_material_infos
})
this.$message.success(`批量取消关联成功,共取消关联 ${this.selectedItems.length} 项物资`)
this.selectedItems = []
this.hasSelectedItems = false
this.getList()
this.searchMaterialsPost()
} catch (e) {
this.$message.error('批量取消关联失败')
} finally {
this.isDisassociating = false
}
},
handleAssociatePageSizeChange(size) {
this.associatePageSize = size
@ -586,6 +899,7 @@ export default {
},
resetAssociateSearch() {
this.associateSearch = ''
this.associateFenlei = ''
this.select.storehouses_id = ''
this.select.area = ''
this.associateWarehouseName = ''

@ -255,7 +255,9 @@
//
async getFenlei() {
const res = await getFenleilist({
tree: 1
tree: 1,
sort_type:'ASC',
sort_name:'sort'
})
this.fenleiList = this.removeEmptyChildren(res)
console.log("this.fenleiList", this.fenleiList)

@ -206,7 +206,9 @@
async getFenlei() {
const res = await getFenleilist({
tree: 1
tree: 1,
sort_type:'ASC',
sort_name:'sort'
})
this.fenleiList = this.removeEmptyChildren(res)
},

@ -1,67 +1,68 @@
<template>
<template>
<div class="printwrap">
<Modal v-model="isShow" width="70" title="出库" :loading="showLoading">
<!-- :class="{'watermark':!showwatermark}" -->
<div class="print" id="printmodal">
<div class="printtitle">苏州市河道管理处物资出库记录单</div>
<div class="printtop">
<span>业务科室:{{ form.jieyongbumen }}</span>
<span>编号:{{ form.chukushijian }}-{{ form.id }}</span>
</div>
<table width="100%">
<!-- :class="{'watermark':!showwatermark}" -->
<div class="print" id="printmodal">
<div class="printtitle">苏州市河道管理处物资出库记录单</div>
<div class="printtop">
<span>业务科室:{{ form.jieyongbumen }}</span>
<span>编号:{{ form.chukushijian }}-{{ form.id }}</span>
</div>
<table width="100%">
<tr>
<td>出库日期</td>
<td>出库日期</td>
<td>物资名称</td>
<td>物资类型</td>
<td>批次</td>
<td>批内序号</td>
<!-- <td>批次</td> -->
<td>批内序号</td>
<td>数量</td>
<td>规格</td>
<td>规格</td>
<td>型号</td>
<td v-if="isChange"></td>
</tr>
<td v-if="isChange"></td>
</tr>
<tr v-for="item in mingxiList">
<td>{{ form.chukushijian }}</td>
<td>{{ form.chukushijian }}</td>
<td>{{ item.zichanmingcheng }}</td>
<td>{{ item.wuzileixing }}</td>
<td>{{ item.rukupici }}</td>
<td>
<td>{{ item.wuzileixing }}</td>
<!-- <td>{{ item.rukupici }}</td> -->
<td >
<div v-for="inven in item.inventorys">
{{inven?inven.shunxuhao:''}}
{{inven?'批次:'+inven.rukupici+'-顺序号:'+inven.shunxuhao:''}}
</div>
</td>
</td>
<td>{{ item.wuzileixing==='一物一码'?item.inventorys.length:item.jieyongshuliang }}</td>
<td>{{ item.wuziguige }}</td>
<td>{{ item.wuziguige }}</td>
<td>{{ item.guigexinghao }}</td>
<td v-if="isChange">
<el-button @click="changeWz(item)" v-if="item.wuzileixing==='一物一码'" size="small" type="primary"></el-button>
</td>
<el-button @click="changeWz(item)" size="small" type="primary">更改出库序号</el-button>
</td>
</tr>
<tr>
<td :colspan="isChange?9:8">
<p>备注</p>
<p>{{form.beizhu}}</p>
</td>
</tr>
<tr class="printbottom">
<td :colspan="isChange?4:4" rowspan="4">
<p>经办人签字区</p>
<p>
<span></span>
<span></span>
<span></span>
</p>
</td>
<td :colspan="isChange?5:4" rowspan="4">
<p>仓库管理员签字区</p>
<p><span></span>
<span></span>
<span></span>
</p>
</td>
</tr>
</table>
</tr>
<tr class="printbottom">
<td :colspan="isChange?4:4" rowspan="4">
<p>经办人签字区</p>
<p>
<span></span>
<span></span>
<span></span>
</p>
</td>
<td :colspan="isChange?5:4" rowspan="4">
<p>仓库管理员签字区</p>
<p><span></span>
<span></span>
<span></span>
</p>
</td>
</tr>
</table>
</div>
<!-- 提交记录单 -->
@ -122,12 +123,12 @@
</td>
</tr>
</table>
</div> -->
</div> -->
<template v-slot:footer>
<Button type="info" style="margin-left:5px;margin-bottom:5px;" @click="isShow=false"></Button>
<Button ref="prints" v-print="'#printmodal'" @click="clickPrint" type="primary" style="margin-left:5px;margin-bottom:5px;"></Button>
<Button type="primary" style="margin-left:5px;margin-bottom:5px;" @click="submit"></Button>
</template>
</template>
</Modal>
@ -143,7 +144,20 @@
</div>
<div class="xy-table-item-content">
<el-select multiple v-model="mingxiObj.inventorys_id" style="width: 300px;" placeholder="请选择">
<el-option v-for="item in sxhList" :key="item.id" :label="item.shunxuhao" :value="item.id" />
<el-option-group
v-for="group in sxhList"
:key="group.label"
:label="group.label"
>
<el-option
v-for="option in group.options"
:key="option.id"
:label="option.shunxuhao"
:value="option.id"
>
<span>{{ option.shunxuhao }}</span>
</el-option>
</el-option-group>
</el-select>
</div>
</div>
@ -152,22 +166,22 @@
<Button type="info" style="margin-left:5px;margin-bottom:5px;" @click="mingxiCancel"></Button>
<Button type="primary" style="margin-left:5px;margin-bottom:5px;" @click="mingxiConfirm"></Button>
</template>
</Modal>
</div>
</template>
<script>
// import {
</Modal>
</div>
</template>
<script>
// import {
// show,
// save,
// save,
// } from '@/api/system/baseForm.js'
import {
import {
saveOutbounds,
show
show
} from '@/api/outbounds.js'
import {
Message
import {
Message
} from 'element-ui'
import {
desChuku
@ -178,67 +192,67 @@ import {
import {
index
} from '@/api/inventory.js'
import {deepCopy} from "@/utils/index.js"
export default {
data() {
return {
import {deepCopy} from "@/utils/index.js"
export default {
data() {
return {
isShow: false,
showLoading:false,
isShowMingxi:false,
type: 'print',
isShowMingxi:false,
type: 'print',
id: '',
chukuType: '',
chukuType: '',
tableName: 'outbounds',
showwatermark: true,
isChange:true,
form: {
chukushijian: '',
chukuleixing: '',
jieyongcangku: '',
jieyongbumen: '',
jieyongren: '',
jilurenyuan: '',
beizhu: '',
chukumingxi: ''
isChange:true,
form: {
chukushijian: '',
chukuleixing: '',
jieyongcangku: '',
jieyongbumen: '',
jieyongren: '',
jilurenyuan: '',
beizhu: '',
chukumingxi: ''
},
ywymList:[], //
sxhList:[],
mingxiList: [],
sxhList:[],
mingxiList: [],
fileList: [],
action: process.env.VUE_APP_UPLOAD_API,
headers: {
token: ''
},
mingxiObj:{},
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'print') {
this.getDetail()
}
} else {
this.id = ''
mingxiObj:{},
}
},
watch: {
isShow(newVal) {
if (newVal) {
if (this.type === 'print') {
this.getDetail()
}
} else {
this.id = ''
this.type = 'print'
this.showwatermark = true
this.isChange = true
this.form = {}
this.fileList = []
this.fileList = []
this.mingxiList = []
this.ywymList = []
this.sxhList = []
}
}
},
this.sxhList = []
}
}
},
created() {
this.headers.token = getToken()
},
},
methods: {
clickPrint(){
this.isChange = false
},
},
beforeUpload(file) {
// if (file.size / 1000 > 500) {
// this.$message({
@ -273,11 +287,11 @@ export default {
type: 'warning',
message: err
})
},
async getDetail() {
const res = await show({
id: this.id
})
},
async getDetail() {
const res = await show({
id: this.id
})
this.form = res
// if (res.zhuangtai == 2) {
// this.showwatermark = true
@ -287,17 +301,17 @@ export default {
// res.id_outbounds_items_outbounds_id_relation.map(item=>{
// })
this.ywymList = deepCopy(res.id_outbounds_items_outbounds_id_relation)
this.ywymList = deepCopy(res.id_outbounds_items_outbounds_id_relation)
this.mingxiList = this.mergeSameWuzibianma(res.id_outbounds_items_outbounds_id_relation)
console.log("this.mingxiList",this.mingxiList,this.ywymList)
console.log("this.mingxiList",this.mingxiList,this.ywymList)
},
//
mergeSameWuzibianma(arr) {
// 1. wuzileixing = ""
const yiwuData = arr.filter(item => item.wuzileixing === "一物一码");
const yiwuData = arr.filter(item => item);
// 2. wuzileixing = ""
const yileiData = arr.filter(item => item.wuzileixing === "一类一码");
// const yileiData = arr.filter(item => item.wuzileixing === "");
// 3. wuzibianma
const groups = yiwuData.reduce((acc, item) => {
@ -329,7 +343,7 @@ export default {
});
// 5.
return [...mergedYiwuData, ...yileiData];
return [...mergedYiwuData];
},
changeWz(row){
this.showLoading = true
@ -342,15 +356,36 @@ export default {
},
async getInventory(wzbm){
const res = await index({
page:1,
page_size:999,
page: 1,
page_size: 999,
filter: [ {
'key': 'wuzibianma',
'op': 'like',
'value': wzbm
}]
})
this.sxhList = res.list.data.filter(item=> (Number(item.zaikushuliang) - item.wait_num)>0)
//
const filteredData = res.list.data.filter(item => (Number(item.zaikushuliang) - item.wait_num) > 0)
// rukupici
const groupedData = filteredData.reduce((acc, item) => {
const rukupici = item.rukupici || '未知批次'
if (!acc[rukupici]) {
acc[rukupici] = []
}
acc[rukupici].push({
...item
})
return acc
}, {})
// Element UI
this.sxhList = Object.keys(groupedData).map(rukupici => ({
label: '批次:'+rukupici,
options: groupedData[rukupici]
}))
},
mingxiConfirm(){
console.log("obj",this.mingxiObj)
@ -409,12 +444,12 @@ export default {
const result = [];
mergedArr.forEach(item => {
if (item.wuzileixing === "一类一码") {
result.push(item);
return;
}
// if (item.wuzileixing === "") {
// result.push(item);
// return;
// }
if (item.wuzileixing === "一物一码") {
// if (item.wuzileixing === "") {
const len = Math.min(
item.id?.length || 0,
item.inventorys_id?.length || 0,
@ -428,18 +463,18 @@ export default {
splitItem.inventorys = item.inventorys[i];
result.push(splitItem);
}
}
// }
});
return result;
},
},
handlePrint() {
if (this.chukuType == '领用') {
this.$Print('#printmodal')
} else if (this.chukuType == '处置') {
this.$Print('#printmodal1')
}
},
}
},
submit() {
if(!this.form.qianzi || (this.form.qianzi && this.form.qianzi.length<1)){
Message({
@ -447,7 +482,7 @@ export default {
message: '请上传签字确认单'
})
return
}
}
this.form.zhuangtai = 3
saveOutbounds({
table_name: this.tableName,
@ -464,13 +499,13 @@ export default {
})
this.isShow = false
this.$emit('refresh')
})
}
}
}
</script>
})
}
}
}
</script>
<style scoped>
@media print {
@page {
@ -479,45 +514,45 @@ export default {
body, html,div{
height: auto!important;
}
}
.print {}
.printtitle {
text-align: center;
font-size: 24px;
font-weight: bold;
}
.printtop {
display: flex;
justify-content: space-between;
font-size: 18px
}
.print table {
font-size: 18px;
border-collapse: collapse;
margin-top: 20px;
}
.print table tr {}
.print table td {
padding: 10px;
border: 1px solid #ddd;
}
.printbottom {}
.printbottom td {}
.printbottom td p {
text-align: left;
}
.printbottom td>p:first-child+p {
padding-top: 80px;
text-align: right;
}
.print {}
.printtitle {
text-align: center;
font-size: 24px;
font-weight: bold;
}
.printtop {
display: flex;
justify-content: space-between;
font-size: 18px
}
.print table {
font-size: 18px;
border-collapse: collapse;
margin-top: 20px;
}
.print table tr {}
.print table td {
padding: 10px;
border: 1px solid #ddd;
}
.printbottom {}
.printbottom td {}
.printbottom td p {
text-align: left;
}
.printbottom td>p:first-child+p {
padding-top: 80px;
text-align: right;
}
.printbottom td p span{
margin-left:30px;
@ -539,5 +574,5 @@ export default {
z-index: 1;
pointer-events: none;
}
</style>

@ -1,14 +1,14 @@
<template>
<div>
<template>
<div>
<div class="button-wrap">
<Button type="primary" @click="editorChuku('','add','领用出库')"></Button>
<Button type="primary" @click="editorChuku('','add','处置出库')"></Button>
<Button type="primary" @click="editorChuku('','add','调令出库')"></Button>
</div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
</div>
<div ref="lxHeader">
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<slot>
<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
<el-input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="经办人搜索" />
<el-select v-model="select.chukuleixing" style="width: 200px;margin-right: 10px;" placeholder="出库类型" clearable>
<el-option v-for="item in chukuTypeList" :key="item.id" :value="item.id" :label="item.value"></el-option>
@ -17,19 +17,19 @@
<el-option v-for="item in statusList" :key="item.id" :value="item.id" :label="item.value"></el-option>
</el-select>
<el-date-picker type="date" placeholder="发起日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="select.created_at" style="width: 200px;margin-right: 10px;" />
<el-date-picker type="date" placeholder="出库日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="select.chukushijian" style="width: 200px;margin-right: 10px;" />
<Button type="primary" @click="getindex"></Button>
</div>
</slot>
</lx-header>
</div>
<el-date-picker type="date" placeholder="出库日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="select.chukushijian" style="width: 200px;margin-right: 10px;" />
<Button type="primary" @click="getindex"></Button>
</div>
</slot>
</lx-header>
</div>
<xy-table
v-loading="loading"
:list="list"
:total="total"
:table-item="table"
@pageSizeChange="e => select.pageSize = e"
@pageSizeChange="e => select.pageSize = e"
@pageIndexChange="pageChange"
>
<template v-slot:zhuangtai>
@ -42,16 +42,16 @@
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="300" header-align="center">
</template>
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="300" header-align="center">
<template slot-scope="scope">
<template v-if="scope.row.jilurenyuan==authName||isCkName=='仓库管理员'||roleName=='系统管理员'">
<!-- <Button v-if="scope.row.zhuangtai==='已办结'" type="primary" size="small" style="margin-left: 10px;" @click="printChuku(scope.row.id,scope.row.chukuleixing)"></Button>
<Button type="primary" size="small" style="margin-left: 10px;" @click="editorChuku(scope.row.id,'editor',scope.row.chukuleixing)"></Button>
<Button v-if="scope.row.zhuangtai==='待处理'" type="primary" size="small" style="margin-left: 10px;" @click="toOaFollow(scope.row.id,scope.row.chukuleixing)"></Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteChuku(scope.row)">
<Button type="error" style="margin-left: 10px;" size="small" ghost>删除</Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="deleteChuku(scope.row)">
<Button type="error" style="margin-left: 10px;" size="small" ghost>删除</Button>
</Poptip> -->
<template v-if="scope.row.zhuangtai==3 || scope.row.zhuangtai==1">
@ -65,7 +65,7 @@
<Button v-if="scope.row.zhuangtai==0 || scope.row.zhuangtai==4" style="margin-right: 10px;" type="primary" size="small"
@click="toOaFollow(scope.row,scope.row.chukuleixing)">发起流程</Button>
<!-- v-if="scope.row.zhuangtai==2 &&(isCkName=='仓库管理员'||roleName=='系统管理员')" -->
<Button v-if="scope.row.zhuangtai==2 &&(isCkName==''||roleName=='')" style="margin-right: 10px;" type="primary" size="small"
<Button style="margin-right: 10px;" type="primary" size="small"
@click="printChuku(scope.row.id)">确认出库</Button>
<Poptip v-if="scope.row.zhuangtai==0" transfer confirm title="确认要删除该出库记录?"
@ -74,27 +74,27 @@
</Poptip>
</template>
</template>
</template>
</el-table-column>
</template>
</xy-table>
<addoutbounds ref="addoutbounds" @refresh="getindex" />
<printoutbounds ref="printoutbounds" @refresh="getindex" />
<imports ref="imports" :table-name="customForm.tableName" :form-info="form" @refresh="getindex" />
<showChuku ref="showChuku" @refresh="getindex"></showChuku>
</div>
</template>
<script>
import {
index,
destroy
</template>
</template>
</el-table-column>
</template>
</xy-table>
<addoutbounds ref="addoutbounds" @refresh="getindex" />
<printoutbounds ref="printoutbounds" @refresh="getindex" />
<imports ref="imports" :table-name="customForm.tableName" :form-info="form" @refresh="getindex" />
<showChuku ref="showChuku" @refresh="getindex"></showChuku>
</div>
</template>
<script>
import {
index,
destroy
} from '@/api/system/baseForm.js'
import {
delOutbounds
import {
delOutbounds
} from '@/api/outbounds.js'
import {
getInfo
@ -102,42 +102,42 @@ import {
import {
getOutboundsStatus,
getOatoken
} from '@/api/contract.js'
} from '@/api/contract.js'
import addoutbounds from './component/addoutbounds.vue'
import showChuku from './component/showChuku.vue'
import printoutbounds from './component/printoutbounds.vue'
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'
export default {
components: {
import printoutbounds from './component/printoutbounds.vue'
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'
export default {
components: {
addoutbounds,
showChuku,
showChuku,
imports,
printoutbounds
},
data() {
printoutbounds
},
data() {
return {
loading: false,
userName: '',
authName: '',
roleName: '',
isCkName: '',
select: {
pageSize: 10,
pageIndex: 1,
isCkName: '',
select: {
pageSize: 10,
pageIndex: 1,
keyword: '',
chukuleixing: '',
zhuangtai:'',
created_at:'',
chukushijian:''
chukushijian:''
},
chukuTypeList: [{
id: '领用出库',
@ -169,26 +169,26 @@ export default {
id:4,
value:'退回',
type:'danger'
}],
customForm: {
customFormId: '',
tableName: ''
}],
customForm: {
customFormId: '',
tableName: ''
},
wuziguanli_oatoken: '',
form: [],
total: 0,
list: [],
table: [{
label: '序号',
type: 'index',
wuziguanli_oatoken: '',
form: [],
total: 0,
list: [],
table: [{
label: '序号',
type: 'index',
fixed: 'left',
width: 80
}, {
label: '出库日期',
width: 180,
prop: 'chukushijian',
align: 'center',
fixed: 'left'
width: 80
}, {
label: '出库日期',
width: 180,
prop: 'chukushijian',
align: 'center',
fixed: 'left'
},
{
label: '出库类型',
@ -201,24 +201,24 @@ export default {
width: 180,
prop: 'zhuangtai',
align: 'center'
},
// {
// label: '',
// width: 180,
// prop: 'jieyongcangku',
// align: 'center'
// },
{
label: '借用部门',
width: 180,
prop: 'jieyongbumen',
align: 'center'
},
{
label: '经办人',
width: 180,
},
// {
// label: '',
// width: 180,
// prop: 'jieyongcangku',
// align: 'center'
// },
{
label: '借用部门',
width: 180,
prop: 'jieyongbumen',
align: 'center'
},
{
label: '经办人',
width: 180,
prop: 'jilurenyuan',
align: 'center'
align: 'center'
},
{
label: '出库详情',
@ -237,21 +237,21 @@ export default {
return
}
}
},
{
label: '备注',
prop: 'beizhu',
align: 'left'
},
{
label: '备注',
prop: 'beizhu',
align: 'left'
},
{
label: '发起时间',
prop: 'created_at',
align: 'center',
width:180
}
]
}
},
}
]
}
},
mounted() {
// if (this.$route.path) {
// const path = this.$route.path.split('_')[1]
@ -263,12 +263,12 @@ export default {
if(this.$route.query.oaType==='wuzi'){
this.editorChuku('','add',this.$route.query.chukuType)
}
this.getUserName()
this.getUserName()
this.getindex()
getOatoken().then(res => {
this.wuziguanli_oatoken = res.oatoken
})
},
},
methods: {
showChukuDetail(id){
this.$refs['showChuku'].id = id
@ -288,13 +288,13 @@ export default {
}
}
}).catch(error => {})
},
},
async getindex() {
this.loading = true
const res = await index({
this.loading = true
const res = await index({
page_size: this.select.pageSize,
page: this.select.pageIndex,
table_name: 'outbounds',
page: this.select.pageIndex,
table_name: 'outbounds',
filter: [{ 'key': 'jilurenyuan', 'op': 'like', 'value': this.select.keyword },
{ 'key': 'chukuleixing', 'op': 'like', 'value': this.select.chukuleixing ? this.select.chukuleixing : '' },
{ 'key': 'created_at', 'op': 'like', 'value': this.select.created_at ? this.select.created_at : '' },
@ -303,24 +303,24 @@ export default {
'key': 'zhuangtai',
'op': 'like',
'value': this.select.zhuangtai ? this.select.zhuangtai : (this.select.zhuangtai===0?0:'')
}]
}]
})
this.list = res.data
})
this.list = res.data
this.total = res.total
this.loading = false
},
pageChange(e) {
this.loading = false
},
pageChange(e) {
this.select.pageIndex = e
this.getindex()
},
this.getindex()
},
editorChuku(id, type, leixing) {
if (id) {
this.$refs['addoutbounds'].id = id
}
this.$refs['addoutbounds'].authName = this.authName
this.$refs['addoutbounds'].isShow = true
}
this.$refs['addoutbounds'].authName = this.authName
this.$refs['addoutbounds'].isShow = true
this.$refs['addoutbounds'].type = type
this.$refs['addoutbounds'].chukuType = leixing
},
@ -354,30 +354,30 @@ export default {
if(this.$route.query.oaType==='wuzi'){
window.history.back()
}
},
deleteChuku(row) {
// return
delOutbounds({
id: row.id,
},
deleteChuku(row) {
// return
delOutbounds({
id: row.id,
// table_name: 'outbounds',
// destroy_relation: ['id_outbounds_items_outbounds_id_relation']
}).then(res => {
Message({
type: 'success',
message: '删除成功'
})
this.getindex()
})
}
}
}
</script>
// destroy_relation: ['id_outbounds_items_outbounds_id_relation']
}).then(res => {
Message({
type: 'success',
message: '删除成功'
})
this.getindex()
})
}
}
}
</script>
<style scoped lang="scss">
.button-wrap{
button{
margin-right:10px;
}
}
}
</style>

@ -2,7 +2,7 @@
<div>
<el-dialog :visible.sync="isShowMingxi" :modal="false" width="80%" title="新增明细">
<el-form ref="form" :model="formData" :rules="rules" label-width="100px">
<!-- 不是归还入库的 选择物资档案信息 -->
<!-- 不是归还入库的 选择物资档案信息 -->
<!-- <el-form-item label="种类编码" prop="wuzibianma">
<template v-if="rukuleixing!='归还入库'">
@ -18,18 +18,18 @@
</template>
</el-form-item> -->
<el-form-item label="物资名称" prop="zichanmingcheng">
<!-- <el-input v-model="formData.zichanmingcheng" disabled /> -->
<template v-if="rukuleixing!='归还入库'">
<el-input v-model="formData.zichanmingcheng" @focus="showMaterial">
<el-button slot="append" @click="addMaterial"></el-button>
</el-input>
</template>
<template v-else>
<!-- @change="getKucunShow" -->
<el-input ref="huikubianma" v-model="formData.zichanmingcheng" placeholder=""
@focus="showInventorys">
<el-button slot="append" @click="showInventorys"></el-button>
</el-input>
<!-- <el-input v-model="formData.zichanmingcheng" disabled /> -->
<template v-if="rukuleixing!='归还入库'">
<el-input v-model="formData.zichanmingcheng" @focus="showMaterial">
<el-button slot="append" @click="addMaterial"></el-button>
</el-input>
</template>
<template v-else>
<!-- @change="getKucunShow" -->
<el-input ref="huikubianma" v-model="formData.zichanmingcheng" placeholder=""
@focus="showInventorys">
<el-button slot="append" @click="showInventorys"></el-button>
</el-input>
</template>
</el-form-item>
<el-form-item label="所属种类" prop="fenlei">
@ -47,28 +47,28 @@
<el-form-item label="单位" prop="jiliangdanwei">
<el-input v-model="formData.jiliangdanwei" disabled />
</el-form-item>
<el-form-item label="储备年限" prop="chubeinianxian">
<el-input v-model="formData.chubeinianxian" disabled />
</el-form-item>
<el-form-item label="存放要求" prop="cunfangyaoqiu">
<el-input v-model="formData.cunfangyaoqiu" disabled />
</el-form-item>
<el-form-item label="维护要求" prop="weihuyaoqiu">
<el-input v-model="formData.weihuyaoqiu" disabled />
</el-form-item>
<el-form-item label="保养频次" prop="equipment_maintain_config_id">
<el-select disabled v-model="formData.equipment_maintain_config_id" popper-class="select_popper" style="width: 100%;"
placeholder="请选择保养频次" clearable>
<el-option v-for="item in configList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="储备年限" prop="chubeinianxian">
<el-input v-model="formData.chubeinianxian" disabled />
</el-form-item>
<el-form-item label="存放要求" prop="cunfangyaoqiu">
<el-input v-model="formData.cunfangyaoqiu" disabled />
</el-form-item>
<el-form-item label="维护要求" prop="weihuyaoqiu">
<el-input v-model="formData.weihuyaoqiu" disabled />
</el-form-item>
<el-form-item label="保养频次" prop="equipment_maintain_config_id">
<el-select disabled v-model="formData.equipment_maintain_config_id" popper-class="select_popper" style="width: 100%;"
placeholder="请选择保养频次" clearable>
<el-option v-for="item in configList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="在库数量" prop="zaikushuliang">
<el-input v-model="formData.zaikushuliang" disabled />
</el-form-item>
</el-form-item>
<!-- v-if="formData.wuzileixing=='一类一码' && rukuleixing!='归还入库'" -->
<el-form-item label="入库批次" prop="rukupici">
<el-input v-model="formData.rukupici" disabled/>
<el-input v-model="formData.rukupici" disabled/>
<!-- <el-select v-model="formData.rukupici" style="width:100%" filterable clearable allow-create
default-first-option placeholder="入库批次" @change="changePici">
<el-option v-for="item in rukupiciList" :key="item.value" :label="item.label" :value="item.value" />
@ -84,12 +84,12 @@
<el-form-item label="入库日期" prop="rukuriqi">
<el-date-picker v-model="formData.rukuriqi" :disabled="hasPici" style="width:100%" value-format="yyyy-MM-dd"
type="date" placeholder="选择日期" />
</el-form-item>
<el-form-item label="物资状态" prop="wuzizhuangtai">
<el-select v-model="formData.wuzizhuangtai" :disabled="hasPici" style="width:100%" placeholder="请选择物资状态">
<el-option v-for="item in paraOptions.materials_status" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="物资状态" prop="wuzizhuangtai">
<el-select v-model="formData.wuzizhuangtai" :disabled="hasPici" style="width:100%" placeholder="请选择物资状态">
<el-option v-for="item in paraOptions.materials_status" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="所在仓库" prop="suozaicangku">
<el-select v-model="formData.suozaicangku" :disabled="hasPici" style="width:100%" placeholder="请选择所在仓库"
@ -121,18 +121,16 @@
<el-option v-for="item in paraOptions.materials_property" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</el-form-item>
<!-- <el-form-item label="是否为固定资产" prop="shifouweigudingzichan">
<el-select v-model="formData.chanquanxinxi" :disabled="hasPici" style="width:100%" placeholder="请选择">
<el-option v-for="item in [{id:'',value:''},{id:'',value:''}]" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="固定资产编码" prop="gudingzichanbianma">
<el-input v-model="formData.gudingzichanbianma"/>
</el-form-item> -->
</el-form-item>
<el-form-item label="是否为固定资产" prop="shifouweigudingzichan">
<el-select v-model="formData.shifouweigudingzichan" :disabled="hasPici" style="width:100%" placeholder="请选择">
<el-option v-for="item in [{id:'',value:''},{id:'',value:''}]" :key="item.id" :label="item.value"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="固定资产编码" prop="gudingzichanbianma">
<el-input v-model="formData.gudingzichanbianma"/>
</el-form-item>
</el-form>
<div slot="footer" align="right">
@ -159,7 +157,7 @@
import {
index as indexInventory,
show as showInventory
} from '@/api/inventory.js'
} from '@/api/inventory.js'
import { getMaintainConfigList } from '@/api/maintenance/maintenance.js'
import {
getparameteritemMore
@ -178,7 +176,7 @@
},
data() {
return {
return {
configList: [],
isShowMingxi: false,
//
@ -215,8 +213,9 @@
chanquanxinxi: '',
cunfangyaoqiu: '',
weihuyaoqiu: '',
equipment_maintain_config_id: ''
equipment_maintain_config_id: '',
shifouweigudingzichan:'',
gudingzichanbianma:''
},
rukupiciList: [],
rules: {
@ -248,45 +247,45 @@
if (newVal === '归还入库') {
this.hasPici = true
}
},
isShowMingxi(val){
if(val){
}else{
this.hasPici = false
this.resetForm()
}
},
},
isShowMingxi(val){
if(val){
}else{
this.hasPici = false
this.resetForm()
}
},
},
created() {
this.getData()
this.getCangku()
this.getCangku()
this.getConfig()
},
methods: {
//
setPici(e,date){
if(this.rukuleixing!='归还入库'){
this.formData.rukupici = e
}
this.formData.rukuriqi = date?date:''
},
//
async getConfig() {
try {
const res = await getMaintainConfigList({
page: 1,
page_size: 999
//
})
if (res && res.data) {
this.configList = res.data
}
} catch (e) {
this.$message.error('获取运维规则列表失败')
}
methods: {
//
setPici(e,date){
if(this.rukuleixing!='归还入库'){
this.formData.rukupici = e
}
this.formData.rukuriqi = date?date:''
},
//
async getConfig() {
try {
const res = await getMaintainConfigList({
page: 1,
page_size: 999
//
})
if (res && res.data) {
this.configList = res.data
}
} catch (e) {
this.$message.error('获取运维规则列表失败')
}
},
//
async getData() {
@ -327,7 +326,7 @@
this.formData.zaikushuliang = 0
this.formData.chubeinianxian = e.chubeinianxian
this.formData.cunfangyaoqiu = e.cunfangyaoqiu
this.formData.weihuyaoqiu = e.weihuyaoqiu
this.formData.weihuyaoqiu = e.weihuyaoqiu
this.formData.chubeinianxian = e.chubeinianxian
this.formData.equipment_maintain_config_id = e.equipment_maintain_config_id?parseFloat(e.equipment_maintain_config_id):''
},
@ -418,11 +417,11 @@
page: 1,
table_name: 'materialstorages',
sort_name: 'sort',
sort_type: 'ASC',
filter: [{
key: 'shifouzili',
op: 'eq',
value: '是'
sort_type: 'ASC',
filter: [{
key: 'shifouzili',
op: 'eq',
value: '是'
}]
})
this.cangkuList = res.data
@ -443,11 +442,11 @@
},
//
showInventorys() {
showInventorys() {
this.$refs.inventorysSelect.isHuiku = true
this.$refs.inventorysSelect.isShowWuzi = true
},
mingxiCancel() {
mingxiCancel() {
this.hasPici = false
this.isShowMingxi = false
this.resetForm()
@ -493,7 +492,9 @@
chanquanxinxi: '',
cunfangyaoqiu: '',
weihuyaoqiu: '',
equipment_maintain_config_id: ''
equipment_maintain_config_id: '',
shifouweigudingzichan:'',
gudingzichanbianma:''
}
}
}
@ -514,4 +515,4 @@
flex-basis: 50%;
}
}
</style>
</style>

@ -32,6 +32,19 @@
</el-select>
</div>
</div>
</template>
<template v-slot:quyu>
<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.quyu" style="width:300px" filterable placeholder="请选择">
<el-option v-for="item in quyuList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:gongsi>
<div class="xy-table-item">
@ -168,12 +181,13 @@ export default {
duizhang: '',
lianxidianhua: '',
renshu: '',
// quyu: '',
quyu: '',
dizhi: '',
jingdu: '',
weidu: '',
duiyuan: []
},
quyuList:[],
shuxingList:[{
label:'自管队伍',
value:'自管队伍'
@ -186,7 +200,11 @@ export default {
mingcheng: [{
required: true,
message: '请填写队伍名称'
}]
}],
quyu:[{
required: true,
message: '请选择区域'
}],
}
}

@ -79,35 +79,48 @@
<el-button type="primary" style="margin-bottom:10px" size="small" @click="addRow"></el-button>
<xy-table style="width:850px" :list="form.travel_info" :isPage="false" :height="350"
:table-item="detail_item">
<template v-slot:start>
<el-table-column align='left' label="出发地" width="180">
<template v-slot:start>
<el-table-column align='left' label="出发地" width="220">
<template slot-scope="scope">
<el-input placeholder="请输入出发地" style="width:100%" v-model="scope.row.start"></el-input>
</template>
</el-table-column>
</template>
<template v-slot:end>
<el-table-column align='left' label="目的地" width="220">
<template slot-scope="scope">
<avue-input-map
v-model="scope.row.mapform"
:params="mapparams"
style="width:100%"
placeholder="请选择地图"
@input="(val) => handleMapChange(val, scope.$index)"
/>
</template>
</el-table-column>
</template>
<template v-slot:start_time>
<el-table-column align='left' label="开始时间" width="220">
<template slot-scope="scope">
<el-date-picker format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
v-model="scope.row.start_time" style="width:195px" type="datetime" placeholder="选择时间">
</el-date-picker>
</template>
</el-table-column>
</template>
<template v-slot:end_time>
<el-table-column align='left' label="结束时间" width="220">
<template slot-scope="scope">
<el-date-picker format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
v-model="scope.row.end_time" style="width:195px" type="datetime" placeholder="选择时间">
</el-date-picker>
</template>
</el-table-column>
</template>
<template v-slot:remark>
<el-table-column align='left' label="备注" width="180">
<template slot-scope="scope">
<el-input placeholder="请输入出发地" style="width:100%" v-model="scope.row.start"></el-input>
</template>
</el-table-column>
</template>
<template v-slot:end>
<el-table-column align='left' label="目的地" width="180">
<template slot-scope="scope">
<el-input placeholder="请输入目的地" style="width:100%" v-model="scope.row.end"></el-input>
</template>
</el-table-column>
</template>
<template v-slot:start_time>
<el-table-column align='left' label="开始时间" width="180">
<template slot-scope="scope">
<el-date-picker format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
v-model="scope.row.start_time" style="width:300px" type="datetime" placeholder="选择时间">
</el-date-picker>
</template>
</el-table-column>
</template>
<template v-slot:end_time>
<el-table-column align='left' label="结束时间" width="180">
<template slot-scope="scope">
<el-date-picker format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
v-model="scope.row.end_time" style="width:300px" type="datetime" placeholder="选择时间">
</el-date-picker>
<el-input placeholder="请输入备注" style="width:100%" v-model="scope.row.remark"></el-input>
</template>
</el-table-column>
</template>
@ -159,6 +172,9 @@
travel_info: []
},
teamList: [],
mapparams: {
zoom: 11
},
detail_item: [{
label: "出发地",
prop: 'start'
@ -171,6 +187,9 @@
}, {
label: "结束时间",
prop: 'end_time'
}, {
label: "备注",
prop: 'remark'
}],
rules: {
start_date: [{
@ -209,11 +228,26 @@
end: '',
start_time: '',
end_time: '',
remark: '',
longitude: '',
latitude: '',
mapform: []
})
},
delRow(obj, index) {
this.form.travel_info.splice(index, 1);
},
handleMapChange(val, index) {
console.log('地图选点变化:', val, index)
//
if (val && val.length >= 3) {
this.form.travel_info[index].longitude = val[0]
this.form.travel_info[index].latitude = val[1]
this.form.travel_info[index].end = val[2]
//
this.$set(this.form.travel_info, index, { ...this.form.travel_info[index] })
}
},
async getTeams() {
const res = await index({
table_name: 'teams',
@ -226,45 +260,61 @@
const res = await show({
id: this.id
})
this.$integrateData(this.form, res)
this.$integrateData(this.form, res)
this.form.travel_info = res.travel_info?res.travel_info:[]
//
if (this.form.travel_info && this.form.travel_info.length > 0) {
this.form.travel_info.forEach(item => {
if (item.longitude && item.latitude && item.end) {
item.mapform = [item.longitude, item.latitude, item.end]
} else {
item.mapform = []
}
})
}
},
submit() {
if (this.form.travel_info.length > 0) {
//
for (var p of this.form.travel_info) {
if (!p.start) {
this.$message({
type: 'warning',
message: `行程信息出发地不能为空`
})
return
}
if (!p.end) {
this.$message({
type: 'warning',
message: `行程信息目的地不能为空`
})
return
}
if (!p.start_time) {
this.$message({
type: 'warning',
message: `行程信息开始时间不能为空`
})
return
}
if (!p.end_time) {
this.$message({
type: 'warning',
message: `行程信息结束时间不能为空`
})
return
}
}
}
submit() {
if (this.form.travel_info.length > 0) {
//
for (var p of this.form.travel_info) {
if (!p.start) {
this.$message({
type: 'warning',
message: `行程信息出发地不能为空`
})
return
}
// endmapform
if (!p.end && p.mapform && p.mapform.length >= 3) {
p.end = p.mapform[2]
p.longitude = p.mapform[0]
p.latitude = p.mapform[1]
}
if (!p.end) {
this.$message({
type: 'warning',
message: `行程信息目的地不能为空`
})
return
}
if (!p.start_time) {
this.$message({
type: 'warning',
message: `行程信息开始时间不能为空`
})
return
}
if (!p.end_time) {
this.$message({
type: 'warning',
message: `行程信息结束时间不能为空`
})
return
}
}
}
if (this.type === 'add') {
save({
@ -303,4 +353,4 @@
::v-deep .xy-table-item-label {
min-width: 160px !important
}
</style>
</style>

@ -4,15 +4,22 @@
<lx-header icon="md-apps" :text="$route.meta.title" 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="名称搜索" />
<el-input v-model="select.keyword" style="width: 200px;margin-right: 10px;" placeholder="名称搜索" />
<el-select style="width: 200px;margin-right: 10px;" clearable v-model="select.duiwushuxing" placeholder="请选择队伍属性">
<el-option v-for="item in shuxingList" :key="item.label" :label="item.label" :value="item.label" />
</el-select>
<el-select style="width: 200px;margin-right: 10px;" clearable v-model="select.quyu" placeholder="请选择区域">
<el-option v-for="item in quyuList" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
<Button type="primary" @click="getList"></Button>
<Button
<el-button type="primary" @click="getList"></el-button>
<el-button
type="primary"
style="margin-left: 10px;"
@click="$refs['addTeam'].type='add',
@click="$refs['addTeam'].type='add',
$refs['addTeam'].quyuList = quyuList,
$refs['addTeam'].isShow=true"
>添加</Button>
>添加</el-button>
<!-- <Button icon="ios-add" type="primary" style="margin-left: 10px;"
@click="$refs['imports'].show()">导入</Button> -->
</div>
@ -26,7 +33,16 @@
:table-item="table"
@pageSizeChange="pageSizeChange"
@pageIndexChange="pageChange"
>
>
<template v-slot:quyu>
<el-table-column label="区域" width="120" header-align="center">
<template slot-scope="scope">
<div v-for="item in quyuList">
<div style="text-align: center;" v-if="scope.row.quyu===item.id">{{item.value}}</div>
</div>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column fixed="right" label="操作" width="260" header-align="center">
<template slot-scope="scope">
@ -35,7 +51,8 @@
type="primary"
size="small"
@click="$refs['addTeam'].type='editor',
$refs['addTeam'].id=scope.row.id,
$refs['addTeam'].id=scope.row.id,
$refs['addTeam'].quyuList = quyuList,
$refs['addTeam'].isShow=true"
>编辑</Button>
<Poptip transfer confirm title="确认要删除吗?" @on-ok="delRow(scope.row.id)">
@ -68,7 +85,8 @@ import {
destroy
} from '@/api/system/baseForm.js'
import addTeam from './components/addTeam.vue'
import showTeam from './components/showTeam.vue'
import showTeam from './components/showTeam.vue'
import {getparameteritem} from "@/api/system/dictionary.js"
export default {
components: {
addTeam,
@ -80,10 +98,13 @@ export default {
page: 1,
page_size: 10,
keyword: '',
table_name: 'teams'
table_name: 'teams',
quyu:'',
duiwushuxing:''
},
total: 0,
list: [],
quyuList:[],
shuxingList:[{
label:'自管队伍',
value:'自管队伍'
@ -108,6 +129,11 @@ export default {
width: 120,
align: 'center'
}, {
label: '区域',
prop: 'quyu',
width: 120,
align: 'center'
},{
label: '公司',
prop: 'gongsi',
align: 'left',
@ -129,11 +155,6 @@ export default {
prop: 'renshu',
width: 120
},
// {
// label: '',
// prop: 'quyu',
// width: 120
// },
{
label: '地址',
prop: 'dizhi',
@ -149,7 +170,8 @@ export default {
}
},
created() {
this.getList()
this.getList()
this.getQu()
},
methods: {
async getList() {
@ -159,10 +181,22 @@ export default {
key: 'mingcheng',
op: 'like',
value: this.select.keyword
},{
key: 'quyu',
op: 'like',
value: this.select.quyu?this.select.quyu:''
},{
key: 'duiwushuxing',
op: 'like',
value: this.select.duiwushuxing?this.select.duiwushuxing:''
}]
})
this.list = res.data
this.total = res.total
},
async getQu(){
const res = await getparameteritem('area')
this.quyuList = res.detail
},
pageChange(e) {
this.select.page = e

Loading…
Cancel
Save