zouyu
2024-03-05 d896d25a2bee6dc9496f102035b2d68d17f3de65
生产调度变更记录功能
已修改4个文件
119 ■■■■■ 文件已修改
src/api/plan/productionschedul.js 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/common/ztt-table.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/plan/masterproductionschedule/index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/plan/productionschedul/index.vue 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/plan/productionschedul.js
@@ -8,6 +8,13 @@
  })
}
export function fetchRecordsList(mId) {
  return request({
    url: '/mes/productionSchedul/pageRecords/'+mId,
    method: 'get',
  })
}
export function fetchScheduleById(id) {
  return request({
    url: '/mes/productionSchedul/selTime/'+id,
src/views/common/ztt-table.vue
@@ -182,6 +182,7 @@
          v-if="options.multiSelect && !isEdit"
          style="width: 55px;"
          :selectable="selectHandle"
        >
        </el-table-column>
        <!--单选框-->
@@ -571,7 +572,9 @@
    //需要合并的字段集合
    mergeSpanArr: {
        type: Array,
        default: []
        default: ()=>{
            return []
        }
    },
    toolbarMaxLength: {
      type: Number,
src/views/plan/masterproductionschedule/index.vue
@@ -22,6 +22,7 @@
              <el-dropdown-item
                :command="item.command"
                v-for="item in orderTypeArr"
                :key="item.value"
                :disabled="item.disabled"
                >{{ item.label }}</el-dropdown-item
              >
@@ -40,6 +41,7 @@
              <el-dropdown-item
                :command="item.command"
                v-for="item in stateTagArr"
                :key="item.value"
                :disabled="item.disabled"
                >{{ item.label }}</el-dropdown-item
              >
@@ -661,7 +663,7 @@
        label: '自动新增',
        command: 'AUTO',
        disabled: false,
        permitArr: ['01pending','04completed']
        permitArr: ['04completed']
      })
    }
    this.getSysParam(sysParam.IS_REPORT_OPERATION)
@@ -1049,7 +1051,7 @@
          this.stateTagArr[i].disabled = true
        }
      }
       for (var i = 0; i < this.stateTagArr.length; i++) {
       for (var i = 0; i < this.orderTypeArr.length; i++) {
        if (
          uniqueStateArr.every((val) =>
            this.orderTypeArr[i].permitArr.length <= 0
@@ -1057,9 +1059,9 @@
              : this.orderTypeArr[i].permitArr.includes(val)
          )
        ) {
          this.orderTypeArr[i].disabled = false
        } else {
          this.orderTypeArr[i].disabled = true
        } else {
          this.orderTypeArr[i].disabled = false
        }
      }
      this.masterPlanSelection = val
src/views/plan/productionschedul/index.vue
@@ -10,6 +10,8 @@
        :ajaxFun="ajaxFun"
        :paramObj="queryParams"
        :mergeSpanArr="spanArr"
        :selColValArr="paramSelArr"
        :selCol="paramSelCol"
        ref="ttable">
        <template #toolbar>
            <el-dropdown @command="changeTable">
@@ -134,12 +136,27 @@
            </div>
        </el-card>
    </el-dialog>
    <!-- 查看变更记录 -->
    <el-dialog
    title="变更记录"
    :visible.sync="showRecordsDialog"
    width="60%">
        <el-table border :data="recordsList">
            <el-table-column type="index" width="50" label="序号" align="center"/>
            <el-table-column prop="createTime" min-width="120" show-overflow-tooltip label="操作时间" align="center"/>
            <el-table-column prop="createUser" min-width="120" show-overflow-tooltip label="操作人" align="center"/>
            <el-table-column prop="recordType" min-width="120" show-overflow-tooltip label="操作类型" align="center"/>
            <el-table-column prop="oldRecord" min-width="200" show-overflow-tooltip label="旧值" align="center"/>
            <el-table-column prop="newRecord" min-width="200" show-overflow-tooltip label="新值" align="center"/>
        </el-table>
    </el-dialog>
  </div>
</template>
<script>
import {
  fetchScheduleList,
  fetchRecordsList,
  fetchScheduleById,
  fillTime,
  deleteSchedul,
@@ -149,13 +166,16 @@
} from '@/api//plan/productionschedul'
import ttable from '@/views/common/ztt-table.vue'
import { mapGetters } from 'vuex'
import { remote } from '@/api/admin/dict'
export default {
    data() {
    return {
      queryParams: {
        state: false
      },
      showRecordsDialog: false,
      recordsList: [],
      paramSelArr: [false],
      paramSelCol: 'hasEdit',
      ajaxFun: fetchScheduleList,
      prelang: 'productSchedul',
      options: {
@@ -170,7 +190,7 @@
        isRefresh: true, // 是否显示刷新按钮
        isShowHide: true, // 是否显示显影按钮H
        isSearch: true, // 高级查询按钮
        defaultOrderBy: { column: 'createdTime', direction: 'desc' },
        defaultOrderBy: { column: 'time', direction: 'desc' },
        cancelRunCreated: false,
        tableCellMerge: true
      },
@@ -332,8 +352,8 @@
        operatorConfig: {
            fixed: 'right',
            label: '操作',
            width: 100,
            minWidth: 100
            width: 150,
            minWidth: 150
        }
      },
      dropdownTitleStyle: {
@@ -384,47 +404,51 @@
    }
  },
  methods: {
    getProductionSchedulStaffDict(){
        const _than = this
        remote('productionschedul_staff').then((response) => {
            if (response.status === 200) {
                response.data.data.map((ele)=>{
                    _than.productionSchedulStaffOptions.push(ele.value)
                })
            } else {
                _than.productionSchedulStaffOptions = []
            }
        })
    showChangeRecords(row){
        this.recordsList = []
        if(row){
            fetchRecordsList(row.mid).then((res)=>{
                if(res.status===200){
                    this.recordsList = res.data.data.records
                }
            }).catch((error)=>{
                console.error(error);
            })
        }
        this.showRecordsDialog = true
    },
    showOperator(){
        this.table.operator = [{
            text: '变更记录',
            type: 'text',
            size: 'small',
            fun: this.showChangeRecords,
        }]
        if(this.showUnDownTable){
            if(this.permissions.plan_productionschedul_edit){
                this.table.operator = [{
                this.table.operator.push({
                    text: '编辑',
                    type: 'text',
                    size: 'small',
                    fun: this.editHandle
                }]
                    fun: this.editHandle,
                    show: {
                        key: 'hasEdit',
                        val: [true]
                    }
                })
            }
            if(this.permissions.plan_productionschedul_del){
                if(this.table.operator == null){
                    this.table.operator = [{
                        text: '删除',
                        type: 'text',
                        size: 'small',
                        fun: this.deleteHandle
                    }]
                }else{
                    this.table.operator.push({
                        text: '删除',
                        type: 'text',
                        size: 'small',
                        fun: this.deleteHandle
                    })
                }
                this.table.operator.push({
                    text: '删除',
                    type: 'text',
                    size: 'small',
                    fun: this.deleteHandle,
                    show: {
                        key: 'hasEdit',
                        val: [true]
                    }
                })
            }
        }else{
            this.table.operator = null
        }
    },
    handleClickCell(row){
@@ -462,8 +486,7 @@
      updateState(ids).then(res=>{
        if(res.status===200){
          this.$message.success("更新成功")
          this.getUnFinishedData()
          this.getFinishedData()
          this.getDataList()
        }
      }).catch(error=>{
        console.error(error);