zouyu
2024-03-05 d896d25a2bee6dc9496f102035b2d68d17f3de65
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);