|
@@ -1,422 +1,423 @@
|
|
-<template>
|
|
|
|
- <div class="app-container">
|
|
|
|
- <!-- 搜索模块 -->
|
|
|
|
- <div class="filter-container">
|
|
|
|
- <span>
|
|
|
|
- <span>{{$t("machining.table.qualityMgr.bomName")}}:</span>
|
|
|
|
- <el-input v-model="queryParams.model.bomName" :placeholder='$t("common.pleaseEnter")' style="width: 180px;" size="medium"/>
|
|
|
|
- </span>
|
|
|
|
- <!-- -->
|
|
|
|
- <span style="margin-left: 15px;">
|
|
|
|
- <span>{{$t("machining.table.qualityMgr.orderName")}}:</span>
|
|
|
|
- <el-input v-model="queryParams.model.orderName" :placeholder='$t("common.pleaseEnter")' style="width: 180px;" size="medium"/>
|
|
|
|
- </span>
|
|
|
|
-<!-- <span style="margin-left: 15px;">-->
|
|
|
|
-<!-- <span>{{$t("machining.table.qualityMgr.produceStatus")}}:</span>-->
|
|
|
|
-<!-- <el-select v-model="queryParams.model.produceStatus" :placeholder='$t("common.pleaseSelect")' size="medium" style="width: 180px;">-->
|
|
|
|
-<!-- <el-option-->
|
|
|
|
-<!-- v-for="item in audioStatus"-->
|
|
|
|
-<!-- :key="item.value"-->
|
|
|
|
-<!-- :label="item.label"-->
|
|
|
|
-<!-- :value="item.value">-->
|
|
|
|
-<!-- </el-option>-->
|
|
|
|
-<!-- </el-select>-->
|
|
|
|
-<!-- </span>-->
|
|
|
|
- </div>
|
|
|
|
- <div class="filter-container">
|
|
|
|
-<!-- <span>-->
|
|
|
|
-<!-- <span>{{$t("machining.common.jiaohuTime")}}:</span>-->
|
|
|
|
-<!-- <el-date-picker-->
|
|
|
|
-<!-- v-model="queryParams.timeRange"-->
|
|
|
|
-<!-- type="daterange"-->
|
|
|
|
-<!-- :picker-options="pickerOptions"-->
|
|
|
|
-<!-- :range-separator='$t("common.separator")'-->
|
|
|
|
-<!-- :start-placeholder='$t("common.startTime")'-->
|
|
|
|
-<!-- :end-placeholder='$t("common.endTime")'-->
|
|
|
|
-<!-- format="yyyy-MM-dd"-->
|
|
|
|
-<!-- value-format="yyyy-MM-dd"-->
|
|
|
|
-<!-- align="right"-->
|
|
|
|
-<!-- style="width: 350px;"-->
|
|
|
|
-<!-- >-->
|
|
|
|
-<!-- </el-date-picker>-->
|
|
|
|
-<!-- </span>-->
|
|
|
|
- <span style="margin-left: 15px;">
|
|
|
|
- <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
|
|
|
|
- {{ $t("table.search") }}
|
|
|
|
- </el-button>
|
|
|
|
- <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
|
|
|
|
- {{ $t("table.reset") }}
|
|
|
|
- </el-button>
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <!-- 功能按钮 -->
|
|
|
|
- <el-row class="filter-container">
|
|
|
|
- <el-col>
|
|
|
|
- <!--<el-button type="success" icon="el-icon-plus" size="medium" @click="add">{{ $t("machining.common.marking") }}</el-button>-->
|
|
|
|
- <el-button v-has-permission="['quality:view']" type="primary" icon="el-icon-view" size="medium" @click="viewOne">
|
|
|
|
- {{ $t("machining.common.viewOrder") }}
|
|
|
|
- </el-button>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <!-- 列表数据 -->
|
|
|
|
- <el-table
|
|
|
|
- :key="tableKey"
|
|
|
|
- ref="table"
|
|
|
|
- v-loading="loading"
|
|
|
|
- :data="tableData.records"
|
|
|
|
- border
|
|
|
|
- fit
|
|
|
|
- row-key="id"
|
|
|
|
- style="width: 100%;"
|
|
|
|
- @selection-change="onSelectChange"
|
|
|
|
- @cell-click="cellClick"
|
|
|
|
- >
|
|
|
|
- <!-- 序号 -->
|
|
|
|
- <el-table-column :label='$t("common.serialNo")' width="55px" align="center">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <div>
|
|
|
|
- {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <!-- 序号 -->
|
|
|
|
- <el-table-column align="center" type="selection" width="50" :reserve-selection="true" />
|
|
|
|
- <!-- 零件简称 -->
|
|
|
|
- <el-table-column prop="bomName" :label='$t("machining.table.qualityMgr.bomName")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
- <!-- 订单编号-->
|
|
|
|
- <el-table-column prop="orderName" :label='$t("machining.table.qualityMgr.orderName")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
- <!-- 来源
|
|
|
|
- <el-table-column prop="uniqueCode" :label='$t("machining.table.qualityMgr.uniqueCode")' width="100" :show-overflow-tooltip="true"></el-table-column>-->
|
|
|
|
- <!-- 生产状态 -->
|
|
|
|
- <el-table-column prop="produceStatus" :label='$t("machining.table.qualityMgr.produceStatus")' :show-overflow-tooltip="true">
|
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
- <el-tag v-if="row.produceStatus == '0'" type="warning">{{$t("runCenter.common.produceStatus.panse")}}</el-tag>
|
|
|
|
- <el-tag v-if="row.produceStatus == '1'" type="info">{{$t("runCenter.common.produceStatus.noStart")}}</el-tag>
|
|
|
|
- <el-tag v-if="row.produceStatus == '2'">{{$t("runCenter.common.produceStatus.run")}}</el-tag>
|
|
|
|
- <el-tag v-if="row.produceStatus == '3'" type="success">{{$t("runCenter.common.produceStatus.finished")}}</el-tag>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <!-- 产品数量 -->
|
|
|
|
- <el-table-column prop="bomNum" :label='$t("machining.table.qualityMgr.bomNum")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
-
|
|
|
|
- <el-table-column prop="completeNum" :label='$t("machining.table.qualityMgr.completeNum")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
- <el-table-column prop="unqualifiedCount" :label='$t("machining.table.qualityMgr.unqualifiedCount")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
- <el-table-column prop="qualifiedCount" :label='$t("machining.table.qualityMgr.qualifiedCount")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
- <el-table-column prop="addOrderCount" :label='$t("machining.table.qualityMgr.addOrderCount")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
- <!-- 下单日期 -->
|
|
|
|
- <el-table-column prop="orderDeliveryTime" :label='$t("machining.table.qualityMgr.orderDeliveryTime")' width="150" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
- <!-- 操作 -->
|
|
|
|
- <el-table-column
|
|
|
|
- :label="$t('table.operation')"
|
|
|
|
- fixed="right"
|
|
|
|
- align="center"
|
|
|
|
- column-key="operation"
|
|
|
|
- width="80px"
|
|
|
|
- >
|
|
|
|
- <template slot-scope="{ row }">
|
|
|
|
- <el-tooltip class="item" :content="$t('machining.common.viewOrder')" effect="dark" placement="top-start">
|
|
|
|
- <i
|
|
|
|
- class="el-icon-view table-operation"
|
|
|
|
- style="color: #87d068;"
|
|
|
|
- @click="view(row)"
|
|
|
|
- />
|
|
|
|
- </el-tooltip>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- <pagination
|
|
|
|
- v-show="tableData.total > 0"
|
|
|
|
- :limit.sync="queryParams.size"
|
|
|
|
- :page.sync="queryParams.current"
|
|
|
|
- :total="Number(tableData.total)"
|
|
|
|
- @pagination="fetch"
|
|
|
|
- />
|
|
|
|
- <tenant-edit
|
|
|
|
- ref="edit"
|
|
|
|
- :dialog-visible="dialog.isVisible"
|
|
|
|
- :title="dialog.title"
|
|
|
|
- @close="editClose"
|
|
|
|
- @success="editSuccess"
|
|
|
|
- />
|
|
|
|
- <tenant-view
|
|
|
|
- ref="view"
|
|
|
|
- :dialog-visible="tenantViewVisible"
|
|
|
|
- @close="viewClose"
|
|
|
|
- />
|
|
|
|
-
|
|
|
|
- <el-dialog
|
|
|
|
- v-el-drag-dialog
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
- :close-on-press-escape="true"
|
|
|
|
- title="预览"
|
|
|
|
- width="80%"
|
|
|
|
- top="50px"
|
|
|
|
- :visible.sync="preview.isVisible"
|
|
|
|
- >
|
|
|
|
- <el-scrollbar>
|
|
|
|
- <div v-html="preview.context" />
|
|
|
|
- </el-scrollbar>
|
|
|
|
- </el-dialog>
|
|
|
|
- </div>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
- // 【分页】组件
|
|
|
|
- import Pagination from "@/components/Pagination"
|
|
|
|
- // 【新增/修改】组件
|
|
|
|
- import TenantEdit from "./components/Edit"
|
|
|
|
- // 【查看】组件
|
|
|
|
- import TenantView from "./components/View"
|
|
|
|
- // 【不合格产品管理】-API
|
|
|
|
- import unqualifiedMgrApi from "@/api/machiningClient/qualityMgr"
|
|
|
|
- // 【弹出框】elementui组件
|
|
|
|
- import elDragDialog from '@/directive/el-drag-dialog'
|
|
|
|
- // 共通函数
|
|
|
|
- import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
|
|
|
|
-
|
|
|
|
- export default {
|
|
|
|
- name: "UnqualifiedMgr",
|
|
|
|
- directives: { elDragDialog },
|
|
|
|
- components: { Pagination, TenantEdit, TenantView },
|
|
|
|
- props: {
|
|
|
|
- },
|
|
|
|
- data () {
|
|
|
|
- return {
|
|
|
|
- audioStatus: [],
|
|
|
|
- dialog: {
|
|
|
|
- isVisible: false,
|
|
|
|
- title: ""
|
|
|
|
- },
|
|
|
|
- preview: {
|
|
|
|
- isVisible: false,
|
|
|
|
- context: ''
|
|
|
|
- },
|
|
|
|
- tenantViewVisible: false,
|
|
|
|
- tableKey: 0,
|
|
|
|
- queryParams: initQueryParams({}),
|
|
|
|
- selection: [],
|
|
|
|
- loading: false,
|
|
|
|
- tableData: {
|
|
|
|
- total: 0
|
|
|
|
- },
|
|
|
|
- dicts: {
|
|
|
|
- NATION: {}
|
|
|
|
- },
|
|
|
|
- enums: {
|
|
|
|
- TenantTypeEnum: {},
|
|
|
|
- TenantStatusEnum: {}
|
|
|
|
- },
|
|
|
|
- pickerOptions: {
|
|
|
|
- shortcuts: [{
|
|
|
|
- text: '最近一周',
|
|
|
|
- onClick(picker) {
|
|
|
|
- const end = new Date();
|
|
|
|
- const start = new Date();
|
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
|
- }
|
|
|
|
- }, {
|
|
|
|
- text: '最近一个月',
|
|
|
|
- onClick(picker) {
|
|
|
|
- const end = new Date();
|
|
|
|
- const start = new Date();
|
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
|
- }
|
|
|
|
- }, {
|
|
|
|
- text: '最近三个月',
|
|
|
|
- onClick(picker) {
|
|
|
|
- const end = new Date();
|
|
|
|
- const start = new Date();
|
|
|
|
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
|
- picker.$emit('pick', [start, end]);
|
|
|
|
- }
|
|
|
|
- }]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
|
- created() {
|
|
|
|
- // 调用常量-审核状态
|
|
|
|
- this.audioStatus = this.$constWKS.SHOWHIDE
|
|
|
|
- // 加载【字典】
|
|
|
|
- initDicts(['NATION'], this.dicts);
|
|
|
|
- // 加载列表数据
|
|
|
|
- this.fetch()
|
|
|
|
- },
|
|
|
|
- computed: {
|
|
|
|
- currentUser () {
|
|
|
|
- return this.$store.state.account.user
|
|
|
|
- },
|
|
|
|
- nationList() {
|
|
|
|
- return convertEnum(this.dicts.NATION)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- mounted () {
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- viewClose () {
|
|
|
|
- this.tenantViewVisible = false
|
|
|
|
- },
|
|
|
|
- editClose () {
|
|
|
|
- this.dialog.isVisible = false
|
|
|
|
- },
|
|
|
|
- editSuccess () {
|
|
|
|
- this.search()
|
|
|
|
- },
|
|
|
|
- onSelectChange (selection) {
|
|
|
|
- this.selection = selection
|
|
|
|
- },
|
|
|
|
- search () {
|
|
|
|
- this.fetch({
|
|
|
|
- ...this.queryParams
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- reset () {
|
|
|
|
- this.queryParams = initQueryParams({})
|
|
|
|
- this.$refs.table.clearSort()
|
|
|
|
- this.$refs.table.clearFilter()
|
|
|
|
- this.search()
|
|
|
|
- },
|
|
|
|
- add () {
|
|
|
|
- this.$refs.edit.type = "add"
|
|
|
|
- this.dialog.title = this.$t("machining.common.marking")
|
|
|
|
- this.dialog.isVisible = true
|
|
|
|
- },
|
|
|
|
- singleDelete (row) {
|
|
|
|
- this.$refs.table.clearSelection()
|
|
|
|
- this.$refs.table.toggleRowSelection(row, true)
|
|
|
|
- this.batchDelete()
|
|
|
|
- },
|
|
|
|
- batchDelete () {
|
|
|
|
- if (!this.selection.length) {
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t("tips.noDataSelected"),
|
|
|
|
- type: "warning"
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this.$confirm(this.$t("lineSide.tips.wareTips"), this.$t("common.tips"), {
|
|
|
|
- distinguishCancelAndClose: true,
|
|
|
|
- confirmButtonText: this.$t("common.confirm"),
|
|
|
|
- cancelButtonText: this.$t("common.cancel"),
|
|
|
|
- type: "warning"
|
|
|
|
- }).then(() => {
|
|
|
|
- const ids = []
|
|
|
|
- this.selection.forEach(item => {
|
|
|
|
- ids.push(item.id)
|
|
|
|
- })
|
|
|
|
- this.delete(ids)
|
|
|
|
- }).catch(() => {})
|
|
|
|
- },
|
|
|
|
- clearSelections () {
|
|
|
|
- this.$refs.table.clearSelection()
|
|
|
|
- },
|
|
|
|
- delete (ids) {
|
|
|
|
- unqualifiedMgrApi.remove({ ids: ids }).then(response => {
|
|
|
|
- const res = response.data
|
|
|
|
- if (res.isSuccess) {
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t("tips.deleteSuccess"),
|
|
|
|
- type: "success"
|
|
|
|
- })
|
|
|
|
- this.search()
|
|
|
|
- // 清理已经删除的数据
|
|
|
|
- this.$refs.table.clearSelection()
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- // 【查看补单】按钮-事件
|
|
|
|
- viewOne () {
|
|
|
|
- if (!this.selection.length) {
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t("tips.noDataSelected"),
|
|
|
|
- type: "warning"
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (this.selection.length > 1) {
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t("tips.mustOne"),
|
|
|
|
- type: "warning"
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- this.view(this.selection[0]);
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- // 【查看补单-Row】按钮-事件
|
|
|
|
- view (row) {
|
|
|
|
- this.$refs.view.setTenant(row)
|
|
|
|
- this.tenantViewVisible = true
|
|
|
|
- },
|
|
|
|
- // 【修改】表头上Btn-事件
|
|
|
|
- editOne() {
|
|
|
|
- if (!this.selection.length) {
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t("tips.noDataSelected"),
|
|
|
|
- type: "warning"
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- if (this.selection.length > 1) {
|
|
|
|
- this.$message({
|
|
|
|
- message: this.$t("tips.mustOne"),
|
|
|
|
- type: "warning"
|
|
|
|
- })
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- this.edit(this.selection[0]);
|
|
|
|
- },
|
|
|
|
- edit (row) {
|
|
|
|
- this.$refs.edit.setTenant(row)
|
|
|
|
- this.$refs.edit.type = "edit"
|
|
|
|
- this.dialog.title = this.$t("machining.common.marking")
|
|
|
|
- this.dialog.isVisible = true
|
|
|
|
- },
|
|
|
|
- fetch (params = {}) {
|
|
|
|
- this.loading = true
|
|
|
|
- if (this.queryParams.timeRange) {
|
|
|
|
- this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
|
|
|
|
- this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this.queryParams.current = params.current ? params.current : this.queryParams.current
|
|
|
|
- this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
|
-
|
|
|
|
- //处于生产状态中的订单
|
|
|
|
- this.queryParams.model.produceStatus = '2'
|
|
|
|
- unqualifiedMgrApi.page(this.queryParams).then(response => {
|
|
|
|
- const res = response.data
|
|
|
|
- if (res.isSuccess) {
|
|
|
|
- this.tableData = res.data
|
|
|
|
- }
|
|
|
|
- // eslint-disable-next-line no-return-assign
|
|
|
|
- }).finally(() => this.loading = false)
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- cellClick (row, column) {
|
|
|
|
- if (column['columnKey'] === "operation") {
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- let flag = false
|
|
|
|
- this.selection.forEach((item) => {
|
|
|
|
- if (item.id === row.id) {
|
|
|
|
- flag = true
|
|
|
|
- this.$refs.table.toggleRowSelection(row)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- if (!flag) {
|
|
|
|
- this.$refs.table.toggleRowSelection(row, true)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-</script>
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
|
|
|
+<template>
|
|
|
|
+ <div class="app-container">
|
|
|
|
+ <!-- 搜索模块 -->
|
|
|
|
+ <div class="filter-container">
|
|
|
|
+ <span>
|
|
|
|
+ <span>{{$t("machining.table.qualityMgr.bomName")}}:</span>
|
|
|
|
+ <el-input v-model="queryParams.model.bomName" :placeholder='$t("common.pleaseEnter")' style="width: 180px;" size="medium"/>
|
|
|
|
+ </span>
|
|
|
|
+ <!-- -->
|
|
|
|
+ <span style="margin-left: 15px;">
|
|
|
|
+ <span>{{$t("machining.table.qualityMgr.orderName")}}:</span>
|
|
|
|
+ <el-input v-model="queryParams.model.orderName" :placeholder='$t("common.pleaseEnter")' style="width: 180px;" size="medium"/>
|
|
|
|
+ </span>
|
|
|
|
+<!-- <span style="margin-left: 15px;">-->
|
|
|
|
+<!-- <span>{{$t("machining.table.qualityMgr.produceStatus")}}:</span>-->
|
|
|
|
+<!-- <el-select v-model="queryParams.model.produceStatus" :placeholder='$t("common.pleaseSelect")' size="medium" style="width: 180px;">-->
|
|
|
|
+<!-- <el-option-->
|
|
|
|
+<!-- v-for="item in audioStatus"-->
|
|
|
|
+<!-- :key="item.value"-->
|
|
|
|
+<!-- :label="item.label"-->
|
|
|
|
+<!-- :value="item.value">-->
|
|
|
|
+<!-- </el-option>-->
|
|
|
|
+<!-- </el-select>-->
|
|
|
|
+<!-- </span>-->
|
|
|
|
+ </div>
|
|
|
|
+ <div class="filter-container">
|
|
|
|
+<!-- <span>-->
|
|
|
|
+<!-- <span>{{$t("machining.common.jiaohuTime")}}:</span>-->
|
|
|
|
+<!-- <el-date-picker-->
|
|
|
|
+<!-- v-model="queryParams.timeRange"-->
|
|
|
|
+<!-- type="daterange"-->
|
|
|
|
+<!-- :picker-options="pickerOptions"-->
|
|
|
|
+<!-- :range-separator='$t("common.separator")'-->
|
|
|
|
+<!-- :start-placeholder='$t("common.startTime")'-->
|
|
|
|
+<!-- :end-placeholder='$t("common.endTime")'-->
|
|
|
|
+<!-- format="yyyy-MM-dd"-->
|
|
|
|
+<!-- value-format="yyyy-MM-dd"-->
|
|
|
|
+<!-- align="right"-->
|
|
|
|
+<!-- style="width: 350px;"-->
|
|
|
|
+<!-- >-->
|
|
|
|
+<!-- </el-date-picker>-->
|
|
|
|
+<!-- </span>-->
|
|
|
|
+ <span style="margin-left: 15px;">
|
|
|
|
+ <el-button plain type="primary" icon="el-icon-search" size="medium" @click="search">
|
|
|
|
+ {{ $t("table.search") }}
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button plain type="warning" icon="el-icon-refresh" size="medium" @click="reset">
|
|
|
|
+ {{ $t("table.reset") }}
|
|
|
|
+ </el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- 功能按钮 -->
|
|
|
|
+ <el-row class="filter-container">
|
|
|
|
+ <el-col>
|
|
|
|
+ <!--<el-button type="success" icon="el-icon-plus" size="medium" @click="add">{{ $t("machining.common.marking") }}</el-button>-->
|
|
|
|
+ <el-button v-has-permission="['quality:view']" type="primary" icon="el-icon-view" size="medium" @click="viewOne">
|
|
|
|
+ {{ $t("machining.common.viewOrder") }}
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+
|
|
|
|
+ <!-- 列表数据 -->
|
|
|
|
+ <el-table
|
|
|
|
+ :key="tableKey"
|
|
|
|
+ ref="table"
|
|
|
|
+ v-loading="loading"
|
|
|
|
+ :data="tableData.records"
|
|
|
|
+ border
|
|
|
|
+ fit
|
|
|
|
+ row-key="id"
|
|
|
|
+ style="width: 100%;"
|
|
|
|
+ @selection-change="onSelectChange"
|
|
|
|
+ @cell-click="cellClick"
|
|
|
|
+ >
|
|
|
|
+ <!-- 序号 -->
|
|
|
|
+ <el-table-column :label='$t("common.serialNo")' width="55px" align="center">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div>
|
|
|
|
+ {{scope.$index+(queryParams.current - 1) * queryParams.size + 1}}
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <!-- 序号 -->
|
|
|
|
+ <el-table-column align="center" type="selection" width="50" :reserve-selection="true" />
|
|
|
|
+ <!-- 零件简称 -->
|
|
|
|
+ <el-table-column prop="bomName" :label='$t("machining.table.qualityMgr.bomName")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
+ <!-- 订单编号-->
|
|
|
|
+ <el-table-column prop="orderName" :label='$t("machining.table.qualityMgr.orderName")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
+ <!-- 来源
|
|
|
|
+ <el-table-column prop="uniqueCode" :label='$t("machining.table.qualityMgr.uniqueCode")' width="100" :show-overflow-tooltip="true"></el-table-column>-->
|
|
|
|
+ <!-- 生产状态 -->
|
|
|
|
+ <el-table-column prop="produceStatus" :label='$t("machining.table.qualityMgr.produceStatus")' :show-overflow-tooltip="true">
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
+ <el-tag v-if="row.produceStatus == '0'" type="warning">{{$t("runCenter.common.produceStatus.panse")}}</el-tag>
|
|
|
|
+ <el-tag v-if="row.produceStatus == '1'" type="info">{{$t("runCenter.common.produceStatus.noStart")}}</el-tag>
|
|
|
|
+ <el-tag v-if="row.produceStatus == '2'">{{$t("runCenter.common.produceStatus.run")}}</el-tag>
|
|
|
|
+ <el-tag v-if="row.produceStatus == '3'" type="success">{{$t("runCenter.common.produceStatus.panse")}}</el-tag>
|
|
|
|
+ <el-tag v-if="row.produceStatus == '4'" type="success">{{$t("runCenter.common.produceStatus.finished")}}</el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <!-- 产品数量 -->
|
|
|
|
+ <el-table-column prop="bomNum" :label='$t("machining.table.qualityMgr.bomNum")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
+
|
|
|
|
+ <el-table-column prop="completeNum" :label='$t("machining.table.qualityMgr.completeNum")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
+ <el-table-column prop="unqualifiedCount" :label='$t("machining.table.qualityMgr.unqualifiedCount")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
+ <el-table-column prop="qualifiedCount" :label='$t("machining.table.qualityMgr.qualifiedCount")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
+ <el-table-column prop="addOrderCount" :label='$t("machining.table.qualityMgr.addOrderCount")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
+ <!-- 下单日期 -->
|
|
|
|
+ <el-table-column prop="orderDeliveryTime" :label='$t("machining.table.qualityMgr.orderDeliveryTime")' width="150" :show-overflow-tooltip="true"></el-table-column>
|
|
|
|
+ <!-- 操作 -->
|
|
|
|
+ <el-table-column
|
|
|
|
+ :label="$t('table.operation')"
|
|
|
|
+ fixed="right"
|
|
|
|
+ align="center"
|
|
|
|
+ column-key="operation"
|
|
|
|
+ width="80px"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
+ <el-tooltip class="item" :content="$t('machining.common.viewOrder')" effect="dark" placement="top-start">
|
|
|
|
+ <i
|
|
|
|
+ class="el-icon-view table-operation"
|
|
|
|
+ style="color: #87d068;"
|
|
|
|
+ @click="view(row)"
|
|
|
|
+ />
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <pagination
|
|
|
|
+ v-show="tableData.total > 0"
|
|
|
|
+ :limit.sync="queryParams.size"
|
|
|
|
+ :page.sync="queryParams.current"
|
|
|
|
+ :total="Number(tableData.total)"
|
|
|
|
+ @pagination="fetch"
|
|
|
|
+ />
|
|
|
|
+ <tenant-edit
|
|
|
|
+ ref="edit"
|
|
|
|
+ :dialog-visible="dialog.isVisible"
|
|
|
|
+ :title="dialog.title"
|
|
|
|
+ @close="editClose"
|
|
|
|
+ @success="editSuccess"
|
|
|
|
+ />
|
|
|
|
+ <tenant-view
|
|
|
|
+ ref="view"
|
|
|
|
+ :dialog-visible="tenantViewVisible"
|
|
|
|
+ @close="viewClose"
|
|
|
|
+ />
|
|
|
|
+
|
|
|
|
+ <el-dialog
|
|
|
|
+ v-el-drag-dialog
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :close-on-press-escape="true"
|
|
|
|
+ title="预览"
|
|
|
|
+ width="80%"
|
|
|
|
+ top="50px"
|
|
|
|
+ :visible.sync="preview.isVisible"
|
|
|
|
+ >
|
|
|
|
+ <el-scrollbar>
|
|
|
|
+ <div v-html="preview.context" />
|
|
|
|
+ </el-scrollbar>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ // 【分页】组件
|
|
|
|
+ import Pagination from "@/components/Pagination"
|
|
|
|
+ // 【新增/修改】组件
|
|
|
|
+ import TenantEdit from "./components/Edit"
|
|
|
|
+ // 【查看】组件
|
|
|
|
+ import TenantView from "./components/View"
|
|
|
|
+ // 【不合格产品管理】-API
|
|
|
|
+ import unqualifiedMgrApi from "@/api/machiningClient/qualityMgr"
|
|
|
|
+ // 【弹出框】elementui组件
|
|
|
|
+ import elDragDialog from '@/directive/el-drag-dialog'
|
|
|
|
+ // 共通函数
|
|
|
|
+ import { downloadFile, initEnums, initDicts, initQueryParams } from '@/utils/commons'
|
|
|
|
+
|
|
|
|
+ export default {
|
|
|
|
+ name: "UnqualifiedMgr",
|
|
|
|
+ directives: { elDragDialog },
|
|
|
|
+ components: { Pagination, TenantEdit, TenantView },
|
|
|
|
+ props: {
|
|
|
|
+ },
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ audioStatus: [],
|
|
|
|
+ dialog: {
|
|
|
|
+ isVisible: false,
|
|
|
|
+ title: ""
|
|
|
|
+ },
|
|
|
|
+ preview: {
|
|
|
|
+ isVisible: false,
|
|
|
|
+ context: ''
|
|
|
|
+ },
|
|
|
|
+ tenantViewVisible: false,
|
|
|
|
+ tableKey: 0,
|
|
|
|
+ queryParams: initQueryParams({}),
|
|
|
|
+ selection: [],
|
|
|
|
+ loading: false,
|
|
|
|
+ tableData: {
|
|
|
|
+ total: 0
|
|
|
|
+ },
|
|
|
|
+ dicts: {
|
|
|
|
+ NATION: {}
|
|
|
|
+ },
|
|
|
|
+ enums: {
|
|
|
|
+ TenantTypeEnum: {},
|
|
|
|
+ TenantStatusEnum: {}
|
|
|
|
+ },
|
|
|
|
+ pickerOptions: {
|
|
|
|
+ shortcuts: [{
|
|
|
|
+ text: '最近一周',
|
|
|
|
+ onClick(picker) {
|
|
|
|
+ const end = new Date();
|
|
|
|
+ const start = new Date();
|
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
|
+ }
|
|
|
|
+ }, {
|
|
|
|
+ text: '最近一个月',
|
|
|
|
+ onClick(picker) {
|
|
|
|
+ const end = new Date();
|
|
|
|
+ const start = new Date();
|
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
|
+ }
|
|
|
|
+ }, {
|
|
|
|
+ text: '最近三个月',
|
|
|
|
+ onClick(picker) {
|
|
|
|
+ const end = new Date();
|
|
|
|
+ const start = new Date();
|
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
|
+ }
|
|
|
|
+ }]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
|
+ created() {
|
|
|
|
+ // 调用常量-审核状态
|
|
|
|
+ this.audioStatus = this.$constWKS.SHOWHIDE
|
|
|
|
+ // 加载【字典】
|
|
|
|
+ initDicts(['NATION'], this.dicts);
|
|
|
|
+ // 加载列表数据
|
|
|
|
+ this.fetch()
|
|
|
|
+ },
|
|
|
|
+ computed: {
|
|
|
|
+ currentUser () {
|
|
|
|
+ return this.$store.state.account.user
|
|
|
|
+ },
|
|
|
|
+ nationList() {
|
|
|
|
+ return convertEnum(this.dicts.NATION)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted () {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ viewClose () {
|
|
|
|
+ this.tenantViewVisible = false
|
|
|
|
+ },
|
|
|
|
+ editClose () {
|
|
|
|
+ this.dialog.isVisible = false
|
|
|
|
+ },
|
|
|
|
+ editSuccess () {
|
|
|
|
+ this.search()
|
|
|
|
+ },
|
|
|
|
+ onSelectChange (selection) {
|
|
|
|
+ this.selection = selection
|
|
|
|
+ },
|
|
|
|
+ search () {
|
|
|
|
+ this.fetch({
|
|
|
|
+ ...this.queryParams
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ reset () {
|
|
|
|
+ this.queryParams = initQueryParams({})
|
|
|
|
+ this.$refs.table.clearSort()
|
|
|
|
+ this.$refs.table.clearFilter()
|
|
|
|
+ this.search()
|
|
|
|
+ },
|
|
|
|
+ add () {
|
|
|
|
+ this.$refs.edit.type = "add"
|
|
|
|
+ this.dialog.title = this.$t("machining.common.marking")
|
|
|
|
+ this.dialog.isVisible = true
|
|
|
|
+ },
|
|
|
|
+ singleDelete (row) {
|
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
|
+ this.$refs.table.toggleRowSelection(row, true)
|
|
|
|
+ this.batchDelete()
|
|
|
|
+ },
|
|
|
|
+ batchDelete () {
|
|
|
|
+ if (!this.selection.length) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
|
+ type: "warning"
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.$confirm(this.$t("lineSide.tips.wareTips"), this.$t("common.tips"), {
|
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
|
+ confirmButtonText: this.$t("common.confirm"),
|
|
|
|
+ cancelButtonText: this.$t("common.cancel"),
|
|
|
|
+ type: "warning"
|
|
|
|
+ }).then(() => {
|
|
|
|
+ const ids = []
|
|
|
|
+ this.selection.forEach(item => {
|
|
|
|
+ ids.push(item.id)
|
|
|
|
+ })
|
|
|
|
+ this.delete(ids)
|
|
|
|
+ }).catch(() => {})
|
|
|
|
+ },
|
|
|
|
+ clearSelections () {
|
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
|
+ },
|
|
|
|
+ delete (ids) {
|
|
|
|
+ unqualifiedMgrApi.remove({ ids: ids }).then(response => {
|
|
|
|
+ const res = response.data
|
|
|
|
+ if (res.isSuccess) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: this.$t("tips.deleteSuccess"),
|
|
|
|
+ type: "success"
|
|
|
|
+ })
|
|
|
|
+ this.search()
|
|
|
|
+ // 清理已经删除的数据
|
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 【查看补单】按钮-事件
|
|
|
|
+ viewOne () {
|
|
|
|
+ if (!this.selection.length) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
|
+ type: "warning"
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (this.selection.length > 1) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: this.$t("tips.mustOne"),
|
|
|
|
+ type: "warning"
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.view(this.selection[0]);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 【查看补单-Row】按钮-事件
|
|
|
|
+ view (row) {
|
|
|
|
+ this.$refs.view.setTenant(row)
|
|
|
|
+ this.tenantViewVisible = true
|
|
|
|
+ },
|
|
|
|
+ // 【修改】表头上Btn-事件
|
|
|
|
+ editOne() {
|
|
|
|
+ if (!this.selection.length) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
|
+ type: "warning"
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if (this.selection.length > 1) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: this.$t("tips.mustOne"),
|
|
|
|
+ type: "warning"
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.edit(this.selection[0]);
|
|
|
|
+ },
|
|
|
|
+ edit (row) {
|
|
|
|
+ this.$refs.edit.setTenant(row)
|
|
|
|
+ this.$refs.edit.type = "edit"
|
|
|
|
+ this.dialog.title = this.$t("machining.common.marking")
|
|
|
|
+ this.dialog.isVisible = true
|
|
|
|
+ },
|
|
|
|
+ fetch (params = {}) {
|
|
|
|
+ this.loading = true
|
|
|
|
+ if (this.queryParams.timeRange) {
|
|
|
|
+ this.queryParams.map.createTime_st = this.queryParams.timeRange[0]
|
|
|
|
+ this.queryParams.map.createTime_ed = this.queryParams.timeRange[1]
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.queryParams.current = params.current ? params.current : this.queryParams.current
|
|
|
|
+ this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
|
+
|
|
|
|
+ //处于生产状态中的订单
|
|
|
|
+ this.queryParams.model.produceStatus = '2,4'
|
|
|
|
+ unqualifiedMgrApi.page(this.queryParams).then(response => {
|
|
|
|
+ const res = response.data
|
|
|
|
+ if (res.isSuccess) {
|
|
|
|
+ this.tableData = res.data
|
|
|
|
+ }
|
|
|
|
+ // eslint-disable-next-line no-return-assign
|
|
|
|
+ }).finally(() => this.loading = false)
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ cellClick (row, column) {
|
|
|
|
+ if (column['columnKey'] === "operation") {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ let flag = false
|
|
|
|
+ this.selection.forEach((item) => {
|
|
|
|
+ if (item.id === row.id) {
|
|
|
|
+ flag = true
|
|
|
|
+ this.$refs.table.toggleRowSelection(row)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ if (!flag) {
|
|
|
|
+ this.$refs.table.toggleRowSelection(row, true)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+<style lang="scss" scoped></style>
|