|
|
@@ -0,0 +1,658 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <!-- 搜索模块 -->
|
|
|
+ <div class="filter-container">
|
|
|
+ <!-- 订单名称 -->
|
|
|
+ <span style="margin-left: 15px;">
|
|
|
+ <span>{{$t("runCenter.searchForm.orderName")}}:</span>
|
|
|
+ <el-input v-model="queryParams.model.orderName" :placeholder='$t("common.pleaseEnter")' style="width: 120px;" size="medium"/>
|
|
|
+ </span>
|
|
|
+ <span style="margin-left: 15px;">
|
|
|
+ <span>{{$t("runCenter.searchForm.deliveryTime")}}:</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">
|
|
|
+ </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="primary" icon="el-icon-plus" size="medium" v-has-permission="['order:add']" @click="add">{{ $t("common.add") }}</el-button>
|
|
|
+ <el-button type="success" icon="el-icon-edit" size="medium" v-has-permission="['order:update']" @click="editOne">
|
|
|
+ {{ $t("common.edit") }}
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" icon="el-icon-delete" size="medium" v-has-permission="['order:delete']" @click="orderDelete">
|
|
|
+ {{ $t("table.delete") }}
|
|
|
+ </el-button>
|
|
|
+ <!--<el-button type="primary" icon="el-icon-thumb" size="medium" v-has-permission="['order:pushaudit']" @click="audioStatu('1')">{{$t("common.audio.addAudio")}}</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="55px" :reserve-selection="true" />
|
|
|
+ <!-- 订单编号
|
|
|
+ <el-table-column prop="orderNo" :label='$t("runCenter.table.oder.orderNo")' :show-overflow-tooltip="true"></el-table-column>-->
|
|
|
+ <!-- 订单名称 -->
|
|
|
+ <el-table-column prop="orderName" :label='$t("runCenter.table.oder.orderName")' :show-overflow-tooltip="true"></el-table-column>
|
|
|
+ <!-- 简称 -->
|
|
|
+ <!--<el-table-column prop="custDesc" :label='$t("runCenter.table.oder.custDesc")' :show-overflow-tooltip="true"></el-table-column>-->
|
|
|
+ <!-- 来源 -->
|
|
|
+ <el-table-column prop="source" :label='$t("runCenter.table.oder.source")' :show-overflow-tooltip="true" style="width: 9%;">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag v-if="row.source == '1'">{{$t("runCenter.common.source.self")}}</el-tag>
|
|
|
+ <el-tag v-if="row.source == '2'" type="success">{{$t("runCenter.common.source.out")}}</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 交货日期 -->
|
|
|
+ <el-table-column prop="deliveryTime" :label='$t("runCenter.table.oder.deliveryTime")' :show-overflow-tooltip="true" style="width: 12%;"></el-table-column>
|
|
|
+ <!-- 启用状态 -->
|
|
|
+ <el-table-column prop="status" :label='$t("runCenter.table.oder.status")' align="center" style="width: 9%;">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tag :type="row.status=='1' ? 'success' : 'danger'">
|
|
|
+ {{ row.status=='1' ? $t("common.status.valid") : $t("common.frozen") }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- 下单日期 -->
|
|
|
+ <el-table-column prop="orderTime" :label='$t("runCenter.table.oder.orderTime")' style="width: 12%;"></el-table-column>
|
|
|
+ <!-- 创建时间 -->
|
|
|
+ <el-table-column prop="createTime" :label='$t("runCenter.table.oder.createTime")' style="width: 12%;"></el-table-column>
|
|
|
+ <!-- 操作 -->
|
|
|
+ <el-table-column
|
|
|
+ :label="$t('table.operation')"
|
|
|
+ fixed="right"
|
|
|
+ align="center"
|
|
|
+ column-key="operation"
|
|
|
+ style="width: 8%;"
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-tooltip class="item" :content='$t("runCenter.buttons.viewOrder")' effect="dark" placement="top-start">
|
|
|
+ <i
|
|
|
+ class="el-icon-view table-operation"
|
|
|
+ style="color: #87d068;"
|
|
|
+ @click="view(row)"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip class="item" :content='$t("common.edit")' effect="dark" placement="top-start">
|
|
|
+ <i
|
|
|
+ class="el-icon-edit table-operation"
|
|
|
+ style="color: #2db7f5;"
|
|
|
+ @click="edit(row)"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip v-if="row.produceStatus == '1' || row.produceStatus == '2'" class="item" content='暂停' effect="dark" placement="top-start">
|
|
|
+ <i
|
|
|
+ class="el-icon-video-pause table-operation"
|
|
|
+ style="color: #2db7f5;"
|
|
|
+ @click="orderOperateBtn(row,'stop')"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
+ <!-- 继续生产-->
|
|
|
+ <el-tooltip v-if="row.produceStatus == '3'" class="item" content='继续生产' effect="dark" placement="top-start">
|
|
|
+ <i
|
|
|
+ class="el-icon-video-play table-operation"
|
|
|
+ style="color: #2db7f5;"
|
|
|
+ @click="orderOperateBtn(row,'start')"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ class="item"
|
|
|
+ :content="$t('resource.buttons.setting')"
|
|
|
+ effect="dark"
|
|
|
+ placement="top-start"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="el-icon-setting table-operation"
|
|
|
+ style="color: #2db7f5"
|
|
|
+ @click="orderConf(row)"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip v-if="row.orderStatus == '1' && row.singleTaskFlag == '1' && row.hasMaterial == '0'" class="item" :content='$t("runCenter.buttons.prodNode")' effect="dark" placement="top-start">
|
|
|
+ <i
|
|
|
+ class="el-icon-monitor table-operation"
|
|
|
+ style="color: #2db7f5;"
|
|
|
+ @click="prodNode(row)"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip v-if="row.orderStatus == '1' && row.singleTaskFlag == '1' && row.hasMaterial == '1'" class="item" :content='$t("common.audio.addAudio")' effect="dark" placement="top-start">
|
|
|
+ <i
|
|
|
+ class="el-icon-thumb table-operation"
|
|
|
+ style="color: #2db7f5;"
|
|
|
+ @click="audioStatu(row, '1')"
|
|
|
+ />
|
|
|
+ </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"
|
|
|
+ />
|
|
|
+ <!-- 生产资源资料 -->
|
|
|
+ <detail-conf
|
|
|
+ ref="detailConf"
|
|
|
+ :dialog-visible="dialogDetailConf.isVisible"
|
|
|
+ :title="dialogDetailConf.title"
|
|
|
+ @close="editDetailConfClose"
|
|
|
+ @success="editDetailConfSuccess"
|
|
|
+ />
|
|
|
+ <el-dialog
|
|
|
+ v-el-drag-dialog
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="true"
|
|
|
+ :title='$t("common.preview")'
|
|
|
+ width="80%"
|
|
|
+ top="50px"
|
|
|
+ :visible.sync="preview.isVisible"
|
|
|
+ >
|
|
|
+ <el-scrollbar>
|
|
|
+ <div v-html="preview.context" />
|
|
|
+ </el-scrollbar>
|
|
|
+ </el-dialog>
|
|
|
+ <file-import
|
|
|
+ ref="import"
|
|
|
+ :dialog-visible="fileImport.isVisible"
|
|
|
+ :type="fileImport.type"
|
|
|
+ :exportErrorUrl="fileImport.exportErrorUrl"
|
|
|
+ :action="fileImport.action"
|
|
|
+ accept=".xls,.xlsx"
|
|
|
+ @close="importClose"
|
|
|
+ @success="importSuccess"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ import Pagination from "@/components/Pagination"
|
|
|
+ import TenantEdit from "./components/Edit"
|
|
|
+ import TenantView from "./components/View"
|
|
|
+ import DetailConf from "./components/DetailConf"
|
|
|
+ // 【订单管理】-API
|
|
|
+ import orderMgrApi from "@/api/runManageCenter/orderMgr"
|
|
|
+ import orderTaskMgrApi from "@/api/runManageCenter/orderTaskMgr"
|
|
|
+ import elDragDialog from '@/directive/el-drag-dialog'
|
|
|
+ import { downloadFile, initQueryParams } from '@/utils/commons'
|
|
|
+ import FileImport from "@/components/zuihou/Import";
|
|
|
+ export default {
|
|
|
+ name: "DraftOrder",
|
|
|
+ directives: { elDragDialog },
|
|
|
+ components: { Pagination, TenantEdit, TenantView,FileImport,DetailConf },
|
|
|
+ props: {
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ dialog: {
|
|
|
+ isVisible: false,
|
|
|
+ title: ""
|
|
|
+ },
|
|
|
+ preview: {
|
|
|
+ isVisible: false,
|
|
|
+ context: ''
|
|
|
+ },
|
|
|
+ dialogDetailConf: {
|
|
|
+ isVisible: false,
|
|
|
+ title: "",
|
|
|
+ },
|
|
|
+ tenantViewVisible: false,
|
|
|
+ tableKey: 0,
|
|
|
+ queryParams: initQueryParams({}),
|
|
|
+ selection: [],
|
|
|
+ loading: false,
|
|
|
+ tableData: {
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ dicts: {
|
|
|
+ NATION: {}
|
|
|
+ },
|
|
|
+ enums: {
|
|
|
+ TenantTypeEnum: {},
|
|
|
+ TenantStatusEnum: {}
|
|
|
+ },
|
|
|
+ pickerOptions: {
|
|
|
+ shortcuts: [{
|
|
|
+ text: this.$t("common.timeArea.lastWeek"),
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: this.$t("common.timeArea.lastMonth"),
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ text: this.$t("common.timeArea.lastThreeMonth"),
|
|
|
+ onClick(picker) {
|
|
|
+ const end = new Date();
|
|
|
+ const start = new Date();
|
|
|
+ start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
|
|
+ picker.$emit('pick', [start, end]);
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ fileImport: {
|
|
|
+ isVisible: false,
|
|
|
+ type: "import",
|
|
|
+ action: `${process.env.VUE_APP_BASE_API}/authority/order/import`,
|
|
|
+ exportErrorUrl: `/authority/order/exportError`
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
|
|
|
+ created() {
|
|
|
+ // 加载列表数据
|
|
|
+ this.fetch()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 【提交审核】按钮-事件
|
|
|
+ audioStatu(row, status){
|
|
|
+ if (!row.id) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ let bool = true;
|
|
|
+ orderTaskMgrApi.get({orderId: row.id}).then(res => {
|
|
|
+ res = res.data
|
|
|
+ if(res.isSuccess){
|
|
|
+ if(res.data == null || res.data.start == '' || res.data.goal == ''){
|
|
|
+ bool = false
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ bool = false
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!bool){
|
|
|
+ this.$message({
|
|
|
+ message: '订单任务尚未配置',
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ const ids = []
|
|
|
+ ids.push(row.id)
|
|
|
+
|
|
|
+ // 确认【提交审核】
|
|
|
+ this.$confirm(this.$t("tips.audioTips"), this.$t("common.tips"), {
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ confirmButtonText: this.$t("common.confirm"),
|
|
|
+ cancelButtonText: this.$t("common.cancel"),
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ // 调用API
|
|
|
+ this.audio(ids,status)
|
|
|
+ }).catch(() => {})
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ // 【审核通过/审核不通过】接口-事件
|
|
|
+ audio(ids,status){
|
|
|
+ if(!status){
|
|
|
+ status = this.audioVal
|
|
|
+ }
|
|
|
+ // 赋值
|
|
|
+ //this.selection[0].status = status
|
|
|
+ let msg = this.$t("common.audio.addAudioTips")
|
|
|
+ if(status == "2"){
|
|
|
+ msg = this.$t("common.audio.audioOk")+"!"
|
|
|
+ }
|
|
|
+ if(status == "3"){
|
|
|
+ msg = this.$t("common.audio.aduioFail")+"!"
|
|
|
+ }
|
|
|
+ orderMgrApi.updateStatus({ ids: ids, auditStatus: status}).then(response => {
|
|
|
+ if (response.status == 200) {
|
|
|
+ // 如果是审核,成功后,关闭弹出框
|
|
|
+ if(status == '2' || status == '3'){
|
|
|
+ this.audioIsVisible = false
|
|
|
+ // 审核成功后,改成默认值
|
|
|
+ this.audioVal = '2'
|
|
|
+ }
|
|
|
+ this.$message({
|
|
|
+ message: msg,
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ // 重新查询列表数据
|
|
|
+ this.search()
|
|
|
+ // 通知父组件,相关设置
|
|
|
+ this.$emit("audioStatus", status)
|
|
|
+ // 清除table的选择状态
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ viewClose () {
|
|
|
+ this.tenantViewVisible = false
|
|
|
+ },
|
|
|
+ // 验证是否选中数据-函数
|
|
|
+ checkData(){
|
|
|
+ let flag = true
|
|
|
+ if (!this.selection.length) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.noDataSelected"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ flag = false
|
|
|
+ }
|
|
|
+ if (this.selection.length > 1) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.mustOne"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ flag = false
|
|
|
+ }
|
|
|
+ return flag
|
|
|
+ },
|
|
|
+ editClose () {
|
|
|
+ this.dialog.isVisible = false
|
|
|
+ },
|
|
|
+ editSuccess () {
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ onSelectChange (selection) {
|
|
|
+ this.selection = selection
|
|
|
+ },
|
|
|
+ search () {
|
|
|
+ this.fetch({
|
|
|
+ ...this.queryParams
|
|
|
+ })
|
|
|
+ },
|
|
|
+ orderOperateBtn(row,command){
|
|
|
+ // 如果是:【暂停】
|
|
|
+ if(command == "stop"){
|
|
|
+ const produceStatus = row.produceStatus
|
|
|
+ console.log("produceStatus="+produceStatus)
|
|
|
+ if (produceStatus === '1' || produceStatus === '4') {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("订单未开始生产或已经生产完成,无需暂停"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.panseBtn('0', row)
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果是:【启用】
|
|
|
+ if(command == "start"){
|
|
|
+ const produceStatus = row.produceStatus
|
|
|
+ if (produceStatus != '3') {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("订单未暂停,无需启用"),
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.panseBtn('1', row)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ reset () {
|
|
|
+ this.queryParams = initQueryParams({})
|
|
|
+ this.$refs.table.clearSort()
|
|
|
+ this.$refs.table.clearFilter()
|
|
|
+ this.search()
|
|
|
+ },
|
|
|
+ add () {
|
|
|
+ this.$refs.edit.type = "add"
|
|
|
+ this.$refs.edit.setTenant(false, this.dicts)
|
|
|
+ this.dialog.title = this.$t("common.add")
|
|
|
+ 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("runCenter.tips.orderTips"), 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(() => {})
|
|
|
+ },
|
|
|
+ orderConf(row){
|
|
|
+ this.$refs.detailConf.setTenant(row, this.dicts);
|
|
|
+ this.$refs.detailConf.type = "edit";
|
|
|
+ this.dialogDetailConf.title = "任务配置"
|
|
|
+ this.dialogDetailConf.isVisible = true
|
|
|
+ },
|
|
|
+ orderDelete(){
|
|
|
+ if(this.checkData()){
|
|
|
+ this.$confirm(this.$t("runCenter.tips.orderTips"), this.$t("common.tips"), {
|
|
|
+ distinguishCancelAndClose: true,
|
|
|
+ confirmButtonText: this.$t("common.confirm"),
|
|
|
+ cancelButtonText: this.$t("common.cancel"),
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ let obj = {
|
|
|
+ id: this.selection[0].id
|
|
|
+ }
|
|
|
+ orderMgrApi.delete(obj).then(res => {
|
|
|
+ res = res.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t('tips.optionSuccess'),
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ // 更新列表
|
|
|
+ this.search()
|
|
|
+ // 清理Table的选择数据
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {})
|
|
|
+ }
|
|
|
+ },
|
|
|
+ clearSelections () {
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ },
|
|
|
+ delete (ids) {
|
|
|
+ orderMgrApi.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()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ editDetailConfClose() {
|
|
|
+ this.dialogDetailConf.isVisible = false;
|
|
|
+ },
|
|
|
+ editDetailConfSuccess() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ // 【修改】表头上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]);
|
|
|
+ },
|
|
|
+ prodNode(row){
|
|
|
+ orderMgrApi.prodNode({id:"1234567890", orderId:row.id}).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.$message({
|
|
|
+ message: this.$t("tips.createSuccess"),
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ this.search()
|
|
|
+ // 清理已经删除的数据
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ view (row) {
|
|
|
+ this.$refs.edit.setTenant(row, this.dicts)
|
|
|
+ this.$refs.edit.type = "view"
|
|
|
+ this.dialog.title = this.$t("common.view")
|
|
|
+ this.dialog.isVisible = true
|
|
|
+ },
|
|
|
+ edit (row) {
|
|
|
+ this.$refs.edit.setTenant(row, this.dicts)
|
|
|
+ this.$refs.edit.type = "edit"
|
|
|
+ this.dialog.title = this.$t("common.edit")
|
|
|
+ this.dialog.isVisible = true
|
|
|
+ },
|
|
|
+ fetch (params = {}) {
|
|
|
+ this.loading = true
|
|
|
+ if (this.queryParams.timeRange) {
|
|
|
+ this.queryParams.model.deliveryTime_st = this.queryParams.timeRange[0] + " 00:00:00"
|
|
|
+ this.queryParams.model.deliveryTime_ed = this.queryParams.timeRange[1] + " 23:59:59"
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果【零件交货日期】有值
|
|
|
+ if (this.queryParams.timeRange1) {
|
|
|
+ this.queryParams.model.pdeliveryTimeStart = this.queryParams.timeRange1[0] + " 00:00:00"
|
|
|
+ this.queryParams.model.pdeliveryTimeEnd = this.queryParams.timeRange1[1] + " 23:59:59"
|
|
|
+ }
|
|
|
+
|
|
|
+ this.queryParams.current = params.current ? params.current : this.queryParams.current
|
|
|
+ this.queryParams.size = params.size ? params.size : this.queryParams.size
|
|
|
+ // 查询必须参数-草稿:orderstatus = 1 and source = 1
|
|
|
+ this.queryParams.model.orderStatus = '1'
|
|
|
+ this.queryParams.model.source = '1'
|
|
|
+ this.queryParams.model.singleTaskFlag = '1'
|
|
|
+ orderMgrApi.page(this.queryParams).then(response => {
|
|
|
+ const res = response.data
|
|
|
+ if (res.isSuccess) {
|
|
|
+ this.tableData = res.data
|
|
|
+ // 给列表设置条数
|
|
|
+ this.$emit('setTabNums', res.data.total, 'tab7')
|
|
|
+ }
|
|
|
+ // 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)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ downloadOrderTemplate(){
|
|
|
+ orderMgrApi.downloadOrderTemplate({}).then(response => {
|
|
|
+ downloadFile(response)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ uploadOrder() {
|
|
|
+ this.fileImport.type = "upload";
|
|
|
+ this.fileImport.isVisible = true;
|
|
|
+ this.$refs.import.setModel(false);
|
|
|
+ },
|
|
|
+ importSuccess() {
|
|
|
+ this.search();
|
|
|
+ },
|
|
|
+ importClose() {
|
|
|
+ this.fileImport.isVisible = false;
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+ <style lang="scss" scoped></style>
|
|
|
+
|