parent
f7ebbafa59
commit
91b4784adb
10 changed files with 754 additions and 125 deletions
@ -0,0 +1,342 @@ |
|||||||
|
<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>--> |
||||||
|
<div class="table-operator"> |
||||||
|
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>--> |
||||||
|
<!-- <a-button @click="zyStyleFabricHandleAdd(stationId)" type="primary" icon="plus">新增</a-button>--> |
||||||
|
<a-button type="primary" icon="download" @click="handleExportXls('1')">导出</a-button> |
||||||
|
<a-button type="primary" @click="fanHui()">返回</a-button> |
||||||
|
</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"> |
||||||
|
<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="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> |
||||||
|
</a-table> |
||||||
|
</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> |
||||||
|
|
||||||
|
<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"; |
||||||
|
|
||||||
|
export default { |
||||||
|
name: 'ZyPlanProcessList', |
||||||
|
mixins: [JeecgListMixin, mixinDevice], |
||||||
|
components: { |
||||||
|
ZyPlanProcessModal |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
description: '生产计划工序管理页面', |
||||||
|
// 表头 |
||||||
|
columns: [ |
||||||
|
{ |
||||||
|
title: '#', |
||||||
|
dataIndex: '', |
||||||
|
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' |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '产品id', |
||||||
|
align: "center", |
||||||
|
dataIndex: 'productId' |
||||||
|
}, |
||||||
|
{ |
||||||
|
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: 'toolsList'} |
||||||
|
// scopedSlots: {customRender: this.toolsList} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '工具设备列表', |
||||||
|
align: "center", |
||||||
|
dataIndex: 'machineList', |
||||||
|
width: 150, |
||||||
|
scopedSlots: {customRender: 'machineList'} |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: '操作', |
||||||
|
dataIndex: 'action', |
||||||
|
align: "center", |
||||||
|
fixed: "right", |
||||||
|
width: 147, |
||||||
|
scopedSlots: {customRender: 'action'} |
||||||
|
} |
||||||
|
], |
||||||
|
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: 'planId', 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: 'processIds', text: '工序id列表', dictCode: ''}) |
||||||
|
fieldList.push({type: 'string', value: 'userIds', text: '成员id列表', dictCode: ''}) |
||||||
|
this.superFieldList = fieldList |
||||||
|
}, |
||||||
|
// jumpPage1(record) { |
||||||
|
// this.$router.push({ |
||||||
|
// // path: '/productplan/ZyProductPlanList', |
||||||
|
// path: '/productplan/ZyPlanProcessDataList', |
||||||
|
// |
||||||
|
// // query: { // 路由携带参数 |
||||||
|
// // 'stationId': record.id, |
||||||
|
// // 'stationName': record.stationName, |
||||||
|
// // }, |
||||||
|
// }); |
||||||
|
// }, |
||||||
|
// pf(record) { |
||||||
|
// this.$router.push({ |
||||||
|
// path: '/productplan/ZyPlanProcessAddList', |
||||||
|
// query: { // 路由携带参数 |
||||||
|
// } |
||||||
|
// }); |
||||||
|
|
||||||
|
// getAction("productPlanlist", {id: record.id}).then((res) => { |
||||||
|
// if (res.success) { |
||||||
|
// this.$router.push({ |
||||||
|
// path: '/src/views/processassessment/assessmentCourse/ClassOpeningTaskList', |
||||||
|
// query: { // 路由携带参数 |
||||||
|
// } |
||||||
|
// }); |
||||||
|
// } else { |
||||||
|
// this.$message.error(res.message) |
||||||
|
// } |
||||||
|
// }); |
||||||
|
// }, |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
<style scoped> |
||||||
|
@import '~@assets/less/common.less'; |
||||||
|
</style> |
@ -0,0 +1,130 @@ |
|||||||
|
<template> |
||||||
|
<a-table :columns="columns" :data-source="data" bordered> |
||||||
|
<template |
||||||
|
v-for="col in ['name', 'age', 'address']" |
||||||
|
: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.key)">Save</a> |
||||||
|
<a-popconfirm title="Sure to cancel?" @confirm="() => cancel(record.key)"> |
||||||
|
<a>Cancel</a> |
||||||
|
</a-popconfirm> |
||||||
|
</span> |
||||||
|
<span v-else> |
||||||
|
<a :disabled="editingKey !== ''" @click="() => edit(record.key)">Edit</a> |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
</a-table> |
||||||
|
</template> |
||||||
|
<script> |
||||||
|
const columns = [ |
||||||
|
{ |
||||||
|
title: 'name', |
||||||
|
dataIndex: 'name', |
||||||
|
width: '25%', |
||||||
|
scopedSlots: { customRender: 'name' }, |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: 'age', |
||||||
|
dataIndex: 'age', |
||||||
|
width: '15%', |
||||||
|
scopedSlots: { customRender: 'age' }, |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: 'address', |
||||||
|
dataIndex: 'address', |
||||||
|
width: '40%', |
||||||
|
scopedSlots: { customRender: 'address' }, |
||||||
|
}, |
||||||
|
{ |
||||||
|
title: 'operation', |
||||||
|
dataIndex: 'operation', |
||||||
|
scopedSlots: { customRender: 'operation' }, |
||||||
|
}, |
||||||
|
]; |
||||||
|
|
||||||
|
const data = []; |
||||||
|
for (let i = 0; i < 100; i++) { |
||||||
|
data.push({ |
||||||
|
key: i.toString(), |
||||||
|
name: `Edrward ${i}`, |
||||||
|
age: 32, |
||||||
|
address: `London Park no. ${i}`, |
||||||
|
}); |
||||||
|
} |
||||||
|
export default { |
||||||
|
data() { |
||||||
|
this.cacheData = data.map(item => ({ ...item })); |
||||||
|
return { |
||||||
|
data, |
||||||
|
columns, |
||||||
|
editingKey: '', |
||||||
|
}; |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
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(key) |
||||||
|
const newData = [...this.data]; |
||||||
|
console.log("newData=",JSON.stringify(newData)) |
||||||
|
const target = newData.find(item => key === item.key); |
||||||
|
this.editingKey = key; |
||||||
|
if (target) { |
||||||
|
target.editable = true; |
||||||
|
this.data = newData; |
||||||
|
} |
||||||
|
}, |
||||||
|
save(key) { |
||||||
|
const newData = [...this.data]; |
||||||
|
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.data = newData; |
||||||
|
Object.assign(targetCache, target); |
||||||
|
this.cacheData = newCacheData; |
||||||
|
} |
||||||
|
this.editingKey = ''; |
||||||
|
}, |
||||||
|
cancel(key) { |
||||||
|
const newData = [...this.data]; |
||||||
|
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.data = newData; |
||||||
|
} |
||||||
|
}, |
||||||
|
}, |
||||||
|
} |
||||||
|
</script> |
||||||
|
<style scoped> |
||||||
|
.editable-row-operations a { |
||||||
|
margin-right: 8px; |
||||||
|
} |
||||||
|
</style> |
Loading…
Reference in new issue