ZW_MultiSelect/wms-vue/src/components/duochaxun/Zhengliqingdan.vue

959 lines
29 KiB
Vue
Raw Normal View History

2024-03-21 09:46:25 +08:00
<template>
2024-04-03 14:41:00 +08:00
<div class="div1" style="height: 100%">
2024-03-21 09:46:25 +08:00
<div class="div2" style="padding-bottom: 10px">
2024-03-29 15:33:25 +08:00
<el-form ref="form" :model="param" label-width="80px">
<el-row :gutter="24">
<el-col :span="4">
<el-form-item label="采购单号:">
2024-04-03 09:27:11 +08:00
<el-input type="text" v-model="param.sourceId" :rows="1"></el-input>
2024-03-29 15:33:25 +08:00
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="收货凭证:" >
<el-input type="textarea" v-model="param.strBill7" :rows="1"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="料号:">
2024-04-03 09:27:11 +08:00
<el-input type="textarea" v-model="param.i_CODE" :rows="1"></el-input>
2024-03-29 15:33:25 +08:00
</el-form-item>
</el-col>
2024-04-03 09:27:11 +08:00
<el-col :span="4">
<el-form-item label="物料描述:">
<el-input type="text" v-model="param.i_name" :rows="1"></el-input>
</el-form-item>
</el-col>
2024-03-29 15:33:25 +08:00
<el-col :span="4">
2024-04-03 09:27:11 +08:00
<el-form-item label="库区:">
<el-select v-model="param.z_name" multiple filterable placeholder="请选择库区" style="width: 100%;">
2024-03-29 15:33:25 +08:00
<el-option
2024-04-03 09:27:11 +08:00
v-for="item in name"
2024-04-02 09:33:41 +08:00
:key="item.ID"
2024-04-03 09:27:11 +08:00
:label="item.name"
:value="item.name"
2024-03-29 15:33:25 +08:00
>
</el-option>
</el-select>
</el-form-item>
</el-col>
2024-04-03 09:27:11 +08:00
<el-col :span="4">
<el-form-item label="库位号:">
<el-input type="textarea" v-model="param.lc_CODE" :rows="1"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="24" v-show="isShow">
<el-col :span="4">
<el-form-item label="批次号:">
<el-input type="text" v-model="param.PROP_C1" :rows="1"></el-input>
</el-form-item>
</el-col>
2024-03-29 15:33:25 +08:00
<el-col :span="4">
<el-form-item label="LOC:">
2024-04-02 09:33:41 +08:00
<el-select v-model="param.PROP_C2" multiple filterable placeholder="请选择LOC" style="width: 100%;">
2024-03-29 15:33:25 +08:00
<el-option
2024-04-03 09:27:11 +08:00
v-for="item in loc"
2024-04-02 09:33:41 +08:00
:key="item.ID"
:label="item.PROP_C2"
:value="item.PROP_C2"
2024-03-29 15:33:25 +08:00
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
2024-04-03 09:27:11 +08:00
<el-form-item label="特殊标记:">
<el-input type="text" v-model="param.PROP_C3"></el-input>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="工厂:">
<el-select v-model="param.PROP_C9" multiple filterable placeholder="请选择工厂" style="width: 100%;">
<el-option
v-for="item in plant"
:key="item.ID"
:label="item.PROP_C9"
:value="item.PROP_C9"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="整理人:">
<el-input type="textarea" v-model="param.OPERATOR" :rows="1"></el-input>
2024-03-29 15:33:25 +08:00
</el-form-item>
</el-col>
2024-04-03 09:27:11 +08:00
<el-col :span="4">
<el-form-item label="SAP接口:">
<el-input type="text" v-model="param.a_CODE"></el-input>
</el-form-item>
</el-col>
2024-03-29 15:33:25 +08:00
</el-row>
2024-04-03 09:27:11 +08:00
<el-row :gutter="24" v-show="isShow">
2024-03-29 15:33:25 +08:00
<el-col :span="8">
2024-04-03 09:27:11 +08:00
<el-form-item label="整理日期:">
2024-03-29 15:33:25 +08:00
<el-date-picker style="width: 325px"
2024-04-03 09:27:11 +08:00
v-model="param.RECEIVE_DATE"
2024-03-29 15:33:25 +08:00
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
2024-04-03 09:27:11 +08:00
<el-form-item label="收货日期:">
2024-03-29 15:33:25 +08:00
<el-date-picker style="width: 325px"
2024-04-03 09:27:11 +08:00
v-model="param.ORDER_DATE"
2024-03-29 15:33:25 +08:00
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="4">
2024-04-03 09:27:11 +08:00
<el-form-item label="备注:">
<el-input type="text" v-model="param.description"></el-input>
2024-03-29 15:33:25 +08:00
</el-form-item>
</el-col>
2024-04-03 09:27:11 +08:00
2024-03-29 15:33:25 +08:00
<el-col :span="4">
2024-04-03 09:27:11 +08:00
<el-form-item label="容器码:">
<el-input type="textarea" v-model="param.LP" :rows="1"></el-input>
2024-03-29 15:33:25 +08:00
</el-form-item>
</el-col>
</el-row>
2024-04-03 09:27:11 +08:00
2024-03-29 15:33:25 +08:00
<el-button type="success" @click="find"></el-button>
2024-04-24 16:53:29 +08:00
<el-button type="success" @click="down"></el-button>
2024-04-03 09:27:11 +08:00
<el-button type="success" @click="rest"></el-button>&nbsp;&nbsp;
<el-checkbox v-model="checked" @change="Allquesr"></el-checkbox>
2024-03-29 15:33:25 +08:00
</el-form>
<!-- <el-input v-model="param.sourceId"-->
<!-- placeholder="请输入姓名"-->
<!-- style="width: 200px;margin-left: 5px"-->
<!-- class="input-with-select"-->
<!-- @keyup.enter.native="queryUser">-->
<!-- <el-button class="el-input-group__prepend" slot="append" icon="el-icon-search" @click="queryUser"></el-button>-->
<!-- </el-input>-->
<!-- <el-button type="success" icon="el-icon-refresh-left" style="margin-left: 5px;" @click="rest"></el-button>-->
<!-- <div class="div3" style="">-->
<!-- <el-button type="primary" icon="el-icon-plus" @click="add"></el-button>-->
<!-- <el-button type="success" icon="el-icon-edit" @click="mod"></el-button>-->
<!-- <el-button type="danger" icon="el-icon-delete" @click="del"></el-button>-->
<!-- <el-button type="warning" icon="el-icon-download" @click="exportExcel"></el-button>-->
<!-- </div>-->
2024-03-21 09:46:25 +08:00
</div>
<el-dialog :title="title"
:visible.sync="centerDialogVisible"
width="30%"
:before-close="handleClose"
center>
<el-form ref="form"
:model="form"
:rules="rules"
label-width="80px">
2024-03-29 15:33:25 +08:00
<el-form-item label="id" prop="id">
<el-input v-model="form.id" style="width: 300px;"></el-input>
2024-03-21 09:46:25 +08:00
</el-form-item>
2024-03-29 15:33:25 +08:00
<el-form-item label="sourceId" prop="sourceId">
<el-input v-model="form.sourceId" style="width: 300px;"></el-input>
2024-03-21 09:46:25 +08:00
</el-form-item>
2024-03-29 15:33:25 +08:00
<el-form-item label="strBill7" prop="strBill7">
<el-input v-model.number="form.strBill7" style="width: 300px;" autocomplete="off"></el-input>
2024-03-21 09:46:25 +08:00
</el-form-item>
2024-03-29 15:33:25 +08:00
<el-form-item label="strBill8" prop="age">
<el-input v-model.number="form.strBill8" style="width: 300px;" autocomplete="off"></el-input>
2024-03-21 09:46:25 +08:00
</el-form-item>
2024-03-29 15:33:25 +08:00
<!-- <el-form-item label="性别">-->
<!-- <el-radio-group v-model="form.sex">-->
<!-- <el-radio label='1'></el-radio>-->
<!-- <el-radio label='0'></el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
2024-03-21 09:46:25 +08:00
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" style="width: 300px;"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelDialog"> </el-button>
<el-button type="primary" @click="addUser"> </el-button>
</div>
</el-dialog>
<el-table
2024-04-03 14:41:00 +08:00
v-loading="this.tableloding"
2024-04-08 17:44:37 +08:00
:height="MaxHeight"
2024-03-21 09:46:25 +08:00
:header-cell-style="{background:'#000',color:'#fff'}"
:data="tableData"
id="educe-table"
ref="tableData"
@selection-change="handleSelectionChange"
@select="selectionRow"
2024-04-03 09:27:11 +08:00
style="width: 100%;" >
2024-03-21 09:46:25 +08:00
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
fixed
label="序号"
v-if="false"
width="180">
<template slot-scope="scope">
<span style="margin-left: 10px">{{ scope.row.id }}</span>
</template>
</el-table-column>
2024-04-12 16:42:47 +08:00
<!-- <el-table-column-->
<!-- label="ID"-->
<!-- width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <div slot="reference" class="name-wrapper">-->
<!-- <span>{{ scope.row.id}}</span>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
2024-03-21 09:46:25 +08:00
<el-table-column
2024-03-29 15:33:25 +08:00
label="采购单号"
2024-04-12 16:42:47 +08:00
width="100">
2024-03-21 09:46:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
2024-03-29 15:33:25 +08:00
<span>{{ scope.row.sourceId }}</span>
2024-03-21 09:46:25 +08:00
</div>
</template>
</el-table-column>
<el-table-column
2024-03-29 15:33:25 +08:00
label="凭证号"
2024-04-12 16:42:47 +08:00
width="100">
2024-03-21 09:46:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
2024-03-29 15:33:25 +08:00
<span>{{ scope.row.strBill7 }}</span>
2024-03-21 09:46:25 +08:00
</div>
</template>
</el-table-column>
<el-table-column
2024-03-29 15:33:25 +08:00
label="行号"
2024-04-12 16:42:47 +08:00
width="60">
2024-03-21 09:46:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
2024-03-29 15:33:25 +08:00
<span>{{ scope.row.strBill8 }}</span>
2024-03-21 09:46:25 +08:00
</div>
</template>
</el-table-column>
<el-table-column
2024-03-29 15:33:25 +08:00
label="料号"
2024-04-12 16:42:47 +08:00
width="160">
2024-03-21 09:46:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
2024-04-03 09:27:11 +08:00
<span>{{ scope.row.i_CODE }}</span>
2024-03-21 09:46:25 +08:00
</div>
</template>
</el-table-column>
<el-table-column
2024-04-12 16:42:47 +08:00
:show-overflow-tooltip="true"
2024-03-29 15:33:25 +08:00
label="描述"
2024-03-21 09:46:25 +08:00
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
2024-03-29 15:33:25 +08:00
<span>{{ scope.row.NAME }}</span>
2024-03-21 09:46:25 +08:00
</div>
</template>
</el-table-column>
<el-table-column
2024-03-29 15:33:25 +08:00
label="单位"
2024-04-12 16:42:47 +08:00
width="60">
2024-03-21 09:46:25 +08:00
<template slot-scope="scope">
2024-03-29 15:33:25 +08:00
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.UNIT }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="收货日期"
2024-04-12 16:42:47 +08:00
width="100">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
2024-04-12 16:42:47 +08:00
<span>{{new Date(scope.row.ORDER_DATE).toISOString().replace('T','').substring(0,10) }}</span>
2024-03-29 15:33:25 +08:00
</div>
</template>
</el-table-column>
2024-04-15 14:28:16 +08:00
<el-table-column
label="收货时间"
width="100">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{new Date(scope.row.ORDER_DATE).toISOString().replace('T','').substring(10,18) }}</span>
</div>
</template>
</el-table-column>
2024-03-29 15:33:25 +08:00
<el-table-column
label="整理日期"
2024-04-12 16:42:47 +08:00
width="100">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
2024-04-12 16:42:47 +08:00
<span>{{ new Date(scope.row.RECEIVE_DATE).toISOString().replace('T','').substring(0,10) }}</span>
2024-03-29 15:33:25 +08:00
</div>
</template>
</el-table-column>
2024-04-15 14:28:16 +08:00
<el-table-column
label="整理时间"
width="100">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ new Date(scope.row.RECEIVE_DATE).toISOString().replace('T','').substring(10,18) }}</span>
</div>
</template>
</el-table-column>
2024-03-29 15:33:25 +08:00
<el-table-column
2024-04-03 09:27:11 +08:00
label="整理人"
2024-04-12 16:42:47 +08:00
width="60">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.OPERATOR }}</span>
</div>
</template>
</el-table-column>
<el-table-column
2024-04-03 09:27:11 +08:00
label="上架人"
2024-04-12 16:42:47 +08:00
width="60">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
2024-04-03 09:27:11 +08:00
<span>{{ scope.row.w_NAME }}</span>
2024-03-29 15:33:25 +08:00
</div>
</template>
</el-table-column>
<el-table-column
2024-04-03 09:27:11 +08:00
label="容器"
2024-04-12 16:42:47 +08:00
width="80">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.LP }}</span>
</div>
</template>
</el-table-column>
<el-table-column
2024-04-03 09:27:11 +08:00
label="批号"
2024-04-12 16:42:47 +08:00
width="100">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.PROP_C1 }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="LOC"
2024-04-12 16:42:47 +08:00
width="60">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.PROP_C2 }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="特殊标记"
2024-04-12 16:42:47 +08:00
width="60">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.PROP_C3 }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="供应商编号"
2024-04-12 16:42:47 +08:00
width="100">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.PROP_C5 }}</span>
</div>
</template>
</el-table-column>
2024-04-15 14:28:16 +08:00
<!-- <el-table-column-->
<!-- label="区域"-->
<!-- width="100">-->
<!-- <template slot-scope="scope">-->
<!-- <div slot="reference" class="name-wrapper">-->
<!-- <span>{{ scope.row.PROP_C8 }}</span>-->
<!-- </div>-->
<!-- </template>-->
<!-- </el-table-column>-->
2024-03-29 15:33:25 +08:00
<el-table-column
label="工厂"
2024-04-12 16:42:47 +08:00
width="80">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.PROP_C9 }}</span>
</div>
</template>
</el-table-column>
<el-table-column
2024-04-03 09:27:11 +08:00
label="序列号"
2024-04-12 16:42:47 +08:00
width="100">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.BAR_CODE }}</span>
</div>
</template>
</el-table-column>
<el-table-column
2024-04-03 09:27:11 +08:00
label="是否上架"
2024-04-12 16:42:47 +08:00
width="80">
2024-03-29 15:33:25 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
2024-04-24 16:53:29 +08:00
<span>{{ scope.row.BE_MOVED==1?"是":"否" }}</span>
2024-03-29 15:33:25 +08:00
</div>
</template>
</el-table-column>
<el-table-column
2024-04-12 16:42:47 +08:00
:show-overflow-tooltip="true"
2024-03-29 15:33:25 +08:00
label="备注"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.description }}</span>
</div>
2024-03-21 09:46:25 +08:00
</template>
</el-table-column>
2024-04-03 09:27:11 +08:00
<el-table-column
label="SAP接口"
width="180">
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.a_CODE }}</span>
</div>
</template>
</el-table-column>
<el-table-column
label="库位号"
2024-04-12 16:42:47 +08:00
width="60">
2024-04-03 09:27:11 +08:00
<template slot-scope="scope">
<div slot="reference" class="name-wrapper">
<span>{{ scope.row.lc_CODE }}</span>
</div>
</template>
</el-table-column>
2024-03-29 15:33:25 +08:00
2024-03-21 09:46:25 +08:00
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="pageNum"
2024-04-03 17:34:17 +08:00
:page-sizes="[ 50, 100, 200,500]"
2024-03-21 09:46:25 +08:00
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
</template>
<script>
2024-04-03 09:27:11 +08:00
// import horizontalScroll from 'el-table-horizontal-scroll'
2024-03-21 09:46:25 +08:00
import {outFile} from "@/util/excel.vue";
export default {
name: "Main",
data() {
//验证账号
let checkuserNo = (rule, value, callback) => {
let id=0;
if(this.form.id>0){
id=this.form.id;
}
this.$axios.get(this.$httpUrl + '/user/queryuserNo?id='+id+'&userNo='+ this.form.userNo).then(res => res.data)
.then(res => {
if (res.code == 200) {
callback(new Error(this.form.userNo + '账号已存在!'));
} else {
callback();
}
})
.catch(function (err) {
console.log(err);
})
};
return {
2024-04-03 14:41:00 +08:00
tableloding:false,
2024-03-29 15:33:25 +08:00
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
2024-03-21 09:46:25 +08:00
tableData: [],
2024-04-03 17:34:17 +08:00
pageSize: 50,
2024-03-21 09:46:25 +08:00
pageNum: 1,
total: 3,
2024-03-29 15:33:25 +08:00
param: {
2024-04-03 09:27:11 +08:00
//采购单号
sourceId: '',
//收货凭证号
2024-03-29 15:33:25 +08:00
strBill7: '',
2024-04-03 09:27:11 +08:00
//料号
i_CODE: '',
//物料描述
i_name: '',
//库区
z_name: [],
//库位号
lc_CODE: '',
//批次号
2024-03-29 15:33:25 +08:00
PROP_C1: '',
2024-04-03 09:27:11 +08:00
//LOC
PROP_C2: [],
//特殊标记
2024-03-29 15:33:25 +08:00
PROP_C3: '',
2024-04-03 09:27:11 +08:00
//工厂
2024-03-29 15:33:25 +08:00
PROP_C9: [],
2024-04-03 09:27:11 +08:00
//整理人
OPERATOR: '',
//SPA接口号
a_CODE: '',
2024-04-02 09:33:41 +08:00
//整理日期
RECEIVE_DATE: [],
//收货日期
ORDER_DATE: [],
2024-04-03 09:27:11 +08:00
//备注
description: '',
//容器码
LP: ''
2024-03-29 15:33:25 +08:00
},
2024-04-03 09:27:11 +08:00
plant: [],
loc: [],
name: [],
2024-03-29 15:33:25 +08:00
checked: false,
2024-04-03 09:27:11 +08:00
isShow: false,
2024-03-21 09:46:25 +08:00
form: {
id: '',
userNo: '',
userName: '',
passWord:'123456',
age: '',
sex: '1',
phone: '',
roleId: '2'
},
rules: {
userNo: [
{required: true, message: '请输入账号', trigger: 'blur'},
{ validator: checkuserNo, trigger: 'blur' }
],
userName: [
{required: true, message: '请输入姓名', trigger: 'blur'},
],
age: [
{required: true, message: '年龄不能为空'},
{type: 'number', message: '年龄必须为数字值'}
]
},
multipleSelection:[],
centerDialogVisible: false,
title:''
}
2024-04-03 09:27:11 +08:00
},
2024-04-08 17:44:37 +08:00
computed:{
MaxHeight(){
return window.innerHeight - 240 +"px";
}
},
2024-04-03 09:27:11 +08:00
mounted() {
this.Plant();
this.Loc();
this.z_Name();
2024-03-21 09:46:25 +08:00
},
methods: {
handleEdit(index, row) {
console.log(index, row);
},
handleDelete(index, row) {
console.log(index, row);
},
handleSizeChange(val) {
console.log(`每页 ${val}`);
this.pageNum = 1;
this.pageSize = val;
this.queryUser();
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
this.pageNum = val;
this.queryUser();
},
2024-04-03 09:27:11 +08:00
Plant(){
//下拉数据架子啊
this.$axios.post(this.$httpUrl + '/Zhengliqingdan/ZPlant', {
2024-04-02 09:33:41 +08:00
}).then(res => res.data)
.then(res => {
if (res.code == 200) {
2024-04-03 09:27:11 +08:00
console.log(res.data)
this.plant = res.data
2024-04-02 09:33:41 +08:00
} else {
this.$message.error('获取数据失败');
}
})
.catch(function (err) {
console.log(err);
})
},
2024-04-03 09:27:11 +08:00
Loc(){
//下拉数据架子啊
this.$axios.post(this.$httpUrl + '/Zhengliqingdan/ZLOC', {
2024-04-02 09:33:41 +08:00
}).then(res => res.data)
.then(res => {
if (res.code == 200) {
2024-04-03 09:27:11 +08:00
console.log(res.data)
this.loc = res.data
} else {
this.$message.error('获取数据失败');
}
2024-04-03 14:41:15 +08:00
// eslint-disable-next-line no-unused-vars
},err =>{
this.tableloding=false
2024-04-03 09:27:11 +08:00
})
},
z_Name(){
//下拉数据架子啊
this.$axios.post(this.$httpUrl + '/Zhengliqingdan/ZZONE', {
}).then(res => res.data)
.then(res => {
if (res.code == 200) {
console.log(res.data)
this.name = res.data
2024-04-02 09:33:41 +08:00
} else {
this.$message.error('获取数据失败');
}
2024-04-03 14:41:15 +08:00
// eslint-disable-next-line no-unused-vars
},err =>{
this.tableloding=false
})
2024-04-02 09:33:41 +08:00
},
queryUser() {
2024-04-03 14:41:00 +08:00
this.tableloding=true
2024-03-21 09:46:25 +08:00
//列表数据加载
2024-04-03 09:27:11 +08:00
this.$axios.post(this.$httpUrl + '/Zhengliqingdan/queryWhere', {
2024-03-21 09:46:25 +08:00
pageSize: this.pageSize,
pageNum: this.pageNum,
2024-03-29 15:33:25 +08:00
param: this.param,
2024-03-21 09:46:25 +08:00
}).then(res => res.data)
.then(res => {
2024-04-03 14:41:00 +08:00
this.tableloding=false
2024-03-21 09:46:25 +08:00
if (res.code == 200) {
this.tableData = res.data
this.total = res.total
} else {
this.$message.error('获取数据失败');
}
2024-04-03 14:41:00 +08:00
// eslint-disable-next-line no-unused-vars
},err =>{
this.tableloding=false
2024-03-21 09:46:25 +08:00
})
},
2024-03-29 15:33:25 +08:00
find(){
2024-04-03 14:41:15 +08:00
// if(this.checked){
// this.checked=false;
// this.isShow=false;
// }
2024-03-29 15:33:25 +08:00
this.queryUser();
},
2024-04-24 16:53:29 +08:00
down(){
this.downExcel();
},
downExcel() {
//显示加载图
this.tableloding=true;
//发起请求:/Jianhuojiemian/download请求方式为post类型为 {responseType:'blob'}
//参数和搜索参数一样
this.$axios.post(this.$httpUrl + '/Zhengliqingdan/download', {
pageSize: this.pageSize,
pageNum: this.pageNum,
param: this.param,
},{responseType:'blob'}).then(res => {
this.tableloding=false;
//重命名文件
this.downloadFile(res.data,'整理完成未上架清单'+ '数据', 'xlsx')
});
//列表数据加载
},
downloadFile(obj, name, suffix) {
//解析流文件,进行下载保存
const url = window.URL.createObjectURL(new Blob([obj]))
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
const fileName = this.parseTime(new Date()) + '-' + name + '.' + suffix
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
},
parseTime(time, cFormat) {
//获取当前时间
if (arguments.length === 0) {
return null
}
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'undefined' || time === null || time === 'null') {
return ''
} else if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
},
2024-03-29 15:33:25 +08:00
Allquesr(){
//查询按钮
if(this.checked){
2024-04-03 09:27:11 +08:00
this.isShow=true;
}else {
this.isShow=false;
2024-03-29 15:33:25 +08:00
}
},
2024-03-21 09:46:25 +08:00
rest() {
//表单重置
2024-03-29 15:33:25 +08:00
this.param={};
2024-04-03 14:41:15 +08:00
this.isShow=false;
this.checked=false;
2024-03-21 09:46:25 +08:00
},
add() {
//点击新增按弹窗
this.title="新增用户"
this.centerDialogVisible = true;
//重置表单信息
this.$nextTick(() => {
this.resetForm()
})
},
resetForm() {
this.$refs["form"].resetFields();
this.$data.form=JSON.parse(JSON.stringify(this.$options.data().form))
},
handleClose(){
//关闭对话框
this.centerDialogVisible=false;
this.form.sex='1';
},
cancelDialog(){
//取消对话框
this.centerDialogVisible=false;
this.resetForm();
this.form.sex='1';
this.$refs.tableData.clearSelection()
},
addUser() {
//新增用户
this.$refs["form"].validate((valid) => {
if (valid) {
this.$axios.post(this.$httpUrl + '/user/addorupdate', this.form).then(res => res.data)
.then(res => {
if (res.code == 200) {
this.$message({
message: res.msg,
type: 'success'
});
this.centerDialogVisible = false;//退出新增窗体
this.queryUser();//刷新列表
this.resetForm();
} else {
this.$message.error(res.msg);
}
})
.catch(function (err) {
console.log(err);
})
} else {
return false;
}
});
},
editUser(row){
//编辑
this.title="编辑用户"
this.centerDialogVisible = true;
this.$nextTick(() => {
this.form=JSON.parse(JSON.stringify(row));
this.form.sex=row.sex+''
this.$refs.tableData.toggleRowSelection(row, true);//编辑时勾选
})
},
handleSelectionChange(val) {
this.multipleSelection = val;
let planIdList = [];
for (let item of this.multipleSelection) {
planIdList.push(item.id);
}
console.log(planIdList);
},
selectionRow(selection,row){
},
mod(){
//编辑
if(this.$refs.tableData.selection.length==1){
this.title="编辑用户"
this.centerDialogVisible = true;
for (let item of this.multipleSelection) {
this.form=JSON.parse(JSON.stringify(item));
this.form.sex=item.sex+''
}
}else{
this.$message.error('请选中一条记录!');
}
},
del(){
//删除
if(this.$refs.tableData.selection.length==0){
this.$message.error('请至少选中一条记录!');
}else{
this.$confirm('此操作将永久删除, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let ids=[];
for (let item of this.multipleSelection) {
ids.push(item.id)
}
this.$axios.get(this.$httpUrl + '/user/deleteUser?ids='+ids.toString()).then(res => res.data)
.then(res => {
if (res.code == 200) {
this.$message({
message: res.msg,
type: 'success'
});
this.queryUser()//刷新数据
} else {
this.$message.error(res.msg);
}
})
.catch(function (err) {
console.log(err);
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
}
},
exportExcel(){
this.fixs = false
this.$nextTick(() => {
outFile('educe-table', '(用户)')
this.fixs = true
})
}
},
beforeMount() {
this.queryUser();
}
}
</script>
2024-03-29 15:33:25 +08:00
2024-03-21 09:46:25 +08:00
<style lang="scss" scoped>
</style>