Explorar el Código

Merge branch 'master' of http://git.dongkesoft.com:9001/DK-MES-3.0/mes-web

jiangn hace 3 años
padre
commit
d2f3eb9e89

+ 7 - 6
src/components/base/dk-perspective/dk-pivot.vue

@@ -102,13 +102,14 @@
           </div>
         </DkSplit>
         <div style="height: 50px">
-          <DkButton @click="currentType=1">表格</DkButton>
-          <DkButton @click="currentType=2">柱状图</DkButton>
-          <DkButton @click="currentType=3">折线图</DkButton>
+          <DkButton @click="currentType='table'">表格</DkButton>
+          <DkButton @click="currentType='bar'">柱状图</DkButton>
+<!--          <DkButton @click="currentType='line'">折线图</DkButton>-->
+<!--          <DkButton @click="currentType='pie'">饼状图</DkButton>-->
         </div>
       </div>
 
-      <DkTable slot="right" v-show="currentType===1"
+      <DkTable slot="right" v-show="currentType==='table'"
                :id="'table-'+$options.name" ref="table-select" :data="tableData"
                :height="tableHeight"
                :choose-flag="false"
@@ -212,7 +213,7 @@
         </div>
 
       </DkTable>
-      <Echarts class="123112sdfsdf" slot="right" v-if="currentType!==1" :type="currentType"
+      <Echarts slot="right" v-if="currentType!='table'" :type="currentType" :columns="internal"
                :style="'height: '+tableHeight+'px; width: 100%'" :table-instance="$refs['table-select']"/>
     </DkSplit>
   </div>
@@ -321,7 +322,7 @@ export default {
       rowKeys: [],// 行列
       isDataLoading: false,
       reducer: (sum, item) => sum + 1,
-      currentType: 1
+      currentType: 'table'
     }
   },
   computed: {

+ 106 - 46
src/components/base/dk-perspective/echarts.vue

@@ -1,86 +1,147 @@
 <template>
-  <div id="chart">
+  <div :id="id">
   </div>
 </template>
 
 <script>
+import { uuid } from '@tinymce/tinymce-vue/lib/es2015/main/ts/Utils'
+
 export default {
   // name: 'echarts',
   props: {
     type: {
-      type: Number
+      type: String
     },
     tableInstance: {
       type: Object
+    },
+    columns: {
+      type: Object
     }
   },
   data() {
     return {
-      xCol: [],
-      yCol: []
+      id: uuid('chart'),
+    }
+  },
+  watch: {
+    type(){
+      this[this.type]()
     }
   },
   methods: {
-    drawBar() {
-      let col = this.tableInstance.$refs.table.getColumns().map(m => m.field).filter(f => f)
+    /**
+     * @desc   : 获取列信息
+     * @author : 洪旭东
+     * @date   : 2023-04-14 15:36
+     */
+    getColumn () {
+      //表格全部列
+      let colList = this.tableInstance.$refs.table.getColumns()
+      //去除行号列
+      colList.splice(0, 1)
+      return colList
+    },
+    /**
+     * @desc   : 柱状图
+     * @author : 洪旭东
+     * @date   : 2023-04-14 16:46
+     */
+    bar() {
       let tableData = this.tableInstance.$refs.table.getTableData().tableData
+      //表格全部列
+      let colList = this.getColumn()
+      //行
+      let xCol = colList.filter(f => this.columns.rowFieldKeys.indexOf(f.field)!==-1)[0]
+      //把行的列过滤掉,只保留值的列
+      let data = colList.filter(f => this.columns.rowFieldKeys.indexOf(f.field)===-1).map(c => {
+        return {
+          name: c.title,
+          data: tableData.map(m => m[c.field]),
+          type: 'bar',
+          showBackground: true,
+        }
+      })
 
       let echarts = require('echarts')
-      let bar = echarts.init(document.getElementById('chart'))
-      bar.setOption(
+      let chart = echarts.init(document.getElementById(this.id))
+      chart.setOption(
         {
-        //   legend: {},
-        //   tooltip: {},
-        //   dataset: {
-        //     source: [
-        //       ['', '2015', '2016', '2017'],
-        //       ['Matcha Latte', 43.3, 85.8, 93.7],
-        //       ['Milk Tea', 83.1, 73.4, 55.1],
-        //       ['Cheese Cocoa', 86.4, 65.2, 82.5],
-        //       ['Walnut Brownie', 72.4, 53.9, 39.1]
-        //     ]
-        //   },
-        //   xAxis: { type: 'category' },
-        //   yAxis: {},
-        //   series: [{ type: 'bar' }, { type: 'bar' }, { type: 'bar' }]
-        // }
-
-
           tooltip: {
             trigger: 'axis',
             axisPointer: {
               type: 'shadow'
             }
           },
-          grid: {
-            left: '3%',
-            right: '4%',
-            bottom: '3%',
-            containLabel: true
+          xAxis: {
+            type: 'category',
+            data: tableData.map(m => m[xCol.field] || 0)
+          },
+          yAxis: {
+            type: 'value'
+          },
+          series: data
+        }
+      )
+    },
+    line() {
+      let tableData = this.tableInstance.$refs.table.getTableData().tableData
+      //表格全部列
+      let colList = this.getColumn()
+      //行
+      let xCol = colList.filter(f => this.columns.rowFieldKeys.indexOf(f.field)!==-1)[0]
+      //把行的列过滤掉,只保留值的列
+      let data = colList.filter(f => this.columns.rowFieldKeys.indexOf(f.field)===-1).map(c => {
+        return {
+          name: c.title,
+          data: tableData.map(m => m[c.field] || 0),
+          type: 'line',
+          showBackground: true,
+        }
+      })
+
+      let echarts = require('echarts')
+      let chart = echarts.init(document.getElementById(this.id))
+      chart.setOption(
+        {
+          tooltip: {
+            trigger: 'item'
           },
           xAxis: {
             type: 'category',
-            data: tableData.map(m => m[col[0]])
+            data: tableData.map(m => m[xCol.field])
           },
           yAxis: {
             type: 'value',
             boundaryGap: [0, 0.01],
           },
+          series: data
+        }
+      )
+    },
+    pie() {
+      let _this = this
+      let col = this.tableInstance.$refs.table.getColumns().map(m => m.field).filter(f => f)
+      let tableData = this.tableInstance.$refs.table.getTableData().tableData
+
+      let echarts = require('echarts')
+      let chart = echarts.init(document.getElementById(this.id))
+      chart.setOption(
+        {
+          tooltip: {
+            trigger: 'item'
+          },
+          legend: {
+            orient: 'vertical',
+            left: 'left'
+          },
           series: [
             {
-              type: 'bar',
-              data: tableData.map(m => m[col[1]]),
-              barCategoryGap: 8,
-              itemStyle: {
-                normal: {
-                  //这里是重点
-                  color: function (params) {
-                    //注意,如果颜色太少的话,后面颜色不会自动循环,最好多定义几个颜色
-                    let colorList = ['#e58dc2', '#fbb8a1', '#fbe289', '#90e5e7', '#6fbae1', '#749f83', '#ca8622']
-                    return colorList[params.dataIndex]
-                  }
-                }
-              }
+              type: this.type,
+              data: tableData.map(m => {return {
+                value: m[col[1]],
+                name: m[col[0]]
+              }}),
             }
           ]
         }
@@ -88,8 +149,7 @@ export default {
     },
   },
   mounted() {
-    console.log('mounted', this.tableInstance.$refs.table.getColumns())
-    this.drawBar()
+    this[this.type]()
   }
 }
 </script>

+ 3 - 1
src/components/business/process/node-modal/node-modal.vue

@@ -579,11 +579,13 @@ export default {
       }
       // 回收时,结束节点,回收初始方式只能是后续流程
       if (this.nodeData.flowKind === this.$config.flowKind.end) {
+        this.nodeControl.routerTable.visible=false
         this.recycledKindList = this.recycledKindListSocial.filter(it => it.kindCode === this.$config.recycledKind.after)
         this.$nextTick(() => {
           this.nodeData.recycledKind = this.$config.recycledKind.after
         })
       } else {
+        this.nodeControl.routerTable.visible=true
         this.recycledKindList = this.recycledKindListSocial.copy()
       }
       this.$refs['formInline'].clearValidate()
@@ -853,7 +855,7 @@ export default {
         })
       }
       // 结束节点不能作为起点 特殊处理:(后续流程+回收)允许有出线
-      if (this.nodeData?.flowKind == this.$config.flowKind.end && cell?.nodeKind === this.$config.nodeKind.recover && cell.recycledKind != this.$config.recycledKind.after) {
+      if (this.nodeData?.flowKind == this.$config.flowKind.end ) {
         this.graph.getOutgoingEdges(cell)?.forEach(it => {
           this.graph.removeEdge(it.id)
         })

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

@@ -1463,6 +1463,7 @@ export const appColumns = {
   appOpnTime: '操作日期',
   appCurrentNode: '当前工序',
   appLableInput: '请输入{param}',
+  appPrint: '打印',
 }
 /**
  * @desc   : app按钮

+ 141 - 74
src/view-app/app/prod-management/barcode-printing/index.vue

@@ -1,127 +1,195 @@
 <template>
-  <!--条码打印-->
+  <!--条码打印  于继渤-->
 
   <div class="main-app-form">
     <!-- 顶部导航栏 -->
-    <dk-app-nav-bar :title="$t('appBarcodePrintingTitle')"
-                    @click-left="onClickLeft" ></dk-app-nav-bar>
+    <dk-app-nav-bar :title="title" @click-left="onClickLeft"></dk-app-nav-bar>
+
+    <!-- 模板分类 -->
+    <dk-app-field :label="$t('appPrintTemplate')" v-model="formData.printLayoutName" :readonly="true"
+      @click="openDropdown('labelPrintLayout')" placeholderType="choose" is-link arrow-direction="down" />
+    <!--    打印机-->
+    <dk-app-field v-model="formData.printerName" :label="$t('appPrinter')" :readonly="true"
+      @click="openDropdown('labelPrinter')" placeholderType="choose" is-link arrow-direction="down" />
 
     <!--    产品条码-->
-    <dk-app-field
-      :label="$t('appProductBarcode')"
-      v-model="formData.productBarcode"
-      placeholderType="scan"></dk-app-field>
+    <dk-app-field v-model="formData.mouldKindName" :label="$t('appProductBarcode')"
+      @changeBarCode="queryBarCode"></dk-app-field>
+
+    <!-- 打印 -->
+    <div class="app_save_bottom-class">
+      <dk-app-button :soundEffectFlag="false" :disabled="loading" @click="save">{{ $t('appPrint') }}
+      </dk-app-button>
+    </div>
+
+
+
+
+
 
     <!--    工位-->
-    <dk-app-field
-      :label="$t('appStation')"
-      :readonly="true"
-      v-model="formData.productBarcode"
-      placeholderType="choose" is-link arrow-direction="down"></dk-app-field>
-
-    <!--    服务器打印机-->
-    <dk-app-field
-      :label="$t('appServerPrinter')"
-      :readonly="true"
-      v-model="formData.productBarcode"
-      placeholderType="choose" is-link arrow-direction="down"></dk-app-field>
-    <!--    外箱码打印机1-->
-    <dk-app-field
-      :label="$t('appOuterBoxCodePrinter1')"
-      :readonly="true"
-      v-model="formData.productBarcode"
-      placeholderType="choose" is-link arrow-direction="down"></dk-app-field>
-    <!--    外箱码打印机2-->
-    <dk-app-field
-      :label="$t('appOuterBoxCodePrinter2')"
-      :readonly="true"
-      v-model="formData.productBarcode"
-      placeholderType="choose" is-link arrow-direction="down"></dk-app-field>
+    <dk-app-single-dropdown typeName="workStationAll" :show="workStationAllFlag"
+      @mutiClose="singleClose('workStationAll')" :ids="ids" apiType="web"
+      @mutiCommit="singleCommit($event, 'workStationAll')"></dk-app-single-dropdown>
+
+
+    <!--    打印机-->
+    <dk-app-single-dropdown typeName="labelPrinter" :show="labelPrinterFlag" @mutiClose="singleClose('labelPrinter')"
+      :ids="[formData.printerId]" apiType="web"
+      @mutiCommit="singleCommit($event, 'labelPrinter')"></dk-app-single-dropdown>
+
+
+    <!--    打印模板-->
+    <dk-app-single-dropdown typeName="labelPrintLayout" :show="labelPrintLayoutFlag"
+      @mutiClose="singleClose('labelPrintLayout')" :ids="[formData.printLayoutId]" apiType="web"
+      @mutiCommit="singleCommit($event, 'labelPrintLayout')"></dk-app-single-dropdown>
+
 
     <!-- 加载页面   -->
     <dk-app-loading :loading="loading"></dk-app-loading>
 
   </div>
-
 </template>
 
 <script>
+
+import { appFormMixin } from '@/mixins/appform.js'
 export default {
   name: "app-barcode-reprinting",
+  mixins: [appFormMixin],
   data() {
     let self = this
     return {
-      moldingMoldManagementActiveTitle:'',
-
-
-      //标题
+      title: '',
+      loading: false,
+      workStationAllFlag: false,
+      labelPrinterFlag: false, //打印机
+      labelPrintLayoutFlag: false, //打印模板
+      ids: [],
       formData: {
-        productBarcode: '',//产品条码
-        flgValid: '',//有效标识
-        ftyId: 1,//工厂ID
+        printerId: null, //打印机
+        printerName: '',
+        printLayoutId: null, //打印机模板
+        printLayoutName: '',
       },
     }
   },
   methods: {
 
 
-    // region 基础数据源
+    // region 控件 回调
+    /**
+        * @desc   : 侧拉打开事件
+        * @author : 于继渤
+        * @date   : 2023/2/13 13:25
+        */
+    openDropdown(e) {
+      //列表下拉
+      if (e === 'labelPrinter') { //打印机
+        this.labelPrinterFlag = true
+      }
+      if (e === 'labelPrintLayout') { //打印模板
+        this.labelPrintLayoutFlag = true
+      }
+    },
+
+
+    /**
+     * @desc   : 单选侧拉关闭
+     * @author : 于继渤
+     * @date   : 2023/2/7 17:26
+     */
+    singleClose(e) {
+      if (e === 'labelPrinter') {
+        this.labelPrinterFlag = false
+      }
+      if (e === 'labelPrintType') {
+        this.labelPrintTypeFlag = false
+      }
+      if (e === 'labelPrintLayout') {
+        this.labelPrintLayoutFlag = false
+      }
+      if (e === 'workStationAll') {
+        this.workStationAllFlag = false
+      }
+      this.ids = []
+    },
 
+    /**
+ * @desc   : 单选侧拉确定
+ * @author : 于继渤
+ * @date   : 2023/2/7 17:26
+ */
+    singleCommit(e, typeName) {
+      if (typeName === 'labelPrinter') {  //打印机
+        this.$set(this.formData, 'printerId', e.ids ? Number(e.ids) : null)
+        this.$set(this.formData, 'printerName', e.names)
+      }
 
+      if (typeName === 'labelPrintLayout') {  //打印模板
+        this.$set(this.formData, 'printLayoutId', e.ids ? Number(e.ids) : null)
+        this.$set(this.formData, 'printLayoutName', e.names)
+      }
 
-    // endregion
 
-    // region 控件 回调
+    },
     /**
-     * @desc   : 根据输入的usercode 查询 userid
-     * @author : 王英杰
-     * @date   : 2023/2/10 9:16
+     * @desc   : 重置
+     * @author : 于继渤
+     * @date   : 2023/3/13 13:39
      */
+    onClickRightIcon(item) {
+      if (item.key === 'labelPrinter') {
+        this.formData.printerId = null
+        this.formData.printerName = ''
+        this.formData.printerId_Name = ''
+      }
 
-    queryUser() {
-      let params = {
-        ftyId: this.$store.state.user.ftyId,
-        userCode: this.formData.makeUserName,
+      if (item.key === 'labelPrintLayout') {
+        this.formData.printLayoutId = null
+        this.formData.printLayoutName = ''
       }
-      this.excute(this.$service.appCommonService, this.$service.appCommonService.selectUser, params).then(res => {
-        if (res.code === this.$config.SUCCESS_CODE) {
-          if (res.data) {
-            this.formData.makeUser = res.data.userId
-          } else { //没查找
-            this.appToastFail((this.$t('appProductionJobNumbeErro')));
-            this.formData.makeUserName = ""
-            this.formData.makeUser = ""
-          }
-        }
-      })
+
     },
+
+
     //点击标题左侧返回事件
     onClickLeft() {
       this.$router.go(-1)
     },
 
+    /**
+     * @desc   : 查询编码
+     * @author : 于继渤
+     * @date   : 2023/2/10 11:46
+     */
+    queryBarCode() {
 
+    },
 
     // endregion
 
     // region 保存
     /**
      * @desc   : 给参数赋值
-     * @author : 王英杰
+     * @author : 于继渤
      * @date   : 2023/2/10 11:46
      */
     setParams() {
-      this.params = {...this.formData}
+      this.params = { ...this.formData }
     },
     /**
      * @desc   : 检验
-     * @author : 王英杰
+     * @author : 于继渤
      * @date   : 2023/2/10 11:46
      */
     validData(flag) {
-      // 生产工号不能为空
-      if (!this.formData.makeUser) {
-        this.appToastSuccess((this.$t('appProductionJobNumbeWrong')));
+      if (!this.formData.printerId) { //打印机
+        this.appToastFail(this.$t('selectWords', { 'search-name': this.$t('appPrinter') }))
+        return false;
+      }
+      if (!this.formData.printLayoutId) { //打印模板
+        this.appToastFail(this.$t('selectWords', { 'search-name': this.$t('appPrintTemplate') }))
         return false;
       }
 
@@ -129,23 +197,22 @@ export default {
     },
     /**
      * @desc   : 保存方法
-     * @author : 王英杰
+     * @author : 于继渤
      * @date   : 2023/2/10 11:46
      */
     saveData() {
-      return this.excute(this.$service.appMouldService, this.$service.appMouldService.insert, this.params);
+      //  return this.excute(this.$service.appMouldService, this.$service.appMouldService.insert, this.params);
     },
     // endregion
 
   },
-  mounted() {
-    // 设置滚动的位置和高度
-    this.setAppTableHeight(false, null)
+  created() {
+    //设置标题
+    this.title = '' + this.$t('appStationPrinterSettingsTitle')
   },
 
+
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

+ 1 - 1
src/view/process/process-flow/config/ProcessConfig.js

@@ -146,7 +146,7 @@ export default class Process {
             return false
           }
           // 结束节点不能作为连线起点 特殊处理:(后续流程+回收)允许有出线
-          if(source?.flowKind==config.flowKind.end&&source?.nodeKind===config.nodeKind.recover&&source.recycledKind!=config.recycledKind.after) {
+          if(source?.flowKind==config.flowKind.end) {
             return false
           }
           // 回收节点不能作为结束