commit
120ac73975
57 changed files with 2947 additions and 1176 deletions
@ -0,0 +1,131 @@ |
||||
<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="10" :lg="11" :md="12" :sm="24"> |
||||
<a-form-item label="库存剩余"> |
||||
<a-input placeholder="请输入最小值" class="query-group-cust" v-model="queryParam.kcsy_begin"></a-input> |
||||
<span class="query-group-split-cust"></span> |
||||
<a-input placeholder="请输入最大值" class="query-group-cust" v-model="queryParam.kcsy_end"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="名称"> |
||||
<a-input placeholder="请输入名称" v-model="queryParam.temp1"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
<template v-if="toggleSearchStatus"> |
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24"> |
||||
<a-form-item label="编号"> |
||||
<a-input placeholder="请输入编号" v-model="queryParam.temp2"></a-input> |
||||
</a-form-item> |
||||
</a-col> |
||||
</template> |
||||
<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> |
||||
<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> |
||||
|
||||
<kucun-modal ref="modalForm" @ok="modalFormOk"></kucun-modal> |
||||
</a-card> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import { mixinDevice } from '@/utils/mixin' |
||||
import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
||||
import KucunModal from './modules/KucunModal' |
||||
import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' |
@ -0,0 +1,188 @@ |
||||
<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="wuplx"> |
||||
<j-dict-select-tag type="list" v-model="model.wuplx" dictCode="goods_category" placeholder="请选择物品类型" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24" v-if="this.model.wuplx==1"> |
||||
<a-form-model-item label="面料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="mlname"> |
||||
<j-popup |
||||
v-model="model.mlname" |
||||
field="mlname" |
||||
org-fields="name,id,fabric_number" |
||||
dest-fields="mlname,mlid,mlbh" |
||||
code="findml" |
||||
:multi="true" |
||||
@input="popupCallback" |
||||
/> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24" v-if="this.model.wuplx==2"> |
||||
<a-form-model-item label="辅料" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="flname"> |
||||
<j-popup |
||||
v-model="model.flname" |
||||
field="flname" |
||||
org-fields="id,contents" |
||||
dest-fields="flid,flname" |
||||
code="ckfindfl" |
||||
:multi="true" |
||||
@input="popupCallback" |
||||
/> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24" v-if="this.model.wuplx==3"> |
||||
<a-form-model-item label="设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="sbname"> |
||||
<j-popup |
||||
v-model="model.sbname" |
||||
field="sbname" |
||||
org-fields="id,code,name" |
||||
dest-fields="sbid,sbbh,sbname" |
||||
code="ckfindsb" |
||||
:multi="true" |
||||
@input="popupCallback" |
||||
/> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24" v-if="this.model.wuplx==4"> |
||||
<a-form-model-item label="工具" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="gjname"> |
||||
<j-popup |
||||
v-model="model.gjname" |
||||
field="gjname" |
||||
org-fields="id,name,nums" |
||||
dest-fields="gjid,gjbh,gjname" |
||||
code="kcfindgj" |
||||
:multi="true" |
||||
@input="popupCallback" |
||||
/> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24" v-if="this.model.wuplx==5"> |
||||
<a-form-model-item label="商品" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="spname"> |
||||
<j-popup |
||||
v-model="model.spname" |
||||
field="spname" |
||||
org-fields="id,goods_code,goods_name" |
||||
dest-fields="spid,spbh,spname" |
||||
code="kcfindsp" |
||||
:multi="true" |
||||
@input="popupCallback" |
||||
/> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="库存剩余" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="kcsy"> |
||||
<a-input-number v-model="model.kcsy" placeholder="请输入库存剩余" style="width: 100%" /> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<!--<a-col :span="24"> |
||||
<a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="temp1"> |
||||
<a-input v-model="model.temp1" placeholder="请输入名称" ></a-input> |
||||
</a-form-model-item> |
||||
</a-col> |
||||
<a-col :span="24"> |
||||
<a-form-model-item label="编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="temp2"> |
||||
<a-input v-model="model.temp2" placeholder="请输入编号" ></a-input> |
||||
</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: 'KucunForm', |
||||
components: { |
||||
}, |
||||
props: { |
||||
//表单禁用 |
||||
disabled: { |
||||
type: Boolean, |
||||
default: false, |
||||
required: false |
||||
} |
||||
}, |
||||
data () { |
||||
return { |
||||
model:{ |
||||
wuplx : "" |
||||
}, |
||||
labelCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 5 }, |
||||
}, |
||||
wrapperCol: { |
||||
xs: { span: 24 }, |
||||
sm: { span: 16 }, |
||||
}, |
||||
confirmLoading: false, |
||||
validatorRules: { |
||||
}, |
||||
url: { |
||||
add: "/kucun/kucun/add", |
||||
edit: "/kucun/kucun/edit", |
||||
queryById: "/kucun/kucun/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; |
||||
}) |
||||
} |
||||
|
||||
}) |
||||
}, |
||||
popupCallback(value,row){ |
||||
this.model = Object.assign(this.model, row); |
||||
}, |
||||
} |
||||
} |
||||
</script> |
@ -1,422 +1,422 @@ |
||||
<template> |
||||
<a-card :bordered="false"> |
||||
<div class="table-operator"> |
||||
<a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button> |
||||
<a-button type="primary" @click="fanHui()">保存</a-button> |
||||
<a-button type="primary" @click="fanHui()">返回</a-button> |
||||
</div> |
||||
<!--<template>--> |
||||
<!-- <a-card :bordered="false">--> |
||||
<!-- <div class="table-operator">--> |
||||
<!-- <a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>--> |
||||
<!-- <a-button type="primary" @click="fanHui()">保存</a-button>--> |
||||
<!-- <a-button type="primary" @click="fanHui()">返回</a-button>--> |
||||
<!-- </div>--> |
||||
|
||||
<!-- table区域-begin --> |
||||
<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"> |
||||
<span slot="stationList" slot-scope="stationList"> |
||||
<a-select @change="getToolAndMachine" style="width: 180px" placeholder="请选择"> |
||||
<a-select-option v-for="item in stationList" :value="item.id"> |
||||
{{ item.stationName }} |
||||
</a-select-option> |
||||
</a-select> |
||||
</span> |
||||
<!-- <!– table区域-begin –>--> |
||||
<!-- <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">--> |
||||
<!-- <span slot="stationList" slot-scope="stationList">--> |
||||
<!-- <a-select @change="getToolAndMachine" style="width: 180px" placeholder="请选择">--> |
||||
<!-- <a-select-option v-for="item in stationList" :value="item.id">--> |
||||
<!-- {{ item.stationName }}--> |
||||
<!-- </a-select-option>--> |
||||
<!-- </a-select>--> |
||||
<!-- </span>--> |
||||
|
||||
<span slot="toolsList" slot-scope="toolsList"> |
||||
<a-select style="width: 180px" placeholder="请选择"> |
||||
<a-select-option v-for="item in toolsList" :value="item.id"> |
||||
{{ item.name }} |
||||
</a-select-option> |
||||
</a-select> |
||||
</span> |
||||
<!-- <span slot="toolsList" slot-scope="toolsList">--> |
||||
<!-- <a-select style="width: 180px" placeholder="请选择">--> |
||||
<!-- <a-select-option v-for="item in toolsList" :value="item.id">--> |
||||
<!-- {{ item.name }}--> |
||||
<!-- </a-select-option>--> |
||||
<!-- </a-select>--> |
||||
<!-- </span>--> |
||||
|
||||
<span slot="machineList" slot-scope="machineList"> |
||||
<a-select style="width: 180px" placeholder="请选择"> |
||||
<a-select-option v-for="item in machineList" :value="item.id"> |
||||
{{ item.name }} |
||||
</a-select-option> |
||||
</a-select> |
||||
</span> |
||||
<!-- <span slot="machineList" slot-scope="machineList">--> |
||||
<!-- <a-select style="width: 180px" placeholder="请选择">--> |
||||
<!-- <a-select-option v-for="item in machineList" :value="item.id">--> |
||||
<!-- {{ item.name }}--> |
||||
<!-- </a-select-option>--> |
||||
<!-- </a-select>--> |
||||
<!-- </span>--> |
||||
|
||||
<span slot="proProcess" slot-scope="proProcess"> |
||||
<j-search-select-tag type="list" dict="zy_process,process_name,id,id in(select process_id from zy_product_process where product_id='1')" pidField="pid" |
||||
pidValue="" placeholder="前导工序"/> |
||||
</span> |
||||
<span slot="postProcess" slot-scope="postProcess"> |
||||
<j-search-select-tag type="list" dict="zy_process,process_name,id,id in(select process_id from zy_product_process where product_id='1')" pidField="pid" |
||||
pidValue="" placeholder="后导工序"/> |
||||
</span> |
||||
<!-- <span slot="proProcess" slot-scope="proProcess">--> |
||||
<!-- <j-search-select-tag type="list" dict="zy_process,process_name,id,id in(select process_id from zy_product_process where product_id='1')" pidField="pid"--> |
||||
<!-- pidValue="" placeholder="前导工序"/>--> |
||||
<!-- </span>--> |
||||
<!-- <span slot="postProcess" slot-scope="postProcess">--> |
||||
<!-- <j-search-select-tag type="list" dict="zy_process,process_name,id,id in(select process_id from zy_product_process where product_id='1')" pidField="pid"--> |
||||
<!-- pidValue="" placeholder="后导工序"/>--> |
||||
<!-- </span>--> |
||||
|
||||
<span slot="inputProduct" slot-scope="inputProduct"> |
||||
<a-input v-model="processIds" placeholder="请输入产品"></a-input> |
||||
</span> |
||||
<span slot="semiProduct" slot-scope="semiProduct"> |
||||
<a-input v-model="semiProduct" placeholder="请输入成品/半成品"></a-input> |
||||
</span> |
||||
<!-- <span slot="inputProduct" slot-scope="inputProduct">--> |
||||
<!-- <a-input v-model="processIds" placeholder="请输入产品"></a-input>--> |
||||
<!-- </span>--> |
||||
<!-- <span slot="semiProduct" slot-scope="semiProduct">--> |
||||
<!-- <a-input v-model="semiProduct" placeholder="请输入成品/半成品"></a-input>--> |
||||
<!-- </span>--> |
||||
|
||||
<!-- <template |
||||
v-for="col in columns" |
||||
:slot="col" |
||||
slot-scope="text, record, index" |
||||
> |
||||
<div :key="col"> |
||||
<a-input |
||||
v-if="record.editable" |
||||
style="margin: -5px 0" |
||||
:value="text" |
||||
@change="e => handleChange(e.target.value, record.key, col)" |
||||
/> |
||||
<template v-else> |
||||
{{ text }} |
||||
</template> |
||||
</div> |
||||
</template> |
||||
<template slot="operation" slot-scope="text, record, index"> |
||||
<div class="editable-row-operations"> |
||||
<span v-if="record.editable"> |
||||
<a @click="() => save(record)">Save</a> |
||||
<a-popconfirm title="Sure to cancel?" @confirm="() => cancel(record)"> |
||||
<a>Cancel</a> |
||||
</a-popconfirm> |
||||
</span> |
||||
<span> |
||||
<a :disabled="editingKey !== ''" @click="() => edit(index)">Edit66</a> |
||||
</span> b |
||||
</div> |
||||
</template>--> |
||||
</a-table> |
||||
</div> |
||||
<!-- <!– <template--> |
||||
<!-- v-for="col in columns"--> |
||||
<!-- :slot="col"--> |
||||
<!-- slot-scope="text, record, index"--> |
||||
<!-- >--> |
||||
<!-- <div :key="col">--> |
||||
<!-- <a-input--> |
||||
<!-- v-if="record.editable"--> |
||||
<!-- style="margin: -5px 0"--> |
||||
<!-- :value="text"--> |
||||
<!-- @change="e => handleChange(e.target.value, record.key, col)"--> |
||||
<!-- />--> |
||||
<!-- <template v-else>--> |
||||
<!-- {{ text }}--> |
||||
<!-- </template>--> |
||||
<!-- </div>--> |
||||
<!-- </template>--> |
||||
<!-- <template slot="operation" slot-scope="text, record, index">--> |
||||
<!-- <div class="editable-row-operations">--> |
||||
<!-- <span v-if="record.editable">--> |
||||
<!-- <a @click="() => save(record)">Save</a>--> |
||||
<!-- <a-popconfirm title="Sure to cancel?" @confirm="() => cancel(record)">--> |
||||
<!-- <a>Cancel</a>--> |
||||
<!-- </a-popconfirm>--> |
||||
<!-- </span>--> |
||||
<!-- <span>--> |
||||
<!-- <a :disabled="editingKey !== ''" @click="() => edit(index)">Edit66</a>--> |
||||
<!-- </span> b--> |
||||
<!-- </div>--> |
||||
<!-- </template>–>--> |
||||
<!-- </a-table>--> |
||||
<!-- </div>--> |
||||
|
||||
<div class="table-operator" style="text-align: right"> |
||||
<a-button type="primary" @click="fanHui()">提交</a-button> |
||||
</div> |
||||
<!-- <div class="table-operator" style="text-align: right">--> |
||||
<!-- <a-button type="primary" @click="fanHui()">提交</a-button>--> |
||||
<!-- </div>--> |
||||
|
||||
<!-- <zy-plan-process-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></zy-plan-process-modal>--> |
||||
</a-card> |
||||
</template> |
||||
<!-- <!– <zy-plan-process-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></zy-plan-process-modal>–>--> |
||||
<!-- </a-card>--> |
||||
<!--</template>--> |
||||
|
||||
<script> |
||||
<!--<script>--> |
||||
|
||||
import '@/assets/less/TableExpand.less' |
||||
import {mixinDevice} from '@/utils/mixin' |
||||
import {JeecgListMixin} from '@/mixins/JeecgListMixin' |
||||
import ZyPlanProcessModal from './modules/ZyPlanProcessModal2' |
||||
import {getAction} from "@api/manage"; |
||||
import {filterObj} from "@/utils/util"; |
||||
<!--import '@/assets/less/TableExpand.less'--> |
||||
<!--import {mixinDevice} from '@/utils/mixin'--> |
||||
<!--import {JeecgListMixin} from '@/mixins/JeecgListMixin'--> |
||||
<!--import ZyPlanProcessModal from './modules/ZyPlanProcessModal2'--> |
||||
<!--import {getAction} from "@api/manage";--> |
||||
<!--import {filterObj} from "@/utils/util";--> |
||||
|
||||
export default { |
||||
name: 'ZyPlanProcessList', |
||||
mixins: [JeecgListMixin, mixinDevice], |
||||
components: { |
||||
ZyPlanProcessModal |
||||
}, |
||||
data() { |
||||
// this.cacheData = this.dataSource.map(item => ({ ...item })); |
||||
this.cacheData = []; |
||||
return { |
||||
description: '生产计划工序管理页面', |
||||
// columns, |
||||
// 表头 |
||||
columns: [ |
||||
{ |
||||
title: '#', |
||||
dataIndex: 'productProcessId', |
||||
key: 'rowIndex', |
||||
width: 60, |
||||
align: "center", |
||||
customRender: function (t, r, index) { |
||||
return parseInt(index) + 1; |
||||
} |
||||
}, |
||||
/* { |
||||
title: '计划id', |
||||
align: "center", |
||||
dataIndex: 'planId' |
||||
},*/ |
||||
{ |
||||
title: '工单编号', |
||||
align: "center", |
||||
dataIndex: 'workOrderId', |
||||
scopedSlots: {customRender: 'workOrderId'} |
||||
}, |
||||
/*{ |
||||
title: '产品id', |
||||
align: "center", |
||||
dataIndex: 'productId' |
||||
}, |
||||
{ |
||||
title: '工序id', |
||||
align: "center", |
||||
dataIndex: 'productProcessId' |
||||
},*/ |
||||
{ |
||||
title: '产品', |
||||
align: "center", |
||||
dataIndex: 'productName' |
||||
}, |
||||
{ |
||||
title: '车间', |
||||
align: "center", |
||||
dataIndex: 'departName' |
||||
}, |
||||
{ |
||||
title: '工序', |
||||
align: "center", |
||||
dataIndex: 'processName' |
||||
}, |
||||
{ |
||||
title: '工位列表', |
||||
align: "center", |
||||
dataIndex: 'stationList', |
||||
width: 150, |
||||
scopedSlots: {customRender: 'stationList'} |
||||
}, |
||||
{ |
||||
title: '工位工具列表', |
||||
align: "center", |
||||
dataIndex: 'toolsList', |
||||
width: 150, |
||||
// scopedSlots: {customRender: this.toolsList} |
||||
scopedSlots: {customRender: 'toolsList'} |
||||
}, |
||||
{ |
||||
title: '工具设备列表', |
||||
align: "center", |
||||
dataIndex: 'machineList', |
||||
width: 150, |
||||
scopedSlots: {customRender: 'machineList'} |
||||
}, |
||||
{ |
||||
title: '前导工序', |
||||
align: "center", |
||||
dataIndex: 'proProcess', |
||||
width: 150, |
||||
scopedSlots: {customRender: 'proProcess'} |
||||
}, |
||||
{ |
||||
title: '后导工序', |
||||
align: "center", |
||||
dataIndex: 'proProcess', |
||||
width: 150, |
||||
scopedSlots: {customRender: 'postProcess'} |
||||
}, |
||||
{ |
||||
title: '输入产品', |
||||
align: "center", |
||||
dataIndex: 'inputProduct', |
||||
width: 150, |
||||
scopedSlots: {customRender: 'inputProduct'} |
||||
}, |
||||
{ |
||||
title: '成品/半成品', |
||||
align: "center", |
||||
dataIndex: 'semiProduct', |
||||
width: 150, |
||||
scopedSlots: {customRender: 'semiProduct'} |
||||
}, |
||||
<!--export default {--> |
||||
<!-- name: 'ZyPlanProcessList',--> |
||||
<!-- mixins: [JeecgListMixin, mixinDevice],--> |
||||
<!-- components: {--> |
||||
<!-- ZyPlanProcessModal--> |
||||
<!-- },--> |
||||
<!-- data() {--> |
||||
<!-- // this.cacheData = this.dataSource.map(item => ({ ...item }));--> |
||||
<!-- this.cacheData = [];--> |
||||
<!-- return {--> |
||||
<!-- description: '生产计划工序管理页面',--> |
||||
<!-- // columns,--> |
||||
<!-- // 表头--> |
||||
<!-- columns: [--> |
||||
<!-- {--> |
||||
<!-- title: '#',--> |
||||
<!-- dataIndex: 'productProcessId',--> |
||||
<!-- key: 'rowIndex',--> |
||||
<!-- width: 60,--> |
||||
<!-- align: "center",--> |
||||
<!-- customRender: function (t, r, index) {--> |
||||
<!-- return parseInt(index) + 1;--> |
||||
<!-- }--> |
||||
<!-- },--> |
||||
<!-- /* {--> |
||||
<!-- title: '计划id',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'planId'--> |
||||
<!-- },*/--> |
||||
<!-- {--> |
||||
<!-- title: '工单编号',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'workOrderId',--> |
||||
<!-- scopedSlots: {customRender: 'workOrderId'}--> |
||||
<!-- },--> |
||||
<!-- /*{--> |
||||
<!-- title: '产品id',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'productId'--> |
||||
<!-- },--> |
||||
<!-- {--> |
||||
<!-- title: '工序id',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'productProcessId'--> |
||||
<!-- },*/--> |
||||
<!-- {--> |
||||
<!-- title: '产品',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'productName'--> |
||||
<!-- },--> |
||||
<!-- {--> |
||||
<!-- title: '车间',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'departName'--> |
||||
<!-- },--> |
||||
<!-- {--> |
||||
<!-- title: '工序',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'processName'--> |
||||
<!-- },--> |
||||
<!-- {--> |
||||
<!-- title: '工位列表',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'stationList',--> |
||||
<!-- width: 150,--> |
||||
<!-- scopedSlots: {customRender: 'stationList'}--> |
||||
<!-- },--> |
||||
<!-- {--> |
||||
<!-- title: '工位工具列表',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'toolsList',--> |
||||
<!-- width: 150,--> |
||||
<!-- // scopedSlots: {customRender: this.toolsList}--> |
||||
<!-- scopedSlots: {customRender: 'toolsList'}--> |
||||
<!-- },--> |
||||
<!-- {--> |
||||
<!-- title: '工具设备列表',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'machineList',--> |
||||
<!-- width: 150,--> |
||||
<!-- scopedSlots: {customRender: 'machineList'}--> |
||||
<!-- },--> |
||||
<!-- {--> |
||||
<!-- title: '前导工序',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'proProcess',--> |
||||
<!-- width: 150,--> |
||||
<!-- scopedSlots: {customRender: 'proProcess'}--> |
||||
<!-- },--> |
||||
<!-- {--> |
||||
<!-- title: '后导工序',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'proProcess',--> |
||||
<!-- width: 150,--> |
||||
<!-- scopedSlots: {customRender: 'postProcess'}--> |
||||
<!-- },--> |
||||
<!-- {--> |
||||
<!-- title: '输入产品',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'inputProduct',--> |
||||
<!-- width: 150,--> |
||||
<!-- scopedSlots: {customRender: 'inputProduct'}--> |
||||
<!-- },--> |
||||
<!-- {--> |
||||
<!-- title: '成品/半成品',--> |
||||
<!-- align: "center",--> |
||||
<!-- dataIndex: 'semiProduct',--> |
||||
<!-- width: 150,--> |
||||
<!-- scopedSlots: {customRender: 'semiProduct'}--> |
||||
<!-- },--> |
||||
|
||||
// { |
||||
// title: 'operation', |
||||
// dataIndex: 'operation', |
||||
// scopedSlots: {customRender: 'operation'}, |
||||
// }, |
||||
<!-- // {--> |
||||
<!-- // title: 'operation',--> |
||||
<!-- // dataIndex: 'operation',--> |
||||
<!-- // scopedSlots: {customRender: 'operation'},--> |
||||
<!-- // },--> |
||||
|
||||
// { |
||||
// title: '操作', |
||||
// dataIndex: 'action', |
||||
// align: "center", |
||||
// fixed: "right", |
||||
// width: 147, |
||||
// scopedSlots: {customRender: 'action'} |
||||
// } |
||||
], |
||||
editingKey: '', |
||||
url: { |
||||
list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist", |
||||
stationToolslist: "/stationTool/list", |
||||
stationMachinelist: "/stationMachine/list", |
||||
// productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list", |
||||
delete: "/org.jeecg.modules.productplan/zyPlanProcess/delete", |
||||
// deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch", |
||||
// exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcess/exportXls", |
||||
// importExcelUrl: "org.jeecg.modules.productplan/zyPlanProcess/importExcel", |
||||
}, |
||||
loadRouteType: false, |
||||
planId: "", |
||||
dictOptions: {}, |
||||
// superFieldList: [], |
||||
toolsList: [], |
||||
machineList: [], |
||||
} |
||||
}, |
||||
created() { |
||||
this.getSuperFieldList(); |
||||
}, |
||||
computed: { |
||||
importExcelUrl: function () { |
||||
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
||||
}, |
||||
}, |
||||
methods: { |
||||
fanHui() { |
||||
this.$router.push({ |
||||
path: '/productplan/ZyPlanProcessList', |
||||
}); |
||||
}, |
||||
getToolAndMachine(stationId) { |
||||
// alert("stationId=" + stationId); |
||||
getAction(this.url.stationToolslist, {"stationId": stationId}).then((res) => { |
||||
if (res.success) { |
||||
this.toolsList = res.result.records || res.result; |
||||
console.log("toolsList", JSON.stringify(this.toolsList)) |
||||
} else { |
||||
this.$message.warning(res.message) |
||||
} |
||||
}); |
||||
<!-- // {--> |
||||
<!-- // title: '操作',--> |
||||
<!-- // dataIndex: 'action',--> |
||||
<!-- // align: "center",--> |
||||
<!-- // fixed: "right",--> |
||||
<!-- // width: 147,--> |
||||
<!-- // scopedSlots: {customRender: 'action'}--> |
||||
<!-- // }--> |
||||
<!-- ],--> |
||||
<!-- editingKey: '',--> |
||||
<!-- url: {--> |
||||
<!-- list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist",--> |
||||
<!-- stationToolslist: "/stationTool/list",--> |
||||
<!-- stationMachinelist: "/stationMachine/list",--> |
||||
<!-- // productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list",--> |
||||
<!-- delete: "/org.jeecg.modules.productplan/zyPlanProcess/delete",--> |
||||
<!-- // deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch",--> |
||||
<!-- // exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcess/exportXls",--> |
||||
<!-- // importExcelUrl: "org.jeecg.modules.productplan/zyPlanProcess/importExcel",--> |
||||
<!-- },--> |
||||
<!-- loadRouteType: false,--> |
||||
<!-- planId: "",--> |
||||
<!-- dictOptions: {},--> |
||||
<!-- // superFieldList: [],--> |
||||
<!-- toolsList: [],--> |
||||
<!-- machineList: [],--> |
||||
<!-- }--> |
||||
<!-- },--> |
||||
<!-- created() {--> |
||||
<!-- this.getSuperFieldList();--> |
||||
<!-- },--> |
||||
<!-- computed: {--> |
||||
<!-- importExcelUrl: function () {--> |
||||
<!-- return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;--> |
||||
<!-- },--> |
||||
<!-- },--> |
||||
<!-- methods: {--> |
||||
<!-- fanHui() {--> |
||||
<!-- this.$router.push({--> |
||||
<!-- path: '/productplan/ZyPlanProcessList',--> |
||||
<!-- });--> |
||||
<!-- },--> |
||||
<!-- getToolAndMachine(stationId) {--> |
||||
<!-- // alert("stationId=" + stationId);--> |
||||
<!-- getAction(this.url.stationToolslist, {"stationId": stationId}).then((res) => {--> |
||||
<!-- if (res.success) {--> |
||||
<!-- this.toolsList = res.result.records || res.result;--> |
||||
<!-- console.log("toolsList", JSON.stringify(this.toolsList))--> |
||||
<!-- } else {--> |
||||
<!-- this.$message.warning(res.message)--> |
||||
<!-- }--> |
||||
<!-- });--> |
||||
|
||||
getAction(this.url.stationMachinelist, {"stationId": stationId}).then((res) => { |
||||
if (res.success) { |
||||
this.machineList = res.result.records || res.result; |
||||
console.log("machineList", JSON.stringify(this.toolsList)) |
||||
} else { |
||||
this.$message.warning(res.message) |
||||
} |
||||
}); |
||||
}, |
||||
//加载传递参数 |
||||
loadParameter() { |
||||
if (this.loadRouteType === false) { |
||||
this.planId = this.$route.query.planId; |
||||
// this.biaoTi = this.$route.query.styleNames+"款式面料管理"; |
||||
console.log("*******传递的planId:" + this.planId) |
||||
this.loadRouteType = true; |
||||
} |
||||
}, |
||||
loadData(arg) { |
||||
if (!this.url.list) { |
||||
this.$message.error("请设置url.list属性!") |
||||
return |
||||
} |
||||
//加载数据 若传入参数1则加载第一页的内容 |
||||
if (arg === 1) { |
||||
this.ipagination.current = 1; |
||||
} |
||||
this.loadParameter(); |
||||
var params = this.getQueryParams();//查询条件 |
||||
this.loading = true; |
||||
console.log("----------------the params:", params); |
||||
getAction(this.url.list, params).then((res) => { |
||||
if (res.success) { |
||||
this.dataSource = res.result.records || res.result; |
||||
if (res.result.total) { |
||||
this.ipagination.total = res.result.total; |
||||
} else { |
||||
this.ipagination.total = 0; |
||||
} |
||||
} else { |
||||
this.$message.warning(res.message) |
||||
} |
||||
}).finally(() => { |
||||
// this.dataSource.forEach(item => { |
||||
// item['stationName'] = this.stationName; |
||||
// item['stationNum'] = this.stationNum; |
||||
// }) |
||||
this.loading = false |
||||
}) |
||||
}, |
||||
getQueryParams() { |
||||
//获取查询条件 |
||||
let sqp = {} |
||||
if (this.superQueryParams) { |
||||
sqp['superQueryParams'] = encodeURI(this.superQueryParams) |
||||
sqp['superQueryMatchType'] = this.superQueryMatchType |
||||
} |
||||
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters); |
||||
param.field = this.getQueryField(); |
||||
param.pageNo = this.ipagination.current; |
||||
param.pageSize = this.ipagination.pageSize; |
||||
param.planId = this.planId; |
||||
return filterObj(param); |
||||
}, |
||||
// initDictConfig() { |
||||
// }, |
||||
getSuperFieldList() { |
||||
// let fieldList = []; |
||||
// fieldList.push({type: 'string', value: 'id', text: 'id', dictCode: ''}) |
||||
// fieldList.push({type: 'string', value: 'planId', text: '生产计划id', dictCode: ''}) |
||||
// fieldList.push({type: 'string', value: 'productName', text: '生产计划id', dictCode: ''}) |
||||
// fieldList.push({type: 'string', value: 'stationId', text: '工位id', dictCode: ''}) |
||||
// fieldList.push({type: 'string', value: 'machineIds', text: '设备id列表', dictCode: ''}) |
||||
// fieldList.push({type: 'string', value: 'toolsIds', text: '工具id列表', dictCode: ''}) |
||||
// fieldList.push({type: 'string', value: 'productProcessId', text: '工序id列表', dictCode: ''}) |
||||
// fieldList.push({type: 'string', value: 'productProcessId', text: '工序id列表', dictCode: ''}) |
||||
// fieldList.push({type: 'string', value: 'userIds', text: '成员id列表', dictCode: ''}) |
||||
// this.superFieldList = fieldList |
||||
}, |
||||
// handleChange(value, key, column) { |
||||
// const newData = [...this.data]; |
||||
// const target = newData.find(item => key === item.key); |
||||
// if (target) { |
||||
// target[column] = value; |
||||
// this.data = newData; |
||||
// } |
||||
// }, |
||||
edit(key) { |
||||
alert("the edit() record =" + JSON.stringify(key)) |
||||
// const newData = [...this.data]; |
||||
const newData = [...this.dataSource]; |
||||
// const newData = record; |
||||
console.log("the edit() newData =", JSON.stringify(newData)); |
||||
// this.editingKey = '0'; |
||||
// record.editable = true; |
||||
// const target = newData.find(item => key === item.key); |
||||
const target = newData[0]; |
||||
console.log("the edit() target =", JSON.stringify(target)); |
||||
this.editingKey = key; |
||||
console.log("the edit() editingKey =", this.editingKey); |
||||
if (target) { |
||||
// debugger; |
||||
target.editable = true; |
||||
this.dataSource = newData; |
||||
} |
||||
}, |
||||
save(key) { |
||||
// const newData = [...this.data]; |
||||
const newData = this.dataSource; |
||||
console.log("save() newData=", JSON.stringify(newData)) |
||||
const newCacheData = [...this.cacheData]; |
||||
const target = newData.find(item => key === item.key); |
||||
const targetCache = newCacheData.find(item => key === item.key); |
||||
if (target && targetCache) { |
||||
delete target.editable; |
||||
this.dataSource = newData; |
||||
Object.assign(targetCache, target); |
||||
this.cacheData = newCacheData; |
||||
} |
||||
this.editingKey = ''; |
||||
}, |
||||
cancel(key) { |
||||
const newData = this.dataSource; |
||||
const target = newData.find(item => key === item.key); |
||||
this.editingKey = ''; |
||||
if (target) { |
||||
Object.assign(target, this.cacheData.find(item => key === item.key)); |
||||
delete target.editable; |
||||
this.dataSource = newData; |
||||
} |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
<style scoped> |
||||
.editable-row-operations a { |
||||
margin-right: 8px; |
||||
} |
||||
</style> |
||||
<!-- getAction(this.url.stationMachinelist, {"stationId": stationId}).then((res) => {--> |
||||
<!-- if (res.success) {--> |
||||
<!-- this.machineList = res.result.records || res.result;--> |
||||
<!-- console.log("machineList", JSON.stringify(this.toolsList))--> |
||||
<!-- } else {--> |
||||
<!-- this.$message.warning(res.message)--> |
||||
<!-- }--> |
||||
<!-- });--> |
||||
<!-- },--> |
||||
<!-- //加载传递参数--> |
||||
<!-- loadParameter() {--> |
||||
<!-- if (this.loadRouteType === false) {--> |
||||
<!-- this.planId = this.$route.query.planId;--> |
||||
<!-- // this.biaoTi = this.$route.query.styleNames+"款式面料管理";--> |
||||
<!-- console.log("*******传递的planId:" + this.planId)--> |
||||
<!-- this.loadRouteType = true;--> |
||||
<!-- }--> |
||||
<!-- },--> |
||||
<!-- loadData(arg) {--> |
||||
<!-- if (!this.url.list) {--> |
||||
<!-- this.$message.error("请设置url.list属性!")--> |
||||
<!-- return--> |
||||
<!-- }--> |
||||
<!-- //加载数据 若传入参数1则加载第一页的内容--> |
||||
<!-- if (arg === 1) {--> |
||||
<!-- this.ipagination.current = 1;--> |
||||
<!-- }--> |
||||
<!-- this.loadParameter();--> |
||||
<!-- var params = this.getQueryParams();//查询条件--> |
||||
<!-- this.loading = true;--> |
||||
<!-- console.log("----------------the params:", params);--> |
||||
<!-- getAction(this.url.list, params).then((res) => {--> |
||||
<!-- if (res.success) {--> |
||||
<!-- this.dataSource = res.result.records || res.result;--> |
||||
<!-- if (res.result.total) {--> |
||||
<!-- this.ipagination.total = res.result.total;--> |
||||
<!-- } else {--> |
||||
<!-- this.ipagination.total = 0;--> |
||||
<!-- }--> |
||||
<!-- } else {--> |
||||
<!-- this.$message.warning(res.message)--> |
||||
<!-- }--> |
||||
<!-- }).finally(() => {--> |
||||
<!-- // this.dataSource.forEach(item => {--> |
||||
<!-- // item['stationName'] = this.stationName;--> |
||||
<!-- // item['stationNum'] = this.stationNum;--> |
||||
<!-- // })--> |
||||
<!-- this.loading = false--> |
||||
<!-- })--> |
||||
<!-- },--> |
||||
<!-- getQueryParams() {--> |
||||
<!-- //获取查询条件--> |
||||
<!-- let sqp = {}--> |
||||
<!-- if (this.superQueryParams) {--> |
||||
<!-- sqp['superQueryParams'] = encodeURI(this.superQueryParams)--> |
||||
<!-- sqp['superQueryMatchType'] = this.superQueryMatchType--> |
||||
<!-- }--> |
||||
<!-- var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);--> |
||||
<!-- param.field = this.getQueryField();--> |
||||
<!-- param.pageNo = this.ipagination.current;--> |
||||
<!-- param.pageSize = this.ipagination.pageSize;--> |
||||
<!-- param.planId = this.planId;--> |
||||
<!-- return filterObj(param);--> |
||||
<!-- },--> |
||||
<!-- // initDictConfig() {--> |
||||
<!-- // },--> |
||||
<!-- getSuperFieldList() {--> |
||||
<!-- // let fieldList = [];--> |
||||
<!-- // fieldList.push({type: 'string', value: 'id', text: 'id', dictCode: ''})--> |
||||
<!-- // fieldList.push({type: 'string', value: 'planId', text: '生产计划id', dictCode: ''})--> |
||||
<!-- // fieldList.push({type: 'string', value: 'productName', text: '生产计划id', dictCode: ''})--> |
||||
<!-- // fieldList.push({type: 'string', value: 'stationId', text: '工位id', dictCode: ''})--> |
||||
<!-- // fieldList.push({type: 'string', value: 'machineIds', text: '设备id列表', dictCode: ''})--> |
||||
<!-- // fieldList.push({type: 'string', value: 'toolsIds', text: '工具id列表', dictCode: ''})--> |
||||
<!-- // fieldList.push({type: 'string', value: 'productProcessId', text: '工序id列表', dictCode: ''})--> |
||||
<!-- // fieldList.push({type: 'string', value: 'productProcessId', text: '工序id列表', dictCode: ''})--> |
||||
<!-- // fieldList.push({type: 'string', value: 'userIds', text: '成员id列表', dictCode: ''})--> |
||||
<!-- // this.superFieldList = fieldList--> |
||||
<!-- },--> |
||||
<!-- // handleChange(value, key, column) {--> |
||||
<!-- // const newData = [...this.data];--> |
||||
<!-- // const target = newData.find(item => key === item.key);--> |
||||
<!-- // if (target) {--> |
||||
<!-- // target[column] = value;--> |
||||
<!-- // this.data = newData;--> |
||||
<!-- // }--> |
||||
<!-- // },--> |
||||
<!-- edit(key) {--> |
||||
<!-- alert("the edit() record =" + JSON.stringify(key))--> |
||||
<!-- // const newData = [...this.data];--> |
||||
<!-- const newData = [...this.dataSource];--> |
||||
<!-- // const newData = record;--> |
||||
<!-- console.log("the edit() newData =", JSON.stringify(newData));--> |
||||
<!-- // this.editingKey = '0';--> |
||||
<!-- // record.editable = true;--> |
||||
<!-- // const target = newData.find(item => key === item.key);--> |
||||
<!-- const target = newData[0];--> |
||||
<!-- console.log("the edit() target =", JSON.stringify(target));--> |
||||
<!-- this.editingKey = key;--> |
||||
<!-- console.log("the edit() editingKey =", this.editingKey);--> |
||||
<!-- if (target) {--> |
||||
<!-- // debugger;--> |
||||
<!-- target.editable = true;--> |
||||
<!-- this.dataSource = newData;--> |
||||
<!-- }--> |
||||
<!-- },--> |
||||
<!-- save(key) {--> |
||||
<!-- // const newData = [...this.data];--> |
||||
<!-- const newData = this.dataSource;--> |
||||
<!-- console.log("save() newData=", JSON.stringify(newData))--> |
||||
<!-- const newCacheData = [...this.cacheData];--> |
||||
<!-- const target = newData.find(item => key === item.key);--> |
||||
<!-- const targetCache = newCacheData.find(item => key === item.key);--> |
||||
<!-- if (target && targetCache) {--> |
||||
<!-- delete target.editable;--> |
||||
<!-- this.dataSource = newData;--> |
||||
<!-- Object.assign(targetCache, target);--> |
||||
<!-- this.cacheData = newCacheData;--> |
||||
<!-- }--> |
||||
<!-- this.editingKey = '';--> |
||||
<!-- },--> |
||||
<!-- cancel(key) {--> |
||||
<!-- const newData = this.dataSource;--> |
||||
<!-- const target = newData.find(item => key === item.key);--> |
||||
<!-- this.editingKey = '';--> |
||||
<!-- if (target) {--> |
||||
<!-- Object.assign(target, this.cacheData.find(item => key === item.key));--> |
||||
<!-- delete target.editable;--> |
||||
<!-- this.dataSource = newData;--> |
||||
<!-- }--> |
||||
<!-- },--> |
||||
<!-- },--> |
||||
<!--};--> |
||||
<!--</script>--> |
||||
<!--<style scoped>--> |
||||
<!--.editable-row-operations a {--> |
||||
<!-- margin-right: 8px;--> |
||||
<!--}--> |
||||
<!--</style>--> |
@ -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> |
@ -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-product-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></zy-product-form> |
||||
</j-modal> |
||||
</template> |
||||
|
||||
<script> |
||||
|
||||
import ZyProductForm from './ZyProductForm' |
||||
export default { |
||||
name: 'ZyProductModal', |
||||
components: { |
||||
ZyProductForm |
||||
}, |
||||
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-product-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></zy-product-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 ZyProductForm from './ZyProductForm' |
||||
|
||||
export default { |
||||
name: 'ZyProductModal', |
||||
components: { |
||||
ZyProductForm |
||||
}, |
||||
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> |
@ -0,0 +1,230 @@ |
||||
package org.jeecg.modules.demo.kucun.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 org.jeecg.modules.demo.kucun.entity.Kucun; |
||||
import org.jeecg.modules.demo.kucun.service.IKucunService; |
||||
|
||||
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.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("/kucun/kucun") |
||||
@Slf4j |
||||
public class KucunController extends JeecgController<Kucun, IKucunService> { |
||||
@Autowired |
||||
private IKucunService kucunService; |
||||
|
||||
/** |
||||
* 分页列表查询 |
||||
* |
||||
* @param kucun |
||||
* @param pageNo |
||||
* @param pageSize |
||||
* @param req |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "库存信息-分页列表查询") |
||||
@ApiOperation(value="库存信息-分页列表查询", notes="库存信息-分页列表查询") |
||||
@GetMapping(value = "/list") |
||||
public Result<?> queryPageList(Kucun kucun, |
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
||||
HttpServletRequest req) { |
||||
QueryWrapper<Kucun> queryWrapper = QueryGenerator.initQueryWrapper(kucun, req.getParameterMap()); |
||||
Page<Kucun> page = new Page<Kucun>(pageNo, pageSize); |
||||
IPage<Kucun> pageList = kucunService.page(page, queryWrapper); |
||||
return Result.OK(pageList); |
||||
} |
||||
|
||||
/** |
||||
* 添加 |
||||
* |
||||
* @param kucun |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "库存信息-添加") |
||||
@ApiOperation(value="库存信息-添加", notes="库存信息-添加") |
||||
@PostMapping(value = "/add") |
||||
public Result<?> add(@RequestBody Kucun kucun) { |
||||
if(kucun.getWuplx().equals("1")){ |
||||
kucun.setTemp1(kucun.getMlname()); |
||||
kucun.setTemp2(kucun.getMlbh()); |
||||
System.out.println(kucun); |
||||
} |
||||
if(kucun.getWuplx().equals("2")){ |
||||
kucun.setTemp1(kucun.getFlname()); |
||||
kucun.setTemp2(kucun.getFlbh()); |
||||
System.out.println(kucun); |
||||
|
||||
} |
||||
if(kucun.getWuplx().equals("3")){ |
||||
kucun.setTemp1(kucun.getSbname()); |
||||
kucun.setTemp2(kucun.getSbbh()); |
||||
System.out.println(kucun); |
||||
|
||||
} |
||||
if(kucun.getWuplx().equals("4")){ |
||||
kucun.setTemp1(kucun.getGjname()); |
||||
kucun.setTemp2(kucun.getGjbh()); |
||||
System.out.println(kucun); |
||||
|
||||
} |
||||
if(kucun.getWuplx().equals("5")){ |
||||
kucun.setTemp1(kucun.getSpname()); |
||||
kucun.setTemp2(kucun.getSpbh()); |
||||
System.out.println(kucun); |
||||
|
||||
} |
||||
kucunService.save(kucun); |
||||
return Result.OK("添加成功!"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param kucun |
||||
* @return |
||||
*/ |
||||
@AutoLog(value = "库存信息-编辑") |
||||
@ApiOperation(value="库存信息-编辑", notes="库存信息-编辑") |
||||
@PutMapping(value = "/edit") |
||||
public Result<?> edit(@RequestBody Kucun kucun) { |
||||
if(kucun.getWuplx().equals("1")){ |
||||
kucun.setTemp1(kucun.getMlname()); |
||||
kucun.setTemp2(kucun.getMlbh()); |
||||
System.out.println(kucun); |
||||
} |
||||
if(kucun.getWuplx().equals("2")){ |
||||
kucun.setTemp1(kucun.getFlname()); |
||||
kucun.setTemp2(kucun.getFlbh()); |
||||
System.out.println(kucun); |
||||
|
||||
} |
||||
if(kucun.getWuplx().equals("3")){ |
||||
kucun.setTemp1(kucun.getSbname()); |
||||
kucun.setTemp2(kucun.getSbbh()); |
||||
System.out.println(kucun); |
||||
|
||||
} |
||||
if(kucun.getWuplx().equals("4")){ |
||||
kucun.setTemp1(kucun.getGjname()); |
||||
kucun.setTemp2(kucun.getGjbh()); |
||||
System.out.println(kucun); |
||||
|
||||
} |
||||
if(kucun.getWuplx().equals("5")){ |
||||
kucun.setTemp1(kucun.getSpname()); |
||||
kucun.setTemp2(kucun.getSpbh()); |
||||
System.out.println(kucun); |
||||
|
||||
} |
||||
kucunService.updateById(kucun); |
||||
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) { |
||||
kucunService.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.kucunService.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) { |
||||
Kucun kucun = kucunService.getById(id); |
||||
if(kucun==null) { |
||||
return Result.error("未找到对应数据"); |
||||
} |
||||
return Result.OK(kucun); |
||||
} |
||||
|
||||
/** |
||||
* 导出excel |
||||
* |
||||
* @param request |
||||
* @param kucun |
||||
*/ |
||||
@RequestMapping(value = "/exportXls") |
||||
public ModelAndView exportXls(HttpServletRequest request, Kucun kucun) { |
||||
return super.exportXls(request, kucun, Kucun.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, Kucun.class); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,136 @@ |
||||
package org.jeecg.modules.demo.kucun.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("kucun") |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@ApiModel(value="kucun对象", description="库存信息") |
||||
public class Kucun 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, dicCode = "goods_category") |
||||
@Dict(dicCode = "goods_category") |
||||
@ApiModelProperty(value = "物品类型") |
||||
private String wuplx; |
||||
/**面料*/ |
||||
@Excel(name = "面料", width = 15) |
||||
@ApiModelProperty(value = "面料") |
||||
private String mlid; |
||||
/**面料编号*/ |
||||
@Excel(name = "面料编号", width = 15) |
||||
@ApiModelProperty(value = "面料编号") |
||||
private String mlbh; |
||||
/**面料*/ |
||||
@Excel(name = "面料", width = 15) |
||||
@ApiModelProperty(value = "面料") |
||||
private String mlname; |
||||
/**辅料*/ |
||||
@Excel(name = "辅料", width = 15) |
||||
@ApiModelProperty(value = "辅料") |
||||
private String flid; |
||||
/**辅料编号*/ |
||||
@Excel(name = "辅料编号", width = 15) |
||||
@ApiModelProperty(value = "辅料编号") |
||||
private String flbh; |
||||
/**辅料*/ |
||||
@Excel(name = "辅料", width = 15) |
||||
@ApiModelProperty(value = "辅料") |
||||
private String flname; |
||||
/**设备*/ |
||||
@Excel(name = "设备", width = 15) |
||||
@ApiModelProperty(value = "设备") |
||||
private String sbid; |
||||
/**设备编号*/ |
||||
@Excel(name = "设备编号", width = 15) |
||||
@ApiModelProperty(value = "设备编号") |
||||
private String sbbh; |
||||
/**设备*/ |
||||
@Excel(name = "设备", width = 15) |
||||
@ApiModelProperty(value = "设备") |
||||
private String sbname; |
||||
/**工具*/ |
||||
@Excel(name = "工具", width = 15) |
||||
@ApiModelProperty(value = "工具") |
||||
private String gjid; |
||||
/**工具编号*/ |
||||
@Excel(name = "工具编号", width = 15) |
||||
@ApiModelProperty(value = "工具编号") |
||||
private String gjbh; |
||||
/**工具*/ |
||||
@Excel(name = "工具", width = 15) |
||||
@ApiModelProperty(value = "工具") |
||||
private String gjname; |
||||
/**商品*/ |
||||
@Excel(name = "商品", width = 15) |
||||
@ApiModelProperty(value = "商品") |
||||
private String spid; |
||||
/**商品编号*/ |
||||
@Excel(name = "商品编号", width = 15) |
||||
@ApiModelProperty(value = "商品编号") |
||||
private String spbh; |
||||
/**商品*/ |
||||
@Excel(name = "商品", width = 15) |
||||
@ApiModelProperty(value = "商品") |
||||
private String spname; |
||||
/**库存剩余*/ |
||||
@Excel(name = "库存剩余", width = 15) |
||||
@ApiModelProperty(value = "库存剩余") |
||||
private Integer kcsy; |
||||
/**名称*/ |
||||
@Excel(name = "名称", width = 15) |
||||
@ApiModelProperty(value = "名称") |
||||
private String temp1; |
||||
/**编号*/ |
||||
@Excel(name = "编号", width = 15) |
||||
@ApiModelProperty(value = "编号") |
||||
private String temp2; |
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.kucun.mapper; |
||||
|
||||
|
||||
|
||||
import java.util.List; |
||||
|
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.jeecg.modules.demo.kucun.entity.Kucun; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
||||
/** |
||||
* @Description: 库存信息 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-01-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface KucunMapper extends BaseMapper<Kucun> { |
||||
|
||||
} |
@ -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.kucun.mapper.KucunMapper"> |
||||
|
||||
</mapper> |
@ -0,0 +1,16 @@ |
||||
package org.jeecg.modules.demo.kucun.service; |
||||
|
||||
|
||||
|
||||
import org.jeecg.modules.demo.kucun.entity.Kucun; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
||||
/** |
||||
* @Description: 库存信息 |
||||
* @Author: jeecg-boot |
||||
* @Date: 2023-01-07 |
||||
* @Version: V1.0 |
||||
*/ |
||||
public interface IKucunService extends IService<Kucun> { |
||||
|
||||
} |
@ -0,0 +1,19 @@ |
||||
package org.jeecg.modules.demo.kucun.service.impl; |
||||
|
||||
import org.jeecg.modules.demo.kucun.entity.Kucun; |
||||
import org.jeecg.modules.demo.kucun.mapper.KucunMapper; |
||||
import org.jeecg.modules.demo.kucun.service.IKucunService; |
||||
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 KucunServiceImpl extends ServiceImpl<KucunMapper, Kucun> implements IKucunService { |
||||
|
||||
} |
@ -0,0 +1,16 @@ |
||||
package org.jeecg.modules.team.vo; |
||||
|
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
public class GroupxMemeberVo { |
||||
|
||||
private String id; |
||||
private String value; |
||||
private String text; |
||||
private String title; |
||||
} |
@ -0,0 +1,16 @@ |
||||
package org.jeecg.modules.team.vo; |
||||
|
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
public class GroupxVo { |
||||
|
||||
private String id; |
||||
private String value; |
||||
private String text; |
||||
private String title; |
||||
} |
@ -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