包装40%
This commit is contained in:
@@ -6,138 +6,130 @@
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="30%" show-close="true">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
<el-dialog
|
||||
class="baseDialog"
|
||||
:visible.sync="visible"
|
||||
:show-close="true"
|
||||
:wrapper-closable="false"
|
||||
width="50%">
|
||||
<small-title
|
||||
slot="title"
|
||||
:no-padding="true">
|
||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
|
||||
@keyup.enter.native="dataFormSubmit">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="模板名称" prop="name">
|
||||
<el-input v-model="dataForm.name" clearable placeholder="请输入模板名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标签类型" prop="typeId">
|
||||
<el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择标签类型" clearable>
|
||||
<el-option v-for="dict in typeList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="打印方式" prop="printModel">
|
||||
<el-select v-model="dataForm.printModel" style="width: 100%;" placeholder="请选择打印方式" clearable>
|
||||
<el-option v-for="dict in printModelList" :key="dict.id" :label="dict.name" :value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标签备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark" clearable placeholder="请输入标签备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="模板设计" prop="content">
|
||||
<el-button icon="el-icon-edit" @click="btnClickDesign()">模板设计</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="单位平方数" prop="area">
|
||||
<el-input v-model="dataForm.area" placeholder="请输入单位平方数" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<!-- <el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="完成单位产品用时" prop="processTime">
|
||||
<el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
</el-form>
|
||||
|
||||
<!-- <small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
产品属性列表
|
||||
</small-title>
|
||||
|
||||
<div class="attr-list">
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:add-button-show="isdetail ? null : '添加属性'"
|
||||
@emitButtonClick="addNew()"
|
||||
:table-data="productAttributeList">
|
||||
<method-btn
|
||||
v-if="!isdetail"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick" />
|
||||
</base-table>
|
||||
<pagination
|
||||
v-show="listQuery.total > 0"
|
||||
:total="listQuery.total"
|
||||
:page.sync="listQuery.pageNo"
|
||||
:limit.sync="listQuery.pageSize"
|
||||
:page-sizes="[5, 10, 15]"
|
||||
@pagination="getList" />
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div style="position: absolute; bottom: 24px; right: 24px">
|
||||
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
|
||||
<el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
label-width="100px"
|
||||
@keyup.enter.native="dataFormSubmit">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="模板名称"
|
||||
prop="name">
|
||||
<el-input
|
||||
v-model="dataForm.name"
|
||||
clearable
|
||||
placeholder="请输入模板名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="标签类型"
|
||||
prop="typeId">
|
||||
<el-select
|
||||
v-model="dataForm.typeId"
|
||||
style="width: 100%"
|
||||
placeholder="请选择标签类型"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="dict in typeList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="打印方式"
|
||||
prop="printModel">
|
||||
<el-select
|
||||
v-model="dataForm.printModel"
|
||||
style="width: 100%"
|
||||
placeholder="请选择打印方式"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="dict in printModelList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="标签备注"
|
||||
prop="remark">
|
||||
<el-input
|
||||
v-model="dataForm.remark"
|
||||
clearable
|
||||
placeholder="请输入标签备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="模板设计"
|
||||
prop="content">
|
||||
<el-button
|
||||
icon="el-icon-edit"
|
||||
@click="btnClickDesign()">
|
||||
模板设计
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<template slot="footer">
|
||||
<el-button
|
||||
style=""
|
||||
@click="goback()">
|
||||
取消
|
||||
</el-button>
|
||||
<span v-if="!isdetail">
|
||||
<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
|
||||
<el-button
|
||||
v-if="dataForm.id && !isdetail"
|
||||
type="primary"
|
||||
@click="addNew()">
|
||||
添加属性
|
||||
</el-button>
|
||||
</span>
|
||||
</div> -->
|
||||
<template slot="footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button> -->
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</template>
|
||||
<print-model-design v-if="modelShow" ref="printModelDesign" @saveData="getModelData" />
|
||||
</el-dialog>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="dataFormSubmit()">
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
<print-model-design
|
||||
v-if="modelShow"
|
||||
ref="printModelDesign"
|
||||
@saveData="getModelData" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {
|
||||
createPackingModel,
|
||||
updatePackingModel,
|
||||
getPackingModel,
|
||||
// getWorkOrderList,
|
||||
// getCode,
|
||||
// getCustomerList,
|
||||
getTypeList
|
||||
createPackingModel,
|
||||
updatePackingModel,
|
||||
getPackingModel,
|
||||
getTypeList,
|
||||
} from '@/api/base/printModel.js';
|
||||
// import productAttrAdd from './attr-add';
|
||||
import { parseTime } from '../mixins/code-filter';
|
||||
import SmallTitle from './SmallTitle';
|
||||
import printModelDesign from '../custom/index'
|
||||
import printModelDesign from '../custom/index';
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
@@ -166,42 +158,42 @@ const tableProps = [
|
||||
];
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, printModelDesign },
|
||||
components: { SmallTitle, printModelDesign },
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
addOrUpdateVisible: false,
|
||||
tableBtn,
|
||||
tableProps,
|
||||
modelShow:false,
|
||||
typeList:[],
|
||||
tableProps,
|
||||
modelShow: false,
|
||||
typeList: [],
|
||||
dataForm: {
|
||||
id: null,
|
||||
// name: '', // 产品名称
|
||||
name: '', // 产品编码
|
||||
name: '', // 产品编码
|
||||
// area: 0, // 单位平方数(float only)
|
||||
typeId: null, // 产品类型id
|
||||
printModel: null, // 单位产品用时 (s)
|
||||
content: '', // 规格
|
||||
remark: '', // 单位id
|
||||
},
|
||||
printModelList: [
|
||||
{
|
||||
id: 1,
|
||||
name:'自动'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '手动'
|
||||
},
|
||||
],
|
||||
typeId: null, // 产品类型id
|
||||
printModel: null, // 单位产品用时 (s)
|
||||
content: '', // 规格
|
||||
remark: '', // 单位id
|
||||
},
|
||||
printModelList: [
|
||||
{
|
||||
id: 1,
|
||||
name: '自动',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: '手动',
|
||||
},
|
||||
],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
},
|
||||
dataRule: {
|
||||
typeId: [
|
||||
typeId: [
|
||||
{
|
||||
required: true,
|
||||
message: '打印类型不能为空',
|
||||
@@ -221,7 +213,7 @@ export default {
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
printModel: [
|
||||
printModel: [
|
||||
{
|
||||
required: true,
|
||||
message: '模板类型不能为空',
|
||||
@@ -229,11 +221,11 @@ export default {
|
||||
},
|
||||
],
|
||||
content: [
|
||||
{
|
||||
required: true,
|
||||
message: '模板不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
message: '模板不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
processTime: [
|
||||
{
|
||||
@@ -251,30 +243,30 @@ export default {
|
||||
},
|
||||
// isdetail: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getModelData(data) {
|
||||
console.log(data)
|
||||
this.content = JSON.stringify(data)
|
||||
this.dataForm.content = JSON.stringify(data)
|
||||
},
|
||||
btnClickDesign() {
|
||||
console.log(11111)
|
||||
this.modelShow = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.printModelDesign.init(this.dataForm.content)
|
||||
console.log(this.dataForm.content)
|
||||
})
|
||||
// this.$router.push({
|
||||
// path: '/printModelDesign'
|
||||
// })
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getModelData(data) {
|
||||
console.log(data);
|
||||
this.content = JSON.stringify(data);
|
||||
this.dataForm.content = JSON.stringify(data);
|
||||
},
|
||||
btnClickDesign() {
|
||||
console.log(11111);
|
||||
this.modelShow = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.printModelDesign.init(this.dataForm.content);
|
||||
console.log(this.dataForm.content);
|
||||
});
|
||||
// this.$router.push({
|
||||
// path: '/printModelDesign'
|
||||
// })
|
||||
},
|
||||
// initData() {
|
||||
// this.productAttributeList.splice(0);
|
||||
// this.listQuery.total = 0;
|
||||
// },
|
||||
init(id) {
|
||||
this.getDict()
|
||||
init(id) {
|
||||
this.getDict();
|
||||
// this.initData();
|
||||
// this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || null;
|
||||
@@ -284,34 +276,34 @@ export default {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
// 获取产品详情
|
||||
getPackingModel(id).then((response) => {
|
||||
getPackingModel(id).then((response) => {
|
||||
this.dataForm = response.data;
|
||||
});
|
||||
// 获取产品的属性列表
|
||||
// this.getList();
|
||||
} else {
|
||||
// getCode().then((res) => {
|
||||
// this.dataForm.packagingCode = res.data;
|
||||
// this.dataForm.packagingCode = res.data;
|
||||
// });
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getDict() {
|
||||
// 获取产品的属性列表
|
||||
// getCustomerList().then((response) => {
|
||||
// console.log(response);
|
||||
// this.customerList = response.data
|
||||
// // this.listQuery.total = response.data.total;
|
||||
// })
|
||||
getTypeList().then((response) => {
|
||||
console.log(response);
|
||||
this.typeList = response.data
|
||||
// this.listQuery.total = response.data.total;
|
||||
})
|
||||
// getWorkOrderList().then((response) => {
|
||||
// // console.log(response);
|
||||
// this.workOrderList = response.data
|
||||
// 获取产品的属性列表
|
||||
// getCustomerList().then((response) => {
|
||||
// console.log(response);
|
||||
// this.customerList = response.data
|
||||
// // this.listQuery.total = response.data.total;
|
||||
// })
|
||||
getTypeList().then((response) => {
|
||||
console.log(response);
|
||||
this.typeList = response.data;
|
||||
// this.listQuery.total = response.data.total;
|
||||
});
|
||||
// getWorkOrderList().then((response) => {
|
||||
// // console.log(response);
|
||||
// this.workOrderList = response.data
|
||||
// // this.listQuery.total = response.data.total;
|
||||
// })
|
||||
},
|
||||
@@ -353,7 +345,7 @@ export default {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updatePackingModel(this.dataForm).then((response) => {
|
||||
updatePackingModel(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
@@ -361,7 +353,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createPackingModel(this.dataForm).then((response) => {
|
||||
createPackingModel(this.dataForm).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
@@ -439,35 +431,31 @@ export default {
|
||||
}
|
||||
</style> -->
|
||||
<style>
|
||||
|
||||
|
||||
.baseDialog .el-dialog__header {
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
.baseDialog .el-dialog__header .titleStyle::before{
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0B58FF;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
.baseDialog .el-dialog__header .titleStyle::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0b58ff;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
.baseDialog .el-dialog__body {
|
||||
padding-left: 24px;
|
||||
padding-right: 24px;
|
||||
padding-left: 24px;
|
||||
padding-right: 24px;
|
||||
}
|
||||
.baseDialog .btnTextStyle {
|
||||
letter-spacing:6px;
|
||||
padding: 9px 10px 9px 16px;
|
||||
font-size: 14px;
|
||||
letter-spacing: 6px;
|
||||
padding: 9px 10px 9px 16px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user