车间工位管理修改 12.7

zhc4dev
zhc077 2 years ago
parent a9e24c0282
commit ce675ff042
  1. 16
      ant-design-vue-jeecg/src/views/team/StationList.vue
  2. 112
      ant-design-vue-jeecg/src/views/team/StationToolList.vue
  3. 181
      ant-design-vue-jeecg/src/views/team/modules/StationToolModal.vue

@ -188,19 +188,19 @@ export default {
jumpPage1(record) { jumpPage1(record) {
this.$router.push({ this.$router.push({
path: '/team/stationMachineList', path: '/team/stationMachineList',
// query: { // query: { //
// 'id': record.id, 'id': record.id,
// // 'styleNames': record.styleNames, 'stationName': record.stationName,
// }, },
}); });
}, },
jumpPage2(record) { jumpPage2(record) {
this.$router.push({ this.$router.push({
path: '/team/StationToolList', path: '/team/StationToolList',
// query: { // query: { //
// 'id': record.stationId, 'stationId': record.id,
// // 'styleNames': record.styleNames, 'stationName': record.stationName,
// }, },
}); });
}, },
} }

@ -31,7 +31,8 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <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 @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<a-button type="primary" icon="download" @click="handleExportXls('工序工具管理')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('工序工具管理')">导出</a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"--> <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"-->
<!-- @change="handleImportExcel">--> <!-- @change="handleImportExcel">-->
@ -49,7 +50,6 @@
</a-button> </a-button>
</a-dropdown> </a-dropdown>
<a-button type="primary" @click="fanHui()">返回</a-button> <a-button type="primary" @click="fanHui()">返回</a-button>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
@ -78,17 +78,17 @@
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
<!-- <a-divider type="vertical"/>--> <!-- <a-divider type="vertical"/>-->
<!-- <a-dropdown>--> <!-- <a-dropdown>-->
<!-- <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>--> <!-- <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>-->
<!-- <a-menu slot="overlay">--> <!-- <a-menu slot="overlay">-->
<!-- <a-menu-item>--> <!-- <a-menu-item>-->
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">--> <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>--> <!-- <a>删除</a>-->
<!-- </a-popconfirm>--> <!-- </a-popconfirm>-->
<!-- </a-menu-item>--> <!-- </a-menu-item>-->
<!-- </a-menu>--> <!-- </a-menu>-->
<!-- </a-dropdown>--> <!-- </a-dropdown>-->
</span> </span>
</a-table> </a-table>
@ -96,7 +96,7 @@
<!-- table区域-end --> <!-- table区域-end -->
<!-- 表单区域 --> <!-- 表单区域 -->
<stationTool-modal ref="modalForm" @ok="modalFormOk"></stationTool-modal> <stationTool-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></stationTool-modal>
</a-card> </a-card>
</template> </template>
@ -105,6 +105,8 @@ import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin' import {mixinDevice} from '@/utils/mixin'
import StationToolModal from './modules/StationToolModal' import StationToolModal from './modules/StationToolModal'
import {JeecgListMixin} from '@/mixins/JeecgListMixin' import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default { export default {
name: "StationToolList", name: "StationToolList",
@ -132,6 +134,11 @@ export default {
align: "center", align: "center",
dataIndex: 'stationId' dataIndex: 'stationId'
}, },
{
title: '工位名称',
align: "center",
dataIndex: 'stationName',
},
{ {
title: '工具ID', title: '工具ID',
align: "center", align: "center",
@ -151,8 +158,17 @@ export default {
exportXlsUrl: "/stationTool/exportXls", exportXlsUrl: "/stationTool/exportXls",
importExcelUrl: "/stationTool/importExcel", importExcelUrl: "/stationTool/importExcel",
}, },
//
loadRouteType: false,
stationId: "",
stationName: "",
dictOptions: {},
superFieldList: [],
} }
}, },
created() {
this.loadParameter();
},
computed: { computed: {
importExcelUrl: function () { importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
@ -161,14 +177,70 @@ export default {
methods: { methods: {
fanHui() { fanHui() {
this.$router.push({ this.$router.push({
path: '/team/StationList', path: '/src/views/team/StationList',
// query: { // // path: '/src/views/zyclothsstyle/ZyClothsStyleList',
// 'id': record.id,
// 'typeId': record.typeId,
// }
// });
}); });
}, },
// initDictConfig() {
// },
valueChange(value) {
if (value) this.loadData()
},
//
loadParameter() {
if (this.loadRouteType === false) {
this.stationId = this.$route.query.stationId;
this.stationName = this.$route.query.stationName;
// this.biaoTi = this.$route.query.styleNames+"";
// console.log("*******stationId:" + this.stationId)
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;
})
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.stationId = this.stationId;
return filterObj(param);
},
} }
} }
</script> </script>

@ -11,15 +11,19 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules"> <a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId" label="车间工位编号"> <!-- <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId" label="车间工位编号">-->
<!-- <a-input placeholder="车间工位编号" v-model="model.stationId"/>-->
<!--&lt;!&ndash; <j-select-depart placeholder="请选择工位" v-model="model.stationId"/>&ndash;&gt;-->
<!-- </a-form-model-item>-->
<!-- <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId" label="工位ID">-->
<!-- <a-input placeholder="请输入工位ID" v-model="model.stationId" />-->
<!-- </a-form-model-item>-->
<!-- <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolsId" label="工具ID">-->
<!-- <a-input placeholder="请输入工具ID" v-model="model.toolsId" />-->
<!-- </a-form-model-item>-->
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolsId" label="工具编号(TODO)">
<!-- <a-input placeholder="请输入部门编号" v-model="model.departId"/>--> <!-- <a-input placeholder="请输入部门编号" v-model="model.departId"/>-->
<j-select-depart placeholder="请选择工位" v-model="model.stationId"/> <j-select-depart placeholder="请选择工具" v-model="model.toolsId"/>
</a-form-model-item>
<!-- <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId" label="工位ID">-->
<!-- <a-input placeholder="请输入工位ID" v-model="model.stationId" />-->
<!-- </a-form-model-item>-->
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="toolsId" label="工具ID">
<a-input placeholder="请输入工具ID" v-model="model.toolsId" />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
@ -28,88 +32,103 @@
</template> </template>
<script> <script>
import { httpAction } from '@/api/manage' import {httpAction} from '@/api/manage'
import moment from "moment" import moment from "moment"
export default {
name: "StationToolModal",
data () {
return {
title:"操作",
visible: false,
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false, export default {
validatorRules:{ name: "StationToolModal",
}, data() {
url: { return {
add: "/stationTool/add", title: "操作",
edit: "/stationTool/edit", visible: false,
}, model: {
} stationId: '',
},
created () {
},
methods: {
add () {
//
this.edit({});
}, },
edit (record) { labelCol: {
this.model = Object.assign({}, record); xs: {span: 24},
this.visible = true; sm: {span: 5},
}, },
close () { wrapperCol: {
this.$emit('close'); xs: {span: 24},
this.visible = false; sm: {span: 16},
this.$refs.form.clearValidate();
}, },
handleOk () {
const that = this; confirmLoading: false,
// validatorRules: {
this.$refs.form.validate(valid => { toolId: [
if (valid) { {required: true},
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;
that.close();
})
}else{
return false;
}
})
}, },
handleCancel () { url: {
this.close() add: "/stationTool/add",
edit: "/stationTool/edit",
}, },
}
},
created() {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add(stationId) {
this.model.stationId = stationId;
console.log("mode层接收到上级stationId:--" + this.model.stationId);
this.edit(this.model);
},
// add () {
// //
// this.edit({});
// },
edit(record) {
this.model = Object.assign({}, record);
// console.log("edit()model:----------",this.model);
this.visible = true;
},
close() {
this.$emit('close');
this.visible = false;
this.$refs.form.clearValidate();
},
handleOk() {
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';
}
console.log("----------the add() model:",this.model);
this.model.stationId=
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;
that.close();
})
} else {
return false;
}
})
},
handleCancel() {
this.close()
},
}
} }
}
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

Loading…
Cancel
Save