添加物料配置
This commit is contained in:
parent
8f703ab06a
commit
1b13f7106b
@ -73,6 +73,36 @@ export default {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
material:{
|
||||||
|
list:{
|
||||||
|
url: `${config.API_URL}/material.cost.list`,
|
||||||
|
name: "物料成本列表",
|
||||||
|
get: async function (data) {
|
||||||
|
return await http.post(this.url, data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
add:{
|
||||||
|
url: `${config.API_URL}/material.cost.add`,
|
||||||
|
name: "物料成本添加",
|
||||||
|
post: async function (data) {
|
||||||
|
return await http.post(this.url, data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
template:{
|
||||||
|
url: `${config.API_URL}/material.cost.import.template`,
|
||||||
|
name: "物料成本导入模版",
|
||||||
|
post: async function (params) {
|
||||||
|
return await http.get(this.url,params,{responseType: 'arraybuffer'});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
import:{
|
||||||
|
url: `${config.API_URL}/material.cost.batch.import`,
|
||||||
|
name: "物料成本导入",
|
||||||
|
post: async function (params) {
|
||||||
|
return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
bom:{
|
bom:{
|
||||||
list:{
|
list:{
|
||||||
url: `${config.API_URL}/bom.list`,
|
url: `${config.API_URL}/bom.list`,
|
||||||
|
|||||||
13
src/assets/icons/MaterialSetup.vue
Normal file
13
src/assets/icons/MaterialSetup.vue
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<template>
|
||||||
|
<svg t="1725259400280" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4567" width="200" height="200"><path d="M604.672 259.584L476.558222 387.584 348.387556 259.527111l-47.729778 47.729778 108.657778 108.657778H352.142222V483.555556h90.624v39.025777H352.142222v67.584h90.624v114.005334h67.584v-114.005334h90.624V522.581333H510.293333V483.555556h90.624V415.971556H543.744L652.515556 307.2l-47.786667-47.672889z" p-id="4568"></path><path d="M510.293333 842.524444a35.100444 35.100444 0 0 0-35.043555-31.630222h-0.398222A337.009778 337.009778 0 0 1 138.24 474.282667 337.009778 337.009778 0 0 1 474.851556 137.671111a337.123556 337.123556 0 0 1 328.590222 263.168 35.043556 35.043556 0 0 0 68.266666-15.473778 406.528 406.528 0 0 0-396.8-317.724444 405.731556 405.731556 0 0 0-287.516444 119.125333 405.731556 405.731556 0 0 0-119.068444 287.516445 405.617778 405.617778 0 0 0 119.125333 287.516444 405.731556 405.731556 0 0 0 287.459555 119.068445h0.796445c20.48 0 36.522667-17.806222 34.645333-38.286223z" p-id="4569"></path><path d="M947.882667 772.778667l-11.491556-20.024889a0.910222 0.910222 0 0 1 0-0.967111l11.491556-20.024889c9.329778-15.985778 10.808889-35.214222 4.096-52.508445a200.305778 200.305778 0 0 0-31.800889-55.011555 60.871111 60.871111 0 0 0-47.388445-22.584889h-22.983111a1.024 1.024 0 0 1-0.910222-0.512l-11.491556-19.968a60.871111 60.871111 0 0 0-43.292444-29.809778 204.288 204.288 0 0 0-63.431111 0c-18.261333 2.844444-34.133333 13.653333-43.235556 29.809778l-11.548444 19.968a1.080889 1.080889 0 0 1-0.910222 0.568889h-22.983111c-18.488889 0-35.84 8.135111-47.388445 22.528a200.192 200.192 0 0 0-31.857778 55.011555c-6.656 17.294222-5.12 36.408889 4.152889 52.508445l11.491556 20.024889a0.910222 0.910222 0 0 1 0 0.967111l-11.491556 20.024889c-9.329778 15.985778-10.808889 35.214222-4.096 52.508444 7.566222 19.911111 18.261333 38.4 31.800889 54.954667 11.605333 14.336 28.899556 22.641778 47.388445 22.641778h22.983111c0.398222 0 0.682667 0.170667 0.910222 0.455111l11.491555 20.024889c9.329778 15.985778 25.088 26.908444 43.292445 29.809777a197.233778 197.233778 0 0 0 63.374222 0c18.375111-2.901333 34.133333-13.710222 43.349333-29.809777l11.491556-20.024889a1.080889 1.080889 0 0 1 0.910222-0.455111h22.983111c18.488889 0 35.84-8.248889 47.388445-22.641778 13.539556-16.554667 24.234667-35.100444 31.857778-54.954667 6.542222-17.294222 5.063111-36.522667-4.152889-52.508444z m-51.882667 30.890666a142.791111 142.791111 0 0 1-22.414222 38.684445c-0.170667 0.227556-0.455111 0.398222-0.796445 0.398222h-22.983111c-21.731556 0-41.984 11.719111-52.792889 30.492444l-11.491555 20.024889c-0.227556 0.284444-0.398222 0.512-0.739556 0.512-14.677333 2.275556-30.094222 2.275556-44.771555 0-0.284444 0-0.512-0.227556-0.682667-0.568889l-11.548444-19.911111a61.212444 61.212444 0 0 0-52.792889-30.549333h-22.983111a0.910222 0.910222 0 0 1-0.796445-0.398222 142.677333 142.677333 0 0 1-22.414222-38.684445 0.967111 0.967111 0 0 1 0.113778-0.910222l11.491555-20.024889c10.922667-18.773333 10.922667-42.154667 0-60.984889l-11.491555-19.968a0.967111 0.967111 0 0 1-0.113778-0.910222c5.404444-13.994667 12.913778-27.022222 22.414222-38.684444 0.170667-0.227556 0.512-0.398222 0.796445-0.398223h22.983111c21.731556 0 42.040889-11.719111 52.792889-30.549333l11.548444-19.968c0.170667-0.284444 0.341333-0.512 0.682667-0.512 14.677333-2.275556 30.094222-2.275556 44.771555 0 0.341333 0 0.568889 0.227556 0.739556 0.512l11.491555 19.968c10.865778 18.773333 31.061333 30.549333 52.792889 30.549333h22.983111c0.284444 0 0.568889 0.056889 0.796445 0.398223 9.500444 11.662222 17.066667 24.689778 22.414222 38.684444a0.967111 0.967111 0 0 1-0.113778 0.910222l-11.491555 19.968c-10.865778 18.773333-10.865778 42.211556 0 60.984889l11.491555 20.024889c0.227556 0.284444 0.227556 0.568889 0.113778 0.910222z" p-id="4570"></path><path d="M703.772444 752.298667a58.481778 58.481778 0 1 0 117.020445 0 58.481778 58.481778 0 0 0-117.020445 0z" p-id="4571"></path></svg>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "MaterialSetup"
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -28,6 +28,7 @@ export { default as AgentMaintenance } from './AgentMaintenance.vue'
|
|||||||
export { default as CostAllocation } from './CostAllocation.vue'
|
export { default as CostAllocation } from './CostAllocation.vue'
|
||||||
export { default as K3Api } from './K3Api.vue'
|
export { default as K3Api } from './K3Api.vue'
|
||||||
export { default as CostSetup } from './CostSetup.vue'
|
export { default as CostSetup } from './CostSetup.vue'
|
||||||
|
export { default as MaterialSetup } from './MaterialSetup.vue'
|
||||||
export { default as MaintenanceSetup } from './MaintenanceSetup.vue'
|
export { default as MaintenanceSetup } from './MaintenanceSetup.vue'
|
||||||
export { default as ConfirmOrder } from './ConfirmOrder.vue'
|
export { default as ConfirmOrder } from './ConfirmOrder.vue'
|
||||||
export { default as DataSource } from './DataSource.vue'
|
export { default as DataSource } from './DataSource.vue'
|
||||||
|
|||||||
@ -65,7 +65,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import {inject} from "vue";
|
|
||||||
import {eventBus} from "@/utils/eventBus"
|
import {eventBus} from "@/utils/eventBus"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -109,7 +108,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
getWsResult(res){
|
getWsResult(res){
|
||||||
if(res.data && (res.data.type == 4 || res.data.type == 5 || res.data.type == 10)){
|
if(res.data && (res.data.type == 4 || res.data.type == 5 || res.data.type == 10 || res.data.type == 17)){
|
||||||
this.importInfo = res.data;
|
this.importInfo = res.data;
|
||||||
this.progressShow = true;
|
this.progressShow = true;
|
||||||
if(res.data.status == 0){
|
if(res.data.status == 0){
|
||||||
@ -188,7 +187,7 @@ export default {
|
|||||||
.upload .el-icon--upload{
|
.upload .el-icon--upload{
|
||||||
width: 54px;height: 54px;
|
width: 54px;height: 54px;
|
||||||
}
|
}
|
||||||
.upload :deep(.el-upload__text){
|
.upload ::v-deep .el-upload__text{
|
||||||
.trueIcon{
|
.trueIcon{
|
||||||
position: relative;
|
position: relative;
|
||||||
border: 1px solid var(--el-border-color);
|
border: 1px solid var(--el-border-color);
|
||||||
@ -218,7 +217,7 @@ export default {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.upload :deep(.el-upload__tip){
|
.upload ::v-deep .el-upload__tip{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@ -235,7 +234,7 @@ export default {
|
|||||||
margin: 15px 0;
|
margin: 15px 0;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
.name{margin-bottom: 8px;font-size: 13px;}
|
.name{margin-bottom: 8px;font-size: 13px;}
|
||||||
.exportPopover :deep(.el-progress-bar__innerText){
|
.exportPopover ::v-deep .el-progress-bar__innerText{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;align-items: center;justify-content: flex-end;
|
display: flex;align-items: center;justify-content: flex-end;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
|
|||||||
110
src/views/setting/advanced/components/addMaterial.vue
Normal file
110
src/views/setting/advanced/components/addMaterial.vue
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :title="titleMap[mode]" v-model="visible" :width="500" destroy-on-close @closed="$emit('closed')">
|
||||||
|
<el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-width="100px">
|
||||||
|
<el-form-item label="上级部门" prop="parent_id">
|
||||||
|
<el-cascader v-model="form.parent_id" :options="depts" :props="deptsProps" :show-all-levels="false" clearable style="width: 100%;"></el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="部门名称" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入部门名称" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="active_status">
|
||||||
|
<el-switch v-model="form.active_status" :active-value="true" :inactive-value="false"></el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" clearable type="textarea"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="visible=false" >取 消</el-button>
|
||||||
|
<el-button v-if="mode!='show'" type="primary" :loading="isSave" @click="submit()">保 存</el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
emits: ['success', 'closed'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
mode: "add",
|
||||||
|
titleMap: {
|
||||||
|
add: '新增',
|
||||||
|
edit: '编辑',
|
||||||
|
show: '查看'
|
||||||
|
},
|
||||||
|
visible: false,
|
||||||
|
isSave: false,
|
||||||
|
//表单数据
|
||||||
|
form: {
|
||||||
|
parent_id: "",
|
||||||
|
id:"",
|
||||||
|
name: "",
|
||||||
|
active_status: true,
|
||||||
|
remark: ""
|
||||||
|
},
|
||||||
|
//验证规则
|
||||||
|
rules: {
|
||||||
|
name: [
|
||||||
|
{required: true, message: '请输入部门名称'}
|
||||||
|
],
|
||||||
|
active_status: [
|
||||||
|
{required: true,}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
//所需数据选项
|
||||||
|
depts: [],
|
||||||
|
deptsProps: {
|
||||||
|
value: "id",
|
||||||
|
emitPath: false,
|
||||||
|
checkStrictly: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getGroup()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//显示
|
||||||
|
open(mode='add'){
|
||||||
|
this.mode = mode;
|
||||||
|
this.visible = true;
|
||||||
|
return this
|
||||||
|
},
|
||||||
|
//加载树数据
|
||||||
|
async getGroup(){
|
||||||
|
const res = await this.$API.system.dept.active.post();
|
||||||
|
if(res.code == 200){
|
||||||
|
this.depts = res.data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//表单提交方法
|
||||||
|
submit(){
|
||||||
|
this.$refs.dialogForm.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.isSave = true;
|
||||||
|
const res = await this.$API.system.dept.add.post(this.form);
|
||||||
|
this.isSave = false;
|
||||||
|
if(res.code == 200){
|
||||||
|
this.$emit('success', this.form, this.mode)
|
||||||
|
this.visible = false;
|
||||||
|
this.$message.success("操作成功")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//表单注入数据
|
||||||
|
async setData(data) {
|
||||||
|
let params = {
|
||||||
|
id: data.id
|
||||||
|
}
|
||||||
|
const res = await this.$API.system.dept.info.post(params);
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.form = res.data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
@ -38,15 +38,15 @@ import { defineAsyncComponent } from 'vue'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
account: defineAsyncComponent(() => import('./setup/computerRoom')),
|
|
||||||
seting: defineAsyncComponent(() => import('./setup/computerRoom')),
|
|
||||||
pushSettings: defineAsyncComponent(() => import('./setup/computerRoom')),
|
pushSettings: defineAsyncComponent(() => import('./setup/computerRoom')),
|
||||||
password: defineAsyncComponent(() => import('./setup/computerRoom')),
|
password: defineAsyncComponent(() => import('./setup/computerRoom')),
|
||||||
upToEnterprise: defineAsyncComponent(() => import('./setup/computerRoom')),
|
upToEnterprise: defineAsyncComponent(() => import('./setup/computerRoom')),
|
||||||
|
account: defineAsyncComponent(() => import('./setup/computerRoom')),
|
||||||
bind: defineAsyncComponent(() => import('./setup/computerRoom')),
|
bind: defineAsyncComponent(() => import('./setup/computerRoom')),
|
||||||
mail: defineAsyncComponent(() => import('./setup/mail')),
|
mail: defineAsyncComponent(() => import('./setup/mail')),
|
||||||
interface: defineAsyncComponent(() => import('./setup/interface')),
|
interface: defineAsyncComponent(() => import('./setup/interface')),
|
||||||
cost: defineAsyncComponent(() => import('./setup/cost')),
|
cost: defineAsyncComponent(() => import('./setup/cost')),
|
||||||
|
material: defineAsyncComponent(() => import('./setup/material')),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -90,6 +90,12 @@ export default {
|
|||||||
title: "费用类别配置",
|
title: "费用类别配置",
|
||||||
component: "cost",
|
component: "cost",
|
||||||
actions:'costCategoryAdd'
|
actions:'costCategoryAdd'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "sc-icon-MaterialSetup",
|
||||||
|
title: "物料成本配置",
|
||||||
|
component: "material",
|
||||||
|
actions:'materialCostAdd'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -126,10 +132,11 @@ export default {
|
|||||||
item.list.forEach(em=>{
|
item.list.forEach(em=>{
|
||||||
if(permissions.auth.indexOf(em.actions)!=-1){
|
if(permissions.auth.indexOf(em.actions)!=-1){
|
||||||
item.show = true;
|
item.show = true;
|
||||||
this.page = item.list[0].component
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
let pageView = this.menu.find(item=> item.show === true).list.find(em=> permissions.auth.indexOf(em.actions)!=-1);
|
||||||
|
this.page = pageView.component;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openPage(item){
|
openPage(item){
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container class="mainBox">
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<div class="searchMain">
|
<div class="searchMain">
|
||||||
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
|
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container class="mainBox">
|
||||||
<el-main v-loading="listLoading" element-loading-text="加载中...">
|
<el-main class="nopadding" v-loading="listLoading" element-loading-text="加载中...">
|
||||||
<div class="mailView">
|
<div class="mailView">
|
||||||
<div class="headerBox ">
|
<div class="headerBox ">
|
||||||
<div class="title">费用类别配置</div>
|
<div class="title">费用类别配置</div>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container class="mainBox">
|
||||||
<el-main v-loading="listLoading" element-loading-text="加载中...">
|
<el-main class="nopadding" v-loading="listLoading" element-loading-text="加载中...">
|
||||||
<div class="mailView">
|
<div class="mailView">
|
||||||
<div class="headerBox">
|
<div class="headerBox">
|
||||||
<div class="title">K3接口配置</div>
|
<div class="title">K3接口配置</div>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container class="mainBox">
|
||||||
<el-main v-loading="listLoading" element-loading-text="加载中...">
|
<el-main class="nopadding" v-loading="listLoading" element-loading-text="加载中...">
|
||||||
<div class="mailView">
|
<div class="mailView">
|
||||||
<div class="headerBox">
|
<div class="headerBox">
|
||||||
<div class="title">自动维修邮件同步</div>
|
<div class="title">自动维修邮件同步</div>
|
||||||
|
|||||||
121
src/views/setting/advanced/setup/material.vue
Normal file
121
src/views/setting/advanced/setup/material.vue
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
<template>
|
||||||
|
<el-container class="mainBox mainBoxHeaderNoBorder">
|
||||||
|
<el-main class="nopadding">
|
||||||
|
<el-header>
|
||||||
|
<div class="left-panel">
|
||||||
|
<el-button type="primary" :size="size" icon="el-icon-plus" @click="add">新增</el-button>
|
||||||
|
<scImport ref="scImport" :size="size" title="批量导入物料成本" @parentParams="importUpload" @importSuccess="importSuccess">
|
||||||
|
<template #header>
|
||||||
|
<el-button type="primary" :size="size" plain @click="importFile">批量导入</el-button>
|
||||||
|
</template>
|
||||||
|
<template #download>
|
||||||
|
<div @click="importTemplate">下载导入模版</div>
|
||||||
|
</template>
|
||||||
|
</scImport>
|
||||||
|
</div>
|
||||||
|
<div class="right-panel">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</el-header>
|
||||||
|
<div class="searchMain">
|
||||||
|
<scSearch ref="scSearch" :searchList="searchList" @fetchSelectData="getSelectData"></scSearch>
|
||||||
|
|
||||||
|
<div class="searchItem searchBtn">
|
||||||
|
<el-button :size="size" type="primary" icon="el-icon-search" @click="upSearch">查询</el-button>
|
||||||
|
<el-button :size="size" type="info" icon="el-icon-RefreshRight" @click="reset">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<scTable ref="table" :apiObj="list.apiObj" :column="list.column" stripe :size="size" highlightCurrentRow>
|
||||||
|
<sc-table-column label="序号" align="center" type="index"></sc-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
|
||||||
|
<add-material></add-material>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import addMaterial from "../components/addMaterial";
|
||||||
|
export default {
|
||||||
|
name: "material",
|
||||||
|
components:{
|
||||||
|
addMaterial
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
size:'small',
|
||||||
|
list:{
|
||||||
|
apiObj: this.$API.setup.material.list,
|
||||||
|
column:[]
|
||||||
|
},
|
||||||
|
params: {},
|
||||||
|
searchList:[
|
||||||
|
{name:'操作时间',type:'date',code:'created_at',show:true},
|
||||||
|
{name:'物料MPN',type:'text',code:['m_mpn'], placeholder:"请输入物料MPN",show:true},
|
||||||
|
{name:'物料名称',type:'text',code:['m_name'], placeholder:"请输入物料名称",show:true},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
getSelectData(item){
|
||||||
|
let {params} = item;
|
||||||
|
this.params = params;
|
||||||
|
},
|
||||||
|
async save() {
|
||||||
|
const res = await this.$API.setup.room.add.post(this.params);
|
||||||
|
if(res.code == 200){
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
add(){
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
// 批量导入
|
||||||
|
importFile(){
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.scImport.importFile();
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async importTemplate() {
|
||||||
|
const res = await this.$API.setup.material.template.post();
|
||||||
|
const blob = new Blob([res]);
|
||||||
|
const text = new Date().getTime();
|
||||||
|
const eLink = document.createElement('a');
|
||||||
|
eLink.download = "物料导入模版_"+text+'.xlsx';
|
||||||
|
eLink.style.display = 'none';
|
||||||
|
eLink.href = URL.createObjectURL(blob);
|
||||||
|
document.body.appendChild(eLink);
|
||||||
|
eLink.click();
|
||||||
|
URL.revokeObjectURL(eLink.href);
|
||||||
|
document.body.removeChild(eLink);
|
||||||
|
},
|
||||||
|
async importUpload(params) {
|
||||||
|
const res = await this.$API.setup.material.import.post(params);
|
||||||
|
if(res.code == 200){
|
||||||
|
this.$message.success('上传成功,开始导入数据');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
importSuccess(){
|
||||||
|
this.$refs.table.refresh()
|
||||||
|
},
|
||||||
|
|
||||||
|
upSearch(){
|
||||||
|
this.$refs.table.upData(this.params);
|
||||||
|
},
|
||||||
|
reset(){
|
||||||
|
this.params = {};
|
||||||
|
this.$refs.scSearch.reload();
|
||||||
|
this.$refs.table.reload();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user