|
|
|
@ -45,11 +45,12 @@ |
|
|
|
<el-table-column |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
width="100" |
|
|
|
width="120" |
|
|
|
fixed="left" |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" @click="updateModelOpen(scope.row)">编辑</a> |
|
|
|
<a type="text" size="small" @click="copyModelOpen(scope.row)">复制</a> |
|
|
|
<a type="text" size="small" @click="deleteEcssTemplate(scope.row)">删除</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
@ -266,6 +267,41 @@ |
|
|
|
<el-button type="primary" @click="addModelFlag=false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 复制模版对话框 --> |
|
|
|
<el-dialog title="复制模版" :close-on-click-modal="false" v-drag :visible.sync="copyModelFlag" width="400px"> |
|
|
|
<el-form label-position="top" style="margin-left: 2px;margin-top: -5px;"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="原模版信息:"> |
|
|
|
<el-input v-model="copySourceInfo" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="选择目标BU:" required> |
|
|
|
<el-select v-model="copyModel.buNo" placeholder="请选择BU" style="width: 100%"> |
|
|
|
<el-option |
|
|
|
v-for="i in buList" |
|
|
|
:key="i.buNo" |
|
|
|
:label="i.buDesc" |
|
|
|
:value="i.buNo"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="新模版名称:" required> |
|
|
|
<el-input v-model="copyModel.name" placeholder="请输入新模版名称" clearable></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
<el-button type="primary" @click="saveCopyTemplate()">确认复制</el-button> |
|
|
|
<el-button @click="copyModelFlag=false">取消</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="客户" @close="closeCustomDialog" @open="openCustomDialog" :visible.sync="customFlag" width="559px" v-drag> |
|
|
|
<el-form inline="inline" label-position="top" :model="customData" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form-item label="客户名称"> |
|
|
|
@ -306,6 +342,7 @@ |
|
|
|
searchEcssTemplateData, |
|
|
|
saveEcssTemplateData, |
|
|
|
deleteEcssTemplate, |
|
|
|
copyEcssTemplate, |
|
|
|
searchCustomList |
|
|
|
}from "@/api/ecss/ecss.js" |
|
|
|
import {getBuList}from '@/api/factory/site.js' |
|
|
|
@ -562,6 +599,13 @@ |
|
|
|
customFlag:false, |
|
|
|
customData:{}, |
|
|
|
customList:[], |
|
|
|
copyModelFlag: false, |
|
|
|
copyModel: { |
|
|
|
buNo: '', |
|
|
|
name: '' |
|
|
|
}, |
|
|
|
copySourceInfo: '', |
|
|
|
copySourceData: {}, |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
@ -806,6 +850,56 @@ |
|
|
|
}, |
|
|
|
changeBu(){ |
|
|
|
this.addModel.kgs=this.addModel.buNo==='03-RFID'?'4.5':this.addModel.buNo==='01-Label'?'2.5':'' |
|
|
|
}, |
|
|
|
// 打开复制模版对话框 |
|
|
|
copyModelOpen(row) { |
|
|
|
this.copySourceData = JSON.parse(JSON.stringify(row)); |
|
|
|
this.copySourceInfo = `${row.buDesc} - ${row.name} (${row.type})`; |
|
|
|
this.copyModel = { |
|
|
|
buNo: '', |
|
|
|
name: row.name |
|
|
|
}; |
|
|
|
this.copyModelFlag = true; |
|
|
|
}, |
|
|
|
// 保存复制的模版 |
|
|
|
saveCopyTemplate() { |
|
|
|
if (!this.copyModel.buNo) { |
|
|
|
this.$alert('请选择目标BU!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}); |
|
|
|
return false; |
|
|
|
} |
|
|
|
if (!this.copyModel.name || this.copyModel.name.trim() === '') { |
|
|
|
this.$alert('请输入新模版名称!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// 构建复制请求数据 |
|
|
|
const copyData = { |
|
|
|
buNo: this.copyModel.buNo, // 目标BU |
|
|
|
name: this.copyModel.name.trim(), // 新模版名称 |
|
|
|
nameNative: this.copySourceData.name, // 原模版名称 |
|
|
|
site: this.copySourceData.site // 原模版所在站点 |
|
|
|
}; |
|
|
|
|
|
|
|
copyEcssTemplate(copyData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.searchTable(); |
|
|
|
this.copyModelFlag = false; |
|
|
|
this.$message({ |
|
|
|
message: '模版复制成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
activated() { |
|
|
|
|