Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

sh4wmoo 3 лет назад
Родитель
Сommit
08eae26528

+ 1 - 0
src/api/pages/mst/mould.js

@@ -33,5 +33,6 @@ export const routeUrl = {
     mouldChangeStdNum: {key: 'mouldChangeStdNum', method: 'mouldChangeStdNum'},
     changeStdNum: {key: 'changeStdNum', method: 'changeStdNum'},
     modelMouldChange: {key: 'modelMouldChange', method: 'modelMouldChange'},
+    print: {key: 'print', method: 'print'},
   }
 }

+ 1 - 0
src/api/pages/pdm/molding-record.js

@@ -36,5 +36,6 @@ export const routeUrl = {
     bindBarcodeButton:{key: 'bindBarcodeButton', method: 'bindBarcodeButton'},
     clearBindBarcode:{key: 'clearBindBarcode', method: 'clearBindBarcode'},
     bindBarcode:{key: 'bind-barcode',url:'/pdm/molding-record/bind-barcode',chooseFlag: true},
+    print: {key: 'print', method: 'print'},
   }
 }

BIN
src/assets/images/app-image/carrier_printing.png


BIN
src/assets/images/app-image/carrier_reprinting.png


BIN
src/assets/images/app-image/mould_printing.png


BIN
src/assets/images/app-image/mould_reprinting.png


+ 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>

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

@@ -377,6 +377,7 @@ export const columns = {
   saveDetail: '保存至明细',
   clearDefect: '清空',
   userMessage:'员工信息',
+  reverseMessage:'撤销信息',
 
   categoryCode: '分类编码',
   categoryName: '分类名称',
@@ -805,9 +806,9 @@ export const columns = {
   notCounted: '未盘点',
   counted: '已盘点',
   inventoryProfit: '盘盈',
-  finishTimeStart: '完成时间',
+  finishTimeStart: '开始时间',
   finishTimeEnd: '结束时间',
-  makeTimeStart: '生产时间',
+  makeTimeStart: '开始时间',
   makeTimeEnd: '结束时间',
   flowNodeIdList: '盘点工序',
   checkModelCategory: '产品类别',
@@ -835,7 +836,7 @@ export const columns = {
   recordTime: '记录时间',
   temperature: '温度(℃)',
   humidity: '湿度(%RH)',
-  thmeterRecord: '湿温度计',
+  thmeterRecord: '温湿度计',
 
   //报工
   workRecord:'报工记录',
@@ -846,6 +847,7 @@ export const columns = {
   workTimes:'报工工时',
   wordAmount:'报工金额',
   flgOvertime:'加班标识',
+  workJob:'报工工种',
 
   //工位打卡
   replaceStaffName: '替班员工',
@@ -1463,6 +1465,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>

+ 17 - 1
src/view/mst/mould/index.vue

@@ -17,6 +17,8 @@
         <BaseIndexButton right-button="mould-scrap" ref="scrap" name="scrap"/>
         <!--    撤销    -->
         <BaseIndexButton right-button="mould-reverse" ref="reverse" name="reverse"/>
+        <!--    打印    -->
+        <BaseIndexButton ref="print" name="print"></BaseIndexButton>
       </template>
       <template #right>
         <BaseIndexButton right-button="mould-add" ref="add" name="add"></BaseIndexButton>
@@ -162,16 +164,23 @@
           </DkSplit>
       </div>
     </DkModal>
+
+    <PrintModal ref="printModal" :label-kind="$config.modelKind.modelMould"
+                :service="$service.modelMouldService"
+                :id="($refs['table-select'] && $refs['table-select'].batchRows && $refs['table-select'].batchRows[0]) ?
+                $refs['table-select'].batchRows[0].modelId:null"/>
   </div>
 </template>
 
 <script>
 
 import {indexMixin} from '@/mixins'
+import PrintModal from '_c/business/print/modal'
 
 export default {
   name: 'mould',
   mixins: [indexMixin],
+  components: {PrintModal},
   data() {
     let self = this
     return {
@@ -744,7 +753,14 @@ export default {
         }
       })
     },
-
+    /**
+     * @desc   : 选择模板、打印机
+     * @author : 洪旭东
+     * @date   : 2023-04-10 13:45
+     */
+    print(){
+      this.$refs.printModal.showChooseTemplate = true
+    },
     // endregion
   },
   created() {

+ 1 - 0
src/view/pdm/molding-record/form.vue

@@ -1014,6 +1014,7 @@ export default {
             templist[it] = itt[it]
           })
           templist.ftyId = this.formData.ftyId
+          templist.manageUser =this.$store.state.user.id
           // 取出当前成型线对应的模具记录明细
           let temp = table.filter(it => it.groupId === itt.groupId)
           if (temp && temp.length > 0) {

+ 17 - 0
src/view/pdm/molding-record/index.vue

@@ -13,6 +13,8 @@
         <BaseIndexButton v-if="formType==$config.formCode.moldDamage" right-button="user-moldDamage" ref="moldDamage" name="moldDamage"></BaseIndexButton>
         <!--    绑定条码    -->
         <BaseIndexButton v-if="formType==$config.formCode.moldingRecord" right-button="user-bindBarcode" ref="bindBarcode" name="bindBarcode"></BaseIndexButton>
+        <!--    打印    -->
+        <BaseIndexButton ref="print" name="print"></BaseIndexButton>
       </template>
       <template #right>
         <!--   新建     -->
@@ -61,16 +63,23 @@
         <DkTableColumn field="remarks" width="auto"></DkTableColumn>
       </DkTable>
     </div>
+
+    <PrintModal ref="printModal" :label-kind="$config.modelKind.modelProduct"
+                :service="$service.modelProductService"
+                :id="($refs['table-select'] && $refs['table-select'].batchRows && $refs['table-select'].batchRows[0]) ?
+                $refs['table-select'].batchRows[0].modelId:null"/>
   </div>
 </template>
 
 <script>
 
 import {indexMixin} from '@/mixins'
+import PrintModal from '_c/business/print/modal'
 
 export default {
   name: 'molding-record',
   mixins: [indexMixin],
+  components: {PrintModal},
   data() {
     let self = this
     return {
@@ -182,6 +191,14 @@ export default {
       this.primaryKey = 'moldingId'  // 设置主键Id
       this.routeObjName = 'moldingRecord'  // 设置路由名称
     },
+    /**
+     * @desc   : 选择模板、打印机
+     * @author : 洪旭东
+     * @date   : 2023-04-10 13:45
+     */
+    print(){
+      this.$refs.printModal.showChooseTemplate = true
+    },
     // endregion
   },
   created() {

+ 2 - 1
src/view/report/product-follow-report/index.vue

@@ -65,7 +65,8 @@
           <DkTableColumn field="opnTime" :title="$t('operationTime')" data-type="dateTime"></DkTableColumn>
           <DkTableColumn field="opCreateUserCode"></DkTableColumn>
           <DkTableColumn field="opnUserName"></DkTableColumn>
-          <DkTableColumn field="operatingInstructions" width="auto"></DkTableColumn>
+<!--          <DkTableColumn field="operatingInstructions" width="auto"></DkTableColumn>-->
+          <DkTableColumn field="remarks" width="auto"></DkTableColumn>
         </DkTable>
       </div>
     </DkSplit>