From a36b834b2957440a755652ff17d067b18f4e9250 Mon Sep 17 00:00:00 2001 From: 懒羊羊 <15939171744@163.com> Date: 星期一, 29 一月 2024 16:55:05 +0800 Subject: [PATCH] 工位终端 --- jcdm-ui/src/views/main/bs/formula/index.vue | 3 jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/cert/MethodName.java | 70 +++++++++++ jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/mapper/BsFormulaChildInfoMapper.java | 4 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java | 28 ++++ jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/IBsFormulaChildInfoService.java | 8 + jcdm-ui/src/views/main/kb/stationTerminal/index.vue | 48 +++++++ jcdm-ui/src/router/index.js | 2 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java | 19 +++ jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/BsFormulaChildInfo.java | 24 ++++ jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js | 18 +++ jcdm-ui/src/views/main/bs/formulaChild/index.vue | 48 ++++--- jcdm-main/src/main/resources/mapper/bs/formulaChild/BsFormulaChildInfoMapper.xml | 34 +++++ 12 files changed, 276 insertions(+), 30 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java index cb7fe99..fa87316 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/controller/BsFormulaChildInfoController.java @@ -52,6 +52,25 @@ } /** + * 妫�鏌ユ槸鍚﹀彲浠ユ斁琛� + */ + @GetMapping("/releaseCheck") + public AjaxResult releaseCheck() + { + List<BsFormulaChildInfo> i = bsFormulaChildInfoService.releaseCheck(); + return AjaxResult.success(i.size()); + } + + /** + * 鎵爜纭 + */ + @GetMapping("/updateResults") + public AjaxResult updateResults(BsFormulaChildInfo bsFormulaChildInfo) + { + return bsFormulaChildInfoService.updateResults(bsFormulaChildInfo); + } + + /** * 瀵煎嚭閰嶆柟閰嶇疆瀛愪俊鎭垪琛� */ @PreAuthorize("@ss.hasPermi('bs:formulaChild:export')") diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/BsFormulaChildInfo.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/BsFormulaChildInfo.java index 311a0b2..964afed 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/BsFormulaChildInfo.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/domain/BsFormulaChildInfo.java @@ -90,12 +90,36 @@ /** 棰勭暀瀛楁4 */ private String spareField4; + /** 閲囬泦鏁版嵁 */ + @Excel(name = "閲囬泦鏁版嵁") + private String collectData; + + /** 缁撴灉 */ + @Excel(name = "缁撴灉") + private String results; + private String sort; private String address; private String img; + public String getCollectData() { + return collectData; + } + + public void setCollectData(String collectData) { + this.collectData = collectData; + } + + public String getResults() { + return results; + } + + public void setResults(String results) { + this.results = results; + } + public String getSort() { return sort; } diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/mapper/BsFormulaChildInfoMapper.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/mapper/BsFormulaChildInfoMapper.java index faf4468..efc11ce 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/mapper/BsFormulaChildInfoMapper.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/mapper/BsFormulaChildInfoMapper.java @@ -58,4 +58,8 @@ * @return 缁撴灉 */ public int deleteBsFormulaChildInfoByIds(Long[] ids); + + BsFormulaChildInfo selectBsFormulaChildInfoByTypeTopOne(BsFormulaChildInfo bsFormulaChildInfo); + + List<BsFormulaChildInfo> releaseCheck(); } diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/IBsFormulaChildInfoService.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/IBsFormulaChildInfoService.java index 3732946..4790358 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/IBsFormulaChildInfoService.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/IBsFormulaChildInfoService.java @@ -1,6 +1,8 @@ package com.jcdm.main.bs.formulaChild.service; import java.util.List; + +import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.main.bs.formulaChild.domain.BsFormulaChildInfo; /** @@ -58,4 +60,10 @@ * @return 缁撴灉 */ public int deleteBsFormulaChildInfoById(Long id); + + public BsFormulaChildInfo selectBsFormulaChildInfoByTypeTopOne(String type,String productCode,String processesCode); + + List<BsFormulaChildInfo> releaseCheck(); + + AjaxResult updateResults(BsFormulaChildInfo bsFormulaChildInfo); } diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java index 0861693..d1ba232 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java +++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java @@ -1,6 +1,8 @@ package com.jcdm.main.bs.formulaChild.service.impl; import java.util.List; + +import com.jcdm.common.core.domain.AjaxResult; import com.jcdm.common.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -93,4 +95,30 @@ { return bsFormulaChildInfoMapper.deleteBsFormulaChildInfoById(id); } + + @Override + public BsFormulaChildInfo selectBsFormulaChildInfoByTypeTopOne(String type,String productCode,String processesCode) { + BsFormulaChildInfo info = new BsFormulaChildInfo(); + info.setOperationType(type); + info.setProcessesCode(processesCode); + info.setProductCode(productCode); + return bsFormulaChildInfoMapper.selectBsFormulaChildInfoByTypeTopOne(info); + } + + @Override + public List<BsFormulaChildInfo> releaseCheck() { + return bsFormulaChildInfoMapper.releaseCheck(); + } + + @Override + public AjaxResult updateResults(BsFormulaChildInfo bsFormulaChildInfo) { + List<BsFormulaChildInfo> bsFormulaChildInfos = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(bsFormulaChildInfo); + if(bsFormulaChildInfos.size()>0){ + bsFormulaChildInfos.get(0).setResults("OK"); + bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos.get(0)); + }else { + return AjaxResult.error("闈炴湰宸ヤ綅鐗╂枡锛岃閲嶆柊鎵弿"); + } + return AjaxResult.success("鎴愬姛"); + } } diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/cert/MethodName.java b/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/cert/MethodName.java index 2f5a299..2fe1773 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/cert/MethodName.java +++ b/jcdm-main/src/main/java/com/jcdm/main/da/opcuaconfig/cert/MethodName.java @@ -2,6 +2,8 @@ import com.jcdm.framework.websocket.WebSocketServer; import com.jcdm.framework.websocket.WebSocketUsers; +import com.jcdm.main.bs.formulaChild.domain.BsFormulaChildInfo; +import com.jcdm.main.bs.formulaChild.service.IBsFormulaChildInfoService; import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf; import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService; import com.jcdm.main.da.opcuaconfig.client.ClientHandler; @@ -29,6 +31,7 @@ private IDaCollectionParamConfService collectionParamConfService = BeanUtils.getBean(IDaCollectionParamConfService.class); private IDaParamCollectionService daParamCollectionService = BeanUtils.getBean(IDaParamCollectionService.class); private IDaPassingStationCollectionService daPassingStationCollectionService = BeanUtils.getBean(IDaPassingStationCollectionService.class); + private IBsFormulaChildInfoService bsFormulaChildInfoService = BeanUtils.getBean(IBsFormulaChildInfoService.class); private List<DataValue> s=null; public void Transit(String Node, String value) throws Exception { log.info(Node+":"+value); @@ -96,4 +99,71 @@ break; } } + + public void tighten(String Node, String value) throws Exception { + String[] parts = Node.split("[.]"); + ClientHandler clientHandler=new ClientHandler(); + System.out.println("Node:"+Node+"value:"+value); + switch (value){ + case "1": + //璇绘壄鐭� + NodeEntity SN_node= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".RecordSN").value("").type("").build(); + String SNCode=clientHandler.read(SN_node); + + //璇昏搴� + NodeEntity SNDone= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".RecordSNDone").value("").type("").build(); + String RecordSNDone = clientHandler.read(SNDone); + + //璇荤粨鏋� + NodeEntity SNDone1= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".WorkID").value("").type("").build(); + String WorkID = clientHandler.read(SNDone1); + + //淇濆瓨鍙傛暟閲囬泦琛� + DaParamCollection paramCollection = new DaParamCollection(); + paramCollection.setLocationCode(parts[1]); + paramCollection.setParamCode("RecordSN"); + paramCollection.setParamValue(SNCode); + paramCollection.setParamName(parts[0]+"."+parts[1]+".RecordSN"); + daParamCollectionService.insertDaParamCollection(paramCollection); + + + DaParamCollection paramCollection1 = new DaParamCollection(); + paramCollection1.setLocationCode(parts[1]); + paramCollection1.setParamCode("RecordSNDone"); + paramCollection1.setParamValue(RecordSNDone); + paramCollection1.setParamName(parts[0]+"."+parts[1]+".RecordSNDone"); + daParamCollectionService.insertDaParamCollection(paramCollection1); + + + + DaParamCollection paramCollection2 = new DaParamCollection(); + paramCollection2.setLocationCode(parts[1]); + paramCollection2.setParamCode("WorkID"); + paramCollection2.setParamValue(WorkID); + paramCollection2.setParamName(parts[0]+"."+parts[1]+".WorkID"); + daParamCollectionService.insertDaParamCollection(paramCollection2); + + //淇濆瓨鐘舵�佹洿鏂板墠绔〃鍗� + BsFormulaChildInfo test = bsFormulaChildInfoService.selectBsFormulaChildInfoByTypeTopOne("1", "test", parts[1]); + test.setResults(WorkID); + bsFormulaChildInfoService.updateBsFormulaChildInfo(test); + WebSocketUsers.sendMessageToUserByText(map.get(parts[1]), "TIGHTEN"); + + + + System.out.println("SNCode:"+SNCode); + System.out.println("Node:"+Node+"value:"+value); + NodeEntity node= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".StationStatus").value("0").type("short").build(); + Boolean out=clientHandler.write(node); + NodeEntity RecordSN= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".RecordSN").value("0").type("short").build(); + Boolean out1=clientHandler.write(RecordSN); + NodeEntity riteRecordSNDone= NodeEntity.builder().index(2).identifier(parts[0]+"."+parts[1]+".RecordSNDone").value("0").type("short").build(); + Boolean out2=clientHandler.write(riteRecordSNDone); + log.info("鑺傜偣:{},鍝嶅簲缁撴灉:{}", node.getIdentifier(),out); + default: + break; + } + } + + } diff --git a/jcdm-main/src/main/resources/mapper/bs/formulaChild/BsFormulaChildInfoMapper.xml b/jcdm-main/src/main/resources/mapper/bs/formulaChild/BsFormulaChildInfoMapper.xml index 96d6d33..c0265ce 100644 --- a/jcdm-main/src/main/resources/mapper/bs/formulaChild/BsFormulaChildInfoMapper.xml +++ b/jcdm-main/src/main/resources/mapper/bs/formulaChild/BsFormulaChildInfoMapper.xml @@ -27,10 +27,12 @@ <result property="spareField2" column="spare_field_2" /> <result property="spareField3" column="spare_field_3" /> <result property="spareField4" column="spare_field_4" /> + <result property="collectData" column="collect_data" /> + <result property="results" column="results" /> </resultMap> <sql id="selectBsFormulaChildInfoVo"> - select id, workshop_code, line_code, processes_code, product_code, operation_steps, tech_requirement, operation_type, step_sort, param_code, material_code, formula_code, picture, remarks, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from bs_formula_child_info + select id, workshop_code, line_code, processes_code, product_code, operation_steps, tech_requirement, operation_type, step_sort, param_code, material_code, formula_code, picture, remarks, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4, collect_data, results from bs_formula_child_info </sql> <select id="selectBsFormulaChildInfoList" parameterType="BsFormulaChildInfo" resultMap="BsFormulaChildInfoResult"> @@ -42,8 +44,12 @@ <if test="productCode != null and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if> <if test="operationType != null and operationType != ''"> and operation_type like concat('%', #{operationType}, '%')</if> <if test="formulaCode != null and formulaCode != ''"> and formula_code like concat('%', #{formulaCode}, '%')</if> + <if test="collectData != null and collectData != ''"> and collect_data = #{collectData}</if> + <if test="results != null and result != ''"> and result = #{results}</if> + <if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if> </where> + ORDER BY step_sort ASC </select> <select id="selectBsFormulaChildInfoById" parameterType="Long" resultMap="BsFormulaChildInfoResult"> @@ -75,6 +81,8 @@ <if test="spareField2 != null">spare_field_2,</if> <if test="spareField3 != null">spare_field_3,</if> <if test="spareField4 != null">spare_field_4,</if> + <if test="collectData != null">collect_data,</if> + <if test="results != null">results,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="workshopCode != null">#{workshopCode},</if> @@ -98,6 +106,8 @@ <if test="spareField2 != null">#{spareField2},</if> <if test="spareField3 != null">#{spareField3},</if> <if test="spareField4 != null">#{spareField4},</if> + <if test="collectData != null">collect_data,</if> + <if test="results != null">results,</if> </trim> </insert> @@ -125,6 +135,8 @@ <if test="spareField2 != null">spare_field_2 = #{spareField2},</if> <if test="spareField3 != null">spare_field_3 = #{spareField3},</if> <if test="spareField4 != null">spare_field_4 = #{spareField4},</if> + <if test="collectData != null">collect_data = #{collectData},</if> + <if test="results != null">results = #{results},</if> </trim> where id = #{id} </update> @@ -139,4 +151,24 @@ #{id} </foreach> </delete> + + <select id="selectBsFormulaChildInfoByTypeTopOne" parameterType="BsFormulaChildInfo" resultMap="BsFormulaChildInfoResult"> + SELECT + TOP 1 * + FROM + bs_formula_child_info + WHERE NOT results = 'OK' + AND product_code = #{productCode} + AND processes_code = #{processesCode} + AND operation_type = #{operationType} + ORDER BY step_sort ASC + </select> + + <select id="releaseCheck" resultMap="BsFormulaChildInfoResult"> + SELECT + * + FROM + bs_formula_child_info + WHERE NOT results = 'OK' + </select> </mapper> \ No newline at end of file diff --git a/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js b/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js index ad6b5ac..6bffa5f 100644 --- a/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js +++ b/jcdm-ui/src/api/main/bs/formulaChild/formulaChild.js @@ -9,6 +9,24 @@ }) } +// 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛� +export function releaseCheck() { + return request({ + url: '/bs/formulaChild/releaseCheck', + method: 'get', + }) +} + +// 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛� +export function updateResults(query) { + return request({ + url: '/bs/formulaChild/updateResults', + method: 'get', + params: query + + }) +} + // 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭缁� export function getFormulaChild(id) { return request({ diff --git a/jcdm-ui/src/router/index.js b/jcdm-ui/src/router/index.js index d89fed5..f1a20fa 100644 --- a/jcdm-ui/src/router/index.js +++ b/jcdm-ui/src/router/index.js @@ -141,7 +141,7 @@ permissions: ['bs:formulaChild:list'], children: [ { - path: 'index/:formulaCode(\\d+)', + path: 'index', component: () => import('@/views/main/bs/formulaChild/index'), name: 'Data', meta: { title: '閰嶆柟璇︽儏', activeMenu: '/main/bs/formulaChild' } diff --git a/jcdm-ui/src/views/main/bs/formula/index.vue b/jcdm-ui/src/views/main/bs/formula/index.vue index f64e24a..c43aeca 100644 --- a/jcdm-ui/src/views/main/bs/formula/index.vue +++ b/jcdm-ui/src/views/main/bs/formula/index.vue @@ -96,7 +96,8 @@ <!-- </el-table-column>--> <el-table-column label="閰嶆柟缂栫爜" width="130" align="center" :show-overflow-tooltip="true"> <template slot-scope="scope"> - <router-link :to="'/main/formula-data/index/' + scope.row.formulaCode" class="link-type"> + <router-link :to="{path: '/main/formula-data/index/', query: {formulaCode: scope.row.formulaCode} }" class="link-type"> + <span>{{ scope.row.formulaCode }}</span> </router-link> </template> diff --git a/jcdm-ui/src/views/main/bs/formulaChild/index.vue b/jcdm-ui/src/views/main/bs/formulaChild/index.vue index 67c79d1..95a80ea 100644 --- a/jcdm-ui/src/views/main/bs/formulaChild/index.vue +++ b/jcdm-ui/src/views/main/bs/formulaChild/index.vue @@ -107,7 +107,7 @@ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> - <el-descriptions class="margin-top" :column="4" :size="size" border> + <el-descriptions class="margin-top" :column="4" border> <el-descriptions-item :span="1"> <template slot="label"> <i class="el-icon-user"></i> @@ -150,26 +150,29 @@ </el-table-column> <el-table-column label="鎿嶄綔鍐呭" :show-overflow-tooltip='true' width="150" align="center" prop="operationSteps"> </el-table-column> - <el-table-column label="鎶�鏈姹�" width="150" :show-overflow-tooltip='true' align="center" prop="techRequirement"> + <el-table-column label="鎶�鏈姹�" width="150" :show-overflow-tooltip='true' align="center" prop="techRequirement"> </el-table-column> <el-table-column label="绫诲瀷" width="90" align="center" prop="operationType"> + <template slot-scope="scope"> + <dict-tag :options="dict.type.operation_type" :value="scope.row.operationType"/> + </template> </el-table-column> <el-table-column label="鎺掑簭" width="90" align="center" prop="stepSort"> </el-table-column> - <el-table-column label="鍙傛暟缂栫爜" width="130" align="center" prop="paramCode"> + <el-table-column label="鍙傛暟缂栫爜" :show-overflow-tooltip='true' width="130" align="center" prop="paramCode"> </el-table-column> - <el-table-column label="鐗╂枡缂栫爜" width="130" align="center" prop="materialCode"> + <el-table-column label="鐗╂枡缂栫爜" :show-overflow-tooltip='true' width="130" align="center" prop="materialCode"> </el-table-column> <el-table-column label="閰嶆柟缂栫爜" width="130" align="center" prop="formulaCode"> </el-table-column> <el-table-column label="鍥剧墖" :show-overflow-tooltip='true' width="130" align="center" prop="picture"> - <template slot-scope="scope"> - <el-image - style="width: 100px; height: 100px" - :src="pjtUrl+scope.row.picture" - :fit="fit"> - </el-image> - </template> +<!-- <template slot-scope="scope">--> +<!-- <el-image--> +<!-- style="width: 100px; height: 100px"--> +<!-- :src="pjtUrl+scope.row.picture"--> +<!-- :fit="fit">--> +<!-- </el-image>--> +<!-- </template>--> </el-table-column> <el-table-column label="澶囨敞" width="130" align="center" prop="remarks"> </el-table-column> @@ -242,16 +245,16 @@ <el-form-item label="鎶�鏈姹�" prop="techRequirement"> <el-input v-model="form.techRequirement" placeholder="璇疯緭鍏ユ妧鏈姹�" /> </el-form-item> -<!-- <el-form-item label="绫诲瀷" prop="operationType">--> -<!-- <el-select v-model="form.operationType" placeholder="璇烽�夋嫨绫诲瀷">--> -<!-- <el-option--> -<!-- v-for="dict in dict.type.${dictType}"--> -<!-- :key="dict.value"--> -<!-- :label="dict.label"--> -<!-- :value="dict.value"--> -<!-- ></el-option>--> -<!-- </el-select>--> -<!-- </el-form-item>--> + <el-form-item label="绫诲瀷" prop="operationType"> + <el-select style="width: 100%" v-model="form.operationType" placeholder="璇烽�夋嫨绫诲瀷"> + <el-option + v-for="dict in dict.type.operation_type" + :key="dict.value" + :label="dict.label" + :value="dict.value" + ></el-option> + </el-select> + </el-form-item> <el-form-item label="鎺掑簭" prop="stepSort"> <el-input v-model="form.stepSort" placeholder="璇疯緭鍏ユ帓搴�" /> </el-form-item> @@ -285,6 +288,7 @@ export default { name: "FormulaChild", + dicts: ['operation_type'], data() { return { pjtUrl: process.env.VUE_APP_BASE_API, @@ -336,7 +340,7 @@ }; }, created() { - const formulaCode = this.$route.params && this.$route.params.formulaCode; + let formulaCode = this.$route.query.formulaCode; this.queryParams.formulaCode = formulaCode; this.formulaCode = formulaCode; this.headerInformation(); diff --git a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue index d0d7943..2383ad3 100644 --- a/jcdm-ui/src/views/main/kb/stationTerminal/index.vue +++ b/jcdm-ui/src/views/main/kb/stationTerminal/index.vue @@ -93,6 +93,9 @@ </el-col> </el-row> + <el-row style="margin-top: 20px"> + <el-button @click="Release" type="primary">鏀捐</el-button> + </el-row> </el-card> </el-col> @@ -101,7 +104,7 @@ <el-tab-pane name="first"> <span slot="label"> <a class="el-icon-date"></a>棣栭〉</span> <el-col :span="8"> - <el-table :data="formulaChildList"> + <el-table :cell-style="rowStyle" :data="formulaChildList"> <el-table-column label="鎺掑簭" width="60" align="center" prop="stepSort"> </el-table-column> <el-table-column label="鎿嶄綔鍐呭" :show-overflow-tooltip='true' align="center" prop="operationSteps"> @@ -144,7 +147,7 @@ <script> import {listWorkReport} from "@/api/main/om/workReport/workReport"; import {listStationConf,getIpv4} from "@/api/main/sc/stationConf"; -import {listFormulaChild} from "@/api/main/bs/formulaChild/formulaChild"; +import {listFormulaChild, releaseCheck, updateResults} from "@/api/main/bs/formulaChild/formulaChild"; export default { name: "stationTerminal", @@ -195,7 +198,7 @@ }, content: '', activeName: 'first', - url: "ws://192.168.10.184:8080/websocket/message/", + url: "ws://192.168.11.60:8080/websocket/message/", message: "", text_content: "", ws: null, @@ -216,8 +219,32 @@ }, methods: { - serialPortMethod(){ + Release(){ + releaseCheck().then(response => { + if(response.data === 0){ + //鏀瑰彉鐘舵�� + this.$message('鏀捐鎴愬姛锛�'); + }else { + this.$message('姝ラ鏈畬鎴愪笉璁告斁琛岋紒'); + } + }); + }, + serialPortMethod(){ + let formulaChildParams = { + materialCode: this.serialPortContent + } + updateResults(formulaChildParams).then(response => { + this.getListFormulaChild() + }); + }, + rowStyle({ row }) { + if (row.results === 'OK') { + return 'background-color: PaleGreen'; + } else if (row.results === 'NG') { + return 'background-color: LightSalmon'; + } + return ''; }, /** 鏌ヨ閰嶆柟閰嶇疆瀛愪俊鎭垪琛� */ getListFormulaChild() { @@ -238,7 +265,7 @@ this.headContent.sfcCode = this.content this.queryParams.sfcCode = this.content this.getList() - // this.getListFormulaChild() + this.getListFormulaChild() this.cakeLamp.scanFinish = 1 this.cakeLamp.startWork = 1 @@ -247,6 +274,7 @@ async getList() { await listWorkReport(this.queryParams).then(response => { let rowsData = response.rows[0]; + console.log(rowsData) this.workpieceInformation.workOrderCode = rowsData.workOrderCode; this.workpieceInformation.productCode = rowsData.productCode; this.workpieceInformation.productModel = rowsData.productModel; @@ -345,6 +373,9 @@ setTimeout(() => { this.resetting() }, 2000); // 寤舵椂2绉掕Е鍙� + }else if(event.data === 'TIGHTEN'){ + console.log('寮�濮嬫嫥绱�') + self.getListFormulaChild() } }; }, @@ -393,5 +424,12 @@ span{ font-size: 15px; } +.el-table .warning-row { + background: oldlace; +} + +.el-table .success-row { + background: #f0f9eb; +} </style> -- Gitblit v1.9.3