zhuzhuanzhuan
2023-09-01 7a1652cf61e65a2dd2ad1b52c4b383207f3a6956
加班管理
已修改5个文件
322 ■■■■■ 文件已修改
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModal.vue 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalEdit.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalList.vue 234 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/shift/ShiftInfoModel.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementList.vue
@@ -155,7 +155,7 @@
          {
            title: '日期',
            align: 'center',
            dataIndex: 'torqueDate',
            dataIndex: 'effectiveDate',
            // scopedSlots:{customRender:'startTime'},
            // customRender:(text,row,index) => {
            //   return moment(text).format("YYYY-MM-DD HH:mm:ss")
@@ -164,27 +164,27 @@
          {
            title: '班次开始时间',
            align: 'center',
            dataIndex: 'torqueValue'
            dataIndex: 'startDate'
          },
          {
            title: '班次结束时间',
            align: 'center',
            dataIndex: 'torqueValue'
            dataIndex: 'endDate'
          },
          {
            title: '加班开始时间',
            align: 'center',
            dataIndex: 'torqueValue'
            dataIndex: 'startTime'
          },
          {
            title: '加班结束时间',
            align: 'center',
            dataIndex: 'torqueValue'
            dataIndex: 'endTime'
          },
          {
            title: '备注',
            align: 'center',
            dataIndex: 'notes'
            dataIndex: 'remark'
          },
          {
            title: '操作',
@@ -195,12 +195,12 @@
          }
        ],
        url: {
          list: '/mdc/MdcTorqueConfig/pageList',
          delete: '/mdc/MdcTorqueConfig/deleteMdcTorqueConfig',
          deleteBatch: '/mdc/MdcTorqueConfig/deleteBatchMdcTorqueConfig',
          list: '/mdc/mdcEquipmentOvertime/list',
          delete: '/mdc/mdcEquipmentOvertime/delete',
          deleteBatch: '/mdc/mdcEquipmentOvertime/deleteBatch',
          getEquipmentByPid: '/mdc/mdcequipment/getEquipmentByPid',
          exportXlsUrl: "/mdc/MdcTorqueConfig/exportXls",
          importExcelUrl: "/mdc/MdcTorqueConfig/importExcel",
          exportXlsUrl: "/mdc/mdcEquipmentOvertime/exportXls",
          importExcelUrl: "/mdc/mdcEquipmentOvertime/importExcel",
        }
      }
    },
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModal.vue
@@ -5,45 +5,30 @@
      <a-form :form="form">
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item label="设备组" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
              <a-input-search :readOnly="true" v-decorator="['equipmentIds', validatorRules.equipmentIds]"
            <a-form-item label="班次选择" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
              <a-input-search :readOnly="true" v-decorator="['ids', validatorRules.ids]"
                              @search="deviceSearch" enter-button/>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item label="日期" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择时间"
                       v-decorator="['torqueDate', validatorRules.torqueDate]"></j-date>
            </a-form-item>
          </a-col>
          <!--<a-col :span="12">-->
            <!--<a-form-item label="扭矩值" :labelCol="labelCol" :wrapperCol="wrapperCol">-->
              <!--<a-input-number :min="0" :disabled="disableSubmit" placeholder="请输入扭矩值"-->
                       <!--v-decorator="['torqueValue', validatorRules.torqueValue]"/>-->
            <!--</a-form-item>-->
          <!--</a-col>-->
          <a-col :span="12">
            <a-form-item label="加班开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-time-picker :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear
                             v-decorator="['startDate',validatorRules.startDate]"/>
                             v-decorator="['startTime',validatorRules.startTime]"/>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item label="加班结束时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
              <a-time-picker :disabled="disableSubmit" :readOnly="disableSubmit"
                             v-decorator="['endDate',validatorRules.endDate]"/>
                             v-decorator="['endTime',validatorRules.endTime]"/>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
          <a-form-item label="备注" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
            <a-textarea :maxLength="20"  v-decorator="['notes', validatorRules.notes]" placeholder="请输入备注"  ></a-textarea>
            <a-textarea :maxLength="20"  v-decorator="['remark', validatorRules.remark]" placeholder="请输入备注"  ></a-textarea>
          </a-form-item>
          </a-col>
        </a-row>
@@ -129,8 +114,8 @@
        },
        url: {
          add: '/mdc/MdcTorqueConfig/addMdcTorqueConfig',
          edit: '/mdc/MdcTorqueConfig/editMdcTorqueConfig'
          add: '/mdc/mdcEquipmentOvertime/add',
          edit: '/mdc/mdcEquipmentOvertime/edit'
        },
        disableSubmit: true,
@@ -161,17 +146,17 @@
        this.endTime = dateStrings[0];
      },
      getDeviceRows(val) {
        var equipmentIds;
        var calendarId;
        for(var i = 0;i<val.length;i++){
          if (i == 0) {
            equipmentIds =  val[i].equipmentId;
            calendarId =  val[i].id;
          } else {
            equipmentIds = equipmentIds + "," + val[i].equipmentId;
            calendarId = ids + "," + val[i].id;
          }
        }
        // console.log("========",equipmentIds);
        this.form.setFieldsValue({
          equipmentIds: equipmentIds,
          ids: calendarId,
        })
        //   this.form.setFieldsValue({
        // equipmentId: val.equipmentId,
@@ -234,23 +219,23 @@
          if (!err) {
            that.confirmLoading = true
            let formData = Object.assign(this.model, values)
            // let start = moment(formData.startTime).format('YYYY-MM-DD HH:mm:ss');
            // let end = moment(formData.endTime).format('YYYY-MM-DD HH:mm:ss');
            // let startOne = start.replace(/:/g,'');
            // let endOne = end.replace(/:/g,'');
            let start = moment(formData.startTime).format('HH:mm:ss');
            let end = moment(formData.endTime).format('HH:mm:ss');
            let startOne = start.replace(/:/g,'');
            let endOne = end.replace(/:/g,'');
            // var data = new Date();
            // let stertDate = moment(data).format("YYYY-MM-DD HH:mm:ss");
            // let stertDate = moment(data).format("HH:mm:ss");
            // let dataStart = stertDate.replace(/:/g,'');
            // if(startOne < dataStart){
            //   that.$message.warning("开始时间不能小于当前时间")
            //   that.confirmLoading = false
            // }else{
            //   if(startOne>=endOne){
            //     that.$message.warning("结束时间不能小于开始时间");
            //     // console.log(this.model)
            //     // this.endTime = ''
            //     that.confirmLoading = false
            //   }else{
              if(startOne>=endOne){
                that.$message.warning("结束时间不能小于开始时间");
                // console.log(this.model)
                // this.endTime = ''
                that.confirmLoading = false
              }else{
                let obj
                if (!this.model.id) {
                  obj = postAction(this.url.add, formData)
@@ -280,7 +265,7 @@
                  that.close()
                })
              }
            // }
            }
          // }
        })
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalEdit.vue
@@ -137,8 +137,8 @@
        },
        url: {
          add: '/mdc/mdcEquipmentRepair/add',
          edit: '/mdc/MdcTorqueConfig/editMdcTorqueConfig'
          add: '/mdc/mdcEquipmentOvertime/add',
          edit: '/mdc/mdcEquipmentOvertime/edit'
        },
        disableSubmit: true,
src/views/mdc/base/modules/OvertimeManagement/OvertimeManagementModalList.vue
@@ -7,42 +7,11 @@
      <div class="table-page-search-wrapper">
        <a-form layout="inline" @keyup.enter.native="searchQuery">
          <a-row :gutter="24">
            <a-col :md="6" :sm="6"  v-if="isDepartType == 0">
              <a-form-item label="部门" v-if="isDepartType == 0">
                <!--<a-select v-model="queryParam.sectionPid" placeholder="请选择部门" :options="sectionPData" @change="initGroupOptions" />-->
                <a-tree-select
                  v-model="value"
                  style="width: 100%"
                  :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                  :tree-data="treeData"
                  placeholder="请选择部门"
                  tree-default-expand-all
                >
                  <!--<span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }" style="color: #08c">-->
                  <!--Child Node1 {{ value }}-->
                  <!--</span>-->
                </a-tree-select>
              </a-form-item>
            </a-col>
            <a-col :md="6" :sm="6">
              <a-form-item label="车间" >
                <!--<a-select v-model="queryParam.sectionId" placeholder="请选择团队" :options="sectionData"/>-->
                <a-tree-select
                  v-model="valueProduct"
                  style="width: 100%"
                  :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                  :tree-data="sectionData"
                  placeholder="请选择车间"
                  tree-default-expand-all
                >
                  <!--<span v-if="key === '0-0-1'" slot="title" slot-scope="{ key, value }" style="color: #08c">-->
                  <!--Child Node1 {{ value }}-->
                  <!--</span>-->
                </a-tree-select>
              </a-form-item>
            </a-col>
           <a-col :md="8" :sm="8">
             <a-form-item label="时间">
               <a-range-picker @change="dateParamChange" format="YYYYMMDD" v-model="dates"/>
             </a-form-item>
           </a-col>
            <a-col :md="6" :sm="6">
              <a-form-item label="设备编码">
                <a-input placeholder="请输入设备编码检索" v-model="queryParam.equipmentId"></a-input>
@@ -68,6 +37,11 @@
                 :dataSource="dataSource" :pagination="ipagination" :loading="loading"
                 :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
                 @change="handleTableChange">
                    <span slot="isDaySpan" slot-scope="text, record">
           <span v-if="text == 'true'">是</span>
           <span v-if="text == 'false'">否</span>
         </span>
        </a-table>
      </div>
      <!-- table区域-end -->
@@ -77,6 +51,7 @@
<script>
  import {mapActions} from 'vuex'
  import { filterObj } from '@/utils/util';
  import {
    ajaxGetSelectItems
  } from '@/api/api'
@@ -98,7 +73,7 @@
  export default {
    name: 'DeviceCalendarListModel',
    mixins: [JeecgListMixin],
    // mixins: [JeecgListMixin],
    components: {
      JDictSelectTag,
      JEllipsis,
@@ -113,7 +88,43 @@
      }
    },
    data() {
      return {
      return{
        /* 查询条件-请不要在queryParam中声明非字符串值的属性 */
        queryParam: {},
        /* 数据源 */
        dataSource:[],
        /* 分页参数 */
        ipagination:{
          current: 1,
          pageSize: 10,
          pageSizeOptions: ['10', '20', '30'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " 共" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        /* 排序参数 */
        isorter:{
          column: 'createTime',
          order: 'desc',
        },
        /* 筛选参数 */
        filters: {},
        /* table加载状态 */
        loading:false,
        /* table选中keys*/
        selectedRowKeys: [],
        /* table选中records*/
        selectionRows: [],
        /* 查询折叠 */
        toggleSearchStatus:false,
        /* 高级查询条件生效状态 */
        superQueryFlag:false,
        /* 高级查询条件 */
        superQueryParams: '',
        dates:[],
        isDepartType:'',
        /*readOnly:true,*/
        title:'',
@@ -132,11 +143,15 @@
            customRender: function (t, r, index) {
              return parseInt(index) + 1;
            }
          },{
            title: '设备编码',
          }, {
            title: '日期',
            align: 'center',
            dataIndex: 'equipmentId',
            dataIndex: 'effectiveDate',
          },
          {
            title: '设备编号',
            align: 'center',
            dataIndex: 'equipmentId'
          },
          {
            title: '设备名称',
@@ -144,20 +159,46 @@
            dataIndex: 'equipmentName',
          },
          {
            title: '驱动类型',
            title: '班制',
            align: 'center',
            dataIndex: 'driveType'
            dataIndex: 'shiftName'
          },
          {
            title: '数控系统',
            title: '班次',
            align: 'center',
            dataIndex: 'controlSystem'
            dataIndex: 'shiftSubName'
          },
          {
            title: '开始时间',
            align: 'center',
            dataIndex: 'startDate'
          },
          {
            title: '结束时间',
            align: 'center',
            dataIndex: 'endDate'
          },
          {
            title: '是否跨天',
            align: 'center',
            dataIndex: 'isDaySpan',
            scopedSlots: { customRender: 'isDaySpan' }
          },
          {
            title: '开始休息时间',
            align: 'center',
            dataIndex: 'sleepStartDate'
          },
          {
            title: '结束休息时间',
            align: 'center',
            dataIndex: 'sleepEndDate'
          }
        ],
        sectionPData: [],
        sectionData: [],
        url: {
          list: '/mdc/mdcEquipment/findEquipmentList',
          list: '/mdc/mdcDeviceCalendar/list',
          loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
          loadProductionOptions:'/mdc/mdcProduction/loadProductionTreeOptions'
        },
@@ -165,8 +206,12 @@
        valueProduct:undefined
      }
    },
    created() {
      this.queryTreeData()
    created(){
      this.dates = [moment().subtract('days', 0), moment().subtract('days', 0)]
      this.queryParam.startTime = moment(this.dates[0]).format('YYYYMMDD')
      this.queryParam.endTime = moment(this.dates[1]).format('YYYYMMDD')
      // this.queryTreeData()
      this.loadData()
    },
    watch: {
      value(value) {
@@ -193,6 +238,79 @@
        }).finally(() =>{
        })
      },
      getQueryParams() {
        //获取查询条件
        let sqp = {}
        if(this.superQueryParams){
          sqp['superQueryParams']=encodeURI(this.superQueryParams)
          sqp['superQueryMatchType'] = this.superQueryMatchType
        }
        var param = Object.assign(sqp, this.queryParam, this.isorter ,this.filters);
        param.field = this.getQueryField();
        param.pageNo = this.ipagination.current;
        param.pageSize = this.ipagination.pageSize;
        //获取用户定制的参数属性
        if (this.getCustomQueryParams) {
          param = this.getCustomQueryParams(param);
          if(!param){
            return false;
          }
        }
        return filterObj(param);
      },
      getQueryField() {
        //TODO 字段权限控制
        var str = "id,";
        this.columns.forEach(function (value) {
          str += "," + value.dataIndex;
        });
        return str;
      },
      loadData(arg) {
        this.dataSource = [];
        if(!this.url.list){
          this.$message.error("请设置url.list属性!")
          return
        }
        //加载数据 若传入参数1则加载第一页的内容
        if (arg === 1) {
          this.ipagination.current = 1;
        }
        var params = this.getQueryParams();//查询条件
        if(!params){
          return false;
        }
        params.startTime = this.queryParam.startTime;
        params.endTime = this.queryParam.endTime;
        params.orderByName = "ascend";
        this.loading = true;
        getAction(this.url.list, params).then((res) => {
          if (res.success) {
            // console.log(res)
            //update-begin---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
            this.dataSource = res.result.records||res.result;
            if(res.result.total)
            {
              this.ipagination.total = res.result.total;
            }else{
              this.ipagination.total = 0;
            }
            //update-end---author:zhangyafei    Date:20201118  for:适配不分页的数据列表------------
          }else{
            this.$message.warning(res.message)
          }
        }).finally(() => {
          this.loading = false
        })
      },
      dateParamChange(v1, v2) {
        this.queryParam.startTime = v2[0]
        this.queryParam.endTime = v2[1]
      },
      onSelectChange(selectedRowKeys, selectionRows) {
        // this.SelectedList.push(selectedRowKeys);
        this.selectedRowKeys = selectedRowKeys;
@@ -211,13 +329,17 @@
        this.ipagination = pagination;
        this.loadData();
      },
      onClearSelected() {
        this.selectedRowKeys = [];
        this.selectionRows = [];
      },
      openPage() {
        this.visible = true
        this.onClearSelected()
        this.dataSource = [];
        this.queryParam = {
          status: this.status
        };
        // this.queryParam = {
        //   status: this.status
        // };
        this.loadData();
        this.initOptions();
@@ -273,9 +395,11 @@
        this.onClearSelected()
      },
      searchReset() {
        this.queryParam = {
          status: 1
        };
        // this.queryParam = {
        //   status: 1
        // };
        this.dates = []
        this.queryParam = {}
        this.loadData();
        this.onClearSelected()
      },
src/views/mdc/base/modules/shift/ShiftInfoModel.vue
@@ -247,6 +247,7 @@
                  message:'消息',
                  description:"保存失败!"
                });
                that.confirmLoading = false
                that.close()
              }else{
                formData.shiftSubStatus = 1