Merge remote-tracking branch 'origin/master'
| | |
| | | @PreAuthorize("@ss.hasPermi('bs:bomInfo:add')") |
| | | @Log(title = "åºç¡BOM", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public AjaxResult add(@RequestBody BsBomInfo bsBomInfo) |
| | | public void add(@RequestBody BsBomInfo bsBomInfo) |
| | | { |
| | | return toAjax(bsBomInfoService.insertBsBomInfo(bsBomInfo)); |
| | | bsBomInfoService.insertBsBomInfo(bsBomInfo); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Excel(name = "ç¶æ(åå
¸)") |
| | | private String status; |
| | | |
| | | /** å建ç¨æ· */ |
| | | @Excel(name = "å建ç¨æ·") |
| | | private String createUser; |
| | | |
| | | /** æ´æ¹ç¨æ· */ |
| | | @Excel(name = "æ´æ¹ç¨æ·") |
| | | private String updateUser; |
| | | |
| | | /** æ°æ®æ¥æº */ |
| | | @Excel(name = "æ°æ®æ¥æº") |
| | |
| | | * @param bsBomInfo åºç¡BOM |
| | | * @return ç»æ |
| | | */ |
| | | public int insertBsBomInfo(BsBomInfo bsBomInfo); |
| | | public void insertBsBomInfo(BsBomInfo bsBomInfo); |
| | | |
| | | /** |
| | | * ä¿®æ¹åºç¡BOM |
| | |
| | | package com.billion.main.bs.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.billion.common.exception.ServiceException; |
| | | import com.billion.common.utils.DateUtils; |
| | | import com.billion.main.bs.domain.BsBomInfo; |
| | | import com.billion.main.bs.mapper.BsBomInfoMapper; |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertBsBomInfo(BsBomInfo bsBomInfo) |
| | | public void insertBsBomInfo(BsBomInfo bsBomInfo) |
| | | { |
| | | bsBomInfo.setCreateTime(DateUtils.getNowDate()); |
| | | return bsBomInfoMapper.insertBsBomInfo(bsBomInfo); |
| | | List<BsBomInfo> checkList = this.list(new LambdaQueryWrapper<BsBomInfo>().eq(BsBomInfo::getBomCode, bsBomInfo.getBomCode())); |
| | | if (CollUtil.isNotEmpty(checkList)){ |
| | | throw new ServiceException("å·²åå¨å·¥åç¼å·ä¸º"+bsBomInfo.getBomCode()+"çæ°æ®"); |
| | | } |
| | | this.save(bsBomInfo); |
| | | } |
| | | |
| | | /** |
| | |
| | | <result property="version" column="version" /> |
| | | <result property="status" column="status" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="createUser" column="create_user" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateUser" column="update_user" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="dataSource" column="data_source" /> |
| | | <result property="delFlag" column="del_flag" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectBsBomInfoVo"> |
| | | select id, bom_code, bom_name, product_code, product_name, version, status, remark, create_user, create_time, update_user, update_time, data_source, del_flag from bs_bom_info |
| | | select id, bom_code, bom_name, product_code, product_name, version, status, remark, create_by, create_time, update_by, update_time, data_source, del_flag from bs_bom_info |
| | | </sql> |
| | | |
| | | <select id="selectBsBomInfoList" parameterType="BsBomInfo" resultMap="BsBomInfoResult"> |
| | |
| | | <if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if> |
| | | <if test="version != null and version != ''"> and version = #{version}</if> |
| | | <if test="status != null and status != ''"> and status = #{status}</if> |
| | | <if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if> |
| | | <if test="updateUser != null and updateUser != ''"> and update_user = #{updateUser}</if> |
| | | <if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if> |
| | | <if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if> |
| | | <if test="dataSource != null and dataSource != ''"> and data_source = #{dataSource}</if> |
| | | </where> |
| | | </select> |
| | |
| | | <if test="version != null">version,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="remark != null">remark,</if> |
| | | <if test="createUser != null">create_user,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | <if test="updateUser != null">update_user,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | | <if test="dataSource != null">data_source,</if> |
| | | <if test="delFlag != null">del_flag,</if> |
| | |
| | | <if test="version != null">#{version},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="remark != null">#{remark},</if> |
| | | <if test="createUser != null">#{createUser},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | <if test="updateUser != null">#{updateUser},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | | <if test="dataSource != null">#{dataSource},</if> |
| | | <if test="delFlag != null">#{delFlag},</if> |
| | |
| | | <if test="version != null">version = #{version},</if> |
| | | <if test="status != null">status = #{status},</if> |
| | | <if test="remark != null">remark = #{remark},</if> |
| | | <if test="createUser != null">create_user = #{createUser},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="updateUser != null">update_user = #{updateUser},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="dataSource != null">data_source = #{dataSource},</if> |
| | | <if test="delFlag != null">del_flag = #{delFlag},</if> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog title="ç©æ产åéæ©" |
| | | v-if="showFlag" |
| | | :visible.sync="showFlag" |
| | | :modal= false |
| | | width="80%" |
| | | center |
| | | > |
| | | <el-row :gutter="20"> |
| | | <!--ç©ææ°æ®--> |
| | | <el-col :span="24" :xs="24"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="ç©æç¼ç " prop="materialCode"> |
| | | <el-input |
| | | v-model="queryParams.materialCode" |
| | | placeholder="请è¾å
¥ç©æç¼ç " |
| | | clearable |
| | | style="width: 240px" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="ç©æå称" prop="materialName"> |
| | | <el-input |
| | | v-model="queryParams.materialName" |
| | | placeholder="请è¾å
¥ç©æå称" |
| | | clearable |
| | | style="width: 240px" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item style="float: right"> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">æç´¢</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">éç½®</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table border v-loading="loading" :data="itemList" @current-change="handleCurrent" @row-dblclick="handleRowDbClick"> |
| | | <el-table-column width="50" align="center" > |
| | | <template v-slot="scope"> |
| | | <el-radio v-model="selectedItemId" :label="scope.row.id" @change="handleRowChange(scope.row)">{{""}}</el-radio> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç©æç¼å·" align="center" prop="materialCode"> |
| | | </el-table-column> |
| | | <el-table-column label="ç©æå称" align="center" prop="materialName"> |
| | | </el-table-column> |
| | | <el-table-column label="åä½" align="center" prop="unit"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.unit" :value="scope.row.unit"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime"> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ" align="center" prop="status"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="åå" align="center" prop="supplier"> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="confirmSelect">ç¡® å®</el-button> |
| | | <el-button @click="showFlag=false">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listMaterialInfo} from "@/api/main/bs/materialInfo"; |
| | | |
| | | export default { |
| | | name: "MdItemSingle", |
| | | dicts: ['sys_yes_no','mes_item_product','material_type','unit','sys_normal_disable'], |
| | | data() { |
| | | return { |
| | | showFlag:false, |
| | | // éä¸æ°ç» |
| | | selectedItemId: undefined, |
| | | selectedRows: undefined, |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // ç©æ产åè¡¨æ ¼æ°æ® |
| | | itemList: null, |
| | | // é¨é¨æ é项 |
| | | itemTypeOptions: undefined, |
| | | // é¨é¨å称 |
| | | itemTypeName: undefined, |
| | | defaultProps: { |
| | | children: "children", |
| | | label: "label" |
| | | }, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | materialCode: undefined, |
| | | materialName: undefined, |
| | | itemTypeId: 0, |
| | | typeL: 1, |
| | | }, |
| | | // åä¿¡æ¯ |
| | | columns: [ |
| | | { key: 0, label: `ç©æ/产åç¼ç `, visible: true }, |
| | | { key: 1, label: `ç©æ/产åå称`, visible: true }, |
| | | { key: 2, label: `è§æ ¼åå·`, visible: true }, |
| | | { key: 3, label: `åä½`, visible: true }, |
| | | { key: 4, label: `ç©æ/产å`, visible: true }, |
| | | { key: 5, label: `ç©æåç±»`, visible: true }, |
| | | { key: 6, label: `å建æ¶é´`, visible: true } |
| | | ] |
| | | }; |
| | | }, |
| | | watch: { |
| | | // æ ¹æ®å称çéåç±»æ |
| | | itemTypeName(val) { |
| | | this.$refs.tree.filter(val); |
| | | } |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢ç©æç¼ç å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listMaterialInfo(this.queryParams).then(response => { |
| | | this.itemList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | } |
| | | ); |
| | | }, |
| | | // çéèç¹ |
| | | filterNode(value, data) { |
| | | if (!value) return true; |
| | | return data.label.indexOf(value) !== -1; |
| | | }, |
| | | // èç¹åå»äºä»¶ |
| | | handleNodeClick(data) { |
| | | this.queryParams.itemTypeId = data.id; |
| | | this.handleQuery(); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | handleCurrent(row){ |
| | | if(row){ |
| | | this.selectedRows = row; |
| | | } |
| | | }, |
| | | handleRowDbClick(row){ |
| | | if(row){ |
| | | this.selectedRows = row; |
| | | this.$emit('onSelected',this.selectedRows); |
| | | this.showFlag = false; |
| | | } |
| | | }, |
| | | // åééä¸æ°æ® |
| | | handleRowChange(row) { |
| | | debugger; |
| | | if(row){ |
| | | this.selectedRows = row; |
| | | } |
| | | }, |
| | | //ç¡®å®éä¸ |
| | | confirmSelect(){ |
| | | if(this.selectedItemId ==null || this.selectedItemId==0){ |
| | | this.$notify({ |
| | | title:'æ示', |
| | | type:'warning', |
| | | message: '请è³å°éæ©ä¸æ¡æ°æ®!' |
| | | }); |
| | | return; |
| | | } |
| | | console.log(this.selectedRows) |
| | | |
| | | this.$emit('onSelected',this.selectedRows); |
| | | this.showFlag = false; |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | <el-input v-model="form.locationName" placeholder="请è¾å
¥å·¥ä½å称" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç©æç¼ç " prop="materialCode"> |
| | | <el-input v-model="form.materialCode" placeholder="请è¾å
¥ç©æç¼ç " /> |
| | | <el-input v-model="form.materialCode" placeholder="请éæ©äº§å" > |
| | | <el-button slot="append" @click="handleSelectMaterial" icon="el-icon-search"></el-button> |
| | | </el-input> |
| | | <ItemSelect ref="itemSelect" @onSelected="onItemSelected" > </ItemSelect> |
| | | </el-form-item> |
| | | <el-form-item label="ç©æå称" prop="materialName"> |
| | | <el-input v-model="form.materialName" placeholder="请è¾å
¥ç©æå称" /> |
| | | <el-input disabled v-model="form.materialName" placeholder="请è¾å
¥ç©æå称" /> |
| | | </el-form-item> |
| | | <el-form-item label="åè" prop="costQty"> |
| | | <el-input v-model="form.costQty" placeholder="请è¾å
¥åè" /> |
| | |
| | | <script> |
| | | import { listBomChildInfo, getBomChildInfo, delBomChildInfo, addBomChildInfo, updateBomChildInfo } from "@/api/main/bs/bomChildInfo"; |
| | | import { listBomInfo } from "@/api/main/bs/bomInfo"; |
| | | import ItemSelect from "@/components/itemSelect/single.vue"; |
| | | |
| | | export default { |
| | | name: "BomChildInfo", |
| | | components: {ItemSelect}, |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | |
| | | this.getProcesses(); |
| | | }, |
| | | methods: { |
| | | //ç©æéæ©å¼¹åºæ¡ |
| | | onItemSelected(obj){ |
| | | if(obj !== undefined && obj !== null){ |
| | | this.form.materialCode = obj.materialCode; |
| | | this.form.materialName = obj.materialName; |
| | | } |
| | | }, |
| | | handleSelectMaterial(){ |
| | | this.$refs.itemSelect.showFlag = true; |
| | | }, |
| | | /** è¿åæé®æä½ */ |
| | | handleClose() { |
| | | const obj = { path: "/main/bs/bomInfo" }; |
| | |
| | | <el-table-column show-overflow-tooltip="true" label="产åç¼ç " align="center" prop="productCode"/> |
| | | <el-table-column show-overflow-tooltip="true" label="产åå称" align="center" prop="productName" /> |
| | | <el-table-column show-overflow-tooltip="true" label="çæ¬" align="center" prop="version" /> |
| | | <el-table-column show-overflow-tooltip="true" label="ç¶æ" align="center" prop="status" /> |
| | | <el-table-column label="ç¶æ" align="center" prop="status"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column show-overflow-tooltip="true" label="å¤æ³¨" align="center" prop="remark" /> |
| | | </el-table> |
| | | |
| | |
| | | <el-form-item label="产åå称" prop="productName"> |
| | | <el-input v-model="form.productName" placeholder="请è¾å
¥äº§åå称" /> |
| | | </el-form-item> |
| | | <el-form-item label="å·¥åç¶æ" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="å¤æ³¨" prop="remark"> |
| | | <el-input v-model="form.remark" type="textarea" placeholder="请è¾å
¥å
容" /> |
| | | </el-form-item> |
| | |
| | | |
| | | export default { |
| | | name: "BomInfo", |
| | | dicts: ['sys_normal_disable'], |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |