Explorar o código

生产+视图

koushanshan %!s(int64=3) %!d(string=hai) anos
pai
achega
43ed2e98ab

+ 2 - 0
src/api/pages/common/common.js

@@ -112,6 +112,8 @@ export default {
     getStationUserPage:'get_station_user_page',
     //工位工号(工位打卡选择工位数据源)
     getWsStation:'get_ws_station',
+    // 获取工位分页
+    getWorkStationByPage:'get_work_station_by_page',
   },
   appCommonService: {
     prefix: 'mdm-server/app/mst/common/',

+ 42 - 0
src/api/pages/pdm/collect.js

@@ -0,0 +1,42 @@
+/**
+ *   @desc   : 生产服务
+ *   @date   : 2023/2/27 14:14
+ *   @author : 寇珊珊
+ */
+export default {
+  collectService:{
+    // 前缀
+    prefix:'/mdm-server/pdm/collect/',
+    //验证条码
+    checkBarCode:'check_bar_code',
+    //验证用户
+    checkProdUserCode:'check_prod_user_code',
+    //保存
+    add:{key:'add',url:'/pdm/produce/collect'},
+
+  }
+}
+export const routeUrl = {
+  produce: {
+    //计件新建
+    registerAdd:{key:'add',url:'/pdm/data-collection/register-add'},
+    //登窑新建
+    climbKilnAdd:{key:'add',url:'/pdm/data-collection/climbKiln-add'},
+    //入窑新建
+    inKilnAdd:{key:'add',url:'/pdm/data-collection/inKiln-add'},
+    //出窑新建
+    outKiln:{key:'add',url:'/pdm/data-collection/outKiln-add'},
+    //卸窑新建
+    uninstallKiln:{key:'add',url:'/pdm/data-collection/uninstallKiln-add'},
+    //半检新建
+    halfCheckAdd:{key:'add',url:'/pdm/data-collection/halfCheck-add'},
+    //成检新建
+    finishCheckAdd:{key:'add',url:'/pdm/data-collection/finishCheck-add'},
+    //回收新建
+    recoverAdd:{key:'add',url:'/pdm/data-collection/recover-add'},
+  }
+}
+
+
+
+

+ 1 - 1
src/api/pages/pdm/produce.js

@@ -13,7 +13,7 @@ export default {
 export const routeUrl = {
   produce: {
     //计件新建
-    registerAdd:{key:'add',url:'/pdm/data-collection/register-add'},
+    registerAdd:{key:'add',url:'/pdm/data-collection/register-add/'},
     //登窑新建
     climbKilnAdd:{key:'add',url:'/pdm/data-collection/climbKiln-add'},
     //入窑新建

+ 3 - 2
src/components/business/select-magnifier/select-magnifier.vue

@@ -1277,9 +1277,10 @@ export default {
       // 工位
       else if (self.type === self.$config.MagnifierType.station) {
         self.service = this.$service.commonService
-        self.methodsName = 'getStationPage'
-        self.methodsNameDetail = 'getStationPage'
+        self.methodsName = 'getWorkStationByPage'
+        self.methodsNameDetail = 'getWorkStationByPage'
         self.searchContent = [
+          // {itemCode: 'flowNodeId'},
           {itemCode: 'stationCode'},
           {itemCode: 'stationName'},
         ]

+ 3 - 0
src/locale/lang/zh-CN.js

@@ -720,6 +720,9 @@ export const columns = {
   KilnCarNumber:'窑炉车号',
   produceBarCode:'商品条码',
   productRemarks:'备注',
+  barCode:'产品条码',
+  modelMouldCode:'模具编码',
+  flgRecycled:'回收标识',
 
 }
 

+ 105 - 104
src/view/mst/product-view/config/ProductView.js

@@ -325,13 +325,13 @@ export default class Product {
 
     // region 鼠标移入移出 连接桩显示/隐藏
     this.graph.on('node:mouseenter', FunctionExt.debounce(() => {
-      const ports =  dom.querySelectorAll('.x6-port-body')
-      this.showPorts(ports, true)
+      // const ports =  dom.querySelectorAll('.x6-port-body')
+      // this.showPorts(ports, true)
     }), 500,)
 
     this.graph.on('node:mouseleave', () => {
-      const ports =  dom.querySelectorAll('.x6-port-body')
-      this.showPorts(ports, false)
+      // const ports =  dom.querySelectorAll('.x6-port-body')
+      // this.showPorts(ports, false)
     })
     // endregion
 
@@ -554,84 +554,84 @@ export default class Product {
     // region 图形配置
 
     // region 节点上下左右的四个连接桩
-    const ports = {
-      groups: {
-        top: {
-          position: 'top',
-          attrs: {
-            circle: {
-              r: 4,
-              magnet: true,
-              stroke: '#0c1010',
-              strokeWidth: 1,
-              fill: '#fff',
-              style: {
-                visibility: 'hidden',
-              },
-            },
-          },
-        },
-        right: {
-          position: 'right',
-          attrs: {
-            circle: {
-              r: 4,
-              magnet: true,
-              stroke: '#0c1010',
-              strokeWidth: 1,
-              fill: '#fff',
-              style: {
-                visibility: 'hidden',
-              },
-            },
-          },
-        },
-        bottom: {
-          position: 'bottom',
-          attrs: {
-            circle: {
-              r: 4,
-              magnet: true,
-              stroke: '#0c1010',
-              strokeWidth: 1,
-              fill: '#fff',
-              style: {
-                visibility: 'hidden',
-              },
-            },
-          },
-        },
-        left: {
-          position: 'left',
-          attrs: {
-            circle: {
-              r: 4,
-              magnet: true,
-              stroke: '#0c1010',
-              strokeWidth: 1,
-              fill: '#fff',
-              style: {
-                visibility: 'hidden',
-              },
-            },
-          },
-        },
-      },
-      items: [
-        {
-          group: 'top',
-        },
-        {
-          group: 'right',
-        },
-        {
-          group: 'bottom',
-        },
-        {
-          group: 'left',
-        },
-      ],
-    }
+    // const ports = {
+    //   groups: {
+    //     top: {
+    //       position: 'top',
+    //       attrs: {
+    //         circle: {
+    //           r: 4,
+    //           magnet: true,
+    //           stroke: '#0c1010',
+    //           strokeWidth: 1,
+    //           fill: '#fff',
+    //           style: {
+    //             visibility: 'hidden',
+    //           },
+    //         },
+    //       },
+    //     },
+    //     right: {
+    //       position: 'right',
+    //       attrs: {
+    //         circle: {
+    //           r: 4,
+    //           magnet: true,
+    //           stroke: '#0c1010',
+    //           strokeWidth: 1,
+    //           fill: '#fff',
+    //           style: {
+    //             visibility: 'hidden',
+    //           },
+    //         },
+    //       },
+    //     },
+    //     bottom: {
+    //       position: 'bottom',
+    //       attrs: {
+    //         circle: {
+    //           r: 4,
+    //           magnet: true,
+    //           stroke: '#0c1010',
+    //           strokeWidth: 1,
+    //           fill: '#fff',
+    //           style: {
+    //             visibility: 'hidden',
+    //           },
+    //         },
+    //       },
+    //     },
+    //     left: {
+    //       position: 'left',
+    //       attrs: {
+    //         circle: {
+    //           r: 4,
+    //           magnet: true,
+    //           stroke: '#0c1010',
+    //           strokeWidth: 1,
+    //           fill: '#fff',
+    //           style: {
+    //             visibility: 'hidden',
+    //           },
+    //         },
+    //       },
+    //     },
+    //   },
+    //   items: [
+    //     {
+    //       group: 'top',
+    //     },
+    //     {
+    //       group: 'right',
+    //     },
+    //     {
+    //       group: 'bottom',
+    //     },
+    //     {
+    //       group: 'left',
+    //     },
+    //   ],
+    // }
     // endregion
 
     // region 注册自定义节点
@@ -645,14 +645,15 @@ export default class Product {
           body: {
             strokeWidth: 1,
             stroke: '#0c1010',
-            fill: '#ffffff',
+            fill: 'rgba(0,0,0,0.0)',
+
           },
           text: {
             fontSize: 12,
             fill: '#262626',
           },
         },
-        ports: { ...ports },
+        // ports: { ...ports },
       },
       true,
     )
@@ -667,24 +668,24 @@ export default class Product {
           body: {
             strokeWidth: 1,
             stroke: '#0c1010',
-            fill: '#ffffff',
+            fill: 'rgba(0,0,0,0.0)',
           },
           text: {
             fontSize: 12,
             fill: '#262626',
           },
         },
-        ports: {
-          ...ports,
-          items: [
-            {
-              group: 'top',
-            },
-            {
-              group: 'bottom',
-            },
-          ],
-        },
+        // ports: {
+        //   ...ports,
+        //   items: [
+        //     {
+        //       group: 'top',
+        //     },
+        //     {
+        //       group: 'bottom',
+        //     },
+        //   ],
+        // },
       },
       true,
     )
@@ -699,14 +700,14 @@ export default class Product {
           body: {
             strokeWidth: 1,
             stroke: '#0c1010',
-            fill: '#ffffff',
+            fill: 'rgba(0,0,0,0.0)',
           },
           text: {
             fontSize: 12,
             fill: '#262626',
           },
         },
-        ports: { ...ports },
+        // ports: { ...ports },
       },
       true,
     )
@@ -750,7 +751,7 @@ export default class Product {
             fill: '#fff',
           },
         },
-        ports: { ...ports },
+        // ports: { ...ports },
       },
       true,
     )
@@ -816,11 +817,11 @@ export default class Product {
   // endregion
 
   // region 显示/隐藏连接桩事件
-  static showPorts(ports, show) {
-    for (let i = 0, len = ports.length; i < len; i = i + 1) {
-      ports[i].style.visibility = show ? 'visible' : 'hidden'
-    }
-  }
+  // static showPorts(ports, show) {
+  //   for (let i = 0, len = ports.length; i < len; i = i + 1) {
+  //     ports[i].style.visibility = show ? 'visible' : 'hidden'
+  //   }
+  // }
   // endregion
 
   // region 获取所有选中的节点

+ 102 - 21
src/view/pdm/data-collection/register-add.vue

@@ -9,19 +9,21 @@
         <!--  下拉区域  -->
         <DkForm slot="content" ref="formInline" v-model="formData" style="width: 95%">
           <!--选择工位-->
-          <DkFormItem :required="true" prop="stationId" :data-type="$config.dataType.number" :label="$t('stationId')">
+          <DkFormItem v-if="workStationList.length>0" :required="true" prop="stationId"
+                      :data-type="$config.dataType.number" :label="$t('stationId')">
             <SelectMagnifier v-model="formData.stationId" :display-text="formData.stationName"
                              :type="this.$config.MagnifierType.station"
                              :multiple="false"
+                             :search-info="{flowNodeId:flowNodeId}"
                              @ok="chooseStation"></SelectMagnifier>
           </DkFormItem>
           <!--生产工号-->
-          <DkFormItem :required="true" prop="makeUserName">
-            <InputPop ref="makeUserName" v-model="formData.makeUserName"/>
+          <DkFormItem :required="true" prop="prodUserCode">
+            <InputPop ref="prodUserCode" v-model="formData.prodUserCode" @on-blur="onProdUserCode"/>
           </DkFormItem>
           <!--产品条码-->
-          <DkFormItem :required="true" prop="pdtBarcode">
-            <InputPop ref="pdtBarcode" v-model="formData.pdtBarcode" @on-blur="onBlurBarCode"/>
+          <DkFormItem :required="true" prop="barCode">
+            <InputPop :readonly="!formData.prodUserCode" ref="barCode" v-model="formData.barCode" @on-blur="onBarCode"/>
           </DkFormItem>
           <!--产品查询-->
           <DkButton type="primary" @click="productSelect">{{ $v('search') }}</DkButton>
@@ -36,25 +38,25 @@
                    :height="this.tableHeight" primaryKey="uniqueId"
                    :choose-flag="false">
             <!--产品条码-->
-            <DkTableColumn field="productCode" width="auto"></DkTableColumn>
+            <DkTableColumn field="uniqueCode" :title="$t('productCode')" width="auto"></DkTableColumn>
             <!--产品编码-->
             <DkTableColumn field="modelCode" width="auto"></DkTableColumn>
             <!--产品名称-->
             <DkTableColumn field="modelName" width="auto"></DkTableColumn>
             <!--生产工号-->
-            <DkTableColumn field="makeUserName" width="auto"></DkTableColumn>
-            <!--模具编码-->
-            <DkTableColumn field="modelCode" :title="$t('produceModelCode')" width="auto"></DkTableColumn>
+            <DkTableColumn field="prodUserCode" width="auto"></DkTableColumn>
+            <!--模具名称-->
+            <DkTableColumn field="modelMouldCode" :title="$t('produceModelCode')" width="auto"></DkTableColumn>
             <!--注浆日期-->
             <DkTableColumn field="moldingDate" width="auto"></DkTableColumn>
             <!--成型工号-->
-            <DkTableColumn field="moldingUser" width="auto"></DkTableColumn>
-            <!--TODO 公柸标识?-->
-            <!--          <DkTableColumn field="flgBindUnique" type="switch" :switch-disabled="true"></DkTableColumn>-->
-            <!--注浆次数-->
-            <DkTableColumn field="thisMoldedNum" :title="$t('slipCastingNum')" width="auto"></DkTableColumn>
+            <DkTableColumn field="moldingUserCode" :title="$t('moldingUser')" width="auto"></DkTableColumn>
+            <!--回收标识-->
+            <DkTableColumn field="flgRecycled" type="switch" :switch-disabled="true"></DkTableColumn>
             <!--商标-->
             <DkTableColumn field="logoName" width="auto"></DkTableColumn>
+            <!--釉色-->
+            <DkTableColumn field="colourName"  width="auto"></DkTableColumn>
           </DkTable>
         </div>
       </DkPanel>
@@ -81,10 +83,14 @@
         formData: {
           stationId: null,
           stationName: '',
-          makeUserName: '',
-          pdtBarcode: '',
+          prodUserId: null,
+          prodUserCode: '',
+          barCode: '',
+          ftyId: self.$store.state.user.ftyId,
         },
+        flowNodeId:'c565f042-05fc-411a-9059-21c8758ce171',
         tableData: [],
+        workStationList: [],//工位数据
       }
     },
     methods: {
@@ -96,7 +102,8 @@
       productSelect() {
         this.$refs['formInline'].validate().then(valid => {
           if (valid) {
-
+            //产品条码查询
+            this.onBarCode()
           }
         })
       },
@@ -106,15 +113,50 @@
        *   @author : 寇珊珊
        */
       chooseStation(row) {
-        console.log('chooseStation', row)
+        if (row && row[0]) {
+          this.formData.stationId = row[0].stationId
+          this.formData.stationName = row[0].stationName
+        }
+      },
+      /**
+       *   @desc   : 生产工号失焦事件
+       *   @date   : 2023/2/28 9:28
+       *   @author : 寇珊珊
+       */
+      onProdUserCode() {
+        let params = {
+          ftyId: this.formData.ftyId,
+          prodUserCode: this.formData.prodUserCode,
+          stationId:this.formData.stationId,
+          flowNodeId: this.flowNodeId,
+        }
+        this.excute(this.$service.collectService, this.$service.collectService.checkProdUserCode, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.formData.prodUserId = res.data
+          }else{
+            this.$Message.error(res.message)
+          }
+        })
       },
       /**
        *   @desc   : 产品条码失焦事件
        *   @date   : 2023/2/28 9:28
        *   @author : 寇珊珊
        */
-      onBlurBarCode(value) {
-        console.log('onBlurBarCode', value)
+      onBarCode() {
+        let params = {
+          ftyId: this.formData.ftyId,
+          barCode: this.formData.barCode,
+          prodUserCode: this.formData.prodUserCode,
+          flowNodeId: this.flowNodeId,
+        }
+        this.excute(this.$service.collectService, this.$service.collectService.checkBarCode, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.tableData = [res.data]
+          }else{
+            this.$Message.error(res.message)
+          }
+        })
       },
       /**
        *   @desc   : 保存
@@ -122,9 +164,48 @@
        *   @author : 寇珊珊
        */
       save() {
-
+        this.setParams()
+        this.excute(this.$service.collectService, this.$service.collectService.add, this.params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+          }
+        })
+      },
+      /**
+       *   @desc   : 设置参数
+       *   @date   : 2023/3/1 17:14
+       *   @author : 寇珊珊
+       */
+      setParams(){
+        this.params = this.formData
+        this.params.flowNodeId = this.flowNodeId
+      },
+      /**
+       *   @desc   : 获取工位
+       *   @date   : 2023/3/1 14:54
+       *   @author : 寇珊珊
+       */
+      getWorkStation() {
+        let params = {
+          ftyId: this.formData.ftyId,
+          flowNodeId: this.flowNodeId,
+        }
+        this.excute(this.$service.commonService, this.$service.commonService.getWorkStation, params).then(res => {
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.workStationList = res.data
+          }
+        })
+      },
+      createdInit() {
+        // this.primaryKey = 'dataId'     // 设置主键
+        // console.log('formType',this.formType)
+        //获取工位
+        this.getWorkStation()
       },
     },
+    created() {
+      this.createdInit()
+      // this.detail(this.$route.params.id)
+    }
   }
 </script>
 

+ 1 - 1
src/view/pdm/data-collection/register.vue

@@ -14,7 +14,7 @@
       <template #right>
         <!--   新建     -->
         <BaseIndexButton right-button="user-add" ref="create" name="create"
-                         @click="open($config.routeUrl.produce.registerAdd)"></BaseIndexButton>
+                         @click="open($config.routeUrl.produce.registerAdd  )"></BaseIndexButton>
       </template>
     </BaseIndexButtonGroup>
 

+ 0 - 10
src/view/pdm/molding-record/bind-barcode.vue

@@ -35,7 +35,6 @@
                      :new-row-flag="false"
                      :freeze="false"
                      controlId="flgMolding"
-                     @current-change="currentChange"
                      @changeValue="changeValue"></EditTable>
         </div>
       </DkPanel>
@@ -129,7 +128,6 @@
        */
       bindBarcodeButton() {
         this.$refs['formInline'].validate().then(valid => {
-          console.log(this.$refs['formInline'])
           if (valid) {
             if (!this.checkProduceBarCode(this.formData.produceBarCode)) {
               this.$Message.error(this.$t('W_104'))
@@ -162,14 +160,6 @@
         }
       },
       /**
-       *   @desc   : 行改变时间
-       *   @date   : 2023/2/28 11:22
-       *   @author : 寇珊珊
-       */
-      currentChange(e) {
-        console.log('e', e)
-      },
-      /**
        *   @desc   : 值改变
        *   @date   : 2023/2/28 11:23
        *   @author : 寇珊珊