Bladeren bron

安卓新增回调接口同步设备运行状态 运维小程序新增设备运行状态查看接口

wangyuanbo 2 jaren geleden
bovenliggende
commit
e8f127ba79

+ 28 - 3
imcs-bt-be/imcs-authority-server/src/main/java/com/github/zuihou/api/AndroidApi.java

@@ -312,11 +312,11 @@ public class AndroidApi {
                 String trade_state = cipherDto.getTrade_state();
                 Order localOrder = orderService.getById(cipherDto.getOut_trade_no());
                 localOrder.setUpdateTime(LocalDateTime.now());
-                if(trade_state.equals("SUCCESS")){
+                if (trade_state.equals("SUCCESS")) {
                     localOrder.setOrderStatus("1");
-                }else if(trade_state.equals("CLOSED")){
+                } else if (trade_state.equals("CLOSED")) {
                     localOrder.setOrderStatus("2");
-                }else if(trade_state.equals("REFUND")){
+                } else if (trade_state.equals("REFUND")) {
                     localOrder.setOrderStatus("5");
                 }
 //                localOrder.setOrderStatus(trade_state);
@@ -439,5 +439,30 @@ public class AndroidApi {
         return R.fail("操作失败");
     }
 
+    /**
+     * 同步设备状态接口
+     * 0.离线,1在线2.异常3.缺料
+     */
+    @PostMapping("/timelyEquStatus")
+    public R<Boolean> timelyEquStatus(@RequestBody Map<String, String> equInfo) {
+        String equId = equInfo.get("equId");
+        String equStatus = equInfo.get("equStatus");
+        String errMsg = equInfo.get("errMsg");
+
+        HashMap<String, String> saveMap = new HashMap<>();
+        saveMap.put("status", equStatus);
+        saveMap.put("errMsg", errMsg);
+        redisTemplate.opsForHash().putAll("equStatus" + equId,saveMap);
+//        redisTemplate.opsForHash().pu
+//
+//        redisTemplate.opsForHash().putIfAbsent("status" + equId, "equStatus", equStatus);
+//
+//        if (equStatus.equals("2")) {
+//            redisTemplate.opsForHash().putIfAbsent("status" + equId, , "errMsg", errMsg);
+//        }
+        redisTemplate.expire("equStatus" + equId, 4, TimeUnit.SECONDS);
+        return R.success(true, "成功");
+    }
+
 
 }

+ 50 - 29
imcs-bt-be/imcs-authority-server/src/main/java/com/github/zuihou/api/OpsAppApi.java

@@ -28,6 +28,7 @@ import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
 import com.github.zuihou.utils.DateUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.web.bind.annotation.*;
 
 import java.time.LocalDateTime;
@@ -53,6 +54,8 @@ public class OpsAppApi {
     private MaterialService materialService;
     @Autowired
     private DoorRecordService doorRecordService;
+    @Autowired
+    private RedisTemplate<String, Object> redisTemplate;
 
 
     /**
@@ -67,7 +70,7 @@ public class OpsAppApi {
         IPage<ProductionResource> page = params.buildPage();
         LbqWrapper<ProductionResource> queryWrap = Wraps.lbQ();
         ProductionResource productionResource = BeanUtil.toBean(params.getModel(), ProductionResource.class);
-        queryWrap.eq(ProductionResource::getStatus,"1").orderByDesc(ProductionResource::getCreateTime);
+        queryWrap.eq(ProductionResource::getStatus, "1").orderByDesc(ProductionResource::getCreateTime);
         IPage<ProductionResource> list = productionTenantResourceService.pageList(page, queryWrap);
         return R.success(list);
     }
@@ -83,7 +86,7 @@ public class OpsAppApi {
         LbqWrapper<ProductionResource> queryWrap = Wraps.lbQ();
         queryWrap.like(ProductionResource::getName, name).orderByDesc(ProductionResource::getCreateTime);
         List<Long> orgIds = CommonUtil.getOrgIdsArr();
-        if(orgIds.size()>0){
+        if (orgIds.size() > 0) {
             queryWrap.in(ProductionResource::getOrgId, orgIds);
         }
         List<ProductionResource> list = productionTenantResourceService.list(queryWrap);
@@ -104,9 +107,9 @@ public class OpsAppApi {
         BaseContextHandler.setTenant("0000");
         LbqWrapper<ProductionResource> queryWrap = Wraps.lbQ();
         queryWrap.eq(ProductionResource::getId, equId);
-        Page<ProductionResource> page = new Page<>(1L,1);
+        Page<ProductionResource> page = new Page<>(1L, 1);
         IPage<ProductionResource> productionResourceList = productionTenantResourceService.pageList(page, queryWrap);
-        return R.success(productionResourceList.getRecords().size()>0? productionResourceList.getRecords().get(0) : ProductionResource.builder().build());
+        return R.success(productionResourceList.getRecords().size() > 0 ? productionResourceList.getRecords().get(0) : ProductionResource.builder().build());
     }
 
 
@@ -121,22 +124,22 @@ public class OpsAppApi {
         IPage<Order> page = params.buildPage();
         QueryWrap<Order> orderQueryWrap = new QueryWrap<>();
         Order order = BeanUtil.toBean(params.getModel(), Order.class);
-        if(params.getMap().containsKey("createTime_st")){
+        if (params.getMap().containsKey("createTime_st")) {
             LocalDateTime startTime = DateUtils.getStartTime(params.getMap().get("createTime_st").toString());
             orderQueryWrap.geHeader("create_time", startTime);
         }
-        if(params.getMap().containsKey("createTime_ed")){
+        if (params.getMap().containsKey("createTime_ed")) {
             LocalDateTime endTime = DateUtils.getEndTime(params.getMap().get("createTime_ed").toString());
             orderQueryWrap.leFooter("create_time", endTime);
         }
-        orderQueryWrap.eq(StringUtils.isNotEmpty(order.getOrderStatus()),"order_status",order.getOrderStatus()).eq("order_equ_id", order.getOrderEquId()).orderByDesc("create_time");
+        orderQueryWrap.eq(StringUtils.isNotEmpty(order.getOrderStatus()), "order_status", order.getOrderStatus()).eq("order_equ_id", order.getOrderEquId()).orderByDesc("create_time");
         IPage<Order> list = orderService.pageList(page, orderQueryWrap);
 
         orderQueryWrap.select("ifnull(sum(order_amount), 0.0) as orderSum");
         Order sumOrder = orderService.getOne(orderQueryWrap);
-        if(list.getRecords().size()>0){
+        if (list.getRecords().size() > 0) {
             list.getRecords().add(0, sumOrder);
-        }else{
+        } else {
             list.setRecords(new ArrayList<Order>(Arrays.asList(sumOrder)));
         }
         return R.success(list);
@@ -153,9 +156,9 @@ public class OpsAppApi {
         BaseContextHandler.setTenant("0000");
         QueryWrap<Order> queryWrap = new QueryWrap<>();
         queryWrap.eq("id", id);
-        Page<Order> page = new Page<Order>(1L,1);
+        Page<Order> page = new Page<Order>(1L, 1);
         IPage<Order> orderList = orderService.pageList(page, queryWrap);
-        return R.success(orderList.getRecords().size()>0? orderList.getRecords().get(0) : Order.builder().build());
+        return R.success(orderList.getRecords().size() > 0 ? orderList.getRecords().get(0) : Order.builder().build());
     }
 
     /**
@@ -168,14 +171,14 @@ public class OpsAppApi {
         BaseContextHandler.setTenant("0000");
         QueryWrap<EquBarrel> equBarrelQueryWrap = new QueryWrap<>();
         equBarrelQueryWrap.eq("equ_id", equId);
-        if(StringUtils.isNotEmpty(barrelType)){
+        if (StringUtils.isNotEmpty(barrelType)) {
             //equBarrelQueryWrap.in("barrel_type", new String[]{"4","5"});
             equBarrelQueryWrap.gt("barrel_type", 3);
-        }else{
+        } else {
             //equBarrelQueryWrap.in("barrel_type", new String[]{"1","2", "3"});
             equBarrelQueryWrap.le("barrel_type", 3);
         }
-        Page<EquBarrel> page = new Page<>(1L,10);
+        Page<EquBarrel> page = new Page<>(1L, 10);
         IPage<EquBarrel> list = equBarrelService.pageList(page, equBarrelQueryWrap);
         return R.success(list);
     }
@@ -187,14 +190,14 @@ public class OpsAppApi {
      * @return
      */
     @PostMapping("/recordList")
-    public  R<IPage<EquRecord>> recordList(@RequestBody PageParams<EquRecord> params){
+    public R<IPage<EquRecord>> recordList(@RequestBody PageParams<EquRecord> params) {
         BaseContextHandler.setTenant("0000");
         IPage<EquRecord> page = params.buildPage();
         LbqWrapper<EquRecord> recordQueryWrap = Wraps.lbQ();
         EquRecord equRecord = BeanUtil.toBean(params.getModel(), EquRecord.class);
-        if(StringUtil.isNotEmpty(equRecord.getBarrelType())){
+        if (StringUtil.isNotEmpty(equRecord.getBarrelType())) {
             recordQueryWrap.gt(EquRecord::getBarrelType, "3");
-        }else{
+        } else {
             recordQueryWrap.le(EquRecord::getBarrelType, "3");
         }
         recordQueryWrap.eq(EquRecord::getEquId, equRecord.getEquId()).orderByDesc(EquRecord::getCreateTime);
@@ -204,7 +207,7 @@ public class OpsAppApi {
 
 
     @GetMapping("/equMaterialList")
-    public  R<List<Material>> equMaterialList(@RequestParam("mtType") String mtType){
+    public R<List<Material>> equMaterialList(@RequestParam("mtType") String mtType) {
         BaseContextHandler.setTenant("0000");
         LbqWrapper<Material> materialQueryWrap = Wraps.lbQ();
         materialQueryWrap.eq(Material::getMtType, mtType);
@@ -217,27 +220,26 @@ public class OpsAppApi {
 
     /**
      * 订单统计数据
-     *
      */
     @GetMapping("/orderStatistics")
     public R<Map> statisticsList(@RequestParam("equId") Long equId) {
         BaseContextHandler.setTenant("0000");
         QueryWrap<Order> orderStatisticWrap = new QueryWrap<>();
-        if(equId!=null && equId.longValue()!=0) {
+        if (equId != null && equId.longValue() != 0) {
             orderStatisticWrap.eq("id", equId).orderByDesc("create_time");
         }
-        Map<String, String> paramsMap = new HashMap<String,String>();
+        Map<String, String> paramsMap = new HashMap<String, String>();
         String now = DateUtil.dateToString(new Date());
-        String  sevenAgo = DateUtil.dateToString(DateUtil.getBeforeDate(new Date(), 7));
-        String nextDay = DateUtil.dateToString(DateUtil.getAddSecondsTime(new Date(), 60*60*24*1000));
+        String sevenAgo = DateUtil.dateToString(DateUtil.getBeforeDate(new Date(), 7));
+        String nextDay = DateUtil.dateToString(DateUtil.getAddSecondsTime(new Date(), 60 * 60 * 24 * 1000));
         paramsMap.put("now", now);
         paramsMap.put("sevenAgo", sevenAgo);
         paramsMap.put("nextDay", nextDay);
-        if(equId!=null && equId.longValue()!=0) {
+        if (equId != null && equId.longValue() != 0) {
             paramsMap.put("id", equId.toString());
         }
         String orgIds = CommonUtil.getOrgIdsStr();
-        if(StringUtils.isNotEmpty(orgIds)) {
+        if (StringUtils.isNotEmpty(orgIds)) {
             paramsMap.put("orgIds", orgIds);
         }
         Map map = orderService.getStatisticMap(paramsMap);
@@ -245,6 +247,7 @@ public class OpsAppApi {
     }
 
 //
+
     /**
      * 换料接口
      *
@@ -257,7 +260,7 @@ public class OpsAppApi {
         updateWrapper.set(EquBarrel::getMtrId, equRecord.getReplaceMaterial()).set(EquBarrel::getMtrName, equRecord.getMtName()).set(EquBarrel::getMtrResidue, equRecord.getSpecs())
                 .set(StringUtil.isNotEmpty(equRecord.getDate()), EquBarrel::getExprTime, DateUtils.getStartTime(equRecord.getDate())).eq(EquBarrel::getId, equRecord.getMaterialId());
         Boolean bool = equBarrelService.update(null, updateWrapper);
-        if(bool){
+        if (bool) {
             bool = equRecordService.save(equRecord);
         }
         return R.success(bool);
@@ -276,7 +279,7 @@ public class OpsAppApi {
         updateWrapper.set(EquBarrel::getMtrResidue, equRecord.getSpecs()).set(EquBarrel::getExprTime, equRecord.getDate())
                 .eq(EquBarrel::getId, equRecord.getMaterialId());
         Boolean bool = equBarrelService.update(null, updateWrapper);
-        if(bool){
+        if (bool) {
             bool = equRecordService.save(equRecord);
         }
         return R.success(bool);
@@ -284,7 +287,7 @@ public class OpsAppApi {
 
 
     @PostMapping("/doorRecordList")
-    public  R<IPage<DoorRecord>> equDoorList(@RequestBody PageParams<DoorRecord> params){
+    public R<IPage<DoorRecord>> equDoorList(@RequestBody PageParams<DoorRecord> params) {
         BaseContextHandler.setTenant("0000");
         IPage<DoorRecord> page = params.buildPage();
         LbqWrapper<DoorRecord> doorQueryWrap = Wraps.lbQ();
@@ -296,11 +299,29 @@ public class OpsAppApi {
     }
 
 
+    @GetMapping("/getEquRunInfo")
+    public R<Map<String, String>> getEquRunInfo(@RequestParam(name = "equId"  ,required = true) String equId) {
+        BaseContextHandler.setTenant("0000");
+        HashMap<String, String> resultMap = new HashMap<>();
+        Boolean exist = redisTemplate.hasKey("equStatus" + equId);
+        if (exist) {
+            String status = (String) redisTemplate.opsForHash().get("equStatus" + equId, "status");
+            if (status.equals("2")) {
+                String errMsg = (String) redisTemplate.opsForHash().get("equStatus" + equId, "errMsg");
+
+                resultMap.put("errMsg", errMsg);
+            }
+            resultMap.put("equStatus", status);
+        } else {
+            resultMap.put("equStatus", "0");
+        }
+
 
+        return R.success(resultMap);
+    }
 
 
 
-//    操作记录接口
 
 
 }

+ 9 - 5
imcs-bt-be/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/order/OrderController.java

@@ -16,10 +16,7 @@ import com.github.zuihou.security.annotation.PreAuth;
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 import java.util.Map;
@@ -49,7 +46,7 @@ public class OrderController extends SuperController<OrderService, Long, Order,
         OrderPageDTO data = params.getModel();
         Order model = BeanUtil.toBean(data, Order.class);
         QueryWrap<Order> wrapper = this.handlerWrapper(null, params);
-        wrapper.notIn("order_status", "INIT");
+        wrapper.notIn("order_status", "0");
         wrapper.orderByDesc("create_time");
         baseService.pageList(page, wrapper);
     }
@@ -83,4 +80,11 @@ public class OrderController extends SuperController<OrderService, Long, Order,
     }
 
 
+
+
+
+
+
+
+
 }

+ 1 - 2
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/order/allOrders.vue

@@ -123,8 +123,7 @@
         </template>
       </el-table-column>
       <el-table-column :label="$t('btOrder.orderStatus')" :show-overflow-tooltip="true" align="center"
-                       :filter-multiple="false" column-key="goodsCateStatus"
-                       :filters="statusFilter"
+
                        prop="goodsCateStatus" width="80px">
         <template slot-scope="scope">
           {{ scope.row.orderStatus === '0' ? $t("btOrder.status.wzf") : '' }}

+ 12 - 0
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/order/orderDetail.vue

@@ -187,6 +187,7 @@ export default {
         discounts: '',
         realPay: '',
       },
+      width: "",
 
 
       // 设备信息
@@ -235,6 +236,17 @@ export default {
     // this.getCateList()
   },
   methods: {
+
+    initWidth() {
+      this.screenWidth = document.body.clientWidth;
+      if (this.screenWidth < 991) {
+        return "90%";
+      } else if (this.screenWidth < 1400) {
+        return "45%";
+      } else {
+        return "800px";
+      }
+    },
     editClose() {
       this.dialog.isVisible = false;
     },

+ 6 - 6
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/components/OrderMgr.vue

@@ -17,13 +17,13 @@
         <allOrdersTab ref="allOrdersTab"></allOrdersTab>
       </el-tab-pane>
       <!--      待生产-->
-      <el-tab-pane name="toBeProduced" :label="$t('btOrder.toBeProduced')">
-        <toBeProducedTab ref="toBeProduced"></toBeProducedTab>
-      </el-tab-pane>
+<!--      <el-tab-pane name="toBeProduced" :label="$t('btOrder.toBeProduced')">-->
+<!--        <toBeProducedTab ref="toBeProduced"></toBeProducedTab>-->
+<!--      </el-tab-pane>-->
       <!--      待取-->
-      <el-tab-pane name="toBeTaken" :label="$t('btOrder.toBeTaken')">
-        <toBeTakenTab ref="toBeProduced"></toBeTakenTab>
-      </el-tab-pane>
+<!--      <el-tab-pane name="toBeTaken" :label="$t('btOrder.toBeTaken')">-->
+<!--        <toBeTakenTab ref="toBeProduced"></toBeTakenTab>-->
+<!--      </el-tab-pane>-->
     </el-tabs>
   </div>
   </el-dialog>

+ 70 - 46
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/components/allOrders.vue

@@ -57,18 +57,25 @@
               @filter-change="filterChange" @selection-change="onSelectChange" @sort-change="sortChange"
               border fit row-key="id" ref="table" style="width: 100%;" v-loading="loading" height="400">
       <el-table-column align="center" type="selection" width="40px" :reserve-selection="true"/>
-      <el-table-column :label="$t('btOrder.orderGoods')" :show-overflow-tooltip="true" align="center"
-                       prop="orderMemberId" width="200">
-        <template slot-scope="props">
-          <el-form label-position="left">
-            <el-form-item type="select">
-              单号:<span>{{ props.row.id }}</span>
-              创建时间:<span>{{ props.row.createTime }}</span>
-            </el-form-item>
-            <el-form-item>
-              图片:<span>{{ props.row.companyId }}</span>
-            </el-form-item>
-          </el-form>
+      <el-table-column :label="$t('btOrder.id')" :show-overflow-tooltip="true" align="center"
+                       prop="id"
+                       width="">
+        <template slot-scope="scope">
+          <span>{{ scope.row.id }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column :label="$t('btOrder.orderGoodsName')" :show-overflow-tooltip="true" align="center"
+                       prop="orderGoodsName"
+                       width="">
+        <template slot-scope="scope">
+          <span>{{ scope.row.orderGoodsName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column :label="$t('btOrder.orderGoodsPic')" :show-overflow-tooltip="true" align="center"
+                       prop="orderGoodsPic"
+                       width="">
+        <template slot-scope="scope">
+          <img :src="scope.row.orderGoodsPic" min-width="70" height="70"/>
         </template>
       </el-table-column>
       <el-table-column :label="$t('btOrder.equ')" :show-overflow-tooltip="true" align="center"
@@ -78,6 +85,14 @@
           <span>{{ scope.row.equCom }}</span>
         </template>
       </el-table-column>
+      <el-table-column :label="$t('btOrder.orderMemberName')" :show-overflow-tooltip="true" align="center"
+                       prop="orderMemberName"
+                       width="">
+        <template slot-scope="scope">
+          <span>{{ scope.row.orderMemberName }}</span>
+        </template>
+      </el-table-column>
+
       <el-table-column :label="$t('btOrder.orderUnitPrice')" :show-overflow-tooltip="true" align="center"
                        prop="orderCompanyId"
                        width="">
@@ -92,68 +107,62 @@
           <span>{{ scope.row.orderGoodsAmount }}</span>
         </template>
       </el-table-column>
-      <el-table-column :label="$t('btOrder.orderMemberName')" :show-overflow-tooltip="true" align="center"
-                       prop="orderAmount"
+
+      <el-table-column :label="$t('btOrder.orderAmount')" :show-overflow-tooltip="true" align="center"
+                       prop="orderUnitPrice"
                        width="">
         <template slot-scope="scope">
-          <span>{{ scope.row.orderAmount }}</span>
+          <span>{{ scope.row.orderUnitPrice }}</span>
         </template>
       </el-table-column>
-      <el-table-column :label="$t('btOrder.orderAmount')" :show-overflow-tooltip="true" align="center"
-                       prop="orderUnitPrice"
+      <el-table-column :label="$t('btOrder.orderCreateTime')" :show-overflow-tooltip="true" align="center"
+                       prop="orderCreateTime"
                        width="">
         <template slot-scope="scope">
-          <span>{{ scope.row.orderUnitPrice }}</span>
+          <span>{{ scope.row.createTime }}</span>
         </template>
       </el-table-column>
       <el-table-column :label="$t('btOrder.orderStatus')" :show-overflow-tooltip="true" align="center"
-                       :filter-multiple="false" column-key="goodsCateStatus"
 
-                       :filters="statusFilter"
                        prop="goodsCateStatus" width="80px">
         <template slot-scope="scope">
-          {{ scope.row.goodsCateStatus === '1' ? $t("btOrder.status.dzf") : '' }}
-          {{ scope.row.goodsCateStatus === '2' ? $t("bt.status.dsc") : '' }}
-          {{ scope.row.goodsCateStatus === '3' ? $t("bt.status.dq") : '' }}
-          {{ scope.row.goodsCateStatus === '4' ? $t("bt.status.ywc") : '' }}
-          {{ scope.row.goodsCateStatus === '5' ? $t("bt.status.yqx") : '' }}
+          {{ scope.row.orderStatus === '0' ? $t("btOrder.status.wzf") : '' }}
+          {{ scope.row.orderStatus === '1' ? $t("btOrder.status.yzf") : '' }}
+          {{ scope.row.orderStatus === '2' ? $t("btOrder.status.yqx") : '' }}
+          {{ scope.row.orderStatus === '3' ? $t("btOrder.status.scwc") : '' }}
+          {{ scope.row.orderStatus === '4' ? $t("btOrder.status.yc") : '' }}
+          {{ scope.row.orderStatus === '5' ? $t("btOrder.status.zrtk") : '' }}
         </template>
       </el-table-column>
       <el-table-column
         :label="$t('table.operation')" align="center" column-key="operation" class-name="small-padding fixed-width"
         width="100px">
         <template slot-scope="{ row }">
-          <i @click="copy(row)" class="el-icon-copy-document table-operation" :title="$t('common.delete')"
-             style="color: #2db7f5;" v-hasPermission="['order:add']"/>
-          <i @click="edit(row)" class="el-icon-edit table-operation" :title="$t('common.delete')"
-             style="color: #2db7f5;" v-hasPermission="['order:update']"/>
-          <i @click="singleDelete(row)" class="el-icon-delete table-operation" :title="$t('common.delete')"
-             style="color: #f50;" v-hasPermission="['order:delete']"/>
-          <el-link class="no-perm" v-has-no-permission="['order:update', 'order:copy', 'order:delete']">
-            {{ $t("tips.noPermission") }}
-          </el-link>
+
+          <i @click="orderDetail(row)" class="el-icon-view table-operation" :title="$t('btOrder.detail')"
+             style="color: #2db7f5;"/>
         </template>
       </el-table-column>
     </el-table>
     <pagination :limit.sync="queryParams.size" :page.sync="queryParams.current"
                 :total="Number(tableData.total)" @pagination="fetch" v-show="tableData.total > 0"/>
-    <order-edit :dialog-visible="dialog.isVisible" :type="dialog.type"
-                @close="editClose" @success="editSuccess" ref="edit"/>
-    <order-import ref="import" :dialog-visible="fileImport.isVisible" :type="fileImport.type"
-                  :action="fileImport.action" accept=".xls,.xlsx" @close="importClose" @success="importSuccess"/>
-    <el-dialog :close-on-click-modal="false" :close-on-press-escape="true"
-               title="预览" width="80%" top="50px" :visible.sync="preview.isVisible" v-el-drag-dialog>
-      <el-scrollbar>
-        <div v-html="preview.context"></div>
-      </el-scrollbar>
-    </el-dialog>
+
+    <order-detail
+      :dialog-visible="detailDialog.isVisible"
+      :type="detailDialog.type"
+      @close="orderDetailClose"
+      @success="editSuccess"
+      ref="orderDetail"/>
   </div>
+
+
 </template>
 
 <script>
 import Pagination from "@/components/Pagination";
 import elDragDialog from '@/directive/el-drag-dialog'
 import OrderEdit from "./components/Edit";
+import orderDetail from "./orderDetail";
 import orderApi from "@/api/Order.js";
 import OrderImport from "@/components/zuihou/Import"
 import {convertEnum} from '@/utils/utils'
@@ -162,7 +171,7 @@ import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commo
 export default {
   name: "OrderManage",
   directives: {elDragDialog},
-  components: {Pagination, OrderEdit, OrderImport},
+  components: {Pagination, OrderEdit, OrderImport, orderDetail},
   filters: {},
   data() {
     return {
@@ -178,6 +187,10 @@ export default {
         isVisible: false,
         type: "add"
       },
+      detailDialog: {
+        isVisible: false,
+        type: "orderDetail"
+      },
       statusOptions: [{
         value: '1',
         label: '待支付'
@@ -233,6 +246,10 @@ export default {
     editClose() {
       this.dialog.isVisible = false;
     },
+    orderDetailClose() {
+      this.detailDialog.isVisible = false;
+    },
+
     editSuccess() {
       this.search();
     },
@@ -329,6 +346,14 @@ export default {
       this.dialog.isVisible = true;
       this.$refs.edit.setOrder({enums: this.enums, dicts: this.dicts});
     },
+
+    orderDetail(row) {
+      this.detailDialog.type = "orderDetail";
+      this.detailDialog.isVisible = true;
+      this.$refs.orderDetail.orderDetail(row['id']);
+    },
+
+
     copy(row) {
       this.$refs.edit.setOrder({row, enums: this.enums, dicts: this.dicts});
       this.dialog.type = "copy";
@@ -348,7 +373,6 @@ export default {
 
       this.queryParams.current = params.current ? params.current : this.queryParams.current;
       this.queryParams.size = params.size ? params.size : this.queryParams.size;
-
       orderApi.page(this.queryParams).then(response => {
         const res = response.data;
         if (res.isSuccess) {

+ 451 - 0
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/components/orderDetail.vue

@@ -0,0 +1,451 @@
+<template>
+  <el-dialog
+    :close-on-click-modal="false"
+    :close-on-press-escape="true"
+    :title="title"
+    :type="type"
+    :visible.sync="isVisible"
+    :width="width"
+    top="50px"
+  >
+
+    <!--    订单状态-->
+    <el-descriptions title="订单状态" border>
+      <el-descriptions-item>
+        <el-steps :active="1">
+          <el-step title="支付" description=""></el-step>
+          <el-step title="取货" description="这是一段很长很长很长的描述性文字"></el-step>
+          <el-step title="生产" description="这段就没那么长了"></el-step>
+          <el-step title="完成" description="这段就没那么长了"></el-step>
+        </el-steps>
+      </el-descriptions-item>
+    </el-descriptions>
+    <!--    商品信息-->
+    <el-descriptions title="商品信息" border>
+      <el-descriptions-item label="订单号">{{ detail.orderId }}</el-descriptions-item>
+      <el-descriptions-item label="创建时间">{{ detail.createTime }}</el-descriptions-item>
+      <el-descriptions-item label="支付方式">
+        <el-tag size="small">微信</el-tag>
+      </el-descriptions-item>
+
+      <el-descriptions-item label="商品名称">
+        <el-tag size="small">{{ detail.goodsName }}</el-tag>
+      </el-descriptions-item>
+      <el-descriptions-item label="图片">
+        <el-tag size="small">{{ detail.goodsPic }}</el-tag>
+      </el-descriptions-item>
+      <el-descriptions-item label="购买规格">
+        <el-tag size="small">{{ detail.specName }}</el-tag>
+      </el-descriptions-item>
+      <el-descriptions-item label="数量">
+        <el-tag size="small">1</el-tag>
+      </el-descriptions-item>
+      <el-descriptions-item label="销售价">
+        <el-tag size="small">{{ detail.sellPrice }}</el-tag>
+      </el-descriptions-item>
+      <el-descriptions-item label="总价">
+        <el-tag size="small">{{ detail.totalPrice }}</el-tag>
+      </el-descriptions-item>
+      <el-descriptions-item label="优惠">
+        <el-tag size="small">0</el-tag>
+      </el-descriptions-item>
+      <el-descriptions-item label="实际支付">
+        <el-tag size="small">{{ detail.totalPrice }}</el-tag>
+      </el-descriptions-item>
+    </el-descriptions>
+
+
+    <!--    设备信息-->
+    <el-descriptions title="设备信息" border>
+      <el-descriptions-item label="设备">{{ detail.equName }}</el-descriptions-item>
+      <el-descriptions-item label="所属企业">{{ detail.equComName }}</el-descriptions-item>
+      <el-descriptions-item label="下单用户">{{ detail.memberName }}</el-descriptions-item>
+    </el-descriptions>
+
+    <!--    付款信息-->
+    <el-descriptions title="付款信息" border>
+      <el-descriptions-item label="交易单号">{{ detail.orderId }}</el-descriptions-item>
+      <el-descriptions-item label="付款状态">{{ detail.orderStatus }}</el-descriptions-item>
+      <el-descriptions-item label="付款时间">{{ detail.orderStatus }}</el-descriptions-item>
+    </el-descriptions>
+
+
+  </el-dialog>
+
+</template>
+
+<script>
+import Pagination from "@/components/Pagination";
+import elDragDialog from '@/directive/el-drag-dialog'
+import orderApi from "@/api/Order.js";
+import OrderImport from "@/components/zuihou/Import"
+import {convertEnum} from '@/utils/utils'
+import {downloadFile, loadEnums, initDicts, initQueryParams} from '@/utils/commons'
+
+export default {
+  name: "orderDetail",
+  directives: {elDragDialog},
+  components: {Pagination, OrderImport},
+  filters: {},
+  props: {
+    dialogVisible: {
+      type: Boolean,
+      default: false
+    },
+    type: {
+      type: String,
+      default: "add"
+    },
+  },
+  data() {
+    return {
+      statusFilter: [{text: '待支付', value: '1'}, {text: '待生产', value: '2'}, {text: '待取', value: '3'}, {
+        text: '已完成',
+        value: '4'
+      }, {text: '已取消', value: '5'}],
+      // :filters="[{ text: $t('common.status.valid'), value: '1' },{ text: $t('common.status.invalid'), value: '0' }]"
+
+
+      // 编辑
+      dialog: {
+        isVisible: false,
+        type: "add"
+      },
+      detailDialog: {
+        isVisible: false,
+        type: "orderDetail"
+      },
+      statusOptions: [{
+        value: '1',
+        label: '待支付'
+      }, {
+        value: '2',
+        label: '待生产'
+      }, {
+        value: '3',
+        label: '待取'
+      }, {
+        value: '4',
+        label: '已完成'
+      }, {
+        value: '5',
+        label: '已取消'
+      }],
+      // 预览
+      preview: {
+        isVisible: false,
+        context: ''
+      },
+      width: "",
+      // 导入
+      fileImport: {
+        isVisible: false,
+        type: "import",
+        action: `${process.env.VUE_APP_BASE_API}/order/order/import`
+      },
+      tableKey: 0,
+      queryParams: initQueryParams(),
+      selection: [],
+      loading: false,
+      tableData: {
+        total: 0
+      },
+      // 枚举
+      enums: {},
+      // 字典
+      dicts: {},
+      //  订单状态
+
+      detail: {
+        orderId: "",
+        orderStatus: "",
+        createTime: "",
+        memberName: "",
+        equName: "",
+        equComName: "",
+        specName: "",
+        goodsName: "",
+        goodsPic: "",
+        goodsCount: 1,
+        sellPrice: "",
+        totalPrice: "",
+        discountsPrice: "",
+
+
+      },
+      //  商品信息
+
+      goodsData: [],
+
+      goodsInfo: {
+        id: '',
+        goodsName: '张三',
+        goodsPic: '',
+        spec: '',
+        count: '',
+        sailPrice: '',
+        totalPrice: '',
+        discounts: '',
+        realPay: '',
+      },
+
+
+      // 设备信息
+      equInfo: {
+        id: "",
+        name: "",
+        user: "",
+
+      },
+
+
+      // 付款信息
+      paymentInfo: {
+        id: "",
+        status: "",
+        time: "",
+
+
+      }
+
+
+    };
+  },
+  computed: {
+    isVisible: {
+      get() {
+        return this.dialogVisible;
+      },
+      set() {
+        this.close();
+        this.reset();
+      }
+    },
+    title() {
+      return "订单详情";
+    }
+  },
+  watch: {},
+  mounted() {
+    window.onresize = () => {
+      return (() => {
+        this.width = this.initWidth();
+      })();
+    };
+    // 加载数据
+    // this.getCateList()
+  },
+  methods: {
+
+    initWidth() {
+      this.screenWidth = document.body.clientWidth;
+      if (this.screenWidth < 991) {
+        return "90%";
+      } else if (this.screenWidth < 1400) {
+        return "45%";
+      } else {
+        return "800px";
+      }
+    },
+    editClose() {
+      this.dialog.isVisible = false;
+    },
+    editSuccess() {
+      this.search();
+    },
+    onSelectChange(selection) {
+      this.selection = selection;
+    },
+    search() {
+      this.fetch({
+        ...this.queryParams
+      });
+    },
+    reset() {
+      this.queryParams = initQueryParams();
+      this.$refs.table.clearSort();
+      this.$refs.table.clearFilter();
+      this.search();
+    },
+    exportExcelPreview() {
+      if (this.queryParams.timeRange) {
+        this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
+        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
+      }
+      this.queryParams.map.fileName = '导出数据';
+      orderApi.preview(this.queryParams).then(response => {
+        const res = response.data;
+        this.preview.isVisible = true;
+        this.preview.context = res.data;
+      });
+    },
+    exportExcel() {
+      if (this.queryParams.timeRange) {
+        this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
+        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
+      }
+      this.queryParams.map.fileName = '导出数据';
+      orderApi.export(this.queryParams).then(response => {
+        downloadFile(response);
+      });
+    },
+    importExcel() {
+      this.fileImport.type = "upload";
+      this.fileImport.isVisible = true;
+      this.$refs.import.setModel(false);
+    },
+    importSuccess() {
+      this.search();
+    },
+    importClose() {
+      this.fileImport.isVisible = false;
+    },
+
+    close() {
+      this.$emit("close");
+    },
+    // reset() {
+    //   // 先清除校验,再清除表单,不然有奇怪的bug
+    //   this.$refs.form.clearValidate();
+    //   this.$refs.form.resetFields();
+    //   this.user = this.initUser();
+    //   this.imgFileData.bizId = "";
+    //   this.$refs.imgFileRef.init({
+    //     bizId: "",
+    //     bizType: "",
+    //     imageUrl: "",
+    //     isSingle: true,
+    //     isDetail: false
+    //   });
+    // },
+
+
+    singleDelete(row) {
+      this.$refs.table.clearSelection()
+      this.$refs.table.toggleRowSelection(row, true);
+      this.batchDelete();
+    },
+    batchDelete() {
+      if (!this.selection.length) {
+        this.$message({
+          message: this.$t("tips.noDataSelected"),
+          type: "warning"
+        });
+        return;
+      }
+      this.$confirm(this.$t("tips.confirmDelete"), this.$t("common.tips"), {
+        confirmButtonText: this.$t("common.confirm"),
+        cancelButtonText: this.$t("common.cancel"),
+        type: "warning"
+      })
+        .then(() => {
+          const ids = this.selection.map(u => u.id);
+          this.delete(ids);
+        })
+        .catch(() => {
+          this.clearSelections();
+        });
+    },
+    clearSelections() {
+      this.$refs.table.clearSelection();
+    },
+    delete(ids) {
+      orderApi.delete({ids: ids}).then(response => {
+        const res = response.data;
+        if (res.isSuccess) {
+          this.$message({
+            message: this.$t("tips.deleteSuccess"),
+            type: "success"
+          });
+          this.search();
+        }
+      });
+    },
+    add() {
+      this.dialog.type = "add";
+      this.dialog.isVisible = true;
+      this.$refs.edit.setOrder({enums: this.enums, dicts: this.dicts});
+    },
+
+
+    orderDetail(orderId) {
+      this.getOrderDetail(orderId);
+
+    },
+
+    getOrderDetail(orderId) {
+      orderApi.getOrderDetail({orderId: orderId}).then(response => {
+        const res = response.data;
+        if (res.isSuccess) {
+          this.detail = res.data;
+        }
+      }).finally(() => this.loading = false);
+
+    },
+
+
+    copy(row) {
+      this.$refs.edit.setOrder({row, enums: this.enums, dicts: this.dicts});
+      this.dialog.type = "copy";
+      this.dialog.isVisible = true;
+    },
+    edit(row) {
+      this.$refs.edit.setOrder({row, enums: this.enums, dicts: this.dicts});
+      this.dialog.type = "edit";
+      this.dialog.isVisible = true;
+    },
+    fetch(params = {}) {
+      this.loading = true;
+      if (this.queryParams.timeRange) {
+        this.queryParams.map.createTime_st = this.queryParams.timeRange[0];
+        this.queryParams.map.createTime_ed = this.queryParams.timeRange[1];
+      }
+
+      this.queryParams.current = params.current ? params.current : this.queryParams.current;
+      this.queryParams.size = params.size ? params.size : this.queryParams.size;
+      orderApi.page(this.queryParams).then(response => {
+        const res = response.data;
+        if (res.isSuccess) {
+          this.tableData = res.data;
+        }
+      }).finally(() => this.loading = false);
+    },
+    sortChange(val) {
+      this.queryParams.sort = val.prop;
+      this.queryParams.order = val.order;
+      if (this.queryParams.sort) {
+        this.search();
+      }
+    },
+    filterChange(filters) {
+      for (const key in filters) {
+        if (key.includes('.')) {
+          const val = {};
+          val[key.split('.')[1]] = filters[key][0];
+          this.queryParams.model[key.split('.')[0]] = val;
+        } else {
+          this.queryParams.model[key] = filters[key][0]
+        }
+      }
+      this.search()
+    },
+    cellClick(row, column) {
+      if (column['columnKey'] === "operation") {
+        return;
+      }
+      let flag = false;
+      this.selection.forEach((item) => {
+        if (item.id === row.id) {
+          flag = true;
+          this.$refs.table.toggleRowSelection(row);
+        }
+      })
+
+      if (!flag) {
+        this.$refs.table.toggleRowSelection(row, true);
+      }
+    },
+  }
+};
+</script>
+<style lang="scss" scoped></style>