parent
2fe1d09cfa
commit
07f0c8af85
38 changed files with 1416 additions and 497 deletions
@ -0,0 +1,318 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<!-- 查询区域 --> |
||||
<div class="table-page-search-wrapper"> |
||||
<a-form layout="inline" @keyup.enter.native="searchQuery"> |
||||
<a-row :gutter="24"> |
||||
</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> |
||||
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
||||
</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="action" slot-scope="text, record"> |
||||
<a @click="handleEdit(record)">编辑</a> |
||||
|
||||
<a-divider type="vertical" /> |
||||
<a-dropdown> |
||||
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a> |
||||
<a-menu slot="overlay"> |
||||
<a-menu-item> |
||||
<a @click="handleDetail(record)">详情</a> |
||||
</a-menu-item> |
||||
<a-menu-item> |
||||
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
||||
<a>删除</a> |
||||
</a-popconfirm> |
||||
</a-menu-item> |
||||
</a-menu> |
||||
</a-dropdown> |
||||
</span> |
||||
|
||||
</a-table> |
||||
</div> |
||||
|
||||
<zy-product-modal ref="modalForm" @ok="modalFormOk"></zy-product-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import ZyProductModal from './modules/ZyProductModal' |
||||
|
||||
export default { |
||||
name: 'ZyProductList', |
||||
mixins:[JeecgListMixin, mixinDevice], |
||||
components: { |
||||
ZyProductModal |
||||
}, |
||||
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: 'productCode' |
||||
}, |
||||
{ |
||||
title:'工单', |
||||
align:"center", |
||||
dataIndex: 'workOrderId' |
||||
}, |
||||
{ |
||||
title:'生产时间', |
||||
align:"center", |
||||
dataIndex: 'produceTime' |
||||
}, |
||||
{ |
||||
title:'合计(手工TMU)', |
||||
align:"center", |
||||
dataIndex: 'totalManualTmu' |
||||
}, |
||||
{ |
||||
title:'合计(设备TMU)', |
||||
align:"center", |
||||
dataIndex: 'totalMachineTmu' |
||||
}, |
||||
{ |
||||
title:'合计(手工秒)', |
||||
align:"center", |
||||
dataIndex: 'totalMaunal' |
||||
}, |
||||
{ |
||||
title:'合计(设备秒)', |
||||
align:"center", |
||||
dataIndex: 'totalMachine' |
||||
}, |
||||
{ |
||||
title:'企业', |
||||
align:"center", |
||||
dataIndex: 'enterprisesId' |
||||
}, |
||||
{ |
||||
title:'用户', |
||||
align:"center", |
||||
dataIndex: 'userId' |
||||
}, |
||||
{ |
||||
title:'结构图', |
||||
align:"center", |
||||
dataIndex: 'structureDiagram', |
||||
scopedSlots: {customRender: 'imgSlot'} |
||||
}, |
||||
{ |
||||
title:'排料图', |
||||
align:"center", |
||||
dataIndex: 'layoutDiagram', |
||||
scopedSlots: {customRender: 'imgSlot'} |
||||
}, |
||||
{ |
||||
title:'产品图片', |
||||
align:"center", |
||||
dataIndex: 'productPicture', |
||||
scopedSlots: {customRender: 'imgSlot'} |
||||
}, |
||||
{ |
||||
title:'身高', |
||||
align:"center", |
||||
dataIndex: 'height' |
||||
}, |
||||
{ |
||||
title:'体重', |
||||
align:"center", |
||||
dataIndex: 'weight' |
||||
}, |
||||
{ |
||||
title:'下摆', |
||||
align:"center", |
||||
dataIndex: 'hem' |
||||
}, |
||||
{ |
||||
title:'袖口', |
||||
align:"center", |
||||
dataIndex: 'cuff' |
||||
}, |
||||
{ |
||||
title:'袖长', |
||||
align:"center", |
||||
dataIndex: 'sleeveLength' |
||||
}, |
||||
{ |
||||
title:'胸围', |
||||
align:"center", |
||||
dataIndex: 'bust' |
||||
}, |
||||
{ |
||||
title:'腰围', |
||||
align:"center", |
||||
dataIndex: 'theWaist' |
||||
}, |
||||
{ |
||||
title:'肩宽', |
||||
align:"center", |
||||
dataIndex: 'shoulderwidth' |
||||
}, |
||||
{ |
||||
title:'前身长', |
||||
align:"center", |
||||
dataIndex: 'forebodylength' |
||||
}, |
||||
{ |
||||
title:'领围', |
||||
align:"center", |
||||
dataIndex: 'neck' |
||||
}, |
||||
{ |
||||
title:'臀围', |
||||
align:"center", |
||||
dataIndex: 'hipline' |
||||
}, |
||||
{ |
||||
title:'衣长', |
||||
align:"center", |
||||
dataIndex: 'length' |
||||
}, |
||||
{ |
||||
title:'胸距', |
||||
align:"center", |
||||
dataIndex: 'sternalDistance' |
||||
}, |
||||
{ |
||||
title: '操作', |
||||
dataIndex: 'action', |
||||
align:"center", |
||||
fixed:"right", |
||||
width:147, |
||||
scopedSlots: { customRender: 'action' } |
||||
} |
||||
], |
||||
url: { |
||||
list: "/zyproduct/zyProduct/list", |
||||
delete: "/zyproduct/zyProduct/delete", |
||||
deleteBatch: "/zyproduct/zyProduct/deleteBatch", |
||||
exportXlsUrl: "/zyproduct/zyProduct/exportXls", |
||||
importExcelUrl: "zyproduct/zyProduct/importExcel", |
||||
|
||||
}, |
||||
dictOptions:{}, |
||||
superFieldList:[], |
||||
} |
||||
}, |
||||
created() { |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function(){ |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
initDictConfig(){ |
||||
}, |
||||
getSuperFieldList(){ |
||||
let fieldList=[]; |
||||
fieldList.push({type:'string',value:'productCode',text:'产品编号',dictCode:''}) |
||||
fieldList.push({type:'string',value:'workOrderId',text:'工单',dictCode:''}) |
||||
fieldList.push({type:'int',value:'produceTime',text:'生产时间',dictCode:''}) |
||||
fieldList.push({type:'double',value:'totalManualTmu',text:'合计(手工TMU)',dictCode:''}) |
||||
fieldList.push({type:'double',value:'totalMachineTmu',text:'合计(设备TMU)',dictCode:''}) |
||||
fieldList.push({type:'int',value:'totalMaunal',text:'合计(手工秒)',dictCode:''}) |
||||
fieldList.push({type:'int',value:'totalMachine',text:'合计(设备秒)',dictCode:''}) |
||||
fieldList.push({type:'string',value:'enterprisesId',text:'企业',dictCode:''}) |
||||
fieldList.push({type:'string',value:'userId',text:'用户',dictCode:''}) |
||||
fieldList.push({type:'string',value:'structureDiagram',text:'结构图',dictCode:''}) |
||||
fieldList.push({type:'string',value:'layoutDiagram',text:'排料图',dictCode:''}) |
||||
fieldList.push({type:'string',value:'productPicture',text:'产品图片',dictCode:''}) |
||||
fieldList.push({type:'double',value:'height',text:'身高',dictCode:''}) |
||||
fieldList.push({type:'double',value:'weight',text:'体重',dictCode:''}) |
||||
fieldList.push({type:'double',value:'hem',text:'下摆',dictCode:''}) |
||||
fieldList.push({type:'double',value:'cuff',text:'袖口',dictCode:''}) |
||||
fieldList.push({type:'double',value:'sleeveLength',text:'袖长',dictCode:''}) |
||||
fieldList.push({type:'double',value:'bust',text:'胸围',dictCode:''}) |
||||
fieldList.push({type:'double',value:'theWaist',text:'腰围',dictCode:''}) |
||||
fieldList.push({type:'double',value:'shoulderwidth',text:'肩宽',dictCode:''}) |
||||
fieldList.push({type:'double',value:'forebodylength',text:'前身长',dictCode:''}) |
||||
fieldList.push({type:'double',value:'neck',text:'领围',dictCode:''}) |
||||
fieldList.push({type:'double',value:'hipline',text:'臀围',dictCode:''}) |
||||
fieldList.push({type:'double',value:'length',text:'衣长',dictCode:''}) |
||||
fieldList.push({type:'double',value:'sternalDistance',text:'胸距',dictCode:''}) |
||||
this.superFieldList = fieldList |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
<style scoped> |
||||
@import '~@assets/less/common.less'; |
||||
</style> |
@ -0,0 +1,224 @@ |
||||
<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="productCode"> |
||||
<a-input v-model="model.productCode" placeholder="请输入产品编号" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="工单" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workOrderId"> |
||||
<a-input v-model="model.workOrderId" placeholder="请输入工单" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="生产时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="produceTime"> |
||||
<a-input-number v-model="model.produceTime" placeholder="请输入生产时间" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="合计(手工TMU)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalManualTmu"> |
||||
<a-input-number v-model="model.totalManualTmu" placeholder="请输入合计(手工TMU)" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="合计(设备TMU)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalMachineTmu"> |
||||
<a-input-number v-model="model.totalMachineTmu" placeholder="请输入合计(设备TMU)" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="合计(手工秒)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalMaunal"> |
||||
<a-input-number v-model="model.totalMaunal" placeholder="请输入合计(手工秒)" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="合计(设备秒)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalMachine"> |
||||
<a-input-number v-model="model.totalMachine" placeholder="请输入合计(设备秒)" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="企业" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="enterprisesId"> |
||||
<a-input v-model="model.enterprisesId" placeholder="请输入企业" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="用户" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="userId"> |
||||
<a-input v-model="model.userId" placeholder="请输入用户" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="结构图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="structureDiagram"> |
||||
<j-image-upload isMultiple v-model="model.structureDiagram" ></j-image-upload> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="排料图" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="layoutDiagram"> |
||||
<j-image-upload isMultiple v-model="model.layoutDiagram" ></j-image-upload> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="产品图片" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productPicture"> |
||||
<j-image-upload isMultiple v-model="model.productPicture" ></j-image-upload> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="身高" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="height"> |
||||
<a-input-number v-model="model.height" placeholder="请输入身高" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="体重" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="weight"> |
||||
<a-input-number v-model="model.weight" placeholder="请输入体重" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="下摆" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hem"> |
||||
<a-input-number v-model="model.hem" placeholder="请输入下摆" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="袖口" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cuff"> |
||||
<a-input-number v-model="model.cuff" placeholder="请输入袖口" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="袖长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sleeveLength"> |
||||
<a-input-number v-model="model.sleeveLength" placeholder="请输入袖长" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="胸围" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="bust"> |
||||
<a-input-number v-model="model.bust" placeholder="请输入胸围" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="腰围" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="theWaist"> |
||||
<a-input-number v-model="model.theWaist" placeholder="请输入腰围" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="肩宽" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="shoulderwidth"> |
||||
<a-input-number v-model="model.shoulderwidth" placeholder="请输入肩宽" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="前身长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="forebodylength"> |
||||
<a-input-number v-model="model.forebodylength" placeholder="请输入前身长" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="领围" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="neck"> |
||||
<a-input-number v-model="model.neck" placeholder="请输入领围" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="臀围" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hipline"> |
||||
<a-input-number v-model="model.hipline" placeholder="请输入臀围" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="衣长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="length"> |
||||
<a-input-number v-model="model.length" placeholder="请输入衣长" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="胸距" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sternalDistance"> |
||||
<a-input-number v-model="model.sternalDistance" placeholder="请输入胸距" style="width: 100%" /> |
||||
</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: 'ZyProductForm', |
||||
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: { |
||||
}, |
||||
url: { |
||||
add: "/zyproduct/zyProduct/add", |
||||
edit: "/zyproduct/zyProduct/edit", |
||||
queryById: "/zyproduct/zyProduct/queryById" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
return this.disabled |
||||
}, |
||||
}, |
||||
created () { |
||||
//备份model原始值 |
||||
this.modelDefault = JSON.parse(JSON.stringify(this.model)); |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.edit(this.modelDefault); |
||||
}, |
||||
edit (record) { |
||||
this.model = Object.assign({}, record); |
||||
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> |
@ -1,186 +0,0 @@ |
||||
<template> |
||||
<a-spin :spinning="confirmLoading"> |
||||
<j-form-container :disabled="formDisabled"> |
||||
<a-form :form="form" slot="detail"> |
||||
<a-row> |
||||
<a-col :span="24"> |
||||
<a-form-item label="工单ID" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||
<a-input v-decorator="['workId']" placeholder="请输入工单ID"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="工单编号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||
<a-input v-decorator="['workCode']" placeholder="请输入工单编号"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="订单ID" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||
<a-input v-decorator="['orderId']" placeholder="请输入订单ID"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="订单编号" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||
<a-input v-decorator="['orderCode']" placeholder="请输入订单编号"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="客户ID" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||
<a-input v-decorator="['customerId']" placeholder="请输入客户ID"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="客户名称" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||
<a-input v-decorator="['customerName']" placeholder="请输入客户名称"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-item label="完工百分比" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
||||
<a-input v-decorator="['finished']" placeholder="请输入完工百分比"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center"> |
||||
<a-button @click="submitForm">提 交</a-button> |
||||
</a-col> |
||||
</a-row> |
||||
</a-form> |
||||
</j-form-container> |
||||
</a-spin> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import { httpAction, getAction } from '@/api/manage' |
||||
import pick from 'lodash.pick' |
||||
import { validateDuplicateValue } from '@/utils/util' |
||||
import JFormContainer from '@/components/jeecg/JFormContainer' |
||||
|
||||
export default { |
||||
name: 'WorkOrderForm', |
||||
components: { |
||||
JFormContainer, |
||||
}, |
||||
props: { |
||||
//流程表单data
|
||||
formData: { |
||||
type: Object, |
||||
default: ()=>{}, |
||||
required: false |
||||
}, |
||||
//表单模式:true流程表单 false普通表单
|
||||
formBpm: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
}, |
||||
//表单禁用
|
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
form: this.$form.createForm(this), |
||||
model: {}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
}, |
||||
url: { |
||||
add: "/workorder/workOrder/add", |
||||
edit: "/workorder/workOrder/edit", |
||||
queryById: "/workorder/workOrder/queryById" |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
formDisabled(){ |
||||
if(this.formBpm===true){ |
||||
if(this.formData.disabled===false){ |
||||
return false |
||||
} |
||||
return true |
||||
} |
||||
return this.disabled |
||||
}, |
||||
showFlowSubmitButton(){ |
||||
if(this.formBpm===true){ |
||||
if(this.formData.disabled===false){ |
||||
return true |
||||
} |
||||
} |
||||
return false |
||||
} |
||||
}, |
||||
created () { |
||||
//如果是流程中表单,则需要加载流程表单data
|
||||
this.showFlowData(); |
||||
}, |
||||
methods: { |
||||
add () { |
||||
this.edit({}); |
||||
}, |
||||
edit (record) { |
||||
this.form.resetFields(); |
||||
this.model = Object.assign({}, record); |
||||
this.visible = true; |
||||
this.$nextTick(() => { |
||||
this.form.setFieldsValue(pick(this.model,'workId','workCode','orderId','orderCode','customerId','customerName','finished')) |
||||
}) |
||||
}, |
||||
//渲染流程表单数据
|
||||
showFlowData(){ |
||||
if(this.formBpm === true){ |
||||
let params = {id:this.formData.dataId}; |
||||
getAction(this.url.queryById,params).then((res)=>{ |
||||
if(res.success){ |
||||
this.edit (res.result); |
||||
} |
||||
}); |
||||
} |
||||
}, |
||||
submitForm () { |
||||
const that = this; |
||||
// 触发表单验证
|
||||
this.form.validateFields((err, values) => { |
||||
if (!err) { |
||||
that.confirmLoading = true; |
||||
let httpurl = ''; |
||||
let method = ''; |
||||
if(!this.model.id){ |
||||
httpurl+=this.url.add; |
||||
method = 'post'; |
||||
}else{ |
||||
httpurl+=this.url.edit; |
||||
method = 'put'; |
||||
} |
||||
let formData = Object.assign(this.model, values); |
||||
console.log("表单提交数据",formData) |
||||
httpAction(httpurl,formData,method).then((res)=>{ |
||||
if(res.success){ |
||||
that.$message.success(res.message); |
||||
that.$emit('ok'); |
||||
}else{ |
||||
that.$message.warning(res.message); |
||||
} |
||||
}).finally(() => { |
||||
that.confirmLoading = false; |
||||
}) |
||||
} |
||||
|
||||
}) |
||||
}, |
||||
popupCallback(row){ |
||||
this.form.setFieldsValue(pick(row,'workId','workCode','orderId','orderCode','customerId','customerName','finished')) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,171 @@ |
||||
package org.jeecg.modules.workproduct.controller; |
||||
|
||||
import java.util.Arrays; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
import java.io.IOException; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.net.URLDecoder; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import javax.servlet.http.HttpServletResponse; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.system.query.QueryGenerator; |
||||
import org.jeecg.common.util.oConvertUtils; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
|
||||
import org.jeecg.modules.workproduct.entity.ZyProduct; |
||||
import org.jeecg.modules.workproduct.service.IZyProductService; |
||||
import org.jeecgframework.poi.excel.ExcelImportUtil; |
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
||||
import org.jeecgframework.poi.excel.entity.ExportParams; |
||||
import org.jeecgframework.poi.excel.entity.ImportParams; |
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
||||
import org.jeecg.common.system.base.controller.JeecgController; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
import org.springframework.web.multipart.MultipartHttpServletRequest; |
||||
import org.springframework.web.servlet.ModelAndView; |
||||
import com.alibaba.fastjson.JSON; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.jeecg.common.aspect.annotation.AutoLog; |
||||
|
||||
/** |
||||
* @Description: 产品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-01-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Api(tags="产品表") |
||||
@RestController |
||||
@RequestMapping("/zyproduct/zyProduct") |
||||
@Slf4j |
||||
public class ZyProductController extends JeecgController<ZyProduct, IZyProductService> { |
||||
@Autowired |
||||
private IZyProductService zyProductService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param zyProduct |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "产品表-分页列表查询") |
||||
@ApiOperation(value="产品表-分页列表查询", notes="产品表-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(ZyProduct zyProduct, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<ZyProduct> queryWrapper = QueryGenerator.initQueryWrapper(zyProduct, req.getParameterMap()); |
||||
Page<ZyProduct> page = new Page<ZyProduct>(pageNo, pageSize); |
||||
IPage<ZyProduct> pageList = zyProductService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param zyProduct |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "产品表-添加") |
||||
@ApiOperation(value="产品表-添加", notes="产品表-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody ZyProduct zyProduct) { |
||||
zyProductService.save(zyProduct); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param zyProduct |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "产品表-编辑") |
||||
@ApiOperation(value="产品表-编辑", notes="产品表-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody ZyProduct zyProduct) { |
||||
zyProductService.updateById(zyProduct); |
||||
return Result.OK("编辑成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "产品表-通过id删除") |
||||
@ApiOperation(value="产品表-通过id删除", notes="产品表-通过id删除") |
||||
@DeleteMapping(value = "/delete") |
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
||||
zyProductService.removeById(id); |
||||
return Result.OK("删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 批量删除 |
||||
* |
||||
* @param ids |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "产品表-批量删除") |
||||
@ApiOperation(value="产品表-批量删除", notes="产品表-批量删除") |
||||
@DeleteMapping(value = "/deleteBatch") |
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
||||
this.zyProductService.removeByIds(Arrays.asList(ids.split(","))); |
||||
return Result.OK("批量删除成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 通过id查询 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "产品表-通过id查询") |
||||
@ApiOperation(value="产品表-通过id查询", notes="产品表-通过id查询") |
||||
@GetMapping(value = "/queryById") |
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) { |
||||
ZyProduct zyProduct = zyProductService.getById(id); |
||||
if(zyProduct==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(zyProduct); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param zyProduct |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, ZyProduct zyProduct) { |
||||
return super.exportXls(request, zyProduct, ZyProduct.class, "产品表"); |
||||
} |
||||
|
||||
/** |
||||
* 通过excel导入数据 |
||||
* |
||||
* @param request |
||||
* @param response |
||||
* @return |
||||
*/ |
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
||||
return super.importExcel(request, response, ZyProduct.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,157 @@ |
||||
package org.jeecg.modules.workproduct.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.io.UnsupportedEncodingException; |
||||
import java.util.Date; |
||||
import java.math.BigDecimal; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
import org.springframework.format.annotation.DateTimeFormat; |
||||
import org.jeecgframework.poi.excel.annotation.Excel; |
||||
import org.jeecg.common.aspect.annotation.Dict; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* @Description: 产品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-01-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Data |
||||
@TableName("zy_product") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="zy_product对象", description="产品表") |
||||
public class ZyProduct implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/**主键*/ |
||||
@TableId(type = IdType.ASSIGN_ID) |
||||
@ApiModelProperty(value = "主键") |
||||
private String id; |
||||
/**创建人*/ |
||||
@ApiModelProperty(value = "创建人") |
||||
private String createBy; |
||||
/**创建日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "创建日期") |
||||
private Date createTime; |
||||
/**更新人*/ |
||||
@ApiModelProperty(value = "更新人") |
||||
private String updateBy; |
||||
/**更新日期*/ |
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") |
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
||||
@ApiModelProperty(value = "更新日期") |
||||
private Date updateTime; |
||||
/**所属部门*/ |
||||
@ApiModelProperty(value = "所属部门") |
||||
private String sysOrgCode; |
||||
/**产品编号*/ |
||||
@Excel(name = "产品编号", width = 15) |
||||
@ApiModelProperty(value = "产品编号") |
||||
private String productCode; |
||||
/**工单*/ |
||||
@Excel(name = "工单", width = 15) |
||||
@ApiModelProperty(value = "工单") |
||||
private String workOrderId; |
||||
/**生产时间*/ |
||||
@Excel(name = "生产时间", width = 15) |
||||
@ApiModelProperty(value = "生产时间") |
||||
private Integer produceTime; |
||||
/**合计(手工TMU)*/ |
||||
@Excel(name = "合计(手工TMU)", width = 15) |
||||
@ApiModelProperty(value = "合计(手工TMU)") |
||||
private Double totalManualTmu; |
||||
/**合计(设备TMU)*/ |
||||
@Excel(name = "合计(设备TMU)", width = 15) |
||||
@ApiModelProperty(value = "合计(设备TMU)") |
||||
private Double totalMachineTmu; |
||||
/**合计(手工秒)*/ |
||||
@Excel(name = "合计(手工秒)", width = 15) |
||||
@ApiModelProperty(value = "合计(手工秒)") |
||||
private Integer totalMaunal; |
||||
/**合计(设备秒)*/ |
||||
@Excel(name = "合计(设备秒)", width = 15) |
||||
@ApiModelProperty(value = "合计(设备秒)") |
||||
private Integer totalMachine; |
||||
/**企业*/ |
||||
@Excel(name = "企业", width = 15) |
||||
@ApiModelProperty(value = "企业") |
||||
private String enterprisesId; |
||||
/**用户*/ |
||||
@Excel(name = "用户", width = 15) |
||||
@ApiModelProperty(value = "用户") |
||||
private String userId; |
||||
/**结构图*/ |
||||
@Excel(name = "结构图", width = 15) |
||||
@ApiModelProperty(value = "结构图") |
||||
private String structureDiagram; |
||||
/**排料图*/ |
||||
@Excel(name = "排料图", width = 15) |
||||
@ApiModelProperty(value = "排料图") |
||||
private String layoutDiagram; |
||||
/**产品图片*/ |
||||
@Excel(name = "产品图片", width = 15) |
||||
@ApiModelProperty(value = "产品图片") |
||||
private String productPicture; |
||||
/**身高*/ |
||||
@Excel(name = "身高", width = 15) |
||||
@ApiModelProperty(value = "身高") |
||||
private Double height; |
||||
/**体重*/ |
||||
@Excel(name = "体重", width = 15) |
||||
@ApiModelProperty(value = "体重") |
||||
private Double weight; |
||||
/**下摆*/ |
||||
@Excel(name = "下摆", width = 15) |
||||
@ApiModelProperty(value = "下摆") |
||||
private Double hem; |
||||
/**袖口*/ |
||||
@Excel(name = "袖口", width = 15) |
||||
@ApiModelProperty(value = "袖口") |
||||
private Double cuff; |
||||
/**袖长*/ |
||||
@Excel(name = "袖长", width = 15) |
||||
@ApiModelProperty(value = "袖长") |
||||
private Double sleeveLength; |
||||
/**胸围*/ |
||||
@Excel(name = "胸围", width = 15) |
||||
@ApiModelProperty(value = "胸围") |
||||
private Double bust; |
||||
/**腰围*/ |
||||
@Excel(name = "腰围", width = 15) |
||||
@ApiModelProperty(value = "腰围") |
||||
private Double theWaist; |
||||
/**肩宽*/ |
||||
@Excel(name = "肩宽", width = 15) |
||||
@ApiModelProperty(value = "肩宽") |
||||
private Double shoulderwidth; |
||||
/**前身长*/ |
||||
@Excel(name = "前身长", width = 15) |
||||
@ApiModelProperty(value = "前身长") |
||||
private Double forebodylength; |
||||
/**领围*/ |
||||
@Excel(name = "领围", width = 15) |
||||
@ApiModelProperty(value = "领围") |
||||
private Double neck; |
||||
/**臀围*/ |
||||
@Excel(name = "臀围", width = 15) |
||||
@ApiModelProperty(value = "臀围") |
||||
private Double hipline; |
||||
/**衣长*/ |
||||
@Excel(name = "衣长", width = 15) |
||||
@ApiModelProperty(value = "衣长") |
||||
private Double length; |
||||
/**胸距*/ |
||||
@Excel(name = "胸距", width = 15) |
||||
@ApiModelProperty(value = "胸距") |
||||
private Double sternalDistance; |
||||
} |
@ -0,0 +1,17 @@ |
||||
package org.jeecg.modules.workproduct.mapper; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import org.jeecg.modules.workproduct.entity.ZyProduct; |
||||
|
||||
/** |
||||
* @Description: 产品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-01-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface ZyProductMapper extends BaseMapper<ZyProduct> { |
||||
|
||||
} |
@ -0,0 +1,5 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.jeecg.modules.workproduct.mapper.ZyProductMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,14 @@ |
||||
package org.jeecg.modules.workproduct.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import org.jeecg.modules.workproduct.entity.ZyProduct; |
||||
|
||||
/** |
||||
* @Description: 产品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-01-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IZyProductService extends IService<ZyProduct> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.workproduct.service.impl; |
||||
|
||||
import org.jeecg.modules.workproduct.entity.ZyProduct; |
||||
import org.jeecg.modules.workproduct.mapper.ZyProductMapper; |
||||
import org.jeecg.modules.workproduct.service.IZyProductService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
||||
/** |
||||
* @Description: 产品表 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-01-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
@Service |
||||
public class ZyProductServiceImpl extends ServiceImpl<ZyProductMapper, ZyProduct> implements IZyProductService { |
||||
|
||||
} |
Loading…
Reference in new issue