吊挂基本信息 2.2

zhc4dev
zhc077 2 years ago
parent b8aff2e54e
commit 38e999b322
  1. 69
      ant-design-vue-jeecg/src/views/hanger/ZyHangPointList.vue
  2. 3
      ant-design-vue-jeecg/src/views/hanger/modules/ZyHangForm.vue
  3. 197
      ant-design-vue-jeecg/src/views/hanger/modules/ZyHangPointForm.vue
  4. 8
      ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue
  5. 9
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangPointController.java
  6. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHangPoint.java
  7. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangPointService.java
  8. 17
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangPointServiceImpl.java

@ -4,6 +4,21 @@
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="吊挂编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.code" placeholder="请输入吊挂编号"></a-input>
</a-form-model-item>
</a-col><a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-model-item label="工站编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.point" placeholder="请输入工站编号"></a-input>
</a-form-model-item>
</a-col>
<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>
</span>
</a-col>
</a-row>
</a-form>
</div>
@ -13,11 +28,11 @@
<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>
<!-- <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>
<!-- <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>
@ -47,43 +62,12 @@
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-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
@ -124,7 +108,7 @@
{
title:'吊挂编号',
align:"center",
dataIndex: 'code_dictText'
dataIndex: 'code'
},
{
title:'工站编号',
@ -132,7 +116,7 @@
dataIndex: 'point'
},
{
title:'工位id',
title:'工位名称',
align:"center",
dataIndex: 'stationId_dictText'
},
@ -151,7 +135,7 @@
deleteBatch: "/org.jeecg.modules.hanger/zyHangPoint/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.hanger/zyHangPoint/exportXls",
importExcelUrl: "org.jeecg.modules.hanger/zyHangPoint/importExcel",
},
dictOptions:{},
superFieldList:[],
@ -177,7 +161,4 @@
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
</script>

@ -61,6 +61,8 @@
<a-form-model-item label="管理人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="administrator">
<!-- <a-input v-model="model.administrator" placeholder="请输入管理人"></a-input>-->
<j-select-user-by-dep v-model="model.administrator" :multi="false"/>
<!-- <j-dict-select-tag type="list" v-model="model.administrator"-->
<!-- placeholder="请选择管理人" :dict-code="enterprisesManager"/>-->
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -105,6 +107,7 @@ export default {
},
data () {
return {
// enterprisesManager: "sys_user,realname,id",
model:{
status:1,
},

@ -5,17 +5,26 @@
<a-row>
<a-col :span="24">
<a-form-model-item label="吊挂编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="code">
<j-dict-select-tag type="list" v-model="model.code" dictCode="" placeholder="请选择吊挂编号" />
<j-dict-select-tag type="list" v-model="model.code" dictCode="zy_hang,code,code"
placeholder="请选择吊挂编号"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工站编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="point">
<a-input v-model="model.point" placeholder="请输入工站编号" ></a-input>
<a-input v-model="model.point" placeholder="请输入工站编号"></a-input>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工位id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId">
<j-dict-select-tag type="list" v-model="model.stationId" dictCode="" placeholder="请选择工位id" />
<a-form-model-item label="工位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationId">
<j-dict-select-tag type="list" v-model="model.stationId" dictCode="station,station_name,id"
placeholder="请选择工位"/>
<!-- <j-tree-select v-model="model.departId"-->
<!-- dict="station,station_name,id"-->
<!-- pidField="depart_id"-->
<!-- placeholder="请选择车间"-->
<!-- hasChildField="1"-->
<!-- >-->
<!-- </j-tree-select>-->
</a-form-model-item>
</a-col>
</a-row>
@ -26,93 +35,111 @@
<script>
import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import {httpAction, getAction} from '@/api/manage'
import {validateDuplicateValue} from '@/utils/util'
export default {
name: 'ZyHangPointForm',
components: {
},
props: {
//
disabled: {
type: Boolean,
default: false,
required: false
export default {
name: 'ZyHangPointForm',
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: {
code: [
{required: true, message: '吊挂编号不能为空'},
// {pattern: /^\d{0,6}$/, message: '!'},
],
stationId: [
{required: true, message: '工位编号不能为空'},
{pattern: /^\d{0,200}$/, message: '长度过长!'},
],
},
url: {
add: "/org.jeecg.modules.hanger/zyHangPoint/add",
getLastPointCode: "/org.jeecg.modules.hanger/zyHangPoint/getLastPointCode",
edit: "/org.jeecg.modules.hanger/zyHangPoint/edit",
queryById: "/org.jeecg.modules.hanger/zyHangPoint/queryById"
}
}
},
computed: {
formDisabled() {
return this.disabled
},
data () {
return {
model:{
},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
confirmLoading: false,
validatorRules: {
stationId: [
{ required: false},
{ pattern: /^\d{6,16}$/, message: '请输入6到16位数字!'},
],
},
url: {
add: "/org.jeecg.modules.hanger/zyHangPoint/add",
edit: "/org.jeecg.modules.hanger/zyHangPoint/edit",
queryById: "/org.jeecg.modules.hanger/zyHangPoint/queryById"
}
}
},
created() {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
},
methods: {
add() {
this.getLastPointCode();
this.edit(this.modelDefault);
},
computed: {
formDisabled(){
return this.disabled
},
getLastPointCode() {
getAction(this.url.getLastPointCode, {}).then((res) => {
if (res.success) {
this.model.point = res.result;
this.$forceUpdate();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
confirmLoading = false;
})
},
created () {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
edit(record) {
this.model = Object.assign({}, record);
this.visible = true;
},
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;
})
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>

@ -282,7 +282,6 @@ export default {
// },
},
methods: {
jumpPage1(record) {
this.$router.push({
path: '/productplan/ProductplanManage',
@ -308,19 +307,22 @@ export default {
}
}).finally(() => {
this.loading = false
this.loadData();
})
},
getPaiWeiTu(record) {
async getPaiWeiTu(record) {
// alert(JSON.stringify(record));
getAction(this.url.paiweitu, record).then((res) => {
if (res.success) {
console.log("the paiweitu----------" + JSON.stringify(res.result))
// console.log("the paiweitu----------" + JSON.stringify(res.result));
// alert(JSON.stringify(res.result));
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
this.loadData();
})
},
}

@ -57,6 +57,13 @@ public class ZyHangPointController extends JeecgController<ZyHangPoint, IZyHangP
return Result.OK(pageList);
}
@ApiOperation(value = "吊挂工位表-获取是后的吊拉编码", notes = "吊挂工位表-获取是后的吊拉编码")
@GetMapping(value = "/getLastPointCode")
public Result<?> getLastPointCode(HttpServletRequest req) {
return Result.OK(zyHangPointService.getLastPointCode());
}
/**
* 添加
*
@ -67,6 +74,8 @@ public class ZyHangPointController extends JeecgController<ZyHangPoint, IZyHangP
@ApiOperation(value = "吊挂工位表-添加", notes = "吊挂工位表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyHangPoint zyHangPoint) {
String pointCode = zyHangPointService.getLastPointCode();
zyHangPoint.setPoint(pointCode);
zyHangPointService.save(zyHangPoint);
return Result.OK("添加成功!");
}

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
@ -77,5 +78,6 @@ public class ZyHangPoint implements Serializable {
*/
@Excel(name = "工位id", width = 15)
@ApiModelProperty(value = "工位id")
@Dict(dictTable = "station", dicCode = "id", dicText = "station_name")
private String stationId;
}

@ -12,4 +12,5 @@ import org.jeecg.modules.hanger.entity.ZyHangPoint;
*/
public interface IZyHangPointService extends IService<ZyHangPoint> {
String getLastPointCode();
}

@ -1,11 +1,15 @@
package org.jeecg.modules.hanger.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.hanger.entity.ZyHangPoint;
import org.jeecg.modules.hanger.mapper.ZyHangPointMapper;
import org.jeecg.modules.hanger.service.IZyHangPointService;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.List;
/**
* @Description: 吊挂工位表
@ -16,4 +20,17 @@ import org.springframework.stereotype.Service;
@Service
public class ZyHangPointServiceImpl extends ServiceImpl<ZyHangPointMapper, ZyHangPoint> implements IZyHangPointService {
@Override
public String getLastPointCode() {
List<ZyHangPoint> pointList = this.list(new LambdaQueryWrapper<ZyHangPoint>().orderByDesc(ZyHangPoint::getPoint));
String code = "";
if (ObjectUtils.isEmpty(pointList)) {
code = "P100";
} else {
String[] dgs = pointList.get(0).getPoint().split("P");
int val = new Integer(dgs[1]).intValue() + 1;
code = "P" + val + "";
}
return code;
}
}

Loading…
Cancel
Save