Files
scrq-hd/.svn/pristine/17/175d360eb8f9644fd23d2e2c9f6e2bf78adb2009.svn-base
2025-07-03 10:34:04 +08:00

2311 lines
70 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<!-- 工单主页 -->
<div class="app-container">
<div class="main" style="width: 1860px">
<query-params
ref="query"
:form="queryFormConfig"
@handleQuery="handleQuery"
@getTableData="getTableData"
@resetQuery="resetQuery"
>
</query-params>
<el-divider></el-divider>
<div>
<el-row v-if="false" :gutter="10" style="margin: 10px 0px" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>-->
<!-- </el-col>-->
<el-col v-hasPermi="['order_work_createdWork']" :span="1.5">
<el-button
style="margin-bottom:2px;"
type="primary"
icon="el-icon-plus"
size="mini"
@click="createdWork"
>新增</el-button
>
</el-col>
<el-col v-hasPermi="['order_work_edit']" :span="1.5">
<el-button
style="margin-bottom:2px;"
type="warning"
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="updateThis"
>修改</el-button
>
</el-col>
<el-col v-hasPermi="['order:work:pbmList']" :span="1.5">
<el-button
style="margin-bottom:2px;"
type="success"
icon="el-icon-s-grid"
size="mini"
:disabled="single"
@click="pbmListClick"
>用料清单</el-button
>
</el-col>
<el-col v-hasPermi="['order:work:ecnSign']" :span="1.5">
<el-button
type="primary"
icon="el-icon-s-grid"
size="mini"
:disabled="single"
@click="ecnSignClick"
>ECN签核</el-button
>
</el-col>
<el-col :span="1.5" v-hasPermi="['order_work_begin']">
<el-button
style="margin-bottom:2px;"
type="primary"
icon="el-icon-scissors"
size="mini"
:disabled="single"
@click="splitFlow"
>开始
</el-button>
</el-col>
<el-col :span="1.5" v-hasPermi="['order_work_pause']">
<el-button
style="margin-bottom:2px;"
type="info"
size="mini"
@click="pause"
:disabled="single"
icon="el-icon-video-pause"
>{{ stop }}
</el-button>
</el-col>
<el-col
v-hasPermi="['order_work_handleImport']"
:span="1.5"
v-if="false"
>
<el-button
style="margin-bottom:2px;"
@click="handleImport"
icon="el-icon-upload2"
size="mini"
type="info"
>导入</el-button
>
</el-col>
<el-col
:span="1.5"
>
<el-button
style="margin-bottom:2px;"
@click="handleBomDownload"
icon="el-icon-download"
size="mini"
type="warning"
>BOM下载</el-button
>
</el-col>
<el-col :span="1.5" v-hasPermi="['order_work_valid']">
<el-button
style="margin-bottom:2px;"
type="warning"
size="mini"
:disabled="multiple"
@click="valid"
>齐套性判断</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
style="margin-bottom:2px;"
type="warning"
size="mini"
:disabled="single"
@click="valid"
>料站表管理</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-s-order"
size="mini"
:disabled="single"
@click="serialGenerateClick"
>生成序列号</el-button
>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="el-icon-s-order"
size="mini"
:disabled="single"
@click="serialGenerateCmClick"
>生成中移序列号</el-button
>
</el-col>
<!-- <el-col v-hasPermi="['order_work_createdJSTL']" :span="1.5">
<el-button
style="margin-bottom:2px;"
type="success"
size="mini"
:disabled="ispickshowT"
@click="createdJSTL"
>生产合并领料</el-button
>
</el-col> -->
<el-col v-hasPermi="['order_work_createdJSTLOne']" :span="1.5">
<el-button
style="margin-bottom:2px;"
type="success"
size="mini"
:disabled="ispickshow"
@click="createdJSTLOne"
>生产领料</el-button
>
</el-col>
<el-col v-hasPermi="['order_work_pickList']" :span="1.5">
<el-button
style="margin-bottom:2px;"
type="success"
size="mini"
:disabled="multiple"
@click="pickList"
>领料记录</el-button
>
</el-col>
<el-col :span="1.5" v-hasPermi="['order_work_createdReturnBill']">
<el-button type="warning" size="mini" @click="createdReturnBill" style="margin-bottom:2px;"
>生产退料
</el-button>
</el-col>
<el-col :span="1.5" v-hasPermi="['order_work_pickReturnBill']">
<el-button type="warning" size="mini" @click="pickReturnBill" style="margin-bottom:2px;"
>退料记录
</el-button>
</el-col>
<el-col :span="1.5" v-hasPermi="['order_work_prodPick']">
<el-button style="margin-bottom:2px;"
type="success"
size="mini"
@click="prodPick"
:disabled="isReShow"
>生产补料</el-button
>
</el-col>
<el-col :span="1.5" v-hasPermi="['order_work_repRecord']">
<el-button style="margin-bottom:2px;"
type="success"
size="mini"
@click="repRecord"
:disabled="isReShow"
>补料记录</el-button
>
</el-col>
<el-col :span="1.5"
>
<el-button style="margin-bottom:2px;"
type="primary"
size="mini"
@click="deliver"
>下发
</el-button>
</el-col>
<el-col :span="1.5" v-hasPermi="['order_work_serinumber']">
<el-button style="margin-bottom:2px;"
type="warning"
icon="el-icon-document"
size="mini"
:disabled="single"
@click="serinumber"
>详情
</el-button>
</el-col>
<el-col v-hasPermi="['order_work_openPrinter']" :span="1.5">
<el-button style="margin-bottom:2px;"
type="warning"
size="mini"
:disabled="single"
@click="openPrinter"
>打印流转卡
</el-button>
</el-col>
<!-- <el-col :span="1.5" v-hasPermi="['order_work_pause']">-->
<!-- <el-button style="margin-bottom:2px;"-->
<!-- type="primary"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- icon="el-icon-check"-->
<!-- @click="Finspect"-->
<!-- >首件检验-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- round-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="imageClick"-->
<!-- :disabled="single"-->
<!-- >流程图-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- icon="el-icon-s-check"-->
<!-- size="mini"-->
<!-- @click="approveClick"-->
<!-- :disabled="single"-->
<!-- >审批-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col v-hasPermi="['order_work_userBind']" :span="1.5">
<el-button
type="warning"
size="mini"
:disabled="single"
@click="userBind"
>分配流转卡
</el-button>
</el-col> -->
<el-col :span="1.5" v-hasPermi="['order_work_close']">
<el-button style="margin-bottom:2px;"
type="danger"
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="close"
>关闭
</el-button>
</el-col>
<el-col :span="1.5" v-hasPermi="['order_work_viewAll']">
<el-button
type="warning"
icon="el-icon-search"
size="mini"
@click="ViewAll"
>所有异常工单
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
icon="el-icon-s-grid"
size="mini"
@click="handleTailOrder"
v-hasPermi="['order_work_tail']"
>尾单管理
</el-button>
</el-col>
<el-popover
style="float: right"
placement="bottom-end"
title="自定义显示列"
width="250"
@show="initPopover"
trigger="hover"
>
<headConfig
ref="test"
@fathers="fathers"
:propThis="propThis"
></headConfig>
<el-button
size="mini"
type="primary"
class="el-icon-caret-bottom"
slot="reference"
>自定义列</el-button
>
</el-popover>
</el-row>
<el-row :gutter="10" style="margin: 10px 0px;" class="mb8" v-if="false && isSortShow">
<el-col>
<el-select
class="sortSeq"
ref="select"
@click.native="notSelect"
style="width: 100%"
v-model="seqence"
:multiple="true"
placeholder=""
>
<el-option
v-for="(item,index) in seqenceOptions"
:key="index"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-row>
<el-table
@sort-change="sortChange"
@header-dragend="headerDragend"
v-if="indexShow"
v-loading="loading"
:data="tableData"
@selection-change="handleSelectionChange"
border
ref="list"
@row-click="handleRowClick"
:height="tableHeight"
:cell-style="cellStyle"
highlight-current-row
>
<!-- <el-table-column type="selection" width="50" align="center"/>-->
<el-table-column
type="index"
width="50"
align="center"
label="序号"
/>
<el-table-column
type="selection"
width="50"
align="center"
label="序号"
/>
<!-- <el-table-column label="审批记录" header-align="center" :show-overflow-tooltip="true"-->
<!-- width="100">-->
<!-- <template slot-scope="scope">-->
<!-- <i style="color: blue;text-decoration:underline; cursor:pointer;" @click="approvelistClick(scope.row)">审批记录</i>-->
<!-- </template>-->
<!-- </el-table-column>-->
<template v-for="(item, index) in realList">
<el-table-column
v-if="item.tableProp === 'lastTime'"
:sortable="item.notSort == true ? false : `custom`"
:prop="item.tableProp"
:key="index"
:align="item.align"
header-align="center"
:min-width="item.width"
:label="item.tableTitle"
:show-overflow-tooltip="item.show_overflow_tooltip"
>
<template v-slot="scope">
<span :style="getLastTime(scope.row, true)">{{ getLastTime(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column
v-else
:sortable="item.notSort == true ? false : `custom`"
:prop="item.tableProp"
:key="index"
:align="item.align"
header-align="center"
:min-width="item.width"
:label="item.tableTitle"
:show-overflow-tooltip="item.show_overflow_tooltip"
></el-table-column>
</template>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryParams.pageNo"
:page-sizes="[10, 20, 50, 100, 200, 500, 1000]"
:page-size="queryParams.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
<!-- <order-prod-form :propThis="propsThis" ref="orderForm"></order-prod-form>-->
</div>
<el-dialog
title="审批记录"
:visible.sync="isApprovelistShow"
v-if="isApprovelistShow"
width="840px"
append-to-body
>
<el-table
:data="approvelistTableData"
highlight-current-row
max-height="440"
border
style="width: 100%">
<el-table-column label="序号" header-align="center" type="index"
width="80"></el-table-column>
<el-table-column prop="taskName" align="center" label="任务节点" width="180"></el-table-column>
<el-table-column prop="comment" align="center" label="备注" width="250"></el-table-column>
<el-table-column prop="assigneeName" align="center" label="审批人" width="90"></el-table-column>
<el-table-column prop="startDt" align="center" label="开始时间" width="150"></el-table-column>
<el-table-column prop="endDt" align="center" label="结束时间" width="150"></el-table-column>
<el-table-column prop="duration" align="center" label="审批耗时" width="150" :formatter="durationFormatter"></el-table-column>
</el-table>
</el-dialog>
<el-dialog
width="300px"
title="选择领料单"
:visible.sync="dialogTableVisible"
>
<el-select
clearable
v-model="gridDataSelect"
placeholder="领料单"
style="width: 100%"
>
<el-option
v-for="(dict,index) in gridData"
:key="index"
:label="dict.text"
:value="dict.key"
/>
</el-select>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogTableVisible = false">取 消</el-button>
<el-button type="primary" @click="createdReturnBillIn"
>确 定</el-button
>
</span>
</el-dialog>
</div>
<SelectWidget ref="selectWidget" @getSelect="getSelect" ></SelectWidget>
<el-dialog :visible.sync="dialogVisible" v-if="dialogVisible">
<!-- 这个dialog是预览文件用的 -->
<img width="100%" :src="dialogImageUrl" alt="">
<div id="qr-div" class="qr-div"></div>
</el-dialog>
<el-dialog
v-dialogDrag
title="审批"
:visible.sync="isFormMakingShow"
v-if="isFormMakingShow"
width="840px"
append-to-body
>
<formGenerate :taskId="taskId" :form="proForm" @handleSubClose="handleSubClose"></formGenerate>
</el-dialog>
</div>
</template>
<script>
import selectWorkCenter from './selectWorkCenter'
import generateSerial from "./generateSerial"; //生成序列号
import generateCmSerial from "./generateCmSerial"; //生成中移序列号
import SelectWidget from '@/views/components/select-widget/select-widget'
import ecnSign from "@/views/mes/plan/ECN/ECNsign.vue"
import orderProdForm from "./order-work-form";
import bomList from "./order-prod-valid";
import snUserBind from "./snUserBind/index";
import TreeSelect from "@riophae/vue-treeselect"; //引用下拉树组件
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import QRCode from "qrcodejs2";
// import orderFlowForm from '../flow/order-flow-form'
import orderSerial from "./order-prod-serialNumber";
import printer from "./order-work-print";
import workCreated from "./order-prod-form";
// import orderProdBomList from './order-prod-bomList'
import pordJSTL from "./order-prod-dstlList";
import pickListdemo from "./order-prod-pickList";
import addReturnBill from "./returnBill/addReturnBill";
import checkReturnBill from "./returnBill/checkReturnBill";
import prodPick from "./Replesh/prodPick";
import repRecord from "./Replesh/repRecord";
import stopOrderWork from "./stopOrderWork";
import pickOne from "./pick/pickOne";
// import Finspect from "./Finspect/Finspect";
import pbmList from "./pbmList";
import AbnormalWorkOrder from "./AbnormalWorkOrder";
export default {
name: "OrderWork",
components: {
TreeSelect,
ecnSign,
SelectWidget,
},
computed:{
queryFormConfig()
{
return{
controlList:[
{
key:'number',
label:'工单编号',
type:'input',
placeholder:'请输入',
prop:'number',
class:'width_0180'
},
{
key:'orderProdNumber',
label:'订单编号',
type:'input',
placeholder:'请输入',
prop:'orderProdNumber',
class:'width_0180'
},
{
key: "customer",
label: "客户代码",
type: "inputWidget",
placeholder: "请输入",
prop: "customer",
selectWidgetIndex: 5,
subProp: "customerCode"
},
{
key:'materialCode',
label:'产品编码',
type:'inputWidget',
placeholder:'请输入',
prop:'materialCode',
selectWidgetIndex:0
},
{
key:'materialName',
label:'产品名称',
type:'input',
placeholder:'请输入',
prop:'materialName',
class:'width_0180'
},
{
key:'dictStatus',
label: '工单状态',
type: 'select',
placeholder: '请选择',
prop: 'dictStatus',
options: this.workStatus,
optionLabel:'text',
optionValue:'key'
},
{
key:'lastStatus',
label: '尾单状态',
type: 'select',
placeholder: '请选择',
prop: 'lastStatus',
options: this.lastStatus,
optionLabel:'text',
optionValue:'key'
},
{
key:"workCenterId",label: '工作中心', type: 'treeSelect', prop: 'workCenterId', treeOptions:this.treeOptions,
normalizer:function(node) {
return {
id: node.value,
label: node.title,
children: node.children,
isDefaultExpanded: true,
};
},
},
{
key:"planStartDtArray",label: '开始时间', type: 'datetimerange', startPlaceholder:"计划开始时间起始",endPlaceholder:"计划开始时间截止", prop: 'planStartDtArray',
},
{
key:"planEndDtArray",label: '结束时间', type: 'datetimerange', startPlaceholder:"计划结束时间起始",endPlaceholder:"计划结束时间截止", prop: 'planEndDtArray',
},
],
config:{
//零散的配置参数
hasAdvQuery:false,//有无高级查询
storageMode:true,//记忆模式开启后每次查询会存储到localstorage中存储名为下面的storageKey
storageKey:"work",
propThis:this,//this
preFixWidthClass:'width_0100', //前置框的宽度calss不写则为默认100
marginWidthClass:'width_0180' //空白选择框的宽度calss不写则为默认180
},
defaultList: [
//默认展示的属性,跟controList里面的key相对应
'number','materialName','orderProdNumber',//'planStartDtArray',
],
}
}
},
data() {
return {
isFormMakingShow:false,//单条审批子组件是否SHOW
dialogVisible:false,
gridDataSelect: null,
gridData: [],
dialogTableVisible: false,
isApprovelistShow:false,//审批记录对话框是否显示
rowClickFlag: false, //当为false的时候表示没有选择复选框
statusList:[
{key:0,text:"未发起"},
{key:1,text:"处理中"},
{key:2,text:"评审通过"},
{key:3,text:"已关闭"}
],
isReShow: true, //补料
stop: "暂停",
indexShow: false,
isReturnShow: true,
ispickshow: true, //领料
ispickshowT: true, //合并领料
List: [],
realList: [],
normalizer(node) {
return {
id: node.value,
label: node.title,
children: node.children,
isDefaultExpanded: true,
};
},
showMore: false,
tableHeight: 0,
treeValue: [],
treeOptions: [], //下拉树数据
printData: [],
propsThis: this,
// 遮罩层
dateRange: [],
loading: false,
orderStatus: [],
orderType: [],
workStatus: [],
lastStatus:[],
workType: [],
// 选中数组
rows: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 总条数
total: 0,
// 用户表格数据
tableData: null,
startDateRange: undefined,
endDateRange: undefined,
// 弹出层标题
// 表单参数
form: {
id: undefined,
number: "",
planQty: 0,
materialId: "",
bomId: "",
dictStatus: 1,
dictType: 1,
order: 99,
customerOrder: "",
customer: "",
autoOrderPicking: false,
autoOrderWork: false,
planStartDt: undefined,
planEndDt: undefined,
routeId: undefined,
workCenterId: undefined,
},
isSortShow: false,
// 用户导入参数
upload: {
// 是否显示弹出层(用户导入)
open: false,
// 弹出层标题(用户导入)
title: "",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的用户数据
updateSupport: 0,
// 设置上传的请求头部
// 上传的地址
url: "/pcp/pp/order/prod/excel/import",
},
centerTree: [],
printInfo: false,
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 50,
number: undefined,
materialNumber: undefined,
materialCode: undefined,
materialName: undefined,
dictStatus: undefined,
lastStatus:undefined,
dictType: undefined,
workCenterId: undefined,
},
seqenceOptions: [],
seqence: [],
propThis: this,
domain: 'com.cmeim.plan.query.po.QryOrderWork',
model: "plan",
queryData: null
};
},
mounted() {
this.$nextTick(() => {
this.tableHeight =
window.innerHeight - this.$refs.query.offsetHeight - 240;
});
window.sessionStorage.setItem(this.queryFormConfig.config.storageKey, '')
this.$refs.query.init()
},
created() {
// this.initPage();
document.documentElement.style.fontSize = (((document.documentElement.clientWidth-200) / 4)-68)/255 * 16 + 'px'
this.initSeqenceOptions();
this.initData();
this.getWorkCenterTree();
},
methods: {
handleSubClose()
{
console.log(' 子组件关闭')
this.getList();
this.isFormMakingShow=false
},
// async approveClickSingle(row)
// {
// //单条审批
// console.log(row,'1812')
// row.processInstanceId
// this.isFormMakingShow=true
//
// },
//审批
// async approveClick()
// {
// //点击审批
// let rows=[]
// if(this.rows.length && this.rows.length>0)
// {
// rows=this.rows
// }
// else if(this.currentRow!=null && this.currentRow!={})
// {
// rows.push(this.currentRow)
// }
// else{this.$message.warning('请选择至少一行点击审批!');return;}
// // if(rows.length==1){
// // this.approveClickSingle(rows[0]) //单条审批
// // return;
// // }
//
// this.$confirm("是否同意所有选中的订单?", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning",
// })
// .then(() => {
// let idList=rows.map(o=>{return o.processInstanceId})
// this.$flowDefine.consent(idList).then(
// resp=>{
// if(resp.data.code==200){
// this.$message.success(resp.data.msg || '操作成功!')
// }
// else{
// this.$message.error(resp.data.msg || '操作失败!')
// }
// }
// )
// })
// .catch(() => {});
//
//
//
// },
// async imageClick()
// //点击查看流程图
// {
// if(this.rows==null ){
// this.$message.warning('请选择一行数据!')
// this.buttonEnable=true
// return
// }
// console.log(this.rows)
// let resp=await this.$flowDefine.getImageByProcessInstanceId(this.rows[0].processInstanceId)
// console.log(resp.data,'1909')
// console.log(window,'1801')
//
// this.dialogVisible=true
// let binaryData = [];
// binaryData.push(resp.data);
//
//
// const qrUrl = window.URL.createObjectURL(new Blob(binaryData),{type: 'image/png'});
// console.log(qrUrl,'1853')
// var img = document.createElement('img')
// img.id='pictureAppend'
// img.src = qrUrl
// img.onload = function () {
// window.URL.revokeObjectURL(qrUrl)
// }
// this.$nextTick(()=>{
// const imgDiv = document.querySelector('#qr-div')
// console.log(imgDiv,'imgDiv')
// imgDiv.appendChild(img)
// }
// )
//
// },
handleBomDownload()
//BOM下载
{
let currentRow
if(this.rows.length != 1 || this.rows[0]==undefined || this.rows[0]==null){
this.$message.warning('必须选择一行数据进行操作!')
this.single=true
return
}
currentRow=this.rows[0]
console.log(currentRow,'1134')
this.$bom.bomDownload(currentRow.materialCode).then((data) => {
console.log(data);
this.download(data.data,currentRow.materialCode+"BOM下载"+this.g_method.dateFtt("yyyyMMdd hh_mm_ss",new Date())+'.xlsx',data.data.data);
});
},
download(data, fileName,urlDirect) {
// 文件导出
if(fileName==undefined){fileName="Bom.xlsx"}
let url = window.URL.createObjectURL(new Blob([data]));
if(urlDirect!==undefined){
url=urlDirect
}//如果是直接模式则url直接等于第三个参数
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", fileName);
document.body.appendChild(link);
link.click();
link.remove();
},
async approvelistClick(row)
//查看审批记录
{
let currentRow
if(row!=undefined){currentRow=row}//表格内点击链接
else{currentRow=this.currentRow}//点击按钮
if(currentRow==null ){
this.$message.warning('请选择一行数据!')
this.single=true
return
}
this.$flowDefine.approvelist(currentRow.processInstanceId).then(async (data) => {
console.log(data,'审批记录data')
if (data.code ==200 || data.data.code == 200) {
console.log(data,'审批记录data')
this. approvelistTableData=data.data.data
this.isApprovelistShow=true
await this.g_method.asyncForEach(this.approvelistTableData,
async (o)=>{
console.log(o.assignee,o,'1832')
if(o.assignee==null){
o.assigneeName=""
return
}
let response=await getUser(o.assignee)
if(response.data && response.data.userName){o.assigneeName=response.data.userName }
else{o.assigneeName=""}
}
)
this.approvelistTableData=JSON.parse(JSON.stringify(this.approvelistTableData))
}
});
},
getSelect(row,index)
{
//查询选择回调 0物料 1 BOM 2工艺
console.log(row,index,'1910')
if(index===0){console.log(row,index,'19111');this.queryParams.materialCode=row.materialCode}
if(index===1){console.log(row,index,'19112');this.queryParams.bomName=row.name}
if(index===2){console.log(row,index,'19113');this.queryParams.routeName=row.name}
this.queryParams=JSON.parse(JSON.stringify(this.queryParams))
console.log( this.queryParams,'1739')
},
selectWidget(index){
// 查询选择点击
console.log(this.$refs.selectWidget,'1808')
this.$refs.parentPage=this
this.$refs.selectWidget.selectWidget(index)
},
splitOrderFlow() {
console.log("拆分", this.rows[0]);
let planqtys=this.rows[0].planQty;
this.$prompt("拆分单个流转卡数量:", "拆分流转卡", {
confirmButtonText: "确定",
cancelButtonText: "取消拆分",
inputPattern:/^[0-9]*$/,
inputErrorMessage: '输入数字',
closeOnClickModal:false,
beforeClose(action,instance,done){
if(action =='confirm'){
//输入拆分的数量,如果不输入跳出提示框
if(instance.$data.inputValue!=NaN
&&instance.$data.inputValue!=null
&&instance.$data.inputValue !=''){
//判断拆分的数量是否大于计划数量,如果大于给予提示,小于进行拆分
if(instance.$data.inputValue <=planqtys){
done();
}else{
this.$message({
message: '填写拆分单个数量不能大于计划数量:'+planqtys,
type: 'error'
});
}
}else{
this.$message({
message: '未填写,请填写拆分数量',
type: 'warning'
});
}
}else{
done();
}
}
}).then((value) => {
console.log(this.rows[0],"nskf1")
let params = {
planQty: parseInt(value.value),
// isBatch: this.rows[0].dictPstatus,
isBatch:true,
orderWorkId: this.rows[0].id,
};
this.$plan.saveProdFlowBatch(params).then((resp) => {
if (resp.data.code == 200) {
this.$message({
type: "success",
message: "拆分成功!",
});
this.initData();
}
});
})
.catch(action => {
this.$message({
type: 'info',
message: action === 'cancel'
? '放弃拆分并离开页面'
: '停留在当前页面'
})
});
},
updateThis() {
//编辑
if(this.rows.length != 1 || this.rows[0]==undefined || this.rows[0]==null){
this.$message.warning('必须选择一行数据进行操作!')
this.single=true
return
}
if(this.rows[0].dictStatus != 10){
this.$message.warning('只有已创建状态的工单才能修改!')
return
}
this.isAdd=false
this.$layer.iframe({
shadeClose: false,
content: {
content: workCreated, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 1,
row: this.rows[0],
},
},
title: "编辑",
});
},
initSeqenceOptions() {
let tempList = this.$headerConfig.getList("work");
tempList.forEach((data, index) => {
if (data.notSort) return;
let temp = {
value: null,
label: null,
};
temp.value = data.tableProp.replace("Show", "") + " ascending";
temp.label = data.tableTitle + " 升序";
this.seqenceOptions.push(temp);
let tempD = {
value: null,
label: null,
};
tempD.value = data.tableProp.replace("Show", "") + " descending";
tempD.label = data.tableTitle + " 降序";
this.seqenceOptions.push(tempD);
});
},
notSelect() {
this.$refs.select.blur();
},
sortChange({ column, prop, order }) {
console.log(prop);
let sTemp = {
value: null,
label: null,
};
let value = prop.replace("Show", "") + " " + order;
let judgeValue = value.split(" ");
// this.seqence.push(value)
if (this.seqence.length === 0) {
this.seqence.push(value);
console.log(this.seqence);
} else {
for (let i = 0; i < this.seqence.length; i++) {
let judgeSeqence = this.seqence[i].split(" ");
if (judgeValue[0] === judgeSeqence[0]) {
if (judgeValue[1] === "null") {
return;
}
this.seqence.splice(i, 1, value);
console.log(this.seqence);
return;
}
if (i + 1 === this.seqence.length) {
this.seqence.push(value);
console.log(this.seqence);
}
}
}
},
headerDragend(newWidth, oldWidth, column, event) {
// realList
this.realList.forEach((value) => {
if (column.property == value.tableProp) {
value.width = newWidth;
}
});
this.$refs.test.init();
setTimeout(() => {
this.$refs.test.show();
}, 1000);
},
userBind() {
this.$layer.iframe({
shadeClose: false,
content: {
content: snUserBind, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
rows: this.rows,
},
},
title: "序列号分配",
});
},
tableRowClassName({ row, rowIndex }) {
row.row_index = rowIndex;
},
createdReturnBill() {
this.gridData = [];
console.log(this.rows[0].pickNumbers.split(","),'this.rows[0].pickNumbers.split(",")');
let pickList = this.rows[0].pickNumbers.split(",");
let pickListId = this.rows[0].pickIds.split(",");
pickList.forEach((data, index) => {
let addTemp = {
key: pickListId[index],
text: data,
};
this.gridData.push(addTemp);
});
this.dialogTableVisible = true;
},
createdReturnBillIn() {
this.gridData.forEach((data) => {
if (data.key === this.gridDataSelect) {
this.gridDataSelect = data;
}
});
this.gridDataSelect.row = this.rows[0];
this.dialogTableVisible = false;
this.$layer.iframe({
shadeClose: false,
content: {
content: addReturnBill, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 1,
row: this.gridDataSelect,
},
},
title: "生产退料",
});
},
pickReturnBill() {
this.$layer.iframe({
shadeClose: false,
content: {
content: checkReturnBill, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 1,
row: this.rows,
},
},
title: "退料记录",
});
},
initPopover() {
const params = {
tableName: "work",
};
this.$headerConfig.getRealList(params).then((_data) => {
console.log(_data,'_data')
let data=_data.config?_data.data:_data
console.log("开始输出真正表格1548",data);
let temp = JSON.parse(data.data);
console.log(temp,'temp');
this.realList = temp.headerList;
console.log(this.realList);
this.$refs.test.init();
});
},
fathers(data) {
this.List = data.configure.List;
data.configure.List.forEach((value) => {
this.realList.forEach((real) => {
if (value.tableProp == real.tableProp) {
value.width = real.width;
}
});
});
data.configure.headerList.forEach((value) => {
this.realList.forEach((real) => {
if (value.tableProp == real.tableProp) {
value.width = real.width;
}
});
});
if (data.configure.headerList.length <= 0) {
return;
}
const params = {
tableName: "work",
configure: JSON.stringify(data.configure),
};
this.realList = data.configure.headerList;
this.$headerConfig.updateRealList(params).then((value) => {
console.log(value);
});
},
currentChange(selection, lastVal) {
this.rows = [];
this.rows.push(selection);
this.single = this.rows.length != 1;
this.multiple = this.rows.length > 1;
this.isReShow = this.rows.length > 1;
},
//展开更多
showMoreChange() {
if (!this.showMore) {
this.tableHeight = this.tableHeight - 70;
} else {
this.tableHeight = this.tableHeight + 70;
}
this.$nextTick(() => {
this.showMore = !this.showMore;
});
},
handleSizeChange(val) {
this.queryParams.pageSize = val;
this.getList();
},
handleCurrentChange(val) {
this.queryParams.pageNo = val;
this.getList();
},
initPage() {
if (localStorage.getItem("order_work_index") == undefined) {
localStorage.setItem("order_work_index", 50 + "");
this.queryParams.pageSize = 50;
}
this.queryParams.pageSize = parseInt(
localStorage.getItem("order_prod_index")
);
},
//初始化表格
initData() {
this.getList();
this.lastStatus = [],
this.lastStatus.push({});
this.workStatus = [];
this.workStatus.push({});
this.$dictType
.getOrderWorkLastStatusArray()
.forEach((value) => this.lastStatus.push(value));
this.workType = [];
this.workType.push({});
this.$dictType
.getOrderWorkStatusArray()
.forEach((value) => this.workStatus.push(value));
const params = {
tableName: "work",
};
this.$headerConfig.getRealList(params).then((data) => {
console.log("开始输出真正表格",data);
if (data.data && data.data.data && data.data.data !== null) {
console.log('113')
let temp = JSON.parse(data.data.data);
this.realList = temp.headerList;
this.List = temp.List;
} else {
this.List = this.$headerConfig.getList("work");
this.realList = this.List;
let temp = {
headerList: this.realList,
List: this.List,
};
const params = {
tableName: "work",
configure: JSON.stringify(temp),
};
console.log('114')
this.$headerConfig.updateRealList(params).then((value) => {
console.log(value);
});
}
this.tableData=JSON.parse(JSON.stringify(this.tableData))
this.indexShow = true;
});
},
getWorkCenterTree() {
this.$plan.getWorkCenterTree().then((resp) => {
console.log(resp,'work-index getWorkCenterTree resp')
this.treeOptions = [];
this.treeOptions.push(resp.data.data);
this.removeBlackChildren(this.treeOptions);
});
},
removeBlackChildren(list) {
list.forEach((value) => {
if (value.children.length == 0) {
value.children = undefined;
} else {
this.removeBlackChildren(value.children);
}
});
},
// /** 查询订单列表 */
// getList() {
// this.loading = true
// this.single = true
// let that = this
// // localStorage.setItem('order_work_index', this.queryParams.pageSize + "")
// this.$plan.getProdWorkList(this.queryParams).then(resp => {
// this.loading = false
// this.total = resp.data.data.recordsTotal
// this.tableData = resp.data.data.data
// this.tableData.forEach(value => {
// value.dictWorkstatus = this.$dictType.getOrderWorkStatus(
// value.dictStatus
// );
// value.showDictFlowtype = this.$dictType.getMaterialFlowType(
// value.dictFlowtype
// );
// });
//
// // this.rows.forEach(row => {
// // that.$nextTick(function () {
// // that.$refs.list.toggleRowSelection(this.tableData[row.row_index],true);
// // })
// // });
// });
// },
getQueryParams()
{
let pageSize=this.queryParams.pageSize
let pageNo=this.queryParams.pageNo
this.queryParams=this.$refs.query.getQueryParams()//返回子组件的queryParams
this.queryParams.pageSize=pageSize
this.queryParams.pageNo=pageNo
//取得子组件的queryParams并且与原来的pagesize pageNo合并
},
/** 搜索按钮操作 */
async handleQuery() {
this.getQueryParams()//加上这一句
if(this.queryParams.planStartDtArray!=null && this.queryParams.planStartDtArray!=undefined)
{
this.queryParams.planStartDt = this.queryParams.planStartDtArray[0];
this.queryParams.planStartDt2 = this.queryParams.planStartDtArray[1];
console.log(this.queryParams.planStartDtArray,'this.queryParams.planStartDtArray', this.queryParams.planStartDt)
}
if(this.queryParams.planEndDtArray!=null && this.queryParams.planEndDtArray!=undefined)
{
console.log(this.queryParams.planEndDtArray,'this.queryParams.planEndDtArray')
this.queryParams.planEndDt = this.queryParams.planEndDtArray[0];
this.queryParams.planEndDt2 = this.queryParams.planEndDtArray[1];
}
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = [];
this.resetForm("queryForm");
this.handleQuery();
this.queryParams.workCenterId = undefined;
this.queryParams.planStartDtArray = undefined;
this.queryParams.planEndDtArray = undefined;
this.queryParams.planStartDt = undefined;
this.queryParams.planStartDt2 = undefined;
this.queryParams.planEndDt = undefined;
this.queryParams.planEndDt2 = undefined;
this.queryParams.orderProdNumber = undefined;
this.single = true;
// 非多个禁用
this.multiple = true;
this.isReShow = true;
this.seqence = [];
},
handleRowClick(selection, column, event) {
if (this.rows.length == 0 || this.rowClickFlag) {
this.rowClickFlag = true;
this.rows = [];
this.rows.push(selection);
this.single = this.rows.length != 1;
this.multiple = !this.rows.length;
if (this.rows.length > 0) {
let flag = false;
this.rows.forEach((element) => {
if (element.pickNumber) {
flag = true;
}
});
if (flag) {
this.ispickshow = true;
} else {
this.ispickshow = false;
}
} else {
this.ispickshow = true;
}
if (this.rows.length === 1 && this.ispickshow) {
this.isReturnShow = false;
} else {
this.isReturnShow = true;
}
this.isReShow = !this.rows.length;
} else {
this.single = this.rows.length != 1;
this.multiple = !this.rows.length;
this.isReShow = !this.rows.length;
}
},
/** 查询工单列表 */
async getList() {
//获取列表
this.loading = true;
const orders = [];
this.seqence.map((val) => {
orders.push(
val.replace("ascending", "asc").replace("descending", "desc")
);
});
this.queryParams.orders = orders;
console.log(this.queryParams,'this.queryParams1730')
this.single = true;
let that = this;
let params=JSON.parse(JSON.stringify(this.queryParams))
if( this.g_method.checkData(params.planStartDt))params.planStartDt=this.g_method.dateFtt("yyyy-MM-dd hh:mm:ss", params.planStartDt)
if( this.g_method.checkData(params.planStartDt2))params.planStartDt2=this.g_method.dateFtt("yyyy-MM-dd hh:mm:ss", params.planStartDt2)
if( this.g_method.checkData(params.planEndDt))params.planEndDt=this.g_method.dateFtt("yyyy-MM-dd hh:mm:ss", params.planEndDt)
if( this.g_method.checkData(params.planEndDt2))params.planEndDt2=this.g_method.dateFtt("yyyy-MM-dd hh:mm:ss", params.planEndDt2)
// localStorage.setItem('order_work_index', this.queryParams.pageSize + "")
params=this.handleParamsArray(params) //处理为array的情况
params.statusArr = [5, 10]
this.$plan.getProdWorkList(params).then(async (_data) => {
let resp=_data.config?_data.data:_data
console.log(resp, "拿到数据");
this.loading = false;
this.total = resp.data.recordsTotal;
let _tableData
_tableData = resp.data.data;
await this.g_method.asyncForEach(_tableData,(async (value) => {
value.materialNumber=value.materialCode
value.dictStatusShow = this.$dictType.getOrderWorkStatus(
value.dictStatus
);
value.lastStatusShow = this.$dictType.getOrderWorkLastStatus(
value.lastStatus
);
value.dictFlowtypeShow = this.$dictType.getMaterialFlowType(
value.dictFlowtype
);
value.dictPtypeShow = this.$dictType.getOrderPtypeType(
value.dictPtype
);
value.dictTypeShow = this.$dictType.getOrderProdType(value.dictType);
let obj=this.statusList.find(o=>{return o.key==value.wfStatus})
value.statusName=obj==undefined?"":obj.text;
value.dictPstatusShow = this.$dictType.getWorkPStatus(value.dictPstatus);//领料状态
if(value.workCenterId!==null && value.workCenterId!==undefined && (value.workCenterName===null || value.workCenterName===undefined))
{
//如果只有工作中心ID 而没有工作中心名称
value.workCenterName=await this.$workCenter.queryWorkCenterById(window,value.workCenterId)
console.log(value.workCenterName,'value.workCenterName')
}
}));
this.tableData=JSON.parse(JSON.stringify(_tableData))
this.tableData.forEach(async(value)=>
{
if(value.orderProdId!==null && value.orderProdId!==undefined && (value.orderProdNumber===null || value.orderProdNumber===undefined))
{
//如果只有id 而没有订单编号
value.orderProdNumber= await this.$plan.queryOrderProdById(window,value.orderProdId)
console.log(value.orderProdNumber,'value.orderProdNumber')
}
}
)
});
},
handleParamsArray(_params)
{
//处理订单编号物料ID物料编码订单状态状态的array查询
let params=JSON.parse(JSON.stringify(_params))
if(params.number && params.number.split)
{
let arr=params.number.split(" ")
let temp=arr.filter(o=>{return o.indexOf(" ")==-1})
if(temp.length==1){return params}
params.orderWorkNumberArr=temp
delete params.number
}
if(params.materialCode && params.materialCode.split)
{
let arr=params.materialCode.split(" ")
let temp=arr.filter(o=>{return o.indexOf(" ")==-1})
if(temp.length==1){return params}
params.materialCodeArr=temp
delete params.materialCode
}
if(params.orderProdNumber && params.orderProdNumber.split)
{
let arr=params.orderProdNumber.split(" ")
let temp=arr.filter(o=>{return o.indexOf(" ")==-1})
if(temp.length==1){return params}
params.orderProdNumberArr=temp
delete params.orderProdNumber
}
return params
},
// 多选框选中数据
handleSelectionChange(selection) {
if (selection.length) {
if (selection[0].dictStatus === 5) {
console.log("是否进入");
this.stop = "恢复";
} else {
this.stop = "暂停";
}
} else {
this.stop = "暂停";
}
this.rowClickFlag = false;
this.rows = selection;
this.single = selection.length != 1;
this.multiple = !selection.length;
this.isReShow = !selection.length;
if (selection.length > 0) {
let flag = false;
selection.forEach((element) => {
if (element.pickNumber) {
flag = true;
}
});
if (flag) {
this.ispickshow = true;
} else {
this.ispickshow = false;
}
} else {
this.ispickshow = true;
}
if (selection.length > 1) {
this.ispickshowT = false;
} else {
this.ispickshowT = true;
}
// console.log(this.ispickshow);
if (selection.length === 1 && this.ispickshow) {
this.isReturnShow = false;
} else {
this.isReturnShow = true;
}
},
/** 新增按钮操作 */
handleAdd() {
this.$layer.iframe({
shadeClose: false,
content: {
content: orderProdForm, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 1,
},
},
title: "新增",
});
},
/** 新增按钮操作 */
createdWork() {
this.$layer.iframe({
shadeClose: false,
content: {
content: workCreated, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
},
area: ["58vw", "auto"],
title: "创建工单",
});
},
ViewAll() {
//查看所有异常工单
this.$layer.iframe({
shadeClose: false,
content: {
content: AbnormalWorkOrder, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
},
area: ["60vw", "auto"],
title: "查看所有异常工单",
});
},
/** 生产领料*/
createdJSTL() {
if(this.rows.length < 2){
// if(this.rows.length != 1 || this.rows[0]==undefined || this.rows[0]==null){
this.$message.warning('必须选择多行数据进行操作!')
this.single=true
return
}
this.$layer.iframe({
shadeClose: false,
content: {
content: pordJSTL, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 1,
row: this.rows,
},
},
title: "生产领料单",
});
},
/** 生产领料*/
createdJSTLOne() {
console.log('1099')
if(this.rows.length > 1){
this.$confirm('是否确认将选中数据单独生成领料单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
var ids = {}
this.rows.forEach(row=>{
ids[row.id] = row.number
})
this.$plan.addByProduce(ids).then(res=>{
if (res.data.code==200) {
this.initData()
this.$message.success("保存成功");
} else {
this.$message.error(res.data.msg || res.data.message);
}
})
}).catch(() => {
// this.$message({
// type: 'info',
// message: '已取消删除'
// });
return;
});
}else{
if(this.rows.length != 1 || this.rows[0]==undefined || this.rows[0]==null){
this.$message.warning('必须选择一行数据进行操作!')
this.single=true
return
}
this.$layer.iframe({
shadeClose: false,
content: {
content: pickOne, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 1,
row: this.rows,
},
},
title: "生产领料单",
});
}
},
// 领料记录
pickList() {
if(this.rows.length != 1 || this.rows[0]==undefined || this.rows[0]==null){
this.$message.warning('必须选择一行数据进行操作!')
this.single=true
return
}
this.$layer.iframe({
shadeClose: false,
content: {
content: pickListdemo, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 1,
row: this.rows,
},
},
title: "领料记录",
});
},
/** 打印流转卡按钮操作 */
openPrinter() {
if(this.rows.length != 1 || this.rows[0]==undefined || this.rows[0]==null){
this.$message.warning('必须选择一行数据进行操作!')
this.single=true
return
}
this.$layer.iframe({
shadeClose: false,
content: {
content: printer, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 1,
row: this.rows[0],
},
},
title: "流转卡",
});
},
splitFlow() {
if(this.rows.length != 1 || this.rows[0]==undefined || this.rows[0]==null){
this.$message.warning('必须选择一行数据进行操作!')
this.single=true
return
}
console.log(this.rows[0],'1907')
this.$confirm("开始工单"+this.rows[0].number+"?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let params = {
id: this.rows[0].id,
};
this.$plan.getStart(params).then((resp) => {
if (resp.data.code == 200) {
this.$message({
type: "success",
message: "状态更改成功!",
});
this.initData();
}
else{this.$message.error(resp.data.msg)}
}) .catch(() => {
this.$message({
type: "error",
message: resp.data.message,
});
});
})
},
unpause() {
this.$confirm("是否取消工单暂停", "操作提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info",
}).then(() => {
let params = {
id: this.rows[0].id,
};
this.$plan.unpauseWork(params).then((resp) => {
if (resp.data.code == "200") {
this.$message.success("工单暂停取消成功");
this.initData();
}
else{this.$message.error(resp.data.msg)}
});
});
},
close() {
//关闭
if(this.rows.length != 1 || this.rows[0]==undefined || this.rows[0]==null){
this.$message.warning('必须选择一行数据进行操作!')
this.single=true
return
}
this.$confirm(
"工单关闭后将无法对此工单进行操作,是否关闭工单",
"操作提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info",
}
).then(() => {
let params = {
id: this.rows[0].id,
};
this.$plan.close(params).then((resp) => {
if (resp.data.code == "200") {
this.$message.success("工单关闭成功");
this.initData();
}
else{this.$message.error(resp.data.msg)}
});
});
},
valid() {
this.$layer.iframe({
shadeClose: false,
content: {
content: bomList, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
rows: this.rows,
},
},
area: ["1296px", "420px"],
title: "齐套性判断",
});
},
pbmListClick()
//用料清单
{
 this.g_method.sidebarReduce() //收紧侧边栏
this.$layer.iframe({
shadeClose: false,
content: {
content: pbmList, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
rows: this.rows,
pageType:"work"//表示页面类型是工单
},
},
area: ["72vw", "700px"],
title: "用料清单",
});
},
ecnSignClick()
{
//工单ECN签核
console.log('1623')
console.log(this.rows,'1649')
if(this.rows.length != 1 || this.rows[0]==undefined || this.rows[0]==null){
this.$message.warning('必须选择一行数据进行操作!')
this.single=true
return
}
this.$layer.iframe({
shadeClose: false,
content: {
content: ecnSign, //传递的组件对象
parent: this, //当前的vue对象
data: {
rows: this.rows,
pageType:'work'
},
},
area: [this.g_const.dialogWidthSmall, "500px"],
title: "ECN签核",
});
},
serinumber() {
this.$layer.iframe({
shadeClose: false,
content: {
content: orderSerial, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
rows: this.rows,
},
},
// area: ["1100px", "420px"],
title: "详情",
});
},
serialGenerateClick() {
//生成序列号点击
this.$layer.iframe({
resize: true,
shadeClose: false,
content: {
content: generateSerial, //传递的组件对象
parent: this, //当前的vue对象
data: {
row: this.rows[0],
},
},
area: [this.g_const.dialogWidthMiddle, "380px"],
title: "生成序列号",
});
},
serialGenerateCmClick() {
//生成中移序列号点击
this.$layer.iframe({
resize: true,
shadeClose: false,
content: {
content: generateCmSerial, //传递的组件对象
parent: this, //当前的vue对象
data: {
row: this.rows[0],
},
},
area: ["60vw", "680px"],
title: "生成中移序列号",
});
},
pause() {
if (this.rows[0].dictStatus == 5) {
this.$confirm("是否取消工单暂停", "操作提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info",
}).then(() => {
let params = {
id: this.rows[0].id,
};
this.$plan.unpauseWork(params).then((resp) => {
if (resp.data.code == "200") {
this.$message.success("工单暂停取消成功");
this.initData();
}
else{this.$message.error(resp.data.msg)}
});
});
} else {
this.$confirm("是否暂停工单", "操作提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "info",
}).then(() => {
let params = {
id: this.rows[0].id,
};
this.$plan.pauseWork(params).then((resp) => {
if (resp.data.code == "200") {
this.$message.success("工单暂停成功");
this.initData();
}
else{this.$message.error(resp.data.msg)}
});
});
}
},
async deliver()
{
//下发
// this.$confirm("是否下发", "操作提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning",
// }).then(async () => {
console.log('15102')
console.log(this.rows,'1510')
// for(let i=0;i<this.rows.length;i++)
// {
//
// if(this.rows[i].routeId==null || this.rows[i].routeId==undefined){
// this.$message.error('工单号为'+this.rows[i].number+'的工艺路线为空,无法下发!')
// return
// }
// if(this.rows[i].dictStatus != 10){
// this.$message.error('工单号为'+this.rows[i].number+'的状态不是已创建,无法下发!')
// return
// }
//
// }
this.$layer.iframe({
resize: true,
shadeClose: false,
content: {
content: selectWorkCenter, //传递的组件对象
parent: this, //当前的vue对象
data: {
rows:this.rows
},
},
area: ['25vw', "400px"],
title: "下发",
});
// let uploadFileMsg=""
// for(let i=0;i<this.rows.length;i++)
// {
// let res=await this.$plan.orderWorkDeliver(this.rows[i])
// console.log(res,'1817')
// if(res.data.code=='200'){
// uploadFileMsg =
// uploadFileMsg +
// "<p style='color:#00F'>" +
// "工单号"+
// this.rows[i].number +
// "下发成功" +
// "</p>";
// }
// else{
// uploadFileMsg =
// uploadFileMsg +
// "<p style='color:#FF0000'>" +
// "工单号"+
// this.rows[i].number +
// "导入失败,原因:" +
// res.data && res.data.msg?res.data.msg : "未知原因" +
// "</p>"
// }
// }
// this.$alert(uploadFileMsg, "下发结果", {
// dangerouslyUseHTMLString: true,
// });
// this.getList()
// })
//下发
},
prodPick() {
//根据生产领料的生产补料
this.$layer.iframe({
shadeClose: false,
content: {
content: prodPick, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 1,
row: this.rows,
},
},
title: "生产补料",
});
},
repRecord() {
//补料记录
console.log("我是补料记录");
this.$layer.iframe({
shadeClose: false,
content: {
content: repRecord, //传递的组件对象
parent: this, //当前的vue对象
shadeClose: false,
data: {
formType: 1,
row: this.rows,
},
},
title: "补料记录",
});
},
// Finspect() {
// //首检
// this.$layer.iframe({
// shadeClose: false,
// content: {
// content: Finspect,
// parent: this,
// shadeClose: false,
// // data: {
// // formType: 1,
// // row: this.rows,
// // },
// data:this.rows[0],
// },
// title: "首检信息",
// });
// },
getTableData(val) {
//高级查询
this.queryData = val
this.tableData=this.queryData.data
this.tableData.forEach((value) => {
value.materialNumber=value.materialCode
value.dictStatusShow = this.$dictType.getOrderWorkStatus(
value.dictStatus
);
value.lastStatusShow = this.$dictType.getOrderWorkLastStatus(
value.lastStatus
);
value.dictFlowtypeShow = this.$dictType.getMaterialFlowType(
value.dictFlowtype
);
value.dictPtypeShow = this.$dictType.getOrderPtypeType(
value.dictPtype
);
value.dictPstatusShow = this.$dictType.getWorkPStatus(value.dictPstatus);//领料状态
});
this.total=this.queryData.recordsTotal
// this.getBomlList()
},
cellStyle ({ row, column, rowIndex, columnIndex }) {
if (row.dictStatus == 10 && column.property=='dictStatusShow') {
//已创建
return 'color: red;font-weight:bold;'
} else if (row.dictStatus == 15 && column.property=='dictStatusShow') {
//已下发
return 'color:lightgreen;font-weight:bold;'
}else if (row.dictStatus == 20 && column.property=='dictStatusShow') {
//生产中
return 'color:blue;font-weight:bold;'
}else if (row.dictStatus == 30 && column.property=='dictStatusShow') {
//暂停
return 'color:orange;font-weight:bold;'
}
else if (row.dictStatus == 40 && column.property=='dictStatusShow') {
//已完成
return 'color:green;font-weight:bold;'
}
else if (row.dictStatus == 50 && column.property=='dictStatusShow') {
//已关闭
return 'color:gray;font-weight:bold;'
};
console.log(row.workLastStatus,column.property)
if (row.lastStatus == 5 && column.property=='lastStatusShow') {
//未执行
return 'color: red;font-weight:bold;'
} else if (row.lastStatus == 10 && column.property=='lastStatusShow') {
//正常执行
return 'color:lightgreen;font-weight:bold;'
}else if (row.lastStatus == 15 && column.property=='lastStatusShow') {
//临近交期
return 'color:blue;font-weight:bold;'
}else if (row.lastStatus == 20 && column.property=='lastStatusShow') {
//已延期
return 'color:orange;font-weight:bold;'
}
else if (row.lastStatus == 25 && column.property=='lastStatusShow') {
//严重延期
return 'color:green;font-weight:bold;'
}
},
getLastTime(row, isStyle) {
// console.log('行: ', row, row.lastTime)
let time = row.lastTime
if (time) {
let h = time % 24
let d = parseInt(time / 24)
if (isStyle) {
if (1 <= d && d < 2) {
return 'color:yellowgreen; font-weight:bold;'
} else if (2 <= d && d < 3) {
return 'color:orange; font-weight:bold;'
} else if (3 <= d) {
return 'color:red; font-weight:bold;'
}
} else {
return `${d ? d + '天' : ''} ${h}小时`
}
}
},
handleTailOrder() {
}
},
watch: {
seqence: function () {
this.getList();
var oldIsSortShow = this.isSortShow
//判断是否显示排序条件
if(this.seqence.length > 0 ){
this.isSortShow = true
}else{
this.isSortShow = false
}
//判断table高度
if(oldIsSortShow != this.isSortShow){
if (this.isSortShow) {
this.tableHeight = this.tableHeight - 47;
} else {
this.tableHeight = this.tableHeight + 47;
}
}
},
},
};
</script>
<style scoped lang="scss">
.el-table th.gutter {
display: table-cell !important;
}
>>> .el-form-item {
padding: 0px;
margin: 0px;
}
>>> .vue-treeselect__control {
height: 20px;
line-height: 28px;
}
>>> .el-divider {
margin: 1px;
}
>>> .el-table__body tr.current-row > td {
background-color: #8ac1ff !important;
cursor: pointer;
}
.el-table >>> tbody tr:hover > td {
background-color: #8ac1ff !important;
}
.mb8 >>> .el-select .el-input__inner {
border: 0px;
}
.mb8 >>> .el-select .el-input__inner {
border: 0px;
padding-right: 35px;
}
.sortSeq >>> .el-input__suffix-inner {
display: none;
}
>>> .el-form-item {
margin-bottom: 10px;
}
.el-divider {
margin-top: 0px;
margin-bottom: 5px;
}
>>> .el-table .el-table__header-wrapper th {
padding: 5px 0;
}
>>> .vue-treeselect__control {
height: 30px !important;
line-height: 30px !important;
}
>>> .vue-treeselect--single .vue-treeselect__input-container {
height: 30px !important;
line-height: 30px !important;
}
// >>> .el-input-group__append{
// padding: 5px;
// }
>>> .el-input-group__append .el-select,
.el-input-group__append .el-button,
.el-input-group__prepend .el-select,
.el-input-group__prepend .el-button {
margin-left: -28px !important;
margin-right: -33px !important;
}
// .query >>> .el-button--mini{
// padding-bottom:0px;
// }
</style>