| | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = Constant.QT.STRING, format = "NAME^LK"), |
| | | @ApiImplicitParam(name = "nodeType", value = "类型", dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "id", value = "上级ID", dataType = Constant.QT.STRING) |
| | | @ApiImplicitParam(name = "srcId", value = "ID", dataType = Constant.QT.STRING) |
| | | }) |
| | | public PageResult<ParamDataAssign> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | public Result<List<ParamDataAssign>> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | | return PageResult.ok(paramDataAssignService.page(queryFilter)); |
| | | return Result.ok(paramDataAssignService.page(queryFilter)); |
| | | } |
| | | |
| | | @PostMapping("get") |
| | |
| | | for(ParamDataAssign assign:list){ |
| | | assign.setProductId(assign.getId()); |
| | | assign.setId(null); |
| | | this.insert(assign); |
| | | paramDataAssignService.insert(assign); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody ParamDataAssign paramDataAssign){ |
| | | @PostMapping("save") |
| | | public Result save(@RequestBody ParamDataAssign paramDataAssign) { |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(paramDataAssign, AddGroup.class, DefaultGroup.class); |
| | | paramDataAssignService.insert(paramDataAssign); |
| | | |
| | | for (ParamDataAssign assign : paramDataAssign.getDataThreeList()) { |
| | | if (assign.getId()!=null){ |
| | | ValidatorUtils.validateEntity(assign, UpdateGroup.class, DefaultGroup.class); |
| | | paramDataAssignService.update(assign); |
| | | }else{ |
| | | ValidatorUtils.validateEntity(assign, AddGroup.class, DefaultGroup.class); |
| | | paramDataAssignService.insert(assign); |
| | | } |
| | | } |
| | | return Result.ok(); |
| | | } |
| | | |
| | |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = Constant.Q.PAGE, value = Constant.QV.PAGE, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "name", value = "名称", dataType = Constant.QT.STRING, format = "NAME^LK"), |
| | | @ApiImplicitParam(name = "nodeType", value = "类型", dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "srcId", value = "上级ID", dataType = Constant.QT.STRING)}) |
| | | public PageResult<ParamDataExpect> page(@ApiIgnore @QueryParam QueryFilter queryFilter) { |
| | | public Result<List<ParamDataExpect>> page(@ApiIgnore @QueryParam QueryFilter queryFilter) { |
| | | |
| | | return PageResult.ok(paramDataExpectService.page(queryFilter)); |
| | | return Result.ok(paramDataExpectService.page(queryFilter)); |
| | | } |
| | | |
| | | @PostMapping("get") |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * param_data_assign |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private Long productIdInit; |
| | | |
| | | @TableField(exist = false) |
| | | private List<ParamDataAssign> dataThreeList; |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private Long productIdInit; |
| | | |
| | | @lombok.Getter |
| | | @TableField(exist = false) |
| | | private List<ParamDataExpect> dataThreeList; |
| | | |
| | |
| | | LEFT JOIN param_data_assign b ON b.product_id = a.id |
| | | <where> |
| | | a.is_delete = 0 |
| | | <if test="id!=null"> |
| | | and a.pid =${id} |
| | | <if test="srcId!=null"> |
| | | and a.pid =${srcId} |
| | | </if> |
| | | <if test="id==null"> |
| | | <if test="srcId==null"> |
| | | and a.pid is null |
| | | </if> |
| | | <if test="whereSql!=null"> |
File was renamed from web/src/views/modules/basicInfo/ParamDataExpect.vue |
| | |
| | | </el-col> |
| | | <el-col :span="19"> |
| | | <div class="mod-basicInfo-paramDataExpect}"> |
| | | <zt-table-wraper ref="tableObj" query-url="/basicInfo/ParamDataExpect/page" |
| | | delete-url="/basicInfo/ParamDataExpect/" |
| | | <zt-table-wraper ref="tableObj" :query-url=queryUrl |
| | | :delete-url=deleteUrl |
| | | @dataLoaded="dataLoaded" |
| | | v-slot="{ table }"> |
| | | v-slot="{ table }" |
| | | :paging='false'> |
| | | <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()"> |
| | | <el-form-item> |
| | | <el-input v-model="dataForm.name" placeholder="请输入名称" clearable></el-input> |
| | |
| | | </el-table-column> |
| | | <el-table-column v-if="dataForm.nodeType==='2'" :key="5" label="基本可靠性计算"> |
| | | <!-- <zt-table-column-dict prop="joinCompute" :keys="6" label="参加计算" width="100" dict="is_or_not"/>--> |
| | | <el-table-column prop="joinCompute" label="参加计算" :key="6" width="100"> |
| | | <el-table-column prop="joinCompute" label="参加计算" :key="6" width="100"> |
| | | <template v-slot="{ row }"> |
| | | <el-select v-if="row.isEdit" v-model="row.joinCompute" |
| | | placeholder="参加计算"> |
| | |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <zt-dict-tag dict="is_or_not" :value="row.joinCompute" :typeS="typeS" :typeI="typeI" :typeD="typeD" |
| | | <zt-dict-tag v-else dict="is_or_not" :value="row.joinCompute" :typeS="typeS" :typeI="typeI" |
| | | :typeD="typeD" |
| | | :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <zt-dict-tag dict="is_or_not" :value="row.repairable" :typeS="typeS" :typeI="typeI" :typeD="typeD" |
| | | <zt-dict-tag v-else dict="is_or_not" :value="row.repairable" :typeS="typeS" :typeI="typeI" |
| | | :typeD="typeD" |
| | | :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <zt-dict-tag dict="RepairDistribType" :value="row.repairDistribType" :typeS="typeS" :typeI="typeI" |
| | | <zt-dict-tag v-else dict="RepairDistribType" :value="row.repairDistribType" :typeS="typeS" |
| | | :typeI="typeI" |
| | | :typeD="typeD" :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | |
| | | <!-- <zt-table-column-dict v-if="dataForm.nodeType==='2'" :key="27" prop="reliabDistribType" label="可靠性分布类型" |
| | | width="160"/>--> |
| | | <el-table-column v-if="dataForm.nodeType==='2'" prop="reliabDistribType" label="可靠性分布类型" :key="27" width="160"> |
| | | <el-table-column v-if="dataForm.nodeType==='2'" prop="reliabDistribType" label="可靠性分布类型" :key="27" |
| | | width="160"> |
| | | <template v-slot="{ row }"> |
| | | <el-select v-if="row.isEdit" v-model="row.reliabDistribType" |
| | | placeholder="当前状态"> |
| | |
| | | |
| | | </el-table> |
| | | <!-- 弹窗, 新增 / 修改 --> |
| | | <add-or-update ref="AddOrUpdate" @refreshDataList="table.query"/> |
| | | <select-ty-model @refreshDataList="table.query" ref="SelectTyModel"/> |
| | | </zt-table-wraper> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import AddOrUpdate from './ParamDataExpect-AddOrUpdate' |
| | | import ProductModelTree from "./ProductModelTree"; |
| | | import SelectTyModel from "./SelectTyModel"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | queryUrl: '/basicInfo/ParamDataExpect/page', |
| | | deleteUrl: '/basicInfo/ParamDataExpect', |
| | | pageCode: '', |
| | | key: '', |
| | | typeS: '', |
| | | typeI: '', |
| | |
| | | effect: '', |
| | | hit: false, |
| | | dataForm: { |
| | | pageCode: this.$route.query.pageCode, |
| | | id: '', |
| | | pid: '', |
| | | srcId: '', |
| | |
| | | } |
| | | }, |
| | | components: { |
| | | AddOrUpdate, |
| | | ProductModelTree, |
| | | SelectTyModel |
| | | }, |
| | | mounted() { |
| | | this.pageCode = this.$route.query.pageCode |
| | | this.dataForm.pageCode = this.$route.query.pageCode |
| | | if (this.pageCode === 'assign') { |
| | | this.queryUrl = '/basicInfo/ParamDataAssign/page' |
| | | this.deleteUrl = '/basicInfo/ParamDataAssign' |
| | | } |
| | | console.log(this.pageCode, 'this.pageCode this.pageCode') |
| | | }, |
| | | methods: { |
| | | add() { |
| | | this.$refs.SelectTyModel.$refs.dialog.init(null, { |
| | | type: this.dataForm.nodeType - 1, |
| | | id: this.dataForm.id, |
| | | data: 'expect' |
| | | pageCode: this.pageCode |
| | | }) |
| | | }, |
| | | //批量保存 |
| | | async handleSaveRows() { |
| | | this.dataForm.dataThreeList = this.$refs.tableObj.dataList |
| | | console.log(this.dataForm, 'this.dataForm this.dataForm') |
| | | let res = await this.$http.post('/basicInfo/ParamDataExpect/save', this.dataForm) |
| | | let res |
| | | if (this.pageCode === 'Expect') { |
| | | res = await this.$http.post('/basicInfo/ParamDataExpect/save', this.dataForm) |
| | | } else { |
| | | res = await this.$http.post('/basicInfo/ParamDataAssign/save', this.dataForm) |
| | | } |
| | | if (res.success) { |
| | | console.log(res.data) |
| | | await this.$tip.success() |
| | |
| | | // }) |
| | | // console.log(this.editingCell, 'this.editingCell') |
| | | // }, |
| | | update(row) { |
| | | console.log(row, 'update') |
| | | this.$refs.AddOrUpdate.$refs.dialog.init(row.id, { |
| | | type: this.dataForm.nodeType, |
| | | name: row.name, |
| | | productId: row.productId |
| | | }) |
| | | }, |
| | | onProductSelected(data) { |
| | | this.dataForm.srcId = data.id |
| | | this.dataForm.nodeType = data.nodeType |
| | |
| | | init(id,params) { |
| | | this.dataForm.nodeType = params.type |
| | | this.dataForm.pid = params.id |
| | | this.data = params.data |
| | | if (this.data ==='expect'||this.data==='assign'){ |
| | | this.pageCode = params.pageCode |
| | | if (this.pageCode ==='expect'||this.pageCode==='assign'){ |
| | | this.url='/basicInfo/XhProductModel/page' |
| | | } |
| | | console.log(this.dataForm.pid, 'init()') |
| | |
| | | }, |
| | | async formSubmit() { |
| | | let res |
| | | if (this.data && this.data === 'expect'){ |
| | | if (this.pageCode && this.pageCode === 'expect'){ |
| | | res = await this.$http.post('/basicInfo/ParamDataExpect/get', this.selectList) |
| | | }else if(this.data && this.data === 'assign') { |
| | | }else if(this.pageCode && this.pageCode === 'assign') { |
| | | res = await this.$http.post('/basicInfo/ParamDataAssign/get', this.selectList) |
| | | }else |
| | | { |