gaosp
2024-01-13 20d1a783e0f2b1d538c77999aa1147cc71fb92af
updatte
已修改5个文件
516 ■■■■ 文件已修改
src/api/Api.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/component/index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/ledger/Manage-add-update.vue 130 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/ledger/index.vue 362 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/container/list/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/Api.js
@@ -1,7 +1,7 @@
/*
 * @Date: 2024-01-10 20:37:45
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-12 21:14:57
 * @LastEditTime: 2024-01-13 10:48:47
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/api/Api.js
 */
import ajax from '@/utils/ajax'
@@ -12,6 +12,7 @@
    useDepartments: '/account/useDepartments',
    // 台账保存
    accountCreate: '/account/create',
    accountUpdate: '/account/update',
    // 车间 工段下啦数据
    getWsl: '/machine/workshopList',
    getPcl: '/machine/protocolList'
@@ -20,7 +21,12 @@
    accountQuery: {
        url: '/account/remainings',
        method: 'GET'
    },
    componentQuery: {
        url: '/component/pageQuery',
        method: 'POST'
    }
}
// 正式环境配置地址
export const URL_CFG = {
@@ -65,6 +71,9 @@
export function accountCreate(params) {
    return sendRequest(HttpConstants.accountCreate, params)
}
export function accountUpdate(params) {
    return sendRequest(HttpConstants.accountUpdate, params)
}
// 
export function getWsl(params) {
    return getData(HttpConstants.getWsl, params)
src/container/component/index.vue
@@ -1,13 +1,13 @@
<!--
 * @Date: 2024-01-06 17:40:19
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-12 22:44:34
 * @LastEditTime: 2024-01-13 10:19:48
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/component/index.vue
-->
<template>
    <div class="maintenance">
        <div class="nav">设备保养/日常保养</div>
        <List ref="list" url="/component/pageQuery">
        <div class="nav">工件信息</div>
        <List ref="list" :url="url">
            <template slot="search">
                <div class="item">
                    <span>零件号</span>
@@ -87,12 +87,14 @@
</template>
<script>
    import List from '../list/index.vue'
    import { getUrl } from '@/api/Api'
    export default {
        components: {
            List
        },
        data () {
            return {
                url: '',
                queryInfo: {
                    timeBegin: '',
                    timeEnd: '',
@@ -104,6 +106,7 @@
            }
        },
        created () {
            this.url = getUrl('componentQuery')
            this.init()
            // this.getProtocolList()
        },
src/container/ledger/Manage-add-update.vue
@@ -268,9 +268,9 @@
</template>
<script>
  import { getUseDpts,accountCreate } from '@/api/Api'
  import { accountUpdate,accountCreate } from '@/api/Api'
  export default {
    props: ['addVisible','deviceType','departmentlist'],
    props: ['addVisible','deviceType','departmentlist','row','isselectlist','deviceStatus','financePro'],
    data() {
      return {
        visible: false,
@@ -306,28 +306,6 @@
        workshoplist: [], // 车间list
        oldworkshoplist: [],
        sectionlist: [], // 工段
        isselectlist: [
          {
            label: '是',
            value: '1'
          },
          {
            label: '否',
            value: '0'
          }
        ],
        // 设备状态
        deviceStatus: [
          { value: 'STOP', label: '关机' },
          { value: 'RUN', label: '运行' },
          { value: 'IDLE', label: '空闲' },
          { value: 'ALARM', label: '报警' }
        ],
        // 账务属性
        financePro: [
          { value: '帐内', label: '帐内' },
          { value: '帐外', label: '帐外' }
        ],
        userNamelist: [], // 用户list
        imageUrl: '', // 图片
        fileList: []// 文档上传list
@@ -342,6 +320,9 @@
        },
        immediate: true
      }
    },
    created () {
      this.init(this.row)
    },
    methods: {
      init(row) {
@@ -376,108 +357,15 @@
          this.dataForm.remark = row.remark
          this.dataForm.managType = row.managType
          this.dataForm.classes = row.classes
        } else { this.dataForm.id = 0 }
        this.visible = true
        this.getMachineList()
        this.queryuserlist()
        this.queryworkshoplist()
        } else { this.dataForm.id = '' }
      },
      /* 查询使用部门*/
      cancel  () {
        this.$emit('close')
      },
      // -----------------
      // 获取机床lists
      getMachineList() {
        // getMachineList(this.currentPage, this.keyWord).then(res => {
        //   this.machineNamelist = []
        //   if (res.list.length > 0) {
        //     res.list.map(item => {
        //       this.machineNamelist.push({
        //         value: item.name,
        //         label: item.name
        //       })
        //     })
        //   }
        // })
      },
      /* 获取用户list*/
      queryuserlist() {
        // queryuserlist().then(res => {
        //   this.userNamelist = []
        //   if (res.list.length > 0) {
        //     res.list.map(item => {
        //       this.userNamelist.push({
        //         value: item.name,
        //         label: item.name
        //       })
        //     })
        //   }
        // })
      },
      /* 获取车间名list*/
      queryworkshoplist() {
        // queryworkshoplist().then(res => {
        //   this.workshoplist = []
        //   if (res.workshopList.length > 0) {
        //     this.oldworkshoplist = res.workshopList
        //     res.workshopList.map(item => {
        //       this.workshoplist.push({
        //         value: item.name,
        //         label: item.name
        //       })
        //     })
        //   }
        // })
      },
      /* 车间名改变 获取工段*/
      workshopchange() {
        var cjname = this.dataForm.workshop
        this.sectionlist = []
        this.oldworkshoplist.map(item => {
          if (item.name === cjname) {
            item.sectionList.map(items => {
              this.sectionlist.push({
                value: items.name,
                label: items.name
              })
            })
          }
        })
      },
      /* 图片*/
      handleAvatarSuccess(res, file) {
        this.imageUrl = URL.createObjectURL(file.raw)
      },
      beforeAvatarUpload(file) {
        const isJPG = file.type === 'image/jpeg'
        const isLt2M = file.size / 1024 / 1024 < 2
        if (!isJPG) {
          this.$message.error('上传头像图片只能是 JPG 格式!')
        }
        if (!isLt2M) {
          this.$message.error('上传头像图片大小不能超过 2MB!')
        }
        return isJPG && isLt2M
      },
      /* 文档 */
      handleRemove(file, fileList) {
        // console.log(file, fileList)
      },
      handlePreview(file) {
        // console.log(file)
      },
      handleExceed(files, fileList) {
        this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
      },
      beforeRemove(file, fileList) {
        return this.$confirm(`确定移除 ${file.name}?`)
      },
      /* 提交*/
      dataFormSubmit() {
        if (this.dataForm.id === 0) { // 新增
        if (this.dataForm.id === '') { // 新增
          accountCreate(this.dataForm).then(res => {
            this.$message({
              message: '新增成功',
@@ -490,7 +378,7 @@
            })
          })
        } else {
          accountCreate(this.dataForm).then(res => {
          accountUpdate(this.dataForm).then(res => {
            this.$message({
              message: '修改成功',
              type: 'success',
@@ -509,7 +397,7 @@
<style lang="scss">
  .el-form-item__content {
    .el-select {
    .el-select,.el-input {
      width: 100%;
    }
  }
src/container/ledger/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-06 17:40:19
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-10 21:43:14
 * @LastEditTime: 2024-01-13 11:09:50
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/ledger/index.vue
-->
<template>
@@ -14,121 +14,230 @@
                    <el-input class="item-value" v-model="queryInfo.uuid"></el-input>
                </div>
                <div class="item">
                    <span>设备规格</span>
                    <el-input class="item-value" v-model="queryInfo.specification"></el-input>
                </div>
                <div class="item">
                    <span>设备型号</span>
                    <el-input class="item-value" v-model="queryInfo.type"></el-input>
                </div>
                <div class="item">
                    <span>加工类型</span>
                    <el-select class="item-value" v-model="queryInfo.category" placeholder="---请选择---">
                        <el-option
                        v-for="item in deviceType"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                    <el-select class="item-value" v-model="queryInfo.category" placeholder="">
                        <el-option v-for="item in deviceType" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </div>
                <div class="item">
                    <span>账务属性</span>
                    <el-select class="item-value" v-model="queryInfo.accountingAttribute" placeholder="">
                        <el-option v-for="item in accountingAttribute" :key="item.value" :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </div>
                <div class="item">
                    <span>使用部门</span>
                    <el-select class="item-value" v-model="queryInfo.department">
                        <el-option
                        v-for="item in departmentlist"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                        <el-option v-for="item in departmentlist" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>
                </div>
                <div class="item">
                    <span>设备管理分类</span>
                    <el-select class="item-value" v-model="queryInfo.manageType">
                        <el-option value="A">A</el-option>
                        <el-option value="B">B</el-option>
                        <el-option value="C">C</el-option>
                    </el-select>
                </div>
                <div class="item">
                    <span>投产日期</span>
                    <el-date-picker class="item-value" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="queryInfo.productionDate" type="date" clearable placeholder="选择日期"></el-date-picker>
                </div>
                <div class="item">
                    <span>生产厂家</span>
                    <el-input class="item-value" v-model="queryInfo.manufacturer"></el-input>
                </div>
                <div class="item">
                    <div class="query btn" @click="query">查询</div>
                </div>
                <div class="item">
                    <div class="reset btn">重置</div>
                    <div class="reset btn"  @click="reset">重置</div>
                </div>
            </template>
            <template slot="table-tool">
                <el-button type="primary" size="mini" @click="add">添加设备台账</el-button>
            </template>
            <template slot="columns">
                <el-table-column
                    prop="uuid"
                    label="统一编号"
                    width="180">
                <!-- <el-table-column type="selection" align="center" width="55">
                </el-table-column> -->
                <el-table-column label="统一编号" align="center" prop="uuid">
                </el-table-column>
                <el-table-column
                    prop="specification"
                    label="设备规格"
                    width="180">
                <el-table-column label="设备名称" align="center" prop="machineName">
                </el-table-column>
                <el-table-column
                    prop="machineId"
                    label="设备型号">
                <el-table-column label="设备规格" align="center" prop="specification">
                </el-table-column>
                <el-table-column label="设备型号" align="center" prop="category">
                </el-table-column>
                <!-- <el-table-column
                label="设备管理分类"
                align="center"
                prop="managType">
            </el-table-column>
            <el-table-column
                label="班次"
                align="center"
                prop="classes">
            </el-table-column> -->
                <el-table-column label="使用部门" align="center" prop="department">
                </el-table-column>
                <el-table-column label="设备类型" align="center" prop="category">
                </el-table-column>
                <el-table-column label="设备状态" align="center" prop="state">
                    <template slot-scope="scope">
                        <span v-if="scope.row.state == 'STOP'">关机状态</span>
                        <span v-else-if="scope.row.state == 'RUN'">运行状态</span>
                        <span v-else-if="scope.row.state == 'IDLE'">空闲状态</span>
                        <span v-else-if="scope.row.state == 'ALARM'">报警状态</span>
                    </template>
                </el-table-column>
                <el-table-column label="账务属性" align="center" prop="accountingAttribute">
                </el-table-column>
                <el-table-column label="生产厂家" align="center" prop="manufacturer">
                </el-table-column>
                <el-table-column label="投产日期" align="center" prop="productionDate">
                </el-table-column>
                <el-table-column label="国别" align="center" prop="country">
                </el-table-column>
                <el-table-column width="110" align="center" label="设备原值(元)" prop="originalValue">
                </el-table-column>
                <el-table-column width="110" align="center" label="设备重量(kg)" prop="weight">
                </el-table-column>
                <el-table-column width="110" align="center" label="电气复杂系数" prop="elecCompFactor">
                </el-table-column>
                <el-table-column width="110" align="center" label="机械复杂系数" prop="mechCompFactor">
                </el-table-column>
                <el-table-column width="120" align="center" label="设备净现值(元)" prop="presentValue">
                </el-table-column>
                <el-table-column label="备注" align="center" prop="remark">
                </el-table-column>
                <el-table-column fixed="right" align="center" label="操作">
                    <template slot-scope="scope">
                        <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row)">编辑</el-button>
                    </template>
                </el-table-column>
            </template>
        </List>
        <manage-add-update :addVisible="addOrUpdateVisible" @close="close" @confirm="confirm" :deviceType="deviceType"
:departmentlist="departmentlist"></manage-add-update>
        <manage-add-update v-if="addOrUpdateVisible" :addVisible="addOrUpdateVisible" @close="close" @confirm="confirm"
            :deviceType="deviceType" :departmentlist="departmentlist" :isselectlist="isselectlist"
            :deviceStatus="deviceStatus" :financePro="financePro" :row="row"></manage-add-update>
    </div>
</template>
<script>
    import ManageAddUpdate from './Manage-add-update'
    import { getUseDpts } from '@/api/Api'
    import List from '../list/index.vue'
    export default {
        components: {
            List,
            ManageAddUpdate
        },
        data () {
            return {
                // 加工类型
                deviceType: [
                    { value: '立加', label: '立加' },
                    { value: '卧加', label: '卧加' },
                    { value: '立卧转换', label: '立卧转换' },
                    { value: '五轴', label: '五轴' },
                    { value: '数控车', label: '数控车' },
                    { value: '复合加工', label: '复合加工' },
                    { value: '数控磨', label: '数控磨' },
                    { value: '齿加工', label: '齿加工' },
                    { value: '电工加', label: '电工加' }
                ],
                departmentlist: [],
                queryInfo: {
                    no: ''
import ManageAddUpdate from './Manage-add-update'
import { getUseDpts } from '@/api/Api'
import List from '../list/index.vue'
export default {
    components: {
        List,
        ManageAddUpdate
    },
    data() {
        return {
            // 加工类型
            deviceType: [
                { value: '立加', label: '立加' },
                { value: '卧加', label: '卧加' },
                { value: '立卧转换', label: '立卧转换' },
                { value: '五轴', label: '五轴' },
                { value: '数控车', label: '数控车' },
                { value: '复合加工', label: '复合加工' },
                { value: '数控磨', label: '数控磨' },
                { value: '齿加工', label: '齿加工' },
                { value: '电工加', label: '电工加' }
            ],
            isselectlist: [
                {
                    label: '是',
                    value: '1'
                },
                options: [{}],
                addOrUpdateVisible: false
            }
        },
        mounted () {
            this.query()
            this.init()
        },
        methods: {
            init  () {
                // 查询使用部门
                getUseDpts().then(res => {
                    this.departmentlist = res.data.map(item => {
                        return {
                {
                    label: '否',
                    value: '0'
                }
            ],
            // 设备状态
            deviceStatus: [
                { value: 'STOP', label: '关机' },
                { value: 'RUN', label: '运行' },
                { value: 'IDLE', label: '空闲' },
                { value: 'ALARM', label: '报警' }
            ],
            // 账务属性
            financePro: [
                { value: '帐内', label: '帐内' },
                { value: '帐外', label: '帐外' }
            ],
            departmentlist: [],
            queryInfo: {
                uuid: '',
                specification: '',
                type: '',
                category: '',
                accountingAttribute: '',
                department: '',
                manageType: '',
                productionDate: '',
                manufacturer: '',
            },
            options: [{}],
            row: {},
            addOrUpdateVisible: false
        }
    },
    mounted() {
        this.query()
        this.init()
    },
    methods: {
        init() {
            // 查询使用部门
            getUseDpts().then(res => {
                this.departmentlist = res.data.map(item => {
                    return {
                        value: item.id,
                        label: item.name
                        }
                    })
                    }
                })
            },
            query () {
                this.$refs.list.pageQuery(this.queryInfo)
            },
            add () {
                this.addOrUpdateVisible = true
            },
            close () {
                this.addOrUpdateVisible = false
            },
            confirm () {
                this.query()
                this.close()
            }
            })
        },
    }
        query() {
            this.$refs.list.pageQuery(this.queryInfo)
        },
        reset () {
            Object.keys(this.queryInfo).forEach(key => {
                this.queryInfo[key] = ''
            })
        },
        add() {
            this.row = {}
            this.addOrUpdateVisible = true
        },
        close() {
            this.addOrUpdateVisible = false
        },
        confirm() {
            this.query()
            this.close()
        },
        addOrUpdateHandle(row) {
            this.row = row
            this.addOrUpdateVisible = true
        }
    },
}
</script>
<style lang="scss">
.maintenance {
@@ -142,48 +251,55 @@
}
</style>
<style lang="scss" scoped>
    .maintenance {
        width: 100%;
        height: 100%;
        overflow: hidden;
        color: #FFF;
.maintenance {
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: #FFF;
    display: flex;
    flex-direction: column;
    .nav {
        padding: 10px 30px;
    }
    .item {
        margin-top: 20px;
        margin-left: 50px;
        display: flex;
        flex-direction: column;
        .nav {
            padding: 10px 30px;
        align-items: center;
        span {
            width: 120px;
            font-size: 16px;
            font-family: PingFangSC, PingFang SC;
            color: #C6DCE0;
            text-align: right;
            padding-right: 20px;
        }
        .item {
            margin-top: 20px;
            margin-left: 50px;
            display: flex;
            align-items: center;
            span {
                width: 120px;
                font-size: 16px;
                font-family: PingFangSC, PingFang SC;
                color: #C6DCE0;
                text-align: right;
                padding-right: 20px;
            }
            .item-value {
                width: 200px;
                border: 1px solid #435F9E;
            }
            .btn {
                line-height: 1.5;
                width: 100px;
                text-align: center;
                font-size: 16px;
                cursor: pointer;
            }
            .reset {
                background: #AAB6BA;
                color: #FFF;
            }
            .query {
                background: #5DD1FC;
                color: #FFF;
            }
        .item-value {
            width: 200px;
            border: 1px solid #435F9E;
        }
        .btn {
            line-height: 1.5;
            width: 100px;
            text-align: center;
            font-size: 16px;
            cursor: pointer;
        }
        .reset {
            background: #AAB6BA;
            color: #FFF;
        }
        .query {
            background: #5DD1FC;
            color: #FFF;
        }
    }
}
</style>
src/container/list/index.vue
@@ -1,7 +1,7 @@
<!--
 * @Date: 2024-01-06 17:40:19
 * @LastEditors: Sneed
 * @LastEditTime: 2024-01-10 21:46:29
 * @LastEditTime: 2024-01-13 11:07:32
 * @FilePath: /belleson-frontend/Users/mache/Documents/demo/mdc/src/container/list/index.vue
-->
<template>
@@ -106,7 +106,7 @@
            }
            .el-table td, .el-table--striped .el-table__body tr.el-table__row--striped td,.el-table--enable-row-hover .el-table__body tr:hover>td{
                color: #E6E5E5;
                border-bottom: none;
                // border-bottom: none;
                background: transparent;
                background-color: transparent;
                // padding: 0;