车间工位管理修改 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) {
this.$router.push({
path: '/team/stationMachineList',
// query: { //
// 'id': record.id,
// // 'styleNames': record.styleNames,
// },
query: { //
'id': record.id,
'stationName': record.stationName,
},
});
},
jumpPage2(record) {
this.$router.push({
path: '/team/StationToolList',
// query: { //
// 'id': record.stationId,
// // 'styleNames': record.styleNames,
// },
query: { //
'stationId': record.id,
'stationName': record.stationName,
},
});
},
}

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

@ -11,15 +11,19 @@
<a-spin :spinning="confirmLoading">
<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"/>-->
<j-select-depart placeholder="请选择工位" v-model="model.stationId"/>
</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" />
<j-select-depart placeholder="请选择工具" v-model="model.toolsId"/>
</a-form-model-item>
</a-form-model>
@ -28,88 +32,103 @@
</template>
<script>
import { httpAction } from '@/api/manage'
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 },
},
import {httpAction} from '@/api/manage'
import moment from "moment"
confirmLoading: false,
validatorRules:{
},
url: {
add: "/stationTool/add",
edit: "/stationTool/edit",
},
}
},
created () {
},
methods: {
add () {
//
this.edit({});
export default {
name: "StationToolModal",
data() {
return {
title: "操作",
visible: false,
model: {
stationId: '',
},
edit (record) {
this.model = Object.assign({}, record);
this.visible = true;
labelCol: {
xs: {span: 24},
sm: {span: 5},
},
close () {
this.$emit('close');
this.visible = false;
this.$refs.form.clearValidate();
wrapperCol: {
xs: {span: 24},
sm: {span: 16},
},
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';
}
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;
}
})
confirmLoading: false,
validatorRules: {
toolId: [
{required: true},
],
},
handleCancel () {
this.close()
url: {
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>
<style lang="less" scoped>

Loading…
Cancel
Save