parent
2fe1d09cfa
commit
357bfb4043
7 changed files with 836 additions and 34 deletions
@ -0,0 +1,305 @@ |
||||
<template> |
||||
<!--成衣样板管理页面 这是成衣样板的主表单 即在侧边点击成衣样板所显示的表单--> |
||||
<a-card :bordered="false"> |
||||
<!-- 查询区域 --> |
||||
<div class="table-page-search-wrapper"> |
||||
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
||||
<a-row :gutter="24"> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="编号"> |
||||
<a-input placeholder="请输入编号" v-model="queryParam.nums"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="服装款式"> |
||||
<j-dict-select-tag v-model="queryParam.styleId" |
||||
placeholder="请选择服装款式" |
||||
dict-code="zy_cloths_style,style_names,nums"> |
||||
</j-dict-select-tag> |
||||
<!-- <a-form-item label="款式">--> |
||||
<!-- <a-input placeholder="请输入款式" v-model="queryParam.styleId"></a-input>--> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
||||
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> |
||||
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> |
||||
<!-- <a @click="handleToggleSearch" style="margin-left: 8px"> |
||||
{{ toggleSearchStatus ? '收起' : '展开' }} |
||||
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> |
||||
</a>--> |
||||
</span> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</div> |
||||
<!-- 查询区域-END --> |
||||
|
||||
<!-- 操作按钮区域 --> |
||||
<div class="table-operator"> |
||||
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>--> |
||||
<!-- <a-button type="primary" icon="download" @click="handleExportXls('成衣样板')">导出</a-button>--> |
||||
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"--> |
||||
<!-- @change="handleImportExcel">--> |
||||
<!-- <a-button type="primary" icon="import">导入</a-button>--> |
||||
<!-- </a-upload>--> |
||||
<!-- 高级查询区域 --> |
||||
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal"--> |
||||
<!-- @handleSuperQuery="handleSuperQuery"></j-super-query>--> |
||||
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">--> |
||||
<!-- <a-menu slot="overlay">--> |
||||
<!-- <a-menu-item key="1" @click="batchDel">--> |
||||
<!-- <a-icon type="delete"/>--> |
||||
<!-- 删除--> |
||||
<!-- </a-menu-item>--> |
||||
<!-- </a-menu>--> |
||||
<!-- <a-button style="margin-left: 8px"> 批量操作--> |
||||
<!-- <a-icon type="down"/>--> |
||||
<!-- </a-button>--> |
||||
<!-- </a-dropdown>--> |
||||
</div> |
||||
|
||||
<!-- table区域-begin --> |
||||
<div> |
||||
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
||||
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a |
||||
style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
||||
<a style="margin-left: 24px" @click="onClearSelected">清空</a> |
||||
</div> |
||||
|
||||
<a-table |
||||
ref="table" |
||||
size="middle" |
||||
:scroll="{x:true}" |
||||
bordered |
||||
rowKey="id" |
||||
:columns="columns" |
||||
:dataSource="dataSource" |
||||
:pagination="ipagination" |
||||
:loading="loading" |
||||
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
||||
class="j-table-force-nowrap" |
||||
@change="handleTableChange"> |
||||
|
||||
<template slot="htmlSlot" slot-scope="text"> |
||||
<div v-html="text"></div> |
||||
</template> |
||||
<template slot="imgSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> |
||||
<span v-else style="font-size: 12px;font-style: italic;"> |
||||
<img :src="getImgView(text)" height="25px" alt="" |
||||
style="max-width:80px;font-size: 12px;font-style: italic;"/> |
||||
<a-divider type="vertical"/> |
||||
<a-button |
||||
:ghost="true" |
||||
type="primary" |
||||
size="small" |
||||
@click="lookFile(text)"> |
||||
在线查看 |
||||
</a-button> |
||||
</span> |
||||
</template> |
||||
|
||||
<template slot="fileSlot" slot-scope="text"> |
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> |
||||
<a-button |
||||
v-else |
||||
:ghost="true" |
||||
type="primary" |
||||
icon="download" |
||||
size="small" |
||||
@click="downloadFile(text)"> |
||||
下载 |
||||
</a-button> |
||||
</template> |
||||
|
||||
<!--跳转到模块样板--> |
||||
<!-- <span slot="action1" slot-scope="text, record">--> |
||||
<!-- <a @click="jumpPage(record)">模块样板</a>--> |
||||
<!-- </span>--> |
||||
|
||||
<span slot="action" slot-scope="text, record"> |
||||
<!-- <a @click="handleEdit(record)">编辑</a>--> |
||||
<!-- <a-divider type="vertical"/>--> |
||||
|
||||
<!-- <a @click="fuzhi(record)">复制</a>--> |
||||
<!-- <a-divider type="vertical" />--> |
||||
|
||||
<!-- <a @click="handleDetail(record.id)">详情</a>--> |
||||
<!-- <a @click="handleDetail(record)">详情</a>--> |
||||
|
||||
<a-divider type="vertical"/> |
||||
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">--> |
||||
<!-- <a>删除</a>--> |
||||
<!-- </a-popconfirm>--> |
||||
</span> |
||||
|
||||
</a-table> |
||||
</div> |
||||
<ZyClothSampleDetail ref="ZyClothSampleDetail"></ZyClothSampleDetail> |
||||
<zy-cloth-sample-modal ref="modalForm" @ok="modalFormOk" v-bind="superFieldList"></zy-cloth-sample-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import {mixinDevice} from '@/utils/mixin' |
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin' |
||||
import ZyClothSampleModal from './modules/ZyClothSampleModal' |
||||
import ZyClothSampleDetail from '@views/product/productSample/modules/ZyClothSampleDetail' |
||||
export default { |
||||
name: "ProductSampleList", //产品样板 |
||||
mixins: [JeecgListMixin, mixinDevice], |
||||
components: { |
||||
ZyClothSampleModal, |
||||
ZyClothSampleDetail |
||||
}, |
||||
data() { |
||||
return { |
||||
description: '成衣样板管理页面', |
||||
// 表头 |
||||
columns: [ |
||||
{ |
||||
title: '#', |
||||
dataIndex: '', |
||||
key: 'rowIndex', |
||||
width: 60, |
||||
align: "center", |
||||
customRender: function (t, r, index) { |
||||
return parseInt(index) + 1; |
||||
} |
||||
}, |
||||
{ |
||||
title: '编号', |
||||
align: "center", |
||||
dataIndex: 'nums' |
||||
}, |
||||
{ |
||||
title: '服装款式', |
||||
align: "center", |
||||
dataIndex: 'styleId_dictText', |
||||
}, |
||||
{ |
||||
title: '款式型号', |
||||
align: "center", |
||||
dataIndex: 'stylemodelId_dictText', |
||||
//dictCode: 'modenumber', |
||||
}, |
||||
// { |
||||
// title: '模块样板', |
||||
// align: "center", |
||||
// dataIndex: 'modelSample_dictText' |
||||
// }, |
||||
// { |
||||
// title: '管理模块', |
||||
// dataIndex: 'action1', |
||||
// align: "center", |
||||
// fixed: "right", |
||||
// width: 110, |
||||
// scopedSlots: {customRender: 'action1'} |
||||
// }, |
||||
{ |
||||
title: '企业', |
||||
align: "center", |
||||
dataIndex: 'userId_dictText' |
||||
}, |
||||
{ |
||||
title: '创建时间', |
||||
align: "center", |
||||
dataIndex: 'createTime' |
||||
}, |
||||
|
||||
/*{ |
||||
title: '图片', |
||||
align: "center", |
||||
dataIndex: 'url', |
||||
scopedSlots: {customRender: 'imgSlot'} |
||||
},*/ |
||||
|
||||
// { |
||||
// title: '管理模块', |
||||
// dataIndex: 'action1', |
||||
// align: "center", |
||||
// fixed: "right", |
||||
// width: 110, |
||||
// scopedSlots: {customRender: 'action1'} |
||||
// }, |
||||
|
||||
// { |
||||
// title: '操作', |
||||
// dataIndex: 'action', |
||||
// align: "center", |
||||
// fixed: "right", |
||||
// width: 147, |
||||
// scopedSlots: {customRender: 'action'} |
||||
// } |
||||
], |
||||
url: { |
||||
list: "/zyclothsample/zyClothSample/list", |
||||
edit: "/zyclothsample/zyClothSample/edit", |
||||
delete: "/zyclothsample/zyClothSample/delete", |
||||
deleteBatch: "/zyclothsample/zyClothSample/deleteBatch", |
||||
exportXlsUrl: "/zyclothsample/zyClothSample/exportXls", |
||||
importExcelUrl: "zyclothsample/zyClothSample/importExcel", |
||||
|
||||
}, |
||||
dictOptions: {}, |
||||
superFieldList: [], |
||||
} |
||||
}, |
||||
created() { |
||||
this.getSuperFieldList(); |
||||
} |
||||
, |
||||
computed: { |
||||
importExcelUrl: function () { |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
initDictConfig() { |
||||
}, |
||||
jumpPage(record) { |
||||
this.$router.push({ |
||||
path: '/src/views/sample/ZyModuleSampleList', |
||||
query: { //路由携带参数 |
||||
'id': record.id, |
||||
} |
||||
}); |
||||
}, |
||||
|
||||
lookFile(fileUrl) { |
||||
let file = window._CONFIG['domianURL'] + "/sys/common/static/" + fileUrl |
||||
let Base64 = require('js-base64').Base64; |
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(file)) |
||||
window.open(url); |
||||
|
||||
} |
||||
, |
||||
getSuperFieldList() { |
||||
let fieldList = []; |
||||
fieldList.push({type: 'string', value: 'nums', text: '编号', dictCode:''}) |
||||
fieldList.push({type: 'string', value: 'styleId', text: '款式', dictCode:''}) |
||||
fieldList.push({type: 'string', value: 'stylemodelId', text: '型号', dictCode: 'modenumber'}) |
||||
fieldList.push({type: 'string', value: 'modelSample', text: '模块样板', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'userId', text: '用户名', dictCode: ''}) |
||||
fieldList.push({type: 'string', value: 'createTime', text: '创建时间', dictCode: ''}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
, |
||||
openDetail(id) { |
||||
this.$refs.ZyClothSampleDetail.showModal(id) |
||||
// this.$children[0].showModal(id) |
||||
} |
||||
, |
||||
// handleDetail(id){ |
||||
// this.$refs.ZyClothSampleDetail.showModal(id) |
||||
// } |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,125 @@ |
||||
<template> |
||||
<div> |
||||
<a-modal |
||||
title="成衣样板-详情" |
||||
:visible="visible" |
||||
:confirm-loading="confirmLoading" |
||||
:width='1000' |
||||
@ok="handleOk" |
||||
@cancel="handleCancel" |
||||
style="display:flex;" |
||||
> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<j-form-container :disabled="formDisabled"> |
||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
||||
<!-- <a-col :span="24">--> |
||||
<!-- <a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="url">--> |
||||
<!-- <j-image-upload isMultiple v-model="model.url" ></j-image-upload>--> |
||||
<!-- </a-form-model-item>--> |
||||
<!-- </a-col>--> |
||||
|
||||
<a-descriptions bordered size="small" class="coin"> |
||||
<a-descriptions-item label="编号" :span="2"> |
||||
{{model.nums}} |
||||
</a-descriptions-item> |
||||
<a-descriptions-item label="客户" > |
||||
{{model.userId}} |
||||
</a-descriptions-item> |
||||
|
||||
<a-descriptions-item label="成衣名称"> |
||||
{{model.clothName}} |
||||
</a-descriptions-item> |
||||
<a-descriptions-item label="描述" > |
||||
{{model.descr}} |
||||
</a-descriptions-item> |
||||
<a-descriptions-item label="客户类型"> |
||||
{{model.type}} |
||||
</a-descriptions-item> |
||||
<a-descriptions-item label="图片"> |
||||
<j-image-upload isMultiple v-model="model.url" ></j-image-upload> |
||||
</a-descriptions-item> |
||||
</a-descriptions> |
||||
|
||||
</a-form-model> |
||||
</j-form-container> |
||||
</a-spin> |
||||
</a-modal> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import { httpAction, getAction } from '@/api/manage' |
||||
import { validateDuplicateValue } from '@/utils/util' |
||||
|
||||
export default { |
||||
name: 'ZyClothSampleDetail', |
||||
components: { |
||||
}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
model:{ |
||||
}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
}, |
||||
visible: false, |
||||
url: { |
||||
add: "/zyclothsample/zyClothSample/add", |
||||
edit: "/zyclothsample/zyClothSample/edit", |
||||
queryById: "/zyclothsample/zyClothSample/queryById" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
return this.disabled |
||||
}, |
||||
}, |
||||
created () { |
||||
//备份model原始值 |
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
}, |
||||
methods: { |
||||
showModal(id) { |
||||
// console.log(this.selectId) |
||||
this.visible = true; |
||||
this.$http.get('/zyclothsample/zyClothSample/queryById?id='+id).then( |
||||
res=>{ |
||||
this.model = res.result |
||||
console.log(this.data) |
||||
} |
||||
) |
||||
}, |
||||
handleOk(e) { |
||||
this.ModalText = 'The modal will be closed after two seconds'; |
||||
this.confirmLoading = true; |
||||
console.log(this.data) |
||||
setTimeout(() => { |
||||
this.visible = false; |
||||
this.confirmLoading = false; |
||||
}, 1); |
||||
}, |
||||
handleCancel(e) { |
||||
console.log('Clicked cancel button'); |
||||
this.visible = false; |
||||
}, |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,229 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<j-form-container :disabled="formDisabled"> |
||||
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterpriseId"> |
||||
<j-select-depart v-model="model.userId" @change="kuanshi" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
|
||||
<!--关联服装款式表 zy_cloths_style 关联列:名称 传值id |
||||
根据企业选择款式,有的企业有选项,有的没有 |
||||
--> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="款式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="styleId"> |
||||
<j-dict-select-tag v-model="model.styleId" placeholder="请输入款式" |
||||
:dict-code="dict" @change="xiugai"></j-dict-select-tag> |
||||
</a-form-model-item> |
||||
<!--编码也是唯一的,和id一样 --> |
||||
</a-col> |
||||
|
||||
<a-col :span="24"> |
||||
<a-form-model-item label="款式型号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stylemodelId"> |
||||
<!-- <a-input v-model="model.stylemodelId" placeholder="请输入款式型号" @change="(vaule) => handletypeSelect(value)"></a-input>--> |
||||
<!-- <j-dict-select-tag v-model="model.stylemodelId" placeholder="请输入款式型号"--> |
||||
<!-- dict-code="zy_style_model,model_number,model_number"></j-dict-select-tag>--> |
||||
<j-dict-select-tag v-model="model.stylemodelId" placeholder="请选择款式型号" |
||||
dictCode="modenumber" @change="gaibian"></j-dict-select-tag> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nums"> |
||||
<!-- <a-input v-model="model.nums || this.nums" placeholder="请输入编号"></a-input>--> |
||||
<a-input v-model="model.nums" placeholder="请输入编号" disabled></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<!--<j-dict-select-tag v-model="model.modelSample" placeholder="请选择模块样板"--> |
||||
<!-- dict-code="zy_module_sample, module_name, id"></j-dict-select-tag>--> |
||||
<!-- <j-search-select-tag v-model="model.modelSample" dict="zy_module_sample" dictText="module_name", dictCode="id" />--> |
||||
<!-- </a-form-model-item>--> |
||||
|
||||
<!-- <a-col :span="24">--> |
||||
<!-- <a-form-model-item label="用户名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId">--> |
||||
<!-- <!– <a-input v-model="model.userId" placeholder="请输入用户名"></a-input>–>--> |
||||
<!-- <j-dict-select-tag v-model="model.userId" placeholder="请输入用户名"--> |
||||
<!-- dict-code="sys_user,username,username"></j-dict-select-tag>--> |
||||
<!-- </a-form-model-item>--> |
||||
<!-- </a-col>--> |
||||
|
||||
<a-col :span="24"> |
||||
<a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="descr"> |
||||
<a-textarea v-model="model.descr" placeholder="请输入描述"></a-textarea> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
|
||||
<a-col :span="24"> |
||||
<a-form-model-item label="图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="url"> |
||||
<j-image-upload isMultiple v-model="model.url"></j-image-upload> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
|
||||
</a-row> |
||||
</a-form-model> |
||||
</j-form-container> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import {httpAction, getAction} from '@/api/manage' |
||||
import {validateDuplicateValue} from '@/utils/util' |
||||
|
||||
export default { |
||||
name: 'ZyClothSampleForm', |
||||
components: {}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
}, |
||||
superFieldList: [], // table列表 |
||||
}, |
||||
data() { |
||||
return { |
||||
nums: '', |
||||
selectedKey: '', // 款式id |
||||
typeid: '', // 型号, |
||||
serialNumber: '', // 顺序号 |
||||
model: { |
||||
nums:'', |
||||
}, |
||||
dict:"zy_cloths_style,style_names,nums", |
||||
labelCol: { |
||||
xs: {span: 24}, |
||||
sm: {span: 5}, |
||||
}, |
||||
wrapperCol: { |
||||
xs: {span: 24}, |
||||
sm: {span: 16}, |
||||
}, |
||||
confirmLoading: false, |
||||
/*效验规则*/ |
||||
validatorRules: { |
||||
// nums: [ |
||||
// //{pattern: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{4}$/, message: '4wei'}, |
||||
// { required:true, message: '编号不能为空'}, |
||||
// { pattern: /^[0-9A-Za-z]{0,20}$/, message: '编号太长'}, |
||||
// //{pattern: /^(?=.*([0-9a-zA-Z]){5}).[A-Za-z0-9]+$/, message: '编号为四位'}, |
||||
// ], |
||||
styleId: [ |
||||
{required: true, message: '款式不能为空'}, |
||||
], |
||||
stylemodelId: [ |
||||
{required: true, message: '款式型号不能为空'}, |
||||
], |
||||
userId: [ |
||||
{required: true, message: '用户名不能为空'},//如果为空 弹出信息 required:false关闭判断是否为空 |
||||
//{ pattern: /^\d{6,16}$/, message: '请输入6到16位数字!'} |
||||
], |
||||
descr: [ |
||||
{pattern: /^[0-9A-Za-z\u4e00-\u9fa5]{0,200}$/, message: '文本长度过长'}, |
||||
] |
||||
}, |
||||
url: { |
||||
add: "/zyclothsample/zyClothSample/add", |
||||
edit: "/zyclothsample/zyClothSample/edit", |
||||
queryById: "/zyclothsample/zyClothSample/queryById", |
||||
sort:"/zyclothsample/zyClothSample/sort" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled() { |
||||
return this.disabled; |
||||
} |
||||
}, |
||||
created() { |
||||
//备份model原始值 |
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
}, |
||||
mounted() { |
||||
// 替换数据-编号拼接 |
||||
const str = `${this.selectedKey}${this.typeid}${''}`; |
||||
// const str = undefined; |
||||
str ? this.nums = str : this.nums = this.nums; |
||||
console.log(this.props, 'superFieldList') |
||||
}, |
||||
methods: { |
||||
add() { |
||||
this.edit(this.modelDefault); |
||||
}, |
||||
// |
||||
kuanshi(){ |
||||
this.dict="zy_cloths_style,style_names,nums,enterprise_id="+"'"+this.model.userId+"'"; |
||||
this.model.styleId=null |
||||
}, |
||||
xiugai(){ |
||||
if(this.model.stylemodelId!=null&&this.model.userId!=null){ |
||||
this.gaibian() |
||||
} |
||||
}, |
||||
gaibian(){ |
||||
var n=3; |
||||
console.log(this.model) |
||||
getAction(this.url.sort,this.model).then((res)=>{ |
||||
console.log(res) |
||||
if(this.model.id!=null){ |
||||
var num=parseInt(res.result,10) |
||||
}else{ |
||||
var num=parseInt(res.result,10)+1 |
||||
|
||||
} |
||||
num=num.toString() |
||||
while(num.length<n){ |
||||
num="0"+num |
||||
} |
||||
this.model.nums=this.model.styleId+this.model.stylemodelId+num; |
||||
console.log( this.model.nums) |
||||
})}, |
||||
// 款式select改变的回调 |
||||
handleSelect(selectedKeys) { |
||||
this.selectedKey = selectedKeys; |
||||
}, |
||||
// 款式型号change事件 |
||||
handletypeSelect(selectedKeys) { |
||||
this.type = selectedKeys; |
||||
}, |
||||
edit(record) { |
||||
this.model = Object.assign({}, record); |
||||
this.dict="zy_cloths_style,style_names,nums,enterprise_id="+"'"+this.model.userId+"'"; |
||||
this.visible = true; |
||||
} |
||||
, |
||||
submitForm() { |
||||
const that = this; |
||||
// 触发表单验证 |
||||
this.$refs.form.validate(valid => { |
||||
if (valid) { |
||||
that.confirmLoading = true; |
||||
let httpurl = ''; |
||||
let method = ''; |
||||
if (!this.model.id) { |
||||
httpurl += this.url.add; |
||||
method = 'post'; |
||||
} else { |
||||
httpurl += this.url.edit; |
||||
method = 'put'; |
||||
} |
||||
httpAction(httpurl, this.model, method).then((res) => { |
||||
if (res.success) { |
||||
that.$message.success(res.message); |
||||
that.$emit('ok'); |
||||
} else { |
||||
that.$message.warning(res.message); |
||||
} |
||||
}).finally(() => { |
||||
that.confirmLoading = false; |
||||
}) |
||||
} |
||||
|
||||
}) |
||||
} |
||||
, |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,60 @@ |
||||
<template> |
||||
<j-modal |
||||
:title="title" |
||||
:width="width" |
||||
:visible="visible" |
||||
switchFullscreen |
||||
@ok="handleOk" |
||||
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
||||
@cancel="handleCancel" |
||||
cancelText="关闭"> |
||||
<zy-cloth-sample-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-cloth-sample-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import ZyClothSampleForm from './ZyClothSampleForm' |
||||
export default { |
||||
name: 'ZyClothSampleModal', |
||||
components: { |
||||
ZyClothSampleForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:'', |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}) |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,84 @@ |
||||
<template> |
||||
<a-drawer |
||||
:title="title" |
||||
:width="width" |
||||
placement="right" |
||||
:closable="false" |
||||
@close="close" |
||||
destroyOnClose |
||||
:visible="visible"> |
||||
<zy-cloth-sample-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-cloth-sample-form> |
||||
<div class="drawer-footer"> |
||||
<a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button> |
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button> |
||||
</div> |
||||
</a-drawer> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import ZyClothSampleForm from './ZyClothSampleForm' |
||||
|
||||
export default { |
||||
name: 'ZyClothSampleModal', |
||||
components: { |
||||
ZyClothSampleForm |
||||
}, |
||||
data () { |
||||
return { |
||||
title:"操作", |
||||
width:800, |
||||
visible: false, |
||||
disableSubmit: false |
||||
} |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.add(); |
||||
}) |
||||
}, |
||||
edit (record) { |
||||
this.visible=true |
||||
this.$nextTick(()=>{ |
||||
this.$refs.realForm.edit(record); |
||||
}); |
||||
}, |
||||
close () { |
||||
this.$emit('close'); |
||||
this.visible = false; |
||||
}, |
||||
submitCallback(){ |
||||
this.$emit('ok'); |
||||
this.visible = false; |
||||
}, |
||||
handleOk () { |
||||
this.$refs.realForm.submitForm(); |
||||
}, |
||||
handleCancel () { |
||||
this.close() |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="less" scoped> |
||||
/** Button按钮间距 */ |
||||
.ant-btn { |
||||
margin-left: 30px; |
||||
margin-bottom: 30px; |
||||
float: right; |
||||
} |
||||
.drawer-footer{ |
||||
position: absolute; |
||||
bottom: -8px; |
||||
width: 100%; |
||||
border-top: 1px solid #e8e8e8; |
||||
padding: 10px 16px; |
||||
text-align: right; |
||||
left: 0; |
||||
background: #fff; |
||||
border-radius: 0 0 2px 2px; |
||||
} |
||||
</style> |
Loading…
Reference in new issue