|
|
@@ -0,0 +1,8883 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <!-- 按钮区域 -->
|
|
|
+ <header>
|
|
|
+ <el-button type="primary" class="bt" @click="onBZ">班组维护</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="onzhicheng" >制程检验</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="onxuncha">管理巡查</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="ondianjian">设备点检</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="onyinban">印版领退</el-button>
|
|
|
+ <!-- <el-button type="primary" @click="onstatus" >设置机台状态</el-button> -->
|
|
|
+ <el-button type="primary" class="bt" @click="oncomplaints" >客诉记录</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="onClear" >换型清场</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="pd_gdprintonClick" >工单打印</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="gzSel" >员工工资查询</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="hesuan" v-if="AddType === true">核算参数调整</el-button>
|
|
|
+ <el-button type="primary" icon="edit" @click="onxzhscsclick" class="bt" title="修正核算参数">修正核算参数</el-button>
|
|
|
+ <el-button type="primary" icon="edit" @click="gd_gxclhconClick" class="bt" title="工序产量核查">工序产量核查</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="onADD" v-if="AddType === true">新增</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="onDel" v-if="DelType === true" >删除</el-button>
|
|
|
+ <el-button type="primary" icon="edit" @click="deldbcl_onclick" :disabled="dbclSelection === ''" class="bt" title="当班产量明细" >当班产量明细删除</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="onRCL">日产量批量维护</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="pd_lcdlistonClick" >流程单查询</el-button>
|
|
|
+ <el-button type="primary" class="bt" @click="scpconClick" >工单生产批次信息查询</el-button>
|
|
|
+ <el-button type="primary" icon="Download" class="bt" @click="llexporttoExcel" >拉料导出Excel</el-button>
|
|
|
+ <el-button @click="selectSameWorkOrder" type="success">全选同工单</el-button>
|
|
|
+ <el-button @click="invertSelection" type="info">反选</el-button>
|
|
|
+ <!-- <el-button type="primary" @click="onClear2" >换型清场</el-button> -->
|
|
|
+ </header>
|
|
|
+
|
|
|
+ <!-- 左侧树状图区域 -->
|
|
|
+ <el-container>
|
|
|
+ <layout-sider :resize-directions="['right']" :width="220" style="margin-right: 10px;" >
|
|
|
+ <div class="JKWTree-tree" style="height: 70vh;" >
|
|
|
+ <h3>设备运行跟踪</h3>
|
|
|
+ <el-tree :data="treeData" class="treecolor" highlight-current @node-click="handleNodeClick" />
|
|
|
+ </div>
|
|
|
+ </layout-sider>
|
|
|
+ <el-container>
|
|
|
+
|
|
|
+ <el-main>
|
|
|
+ <div class="button-container" v-if="showbutton" style="height: 50%;width: 100%; flex: 1; border: 0px magenta solid; margin: 0; padding: 0;">
|
|
|
+ <button v-for="(item, index) in machineData" :key="index" class="custom-button" @click="handleButtonClick(item.设备编号)">
|
|
|
+ <img :src="`/src/assets/${item.状态}.png`" :alt="altText" style="max-width: 100%; height: auto;"/>
|
|
|
+ <span style="margin-top: 8px;">{{ item.设备编号 + ' - ' + item.设备名称 }}</span>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="gva-search-box" v-if="JTMCOn" style="overflow: hidden; padding: 0; display: flex;">
|
|
|
+ <div style="flex: 1; border: 0px magenta solid; margin: 0; padding: 0;">
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="工单编号" prop="name">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6"><el-input v-model="formData.工单编号" disabled :clearable="true"/></el-col>
|
|
|
+ <el-col :span="18"><el-input v-model="formData.产品名称" disabled :clearable="true"/></el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="印件编号" prop="id"><el-input v-model="formData.印件编号" disabled :clearable="true" /></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="17">
|
|
|
+ <el-form-item label="工序名称" prop="name"><el-input v-model="formData.工序名称" disabled :clearable="true" /></el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="4"><el-form-item label="班组成员" prop="id"></el-form-item></el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="1">
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_bh1" disabled :clearable="true"/></el-col>
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_bh2" disabled :clearable="true"/></el-col>
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_bh3" disabled :clearable="true"/></el-col>
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_bh4" disabled :clearable="true"/></el-col>
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_bh5" disabled :clearable="true"/></el-col>
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_bh6" disabled :clearable="true"/></el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="1">
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_name1" disabled :clearable="true" /></el-col>
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_name2" disabled :clearable="true" /></el-col>
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_name3" disabled :clearable="true" /></el-col>
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_name4" disabled :clearable="true" /></el-col>
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_name5" disabled :clearable="true" /></el-col>
|
|
|
+ <el-col :span="4"><el-input v-model="formData.sczl_name6" disabled :clearable="true" /></el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="flex: 1; border: 0px lawngreen solid; margin: 0; padding: 0; overflow: hidden;">
|
|
|
+ <el-table tooltip-effect="dark" :data="selectData" row-key="ID" highlight-current-row="true"
|
|
|
+ :row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ border style="width:100%;height: 30vh;" @row-dblclick="handleSelectClick" >
|
|
|
+ <el-table-column prop="process" label="印件及工序" width="340" />
|
|
|
+ <el-table-column prop="completed" label="已完成板数" width="150" />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="JTMCOn" class="gva-table-box" >
|
|
|
+ <div class="gva-btn-list"></div>
|
|
|
+ <el-tabs v-model="activName" type="card" @tab-click="duohandleClick">
|
|
|
+ <el-tab-pane label="设备作业清单" @click="showTable('印件资料')" name="first" :class="{ 'active-tab': activeTab === 'first' }" >
|
|
|
+ <el-table ref="QDmultipleTable"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ highlight-current-row="true"
|
|
|
+ :cell-class-name="sbzyqdsatusCellClass"
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ @row-click="yjupdateCompanyFunc"
|
|
|
+ style="width: 100%;height: 330px" border tooltip-effect="dark" :data="sbzyData" row-key="ID" @selection-change="handleSelectionChange">
|
|
|
+ <!-- <el-table-column type="selection" width="55" />-->
|
|
|
+ <!-- <el-table-column align="left" label="选择" prop="bh" width="80"/> -->
|
|
|
+ <el-table-column align="left" sortable label="工单编号|质量信息" prop="工单编号|质量信息" width="170" />
|
|
|
+ <el-table-column align="left" label="印件资料" prop="印件资料" width="220" />
|
|
|
+ <el-table-column align="left" sortable label="工序名称" prop="工序名称" width="110" />
|
|
|
+ <el-table-column align="left" label="计划产量/已完成" prop="计划产量/已完成" width="130"/>
|
|
|
+ <el-table-column align="left" label="装版时数" prop="装版时数" width="85"/>
|
|
|
+ <el-table-column align="left" label="工序产能" prop="工序产能" width="85"/>
|
|
|
+ <el-table-column align="left" label="计划工时" prop="计划工时" width="85"/>
|
|
|
+ <el-table-column align="left" sortable label="计划生产时段" prop="计划生产时段" width="210" />
|
|
|
+ <el-table-column align="left" label="排产备注" prop="排产备注" width="85" />
|
|
|
+ <el-table-column align="left" sortable label="产品名称" prop="产品名称" width="400" />
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="班组人员及分配比例" @click="showTable('工艺资料')" name="second">
|
|
|
+ <el-table ref="FPmultipleTable"
|
|
|
+ highlight-current-row="true"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ @row-dblclick="gyupdateCompanyFunc"
|
|
|
+ :row-class-name="rowClassStyle"
|
|
|
+ style="width: 100%;height: 400px" border tooltip-effect="dark" :data="FPData" row-key="ID" @selection-change="handleSelectionChange"
|
|
|
+ @row-click="clickybupdate">
|
|
|
+ <!-- <el-table-column type="selection" width="55" />-->
|
|
|
+ <!-- <el-table-column align="left" label="选择" prop="方案" width="70"/> -->
|
|
|
+ <el-table-column align="left" sortable label="班组号" prop="班组号" width="95" />
|
|
|
+ <el-table-column align="left" label="组员1" prop="0" width="180" />
|
|
|
+ <el-table-column align="left" label="组员2" prop="1" width="180" />
|
|
|
+ <el-table-column align="left" label="组员3" prop="2" width="180" />
|
|
|
+ <el-table-column align="left" label="组员4" prop="3" width="180" />
|
|
|
+ <el-table-column align="left" label="组员5" prop="4" width="180" />
|
|
|
+ <el-table-column align="left" label="组员6" prop="5" width="180" />
|
|
|
+ <el-table-column align="left" label="组员7" prop="6" width="180" />
|
|
|
+ <el-table-column align="left" label="组员8" prop="7" width="180" />
|
|
|
+ <el-table-column align="left" label="组员9" prop="8" width="180" />
|
|
|
+ <el-table-column align="left" label="组员10" prop="9_正品版" width="180" />
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="当班产量明细" @click="showTable('印版资料')" name="third">
|
|
|
+ <el-table ref="DBmultipleTable" highlight-current-row="true"
|
|
|
+ :show-overflow-tooltip="true" :row-style="{ height: '20px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }" @row-dblclick="ybupdateCompanyFunc"
|
|
|
+ style="width: 100%;height: 400px" border tooltip-effect="dark" :data="CLMXData" row-key="ID"
|
|
|
+ @selection-change="dbclmxSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <el-table-column fixed align="left" sortable label="生产时段" prop="生产时间段" width="180"/>
|
|
|
+ <el-table-column fixed align="left" sortable label="工单编号" prop="工单编号" width="110" />
|
|
|
+ <el-table-column fixed align="left" sortable label="产品名称" prop="产品名称" width="150" />
|
|
|
+ <el-table-column fixed align="left" sortable label="印件及工序" prop="印件及工序" width="320"/>
|
|
|
+ <el-table-column align="left" sortable label="标牌号" prop="标牌号" width="100"/>
|
|
|
+ <el-table-column align="left" sortable label="产量" prop="产量" width="100"/>
|
|
|
+ <el-table-column align="left" sortable label="制程废品" prop="制程废品" width="110" />
|
|
|
+ <el-table-column align="left" sortable label="制程次品" prop="制程次品" width="110" />
|
|
|
+ <el-table-column align="left" sortable label="前工序废" prop="前工序废" width="110" />
|
|
|
+ <el-table-column align="left" sortable label="来料异常" prop="来料异常" width="110"/>
|
|
|
+ <el-table-column align="left" sortable label="装版工时" prop="装版工时" width="110" />
|
|
|
+ <el-table-column align="left" sortable label="保养工时" prop="保养工时" width="110" />
|
|
|
+ <el-table-column align="left" sortable label="打样工时" prop="打样工时" width="110"/>
|
|
|
+ <el-table-column align="left" sortable label="异常停机工时" prop="异常停机工时" width="135"/>
|
|
|
+ <el-table-column align="left" sortable label="通电工时" prop="通电工时" width="110"/>
|
|
|
+ <el-table-column align="left" sortable label="码开始行" prop="码开始行" width="110" />
|
|
|
+ <el-table-column align="left" sortable label="码结束行" prop="码结束行" width="110" />
|
|
|
+ <el-table-column align="left" sortable label="码包" prop="码包" width="100" />
|
|
|
+ <el-table-column align="left" sortable label="主电表" prop="主电表" width="100"/>
|
|
|
+ <el-table-column align="left" sortable label="辅电表" prop="辅电表" width="100" />
|
|
|
+ <el-table-column align="left" sortable label="色度数" prop="色度数" width="100" />
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="检验记录" @click="showTable('技术资料附件')" name="fourth">
|
|
|
+ <el-table ref="JYmultipleTable"
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ highlight-current-row="true"
|
|
|
+ style="width: 100%;height: 400px" border tooltip-effect="dark" :data="JYData" row-key="ID" @selection-change="handleSelectionChange">
|
|
|
+ <!-- <el-table-column type="selection" width="55" />-->
|
|
|
+ <el-table-column align="left" sortable label="工单编号" prop="工单编号" width="105"/>
|
|
|
+ <el-table-column align="left" label="印件号" prop="印件号" width="70" />
|
|
|
+ <el-table-column align="left" sortable label="工序名称" prop="工序名称" width="130" />
|
|
|
+ <el-table-column align="left" label="检验项目" prop="检验项目" width="160"/>
|
|
|
+ <el-table-column v-for="time in columnNames" :key="time" :label="time" :prop="time" align="center" width="80" ></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog v-model="detailShow" fullscreen style="font-size: 50px;font-weight: bold;" lock-scroll :before-close="closeDetailShow" title="机台班组维护" destroy-on-close>
|
|
|
+ <div>
|
|
|
+ <el-table ref="JTWHmultipleTable"
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
+ :cell-style="{ padding: '0px' ,color:'blue'}" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ highlight-current-row="true" @row-click="BZhandle"
|
|
|
+ style="width: 100%;height: 250px;margin-top: 0px;" border tooltip-effect="dark"
|
|
|
+ :data="bzData" row-key="ID" @selection-change="BZSelectionChange">
|
|
|
+ <!-- <el-table-column type="selection" width="55" /> -->
|
|
|
+ <el-table-column align="left" label="机台" prop="JTMC" width="100"/>
|
|
|
+ <el-table-column align="left" label="班组" prop="班组号" width="60"/>
|
|
|
+ <el-table-column align="left" label="组员1" prop="0" width="195"/>
|
|
|
+ <el-table-column align="left" label="组员2" prop="1" width="195"/>
|
|
|
+ <el-table-column align="left" label="组员3" prop="2" width="195"/>
|
|
|
+ <el-table-column align="left" label="组员4" prop="3" width="195"/>
|
|
|
+ <el-table-column align="left" label="组员5" prop="4" width="195"/>
|
|
|
+ <el-table-column align="left" label="组员6" prop="5" width="100"/>
|
|
|
+ <el-table-column align="left" label="组员7" prop="6" width="100"/>
|
|
|
+ <el-table-column align="left" label="组员8" prop="7" width="100"/>
|
|
|
+ <el-table-column align="left" label="组员9" prop="8" width="100"/>
|
|
|
+ <el-table-column align="left" label="特殊组员" prop="9" width="100"/>
|
|
|
+ <el-table-column align="left" label="UNIQID" prop="ID" width="100"/>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="margin-top:100px;">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="机台编号" prop="id">
|
|
|
+ <el-select v-model="selectedOption" placeholder="请选择">
|
|
|
+ <el-option v-for="item in dropdownOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="班组编号" prop="id">
|
|
|
+ <el-select v-model="BZMC" placeholder="" >
|
|
|
+ <el-option label="A 班" value="A 班"></el-option>
|
|
|
+ <el-option label="B 班" value="B 班"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div class="groupbox float-div" style="height: 17vh; width: 130vh;">
|
|
|
+ <span class="grouptitle">组员及分配比例</span>
|
|
|
+ <el-row :gutter="10" style="margin-top: 0px; height: 5vh;">
|
|
|
+ <el-col :span="2"><span></span></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="3"></el-col>
|
|
|
+ <el-col :span="3"><el-form-item label="特殊组员" prop="id"></el-form-item></el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10" style="margin-top: 0px;">
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.code1" @keyup.enter.native="getbzyg($event, '1')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.code2" @keyup.enter.native="getbzyg($event, '2')" /></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.code3" @keyup.enter.native="getbzyg($event, '3')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.code4" @keyup.enter.native="getbzyg($event, '4')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.code5" @keyup.enter.native="getbzyg($event, '5')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.code6" @keyup.enter.native="getbzyg($event, '6')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.code7" @keyup.enter.native="getbzyg($event, '7')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.code8" @keyup.enter.native="getbzyg($event, '8')"/></el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10" style="margin-top: 1px;">
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.name1" style="color:#00FF00"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.name2"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.name3"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.name4"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.name5"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.name6"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.name7"/></el-col>
|
|
|
+ <el-col :span="3"><el-input v-model="formDatas.name8"/></el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10" style="margin-top: 1px;">
|
|
|
+ <el-col :span="3"><el-input @input="updateTotal" :readonly="!formDatas.name1" v-model="formDatas.percentage1"/></el-col>
|
|
|
+ <el-col :span="3"><el-input @input="updateTotal" v-model="formDatas.percentage2"/></el-col>
|
|
|
+ <el-col :span="3"><el-input @input="updateTotal" v-model="formDatas.percentage3"/></el-col>
|
|
|
+ <el-col :span="3"><el-input @input="updateTotal" v-model="formDatas.percentage4"/></el-col>
|
|
|
+ <el-col :span="3"><el-input @input="updateTotal" v-model="formDatas.percentage5"/></el-col>
|
|
|
+ <el-col :span="3"><el-input @input="updateTotal" v-model="formDatas.percentage6"/></el-col>
|
|
|
+ <el-col :span="3"><el-input @input="updateTotal" v-model="formDatas.percentage7"/></el-col>
|
|
|
+ <el-col :span="3"><el-input @input="updateTotal" v-model="formDatas.percentage8"/></el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div style="height: 50vh; width: 15vh;margin-top: 3vh;">
|
|
|
+ <el-button type="text"></el-button>
|
|
|
+ <el-button style="margin-bottom: 1vh; width:15vh;background-color:cornflowerblue;font-size: 2.0vh;font-weight: bold; color: white;" @click="addBz" >新 增</el-button>
|
|
|
+ <el-button style="margin-bottom: 1vh; width:15vh;background-color:cornflowerblue;font-size: 2.0vh;font-weight: bold; color: white;" @click="selectBz" >更新当前班组</el-button>
|
|
|
+ <el-button style="margin-bottom: 1vh; width:15vh;background-color:cornflowerblue;font-size: 2.0vh;font-weight: bold; color: white;" @click="delBz" >删除当前班组</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 日产量批量维护 -->
|
|
|
+ <el-dialog v-model="detailShow_rcl" fullscreen
|
|
|
+ style="font-size: 50px;font-weight: bold;" lock-scroll :before-close="closeDetailShow_rcl" title="日产量批量维护" destroy-on-close>
|
|
|
+ <div>
|
|
|
+ <el-table ref="WHmultipleTable"
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
+ :cell-style="{ padding: '0px' ,color:'blue'}" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ highlight-current-row="true" @row-click="BZhandle_rcl"
|
|
|
+ style="width: 100%;height: 250px;margin-top: 0px;" border tooltip-effect="dark"
|
|
|
+ :data="bzData_rcl" row-key="ID" @selection-change="BZSelectionChange_rcl">
|
|
|
+ <!-- <el-table-column type="selection" width="55" /> -->
|
|
|
+ <el-table-column align="left" label="机台" prop="JTMC" width="70"/>
|
|
|
+ <el-table-column align="left" label="班组" prop="班组号" width="60"/>
|
|
|
+ <el-table-column align="left" label="组员1" prop="0" width="195"/>
|
|
|
+ <el-table-column align="left" label="组员2" prop="1" width="195"/>
|
|
|
+ <el-table-column align="left" label="组员3" prop="2" width="195"/>
|
|
|
+ <el-table-column align="left" label="组员4" prop="3" width="195"/>
|
|
|
+ <el-table-column align="left" label="组员5" prop="4" width="195"/>
|
|
|
+ <el-table-column align="left" label="组员6" prop="5" width="100"/>
|
|
|
+ <el-table-column align="left" label="组员7" prop="6" width="100"/>
|
|
|
+ <el-table-column align="left" label="组员8" prop="7" width="100"/>
|
|
|
+ <el-table-column align="left" label="组员9" prop="8" width="100"/>
|
|
|
+ <el-table-column align="left" label="特殊组员" prop="9" width="100"/>
|
|
|
+ <el-table-column align="left" label="UNIQID" prop="ID" width="100"/>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="margin-top:100px;">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="机台编号" prop="id">
|
|
|
+ <el-input v-model="selectedOption_rcl" disabled/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="班组编号" prop="id">
|
|
|
+ <el-input v-model="BZMC_rcl" disabled/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div class="groupbox float-div" style="height: 17vh; width: 130vh;">
|
|
|
+ <span class="grouptitle">组员及分配比例</span>
|
|
|
+ <el-row :gutter="10" style="margin-top: 0px; height: 5vh;">
|
|
|
+ <el-col :span="2"><span></span></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="3"></el-col>
|
|
|
+ <el-col :span="3"><el-form-item label="特殊组员" prop="id"></el-form-item></el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10" style="margin-top: 0px;">
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code1" @keyup.enter.native="getbzyg($event, '1')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code2" @keyup.enter.native="getbzyg($event, '2')" /></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code3" @keyup.enter.native="getbzyg($event, '3')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code4" @keyup.enter.native="getbzyg($event, '4')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code5" @keyup.enter.native="getbzyg($event, '5')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code6" @keyup.enter.native="getbzyg($event, '6')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code7" @keyup.enter.native="getbzyg($event, '7')"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.code8" @keyup.enter.native="getbzyg($event, '8')"/></el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10" style="margin-top: 1px;">
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name1" style="color:#00FF00"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name2"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name3"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name4"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name5"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name6"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name7"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.name8"/></el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="10" style="margin-top: 1px;">
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage1"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage2"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage3"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage4"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage5"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage6"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage7"/></el-col>
|
|
|
+ <el-col :span="3"><el-input disabled v-model="formDatas_rcl.percentage8"/></el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <div style="height: 50vh; width: 15vh;margin-top: 3vh;">
|
|
|
+ <el-button type="text"></el-button>
|
|
|
+ <el-button style="margin-bottom: 1vh; width:15vh;background-color:cornflowerblue;font-size: 2.0vh;font-weight: bold; color: white;" @click="selectBz_rcl" >更新</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+<!--流程单查询【弹窗】-->
|
|
|
+ <el-dialog v-model="pd_lcdlist" title="工单工序生产进程" style="width: 100%;height: 100%;margin: 0px;padding: 0px;">
|
|
|
+ <div style="width: 100%;height: 100%;">
|
|
|
+ <el-button type="" @click="pd_lcdCancel">退出</el-button>
|
|
|
+ </div>
|
|
|
+ <br>
|
|
|
+ <div style="width: 100%; height: 100%; display: flex; align-items: center;">
|
|
|
+ <el-form-item label="工单编号" style="margin-right: 20px; padding: 0;">
|
|
|
+ <el-input v-model="pd_lcdformData['gdbh']" @keyup.enter="pd_lcdProductValue"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="印件号" style="margin-right: 5px; padding: 0;">
|
|
|
+ <el-input v-model="pd_lcdformData['yjno']" @keyup.enter="pd_lcdProductValue"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" style="margin-right: 5px; padding: 0;">
|
|
|
+ <el-input v-model="pd_lcdformData['code']" disabled/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" style="margin-right: 5px; padding: 0;">
|
|
|
+ <el-input v-model="pd_lcdformData['name']" disabled style="width: 500px"/>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div style="width: 100%; height: 70vh; display: flex;">
|
|
|
+ <layout>
|
|
|
+ <layout-sider :resize-directions="['right']" :width="240" style="margin-right: 10px;height: 70vh;">
|
|
|
+ <div class="JKWTree-tree">
|
|
|
+ <el-tree :data="pd_lcd_treeData" @node-click="pd_lcd_handleNodeClick" default-expand-all></el-tree>
|
|
|
+ </div>
|
|
|
+ </layout-sider>
|
|
|
+ <!-- <br> -->
|
|
|
+ <layout-main>
|
|
|
+ <div style="display: flex; align-items: center;margin-left: 25px;">
|
|
|
+ <el-tag type="success" style="width: 55px; height: 40px; margin-right: 10px;"><h2>流程号</h2></el-tag>
|
|
|
+ <h2 style="margin: 0 20px 0 0;">绿格子图标表示“已完成”</h2>
|
|
|
+ <el-tag type="danger" style="width: 55px; height: 40px; margin-right: 10px;"><h2>流程号</h2></el-tag>
|
|
|
+ <h2 style="margin: 0;">红格子图标表示“未完成”</h2>
|
|
|
+ </div>
|
|
|
+ <!-- 这里放右侧的内容 -->
|
|
|
+ <el-space wrap style="margin-left: 20px;">
|
|
|
+ <!-- 右侧内容 -->
|
|
|
+ <template v-for="item in processList.total_process" >
|
|
|
+ <el-button class="custom-buttons" disabled :type="! processList.process.includes(item) ? 'danger' : 'info'" plain style="width: 50px;">{{ item }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-space>
|
|
|
+ </layout-main>
|
|
|
+ </layout>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <!--工单生产批次信息查询【弹窗】-->
|
|
|
+ <el-dialog v-model="scpconlist" title="工单生产批次信息查询" style="width: 100%;height: 100%;margin: 0px;padding: 0px;">
|
|
|
+ <el-button type="primary" @click="ontuicclicks" style="color: white;margin-left: 20px;" class="bt" title="退出">退出</el-button>
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ width: 60%;
|
|
|
+ height: 470px;
|
|
|
+ position: fixed;
|
|
|
+ left: 25%;
|
|
|
+ padding: 20px;
|
|
|
+ border-radius: 8px;
|
|
|
+ background-color: #fff;
|
|
|
+ box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);">
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <!-- 提示信息 -->
|
|
|
+ <hr>
|
|
|
+ <p style="font-size: 14px; color: red; margin: 10px 0;">搜索栏目为空,则从最近2周完工的工单中选择</p>
|
|
|
+ <p style="font-size: 14px; color: red; margin: 10px 0;">否则,以栏目值为关键字,从工单编号、产品名称、客户名称中选择</p>
|
|
|
+ <hr>
|
|
|
+
|
|
|
+ <!-- 输入框和按钮 -->
|
|
|
+ <div style="display: flex; align-items: center; margin-top: 10px;">
|
|
|
+ <el-input v-model="searchInfolcd" placeholder="Enter回车搜索工单编号" @keydown="Enterkeysearch" id="searchInfo" style="height: 40px;flex: 1;"></el-input>
|
|
|
+ <el-button type="primary" title="搜索" icon="el-icon-search" style="width: 70px;height: 40px;font-size: 18px;" @click="onSubmitlcd" >搜索</el-button>
|
|
|
+ <el-button type="primary" title="查看" icon="el-icon-search" style="width: 110px;height: 40px;font-size: 18px;" @click="onstatsuclick" >查看流程单</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 表格展示区域 -->
|
|
|
+ <div class="gva-table-box" style="margin-top: 15px;">
|
|
|
+ <el-table
|
|
|
+ ref="PCmultipleTable"
|
|
|
+ style="width: 100%; height: 30vh; verflow: auto;"
|
|
|
+ :row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :data="tableDatalcd"
|
|
|
+ :border="true"
|
|
|
+ :tooltip-effect="'dark'"
|
|
|
+ row-key="ID"
|
|
|
+ highlight-current-row
|
|
|
+ @row-click="tableRowClicklcd"
|
|
|
+ @row-dblclick="updateCompanyFunclcd"
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column align="left" label="工单编号" width="115" prop="Gd_gdbh" />
|
|
|
+ <el-table-column align="left" label="行号" width="60" prop="行号" />
|
|
|
+ <el-table-column align="left" label="工序名称" prop="Gd_cpmc" />
|
|
|
+ <!-- <el-table-column prop="工单" label="工单编号-行号-工序名称" align="left" sortable show-overflow-tooltipmin-width="300"/> -->
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 机台生产日报表维护弹窗 -->
|
|
|
+ <el-dialog v-model="popdialog" title="机台生产日报表维护" destroy-on-close width="90%" style="height: 92%; margin-left: 5%; margin-top: 1%;">
|
|
|
+ <div>
|
|
|
+ <!-- 顶层布局 -->
|
|
|
+ <layout>
|
|
|
+ <!-- 顶部的搜索区域 -->
|
|
|
+ <layout-header>
|
|
|
+ <el-form ref="elSearchFormRef" class="demo-form-inline" :rules="searchRule">
|
|
|
+ <!-- 添加按钮 -->
|
|
|
+ <el-button type="primary" icon="edit" style="color: white;margin-left: 20px;" @click="ontuicclick" class="bt" title="退出">退出</el-button>
|
|
|
+ </el-form>
|
|
|
+ </layout-header>
|
|
|
+
|
|
|
+ <!-- 左右布局 -->
|
|
|
+ <layout style="height: calc(100% - 50px); display: flex;">
|
|
|
+ <!-- 左侧树形区域 -->
|
|
|
+ <layout-sider style="width: 140px; margin-right: 10px; overflow: hidden;height: 584px;">
|
|
|
+ <div class="JKWTree-tree" style="height: 100%; max-height: 100vh; overflow-y: auto;">
|
|
|
+ <h3></h3>
|
|
|
+ <el-tree
|
|
|
+ :data="treeDatalcd"
|
|
|
+ node-key="num"
|
|
|
+ highlight-current
|
|
|
+ :props="defaultProps"
|
|
|
+ @node-click="handleNodeClicklcd"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </layout-sider>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 右侧表格区域 -->
|
|
|
+ <layout-content style="flex: 1; overflow: auto;">
|
|
|
+ <el-main>
|
|
|
+ <div style="width: 100%; font-family: Arial, sans-serif; font-size: 14px;">
|
|
|
+ <div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
|
|
|
+ <p style="flex: 0.4; margin: 0;">工单编号:<span style="color: red;">{{ _GetorderDetail['Gd_gdbh'] }}</span></p>
|
|
|
+ <p style="flex: 0.3; margin: 0;">产品代号:<span style="color: red;">{{ _GetorderDetail['Gd_cpdh'] }}</span></p>
|
|
|
+ <p style="flex: 1; margin: 0;">产品名称:<span style="color: red;">{{ _GetorderDetail['Gd_cpmc'] }}</span></p>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
|
|
|
+ <p style="flex: 0.4; margin: 0;">订单数量:<span style="color: red;">{{ _GetorderDetail['订单数量'] }}</span></p>
|
|
|
+ <p style="flex: 0.3; margin: 0;">实际投料:<span style="color: red;">{{ _GetorderDetail['实际投料'] }}</span></p>
|
|
|
+ <p style="flex: 1; margin: 0;">
|
|
|
+ 单位:<span style="color: red;">{{ _GetorderDetail['计量单位'] }}</span>
|
|
|
+ 目标合格率:<span style="color: red;">{{ _GetorderDetail['投料率'] }}</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="工艺及生产班组" @click="showTable('工艺及生产班组')" name="first">
|
|
|
+ <el-table tooltip-effect="dark" :data="lcdtableData" row-key="ID"
|
|
|
+ highlight-current-row="true"
|
|
|
+ :row-style="{ height: '0px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
|
|
|
+ border :show-overflow-tooltip="true" :cell-class-name="planUsageCellClass"
|
|
|
+ style="width: 100%;height: 56vh" ref="tablesczl_gxmc"
|
|
|
+ @row-dblclick="gyscbzSelectClick">
|
|
|
+ <el-table-column align="left" label="流程单号" width="81" prop="流程单号" />
|
|
|
+ <el-table-column align="left" label="工序号" width="68" prop="工序号" />
|
|
|
+ <el-table-column align="left" label="工序名称" width="240" prop="工序名称" />
|
|
|
+ <el-table-column align="left" label="生产日期" width="120" prop="生产日期" />
|
|
|
+ <el-table-column align="left" label="机台编号" width="81" prop="机台编号" />
|
|
|
+ <el-table-column align="left" label="班组人员01" width="105" :formatter="(row) => `${row.sczl_bh1 || ''} ${row.name1 || ''}`"/>
|
|
|
+ <el-table-column align="left" label="班组人员02" width="105" :formatter="(row) => `${row.sczl_bh2 || ''} ${row.name2 || ''}`"/>
|
|
|
+ <el-table-column align="left" label="班组人员03" width="105" :formatter="(row) => `${row.sczl_bh3 || ''} ${row.name3 || ''}`"/>
|
|
|
+ <el-table-column align="left" label="班组人员04" width="105" :formatter="(row) => `${row.sczl_bh4 || ''} ${row.name4 || ''}`"/>
|
|
|
+ <el-table-column align="left" label="班组人员05" width="105" :formatter="(row) => `${row.sczl_bh5 || ''} ${row.name5 || ''}`"/>
|
|
|
+ <el-table-column align="left" label="班组人员06" width="105" :formatter="(row) => `${row.sczl_bh6 || ''} ${row.name6 || ''}`"/>
|
|
|
+ <el-table-column align="left" label="班组人员07" width="105" :formatter="(row) => `${row.sczl_bh7 || ''} ${row.name7 || ''}`"/>
|
|
|
+ <el-table-column align="left" label="班组人员08" width="105" :formatter="(row) => `${row.sczl_bh8 || ''} ${row.name8 || ''}`"/>
|
|
|
+ <el-table-column align="left" label="班组人员09" width="105" :formatter="(row) => `${row.sczl_bh9 || ''} ${row.name9 || ''}`"/>
|
|
|
+ <el-table-column align="left" label="班组人员10" width="105" :formatter="(row) => `${row.sczl_bh10 || ''} ${row.name10 || ''}`"/>
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="制程异常记录" @click="showTable('制程异常记录')" name="second">
|
|
|
+ <el-table tooltip-effect="dark" :data="zcycjltableData" row-key="ID"
|
|
|
+ highlight-current-row="true"
|
|
|
+ :row-style="{ height: '0px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
|
|
|
+ border :show-overflow-tooltip="true" :cell-class-name="planUsageCellClass"
|
|
|
+ style="width: 100%;height: 65vh" ref="tablzcycjl_gxmc"
|
|
|
+ @row-dblclick="zcycjlSelectClick">
|
|
|
+ <el-table-column align="left" label="流程单号" width="100" prop="流程单号" />
|
|
|
+ <el-table-column align="left" label="数量" width="100" prop="数量" />
|
|
|
+ <el-table-column align="left" label="异常备注" width="400" prop="缺陷备注" />
|
|
|
+ <el-table-column align="left" label="用户" width="160" prop="用户" />
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ </el-tabs>
|
|
|
+ </el-main>
|
|
|
+ </layout-content>
|
|
|
+ </layout>
|
|
|
+ </layout>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 组员及分配比例 -->
|
|
|
+ <el-dialog v-model="blModel" :before-close="() => blModel = false" style="width: 20%" @keydown="selectBZRR($event)">
|
|
|
+ <el-form>
|
|
|
+ <div>
|
|
|
+ <el-table :data="employeeData" border :show-overflow-tooltip="true" :cell-class-name="blplanUsageCellClass"
|
|
|
+ highlight-current-row="true"
|
|
|
+ ref="tableBZRR"
|
|
|
+ @row-click="tablebllickHandler($event)">
|
|
|
+ <el-table-column prop="员工编号" label="员工编号"></el-table-column>
|
|
|
+ <el-table-column prop="ygxm" label="员工姓名"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog v-model="dianjianVisible" :before-close="dianjiancloseDialog" title="设备点检记录" destroy-on-close width="1300px" style="height: 80%;">
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="3">
|
|
|
+ <el-form-item label="设备编号" prop="id">
|
|
|
+ <el-input v-model="formData.JTMC" :clearable="true" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-row>
|
|
|
+ <el-col>
|
|
|
+ <el-input v-model="formData.产品名称" :clearable="true" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div style="flex: 0.1;">
|
|
|
+ <el-aside width="200px" style="margin: 0;">
|
|
|
+ <div class="JKWTree-tree" style="height: 100%; border-right: 1px solid #ebeef5;">
|
|
|
+ <el-tree :data="dianjiantreeData" :props="defaultProps" highlight-current="true"
|
|
|
+ @node-click="dianjianNodeClick" @node-dblclick="handleNodeDoubleClick"></el-tree>
|
|
|
+ </div>
|
|
|
+ </el-aside>
|
|
|
+ </div>
|
|
|
+ <div style="flex: 1; margin: 0;">
|
|
|
+ <el-table
|
|
|
+ tooltip-effect="dark"
|
|
|
+ :data="dianjianselectData"
|
|
|
+ row-key="ID"
|
|
|
+ highlight-current-row="true"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ border @row-click="dianjianhandle"
|
|
|
+ style="width:100%; height:400px;"
|
|
|
+ @row-dblclick="handleSelectClick"
|
|
|
+ :row-class-name="rowClassName">
|
|
|
+ <el-table-column prop="检验项目" label="检验项目" width="300"/>
|
|
|
+ <el-table-column prop="点检方法" label="点检方法" width="180"/>
|
|
|
+ <el-table-column v-slot="scope" label="正常" width="80" >
|
|
|
+ <el-checkbox v-model="scope.row.zc" @change="zcClick(scope.row)"></el-checkbox>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-slot="scope" label="异常" width="80">
|
|
|
+ <el-checkbox v-model="scope.row.yc" @change="ycClick(scope.row)"></el-checkbox>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="备注说明" width="180">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ v-slot="scope"
|
|
|
+ label="不检测"
|
|
|
+ width="80"
|
|
|
+ >
|
|
|
+ <el-checkbox v-model="scope.row.notjc" @change="notjcClick(scope.row)"></el-checkbox>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-input v-model="pandingfangfa" style="height: 50px;" :clearable="true" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 弹窗底部按钮 -->
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer" style="width: 100%;">
|
|
|
+ <el-button @click="dianjiancloseDialog" style="width: 100px; height: 40px;">关 闭</el-button>
|
|
|
+ <el-button type="primary" @click="dianjianenterDialog" style="width: 100px; height: 40px;">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="yinbanVisible"
|
|
|
+ title="机台印版领用"
|
|
|
+ destroy-on-close
|
|
|
+ width="1300px"
|
|
|
+ style="height: 75%;"
|
|
|
+ >
|
|
|
+ <div style="margin-top:-12px">
|
|
|
+ <el-button type="primary" class="bt" icon="edit" :disabled="currentSelection.length === 0" @click="onout">领出</el-button>
|
|
|
+ <el-button type="primary" class="bt" icon="document" :disabled="currentSelection.length === 0" @click="onwithdraw">收回</el-button>
|
|
|
+ <el-button @click="yinbaninvertSelection" type="info">反选</el-button>
|
|
|
+ </div>
|
|
|
+ <el-row :gutter="24" style="margin-top: 10px;">
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label="工单编号" prop="id">
|
|
|
+ <el-input v-model="formData.工单编号" :clearable="true" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label="印件号" prop="id">
|
|
|
+ <el-input v-model="formData.印件号" :clearable="true" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item prop="id">
|
|
|
+ <el-input v-model="formData.productCode" :clearable="true" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="14">
|
|
|
+ <el-form-item prop="id">
|
|
|
+ <el-input v-model="formData.产品名称" :clearable="true" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div style="flex: 1;">
|
|
|
+ <el-aside width="250px" style="margin: 0;">
|
|
|
+ <div class="JKWTree-tree" style="height: 100%; border-right: 1px solid #ebeef5;">
|
|
|
+ <el-tree :data="yinbantreeData" :props="defaultProps" highlight-current="true"
|
|
|
+ @node-click="yinbanNodeClick" @node-dblclick="handleNodeDoubleClick"></el-tree>
|
|
|
+ </div>
|
|
|
+ </el-aside>
|
|
|
+ </div>
|
|
|
+ <div style="flex: 1; margin: 0;">
|
|
|
+ <el-table
|
|
|
+ ref="yinbanmultipleTable"
|
|
|
+ tooltip-effect="dark"
|
|
|
+ :data="yinbanselectData"
|
|
|
+ row-key="ID"
|
|
|
+ highlight-current-row="true"
|
|
|
+ border
|
|
|
+ style="width:1000px; height:400px;"
|
|
|
+ @row-dblclick="handleSelectClick"
|
|
|
+ :row-class-name="rowClassName"
|
|
|
+ @selection-change="yinbanSelectionChange">
|
|
|
+ <el-table-column fixed type="selection" width="30" />
|
|
|
+ <el-table-column
|
|
|
+ prop="存货编码"
|
|
|
+ label="存货编码"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="存货名称"
|
|
|
+ label="存货名称"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="印版名称"
|
|
|
+ label="印版名称"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="供方批号"
|
|
|
+ label="供方批号"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="工单编号"
|
|
|
+ label="当前领用工单"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="制造日期"
|
|
|
+ label="制造日期"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="印数"
|
|
|
+ label="印数"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="印版类别"
|
|
|
+ label="印版类别"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="客户编号"
|
|
|
+ label="客户编号"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="客户名称"
|
|
|
+ label="客户名称"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="产品编号"
|
|
|
+ label="产品编号"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="产品名称"
|
|
|
+ label="产品名称"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 退回弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialogwithdrawVisible"
|
|
|
+ title="印版印数"
|
|
|
+ style="width: 20%; margin: 30vh auto;"
|
|
|
+ >
|
|
|
+ <el-form-item label="印数">
|
|
|
+ <el-input v-model="Plate.印数" placeholder="请输入印数" />
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer" style="width: 100%;">
|
|
|
+ <el-button @click="rawcloseDialog" style="width: 100px; height: 40px;">关 闭</el-button>
|
|
|
+ <el-button type="primary" @click="rawenterDialog" style="width: 100px; height: 40px;">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="xunchaVisible"
|
|
|
+ title="管理人员现场巡查记录"
|
|
|
+ destroy-on-close
|
|
|
+ width="1300px"
|
|
|
+ style="height: 65%;"
|
|
|
+ >
|
|
|
+
|
|
|
+
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div style="flex: 1;">
|
|
|
+ <el-aside width="250px" style="margin: 0;">
|
|
|
+ <div class="JKWTree-tree" style="height: 100%; border-right: 1px solid #ebeef5;">
|
|
|
+ <el-tree :data="xunchatreeData" :props="defaultProps" highlight-current="true"
|
|
|
+ @node-click="xunchaNodeClick"></el-tree>
|
|
|
+ </div>
|
|
|
+ </el-aside>
|
|
|
+ </div>
|
|
|
+ <div style="flex: 1; margin: 0;">
|
|
|
+ <el-table
|
|
|
+ tooltip-effect="dark"
|
|
|
+ :data="xunchaselectData"
|
|
|
+ row-key="ID"
|
|
|
+ highlight-current-row="true"
|
|
|
+ border
|
|
|
+ style="width:1000px; height:400px;"
|
|
|
+ @row-dblclick="handleSelectClick"
|
|
|
+ :row-class-name="rowClassName"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ prop="工单编号"
|
|
|
+ label="工序编号"
|
|
|
+ width="85"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="印件号"
|
|
|
+ label="印件号"
|
|
|
+ width="70"
|
|
|
+ />
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="工序名称"
|
|
|
+ label="工序名称"
|
|
|
+ width="180"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="流程单号"
|
|
|
+ label="流程单号"
|
|
|
+ width="85"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="设备编号"
|
|
|
+ label="设备编号"
|
|
|
+ width="85"
|
|
|
+ />
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ prop="班组编号"
|
|
|
+ label="班组编号"
|
|
|
+ width="85"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="检验备注"
|
|
|
+ label="检验备注"
|
|
|
+ width="85"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="现场管理人员"
|
|
|
+ label="现场管理人员"
|
|
|
+ width="145"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="提交时间"
|
|
|
+ label="提交时间"
|
|
|
+ width="160"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="开工时间"
|
|
|
+ label="开工时间"
|
|
|
+ width="160"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="分钟差数"
|
|
|
+ label="分钟差数"
|
|
|
+ width="85"
|
|
|
+ />
|
|
|
+ <el-table-column
|
|
|
+ prop="归属时段"
|
|
|
+ label="归属时段"
|
|
|
+ width="160"
|
|
|
+ />
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <!-- <el-button @click="closeDialog">关 闭</el-button> -->
|
|
|
+ <!-- <el-button type="primary" @click="xunjianerDialog">提 交</el-button> -->
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="zhichengVisible"
|
|
|
+ title="制程检验记录"
|
|
|
+ destroy-on-close
|
|
|
+ width="1100px"
|
|
|
+ style="height: 78%;"
|
|
|
+ >
|
|
|
+ <el-row :gutter="24" style="margin-top:0px; margin-bottom: 1px;">
|
|
|
+ <el-col :span="4" style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-form-item label="工单编号" prop="id" style="margin-top:0px;; margin-bottom: 0px;">
|
|
|
+ <el-input v-model="xunchaData.order" :clearable="true" placeholder="" style="margin-top:0px;; margin-bottom: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="9" style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-row style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-col style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-input v-model="xunchaData.product_name" :clearable="true" placeholder="" style="margin-top:0px; margin-bottom: 0px;"/>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-form-item label="流程单" prop="id" style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-input v-model="xunchaData.lcdh" :clearable="true" placeholder="" style="margin-top:0px; margin-bottom: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="margin-top:0px; margin-bottom: 1px;">
|
|
|
+ <el-col :span="3" style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-form-item label="印件编号" prop="id" style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-input v-model="xunchaData.yjno" :clearable="true" placeholder="" style="margin-top:0px; margin-bottom: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="10" style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-row style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-col style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-input v-model="xunchaData.gxmc" :clearable="true" placeholder="" style="margin-top:0px; margin-bottom: 0px;"/>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div style="flex: 0.1;">
|
|
|
+ <el-aside width="180px" style="margin: 0;">
|
|
|
+ <div class="JKWTree-tree" style="height: 100%; border-right: 1px solid #ebeef5;">
|
|
|
+ <el-tree :data="zhichengtreeData" :props="defaultProps" highlight-current="true"
|
|
|
+ @node-click="zhichengNodeClick"></el-tree>
|
|
|
+ </div>
|
|
|
+ </el-aside>
|
|
|
+ </div>
|
|
|
+ <div v-if="zhichengstatus" style="flex: 0; margin: 0;">
|
|
|
+ <el-tabs v-model="activNames" type="card" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="指标检验" @click="showTable('指标检验')" name="first">
|
|
|
+ <el-table
|
|
|
+ tooltip-effect="dark"
|
|
|
+ :data="zhibiaoselectData"
|
|
|
+ row-key="ID"
|
|
|
+ highlight-current-row="true"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ border
|
|
|
+ style="width:100%; height:310px;"
|
|
|
+ :row-class-name="rowClassName">
|
|
|
+ <el-table-column prop="检验项目" label="检验项目" width="270" />
|
|
|
+
|
|
|
+ <el-table-column label="不检测" width="70">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-radio v-model="scope.row.selected" label="不检测">
|
|
|
+ <span style="visibility: hidden;">不检测</span>
|
|
|
+ </el-radio>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="合格" width="60">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-radio v-model="scope.row.selected" label="合格">
|
|
|
+ <span style="visibility: hidden;">合格</span>
|
|
|
+ </el-radio>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="不合格" width="70">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-radio v-model="scope.row.selected" label="不合格">
|
|
|
+ <span style="visibility: hidden;">不合格</span>
|
|
|
+ </el-radio>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column prop="检测方法" label="检测方法" width="90" />
|
|
|
+ <el-table-column prop="检验频率" label="检验频率" width="150" />
|
|
|
+ <el-table-column prop="相关标准" label="相关标准" width="180" />
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="附加检验记录" @click="showTable('附加检验记录')" name="second">
|
|
|
+ <el-table
|
|
|
+ tooltip-effect="dark"
|
|
|
+ :data="fujiaselectData"
|
|
|
+ row-key="ID"
|
|
|
+ highlight-current-row="true"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ border
|
|
|
+ style="width:100%; height:320px;"
|
|
|
+ @row-dblclick="handleSelectClick"
|
|
|
+ :row-class-name="rowClassName">
|
|
|
+ <el-table-column v-slot="scope" label="不检测" width="75">
|
|
|
+ <el-checkbox v-model="scope.row.notjc"></el-checkbox>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <!-- 缺陷及记录列,转换为输入框 -->
|
|
|
+ <el-table-column label="缺陷及记录" width="720">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input v-model="scope.row['缺陷备注']" placeholder="请输入缺陷及记录"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- <el-table-column prop="缺陷备注" label="缺陷及记录" width="720"/> -->
|
|
|
+
|
|
|
+ <el-table-column prop="编号" label="编号" width="80"/>
|
|
|
+
|
|
|
+
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <div v-if="zhichengstatus" class="dialog-footer">
|
|
|
+ <el-button @click="closezhichengDialog">关 闭</el-button>
|
|
|
+ <el-button type="primary" @click="zhichengDialog">提 交</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <div v-if="dateOn" >
|
|
|
+ <el-tabs v-model="activName" type="card" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="当日上报产量" @click="showTable('当日上报产量')" name="first">
|
|
|
+ <!-- 非JP机台 -->
|
|
|
+ <el-table ref="multipleTable"
|
|
|
+ v-if="! isJPJT"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ @selection-change="selectionChange($event)"
|
|
|
+ :row-style="{ height: '20px' }" :selectable="checkboxT"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }" @row-click="getUid"
|
|
|
+ highlight-current-row="true" @row-dblclick="gytableDatadoubleClick"
|
|
|
+ style="width: 100%;height: 70vh" border tooltip-effect="dark" :data="gytableData" row-key="ID" >
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <!-- <el-table-column align="left" label="选择" prop="工单编号" width="100"/> -->
|
|
|
+ <el-table-column fixed align="left" label="产品名称" prop="产品名称" width="300"/>
|
|
|
+ <el-table-column fixed align="left" label="工序" prop="工序" width="170"/>
|
|
|
+ <el-table-column fixed align="left" label="产量" prop="产量" width="100"/>
|
|
|
+ <el-table-column align="left" label="千件工价" prop="千件工价" width="85"/>
|
|
|
+ <el-table-column align="left" label="日定额" prop="日定额" width="85"/>
|
|
|
+ <el-table-column align="left" label="流程" sortable prop="num" width="80"/>
|
|
|
+ <el-table-column align="left" label="补产标准" prop="补产标准" width="85"/>
|
|
|
+ <el-table-column align="left" label="难度系数" prop="难度系数" width="85"/>
|
|
|
+ <el-table-column align="left" label="备注" prop="备注" width="200"/>
|
|
|
+ <el-table-column align="left" label="组员1" prop="组员1" width="150" />
|
|
|
+ <el-table-column align="left" label="组员2" prop="组员2" width="150" />
|
|
|
+ <el-table-column align="left" label="组员3" prop="组员3" width="150" />
|
|
|
+ <el-table-column align="left" label="组员4" prop="组员4" width="150" />
|
|
|
+ <el-table-column align="left" label="组员5" prop="组员5" width="70" />
|
|
|
+ <el-table-column align="left" label="组员6" prop="组员6" width="70" />
|
|
|
+ <el-table-column align="left" label="组员7" prop="组员7" width="70" />
|
|
|
+ <el-table-column align="left" label="组员8" prop="组员8" width="70" />
|
|
|
+ <el-table-column align="left" label="组员9" prop="组员9" width="70" />
|
|
|
+ <el-table-column align="left" label="组员10" prop="组员10" width="70" />
|
|
|
+ <el-table-column align="left" label="制程废品" prop="制程废品" width="85" />
|
|
|
+ <el-table-column align="left" label="制程次品" prop="制程次品" width="85" />
|
|
|
+ <el-table-column align="left" label="前工序废" prop="前工序废" width="85" />
|
|
|
+ <el-table-column align="left" label="来料异常" prop="来料异常" width="85"/>
|
|
|
+ <el-table-column align="left" label="装版工时" prop="装版工时" width="85" />
|
|
|
+ <el-table-column align="left" label="保养工时" prop="保养工时" width="85" />
|
|
|
+ <el-table-column align="left" label="打样工时" prop="打样工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="异常总工时" prop="异常总工时" width="100"/>
|
|
|
+ <el-table-column align="left" label="异常补时" prop="异常补时" width="85"/>
|
|
|
+ <el-table-column align="left" label="异常类型" prop="异常类型" width="110"/>
|
|
|
+ <el-table-column align="left" label="通电工时" prop="通电工时" width="85"/>
|
|
|
+ <el-table-column align="left" label="码开始行" prop="码开始行" width="85" />
|
|
|
+ <el-table-column align="left" label="码结束行" prop="码结束行" width="85" />
|
|
|
+ <el-table-column align="left" label="码包" prop="码包" width="70" />
|
|
|
+ <el-table-column align="left" label="主电表" prop="主电表" width="70"/>
|
|
|
+ <el-table-column align="left" label="辅电表" prop="辅电表" width="70" />
|
|
|
+ <el-table-column align="left" label="色度数" prop="色度数" width="70" />
|
|
|
+ <el-table-column align="left" label="印刷方式" prop="印刷方式" width="85"/>
|
|
|
+ <el-table-column align="left" label="用户" prop="用户" width="210" />
|
|
|
+ <el-table-column align="left" label="更新时间" prop="更新时间" width="160" />
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <el-table ref="JPmultipleTable"
|
|
|
+ v-else
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ @selection-change="selectionChange($event)"
|
|
|
+ :row-style="{ height: '20px' }" :row-class-name="totalClassName" :cell-class-name="tableDataCellClass"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }" @row-click="getUid"
|
|
|
+ highlight-current-row="true" @row-dblclick="JPgytableDatadoubleClick"
|
|
|
+ style="width: 100%;height: 70vh" border tooltip-effect="dark" :data="JPgytableData" row-key="ID" >
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <!-- <el-table-column fixed align="left" label="工单编号" prop="工单编号" width="130"/> -->
|
|
|
+ <el-table-column align="left" fixed label="产品名称" prop="产品名称" width="300"/>
|
|
|
+ <el-table-column align="left" fixed label="工序" prop="工序" width="150"/>
|
|
|
+ <!-- <el-table-column align="left" label="印件号" prop="yjno" width="115"/>
|
|
|
+ <el-table-column align="left" label="工序名称" prop="gxmc" width="200"/> -->
|
|
|
+ <el-table-column align="left" fixed label="班组" prop="bzdh" width="70"/>
|
|
|
+ <el-table-column align="left" label="计件箱数" prop="计件箱数" width="90"/>
|
|
|
+ <el-table-column align="left" label="每箱数量" prop="每箱数量" width="90"/>
|
|
|
+ <el-table-column align="left" label="日定额" prop="日定额" width="80"/>
|
|
|
+ <el-table-column align="left" label="流程" sortable prop="num" width="80"/>
|
|
|
+ <el-table-column align="left" label="检验类型" prop="检验类型" width="90"/>
|
|
|
+ <el-table-column align="left" label="废品率系数" prop="废品率系数" width="100"/>
|
|
|
+ <el-table-column align="left" label="千件工价" prop="千件工价" width="90"/>
|
|
|
+ <el-table-column align="left" label="补产标准" prop="补产标准" width="90"/>
|
|
|
+ <el-table-column align="left" label="组员1" prop="组员1" width="170"/>
|
|
|
+ <el-table-column align="left" label="组员2" prop="组员2" width="170"/>
|
|
|
+ <el-table-column align="left" label="组员3" prop="组员3" width="170"/>
|
|
|
+ <el-table-column align="left" label="组员4" prop="组员4" width="170"/>
|
|
|
+ <el-table-column align="left" label="组员5" prop="组员5" width="170"/>
|
|
|
+ <el-table-column align="left" label="组员6" prop="组员6" width="170"/>
|
|
|
+ <el-table-column align="left" label="组员7" prop="组员7" width="170"/>
|
|
|
+ <el-table-column align="left" label="换膜补时" prop="换膜补时" width="90"/>
|
|
|
+ <el-table-column align="left" label="保养工时" prop="保养工时" width="90"/>
|
|
|
+ <el-table-column align="left" label="异常总工时" prop="异常总工时" width="100"/>
|
|
|
+ <el-table-column align="left" label="通电工时" prop="通电工时" width="90"/>
|
|
|
+ <el-table-column align="left" label="难度系数" prop="难度系数" width="90"/>
|
|
|
+ <el-table-column align="left" label="定额代号" prop="定额代号" width="130"/>
|
|
|
+ <el-table-column align="left" label="更新时间" prop="更新时间" width="160"/>
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="当日制程检验记录" @click="showTable('印件资料')" name="second">
|
|
|
+ <el-table ref="JYmultipleTable"
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ highlight-current-row="true"
|
|
|
+ style="width: 100%;height: 70vh" border tooltip-effect="dark" :data="drzcDatas" row-key="ID" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" />
|
|
|
+ <el-table-column align="left" label="工单编号" prop="工单编号" width="85"/>
|
|
|
+ <el-table-column align="left" label="印件号" prop="印件号" width="70" />
|
|
|
+ <el-table-column align="left" label="工序名称" prop="工序名称" width="85" />
|
|
|
+ <el-table-column align="left" label="检验项目" prop="检验项目" width="85"/>
|
|
|
+ <el-table-column
|
|
|
+ v-for="time in columnNames"
|
|
|
+ :key="time"
|
|
|
+ :label="time"
|
|
|
+ :prop="time"
|
|
|
+ align="center"
|
|
|
+ width="80"
|
|
|
+ ></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+ <el-dialog v-model="complaintsShow" style="width: 1000px" lock-scroll :before-close="closecomplaintsShow" title="=客诉记录" destroy-on-close>
|
|
|
+ <el-table ref="multipleTable"
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ highlight-current-row="true" @row-click="complaintshandle"
|
|
|
+ style="width: 100%;height: 250px;margin-top: 0px;" border tooltip-effect="dark"
|
|
|
+ :data="complaintsData" row-key="ID" @selection-change="complaintsSelectionChange">
|
|
|
+ <!-- <el-table-column type="selection" width="55" /> -->
|
|
|
+ <el-table-column align="left" label="产品编号" prop="产品编号" width="120"/>
|
|
|
+ <el-table-column align="left" label="产品名称" prop="产品名称" width="200"/>
|
|
|
+ <el-table-column align="left" label="客诉日期" prop="客诉日期" width="120"/>
|
|
|
+ <el-table-column align="left" label="客诉单号" prop="客诉单号" width="120"/>
|
|
|
+ <el-table-column align="left" label="客诉方式" prop="客诉方式" width="100"/>
|
|
|
+ <el-table-column align="left" label="订单编号" prop="订单编号" width="100"/>
|
|
|
+ <el-table-column align="left" label="缺陷关键字" prop="缺陷关键字" width="140"/>
|
|
|
+ <el-table-column align="left" label="客诉性质" prop="客诉性质" width="100"/>
|
|
|
+ <el-table-column align="left" label="主要责任部门" prop="主要责任部门" width="140"/>
|
|
|
+ <el-table-column align="left" label="次要责任部门" prop="次要责任部门" width="140"/>
|
|
|
+ </el-table>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="客户编号" prop="id">
|
|
|
+ <el-input v-model="selectedRowData.客户编号" :clearable="true" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="15">
|
|
|
+ <el-form-item label="客户名称" prop="id">
|
|
|
+ <el-input v-model="selectedRowData.客户名称" :clearable="true" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="客诉单号" prop="id">
|
|
|
+ <el-input v-model="selectedRowData.客诉单号" :clearable="true" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="客诉日期" prop="id">
|
|
|
+ <el-input v-model="selectedRowData.客诉日期" :clearable="true" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="方式" prop="id">
|
|
|
+ <el-input v-model="selectedRowData.客诉方式" :clearable="true" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="批次号" prop="id">
|
|
|
+ <el-input v-model="selectedRowData.订单编号" :clearable="true" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-form-item label="反馈问题" prop="id">
|
|
|
+ <el-input v-model="selectedRowData.客诉描述" :clearable="true" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-form-item label="缺陷关键字" prop="id">
|
|
|
+ <el-input v-model="selectedRowData.缺陷关键字" :clearable="true" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="性质" prop="id">
|
|
|
+ <el-input v-model="selectedRowData.客诉性质" :clearable="true" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="扣分" prop="id">
|
|
|
+ <el-input v-model="selectedRowData.扣分" :clearable="true" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <div style="display: flex;">
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="huanxingVisible"
|
|
|
+ title="换型清场"
|
|
|
+ destroy-on-close
|
|
|
+ width="145vh"
|
|
|
+ style="height: 78vh;"
|
|
|
+ :before-close="closehuanxingVisible"
|
|
|
+ >
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div style="flex: 0.1;">
|
|
|
+ <el-aside width="26vh" style="margin: 0;">
|
|
|
+ <div class="JKWTree-tree" style="height: 60vh; border-right: 1px solid #ebeef5;">
|
|
|
+ <el-tree :data="huanxingtreeData" :props="defaultProps" highlight-current="true"
|
|
|
+ @node-click="huanxingNodeClick"></el-tree>
|
|
|
+ </div>
|
|
|
+ </el-aside>
|
|
|
+ </div>
|
|
|
+ <div v-if="huanxingstatus" style="flex: 0; margin: 0;">
|
|
|
+ <el-tabs v-model="activNames" type="card" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="换型清场明细信息" @click="showTable('换型清场明细信息')" name="first">
|
|
|
+ <div style="width:110vh">
|
|
|
+ <el-descriptions :column="9" border>
|
|
|
+ <el-descriptions-item :span="9">
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-col :span="6" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="日期:" prop="id" style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-input v-model="huanxingData.日期" placeholder="" style="margin-top:0px; margin-bottom: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="机台编号:" prop="id" style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-input v-model="huanxingData.机台编号" placeholder="" style="margin-top:0px; margin-bottom: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="班组:" prop="id" style="margin-top:0px; margin-bottom: 0px;">
|
|
|
+ <el-input v-model="huanxingData.班组" placeholder="" style="margin-top:0px; margin-bottom: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="清场原因 从" :span="9">
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-col :span="8" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="工单编号:" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-input v-model="huanxingData.工单编号A" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="16" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="印件名称:" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-input v-model="huanxingData.印件名称A" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-col :span="12" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="印件工序:" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-input v-model="huanxingData.印件工序A" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="码包号" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-input v-model="huanxingData.码包号A" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="清场原因 到" :span="9">
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-col :span="8" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="工单编号:" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-input v-model="huanxingData.工单编号B" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="16" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="印件名称:" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-input v-model="huanxingData.印件名称B" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-col :span="12" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="印件工序:" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-input v-model="huanxingData.印件工序B" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="码包号" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-input v-model="huanxingData.码包B" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="清场确认项目" :span="9">
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-col :span="12" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="菲林_标样_签样品_留样品" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-checkbox v-model="huanxingData.项目1"></el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="版材_纸张_电化铝_油墨" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-checkbox v-model="huanxingData.项目2"></el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-col :span="12" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="过版纸_废品_次品" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-checkbox v-model="huanxingData.项目3"></el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="半成品_成品_零头" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-checkbox v-model="huanxingData.项目4"></el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-col :span="12" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="操作台桌面_抽屉_地面" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-checkbox v-model="huanxingData.项目5"></el-checkbox>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="清场确认人" :span="9">
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-col :span="12" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="机长签字" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-input v-model="huanxingData.机长" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-col :span="12" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="带班主管签字" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-input v-model="huanxingData.班长" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-form-item label="质量巡查员签字" prop="id" style="margin-bottom: 0px;margin-top: 0px;">
|
|
|
+ <el-input v-model="huanxingData.质量巡查员" placeholder="" style="margin-bottom: 0px;margin-top: 0px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="当前设备换型记录" @click="showTable('当前设备换型记录')" name="second">
|
|
|
+ <el-table tooltip-effect="dark" :data="huanxingselectData" row-key="ID"
|
|
|
+ highlight-current-row="true" :show-overflow-tooltip="true" border
|
|
|
+ style="width:115vh; height:50vh;" @row-dblclick="handleSelectClick" :row-class-name="rowClassName" >
|
|
|
+ <el-table-column prop="日期" label="日期" width="160" />
|
|
|
+ <el-table-column prop="机台编号" label="机台编号" width="90" />
|
|
|
+ <el-table-column prop="班组" label="班组" width="70" />
|
|
|
+ <el-table-column prop="工单编号A" label="工单编号A" width="95" />
|
|
|
+ <el-table-column prop="印件名称A" label="印件名称A" width="130" />
|
|
|
+ <el-table-column prop="印件工序A" label="印件工序A" width="150" />
|
|
|
+ <el-table-column prop="码包号A" label="码包号A" width="80" />
|
|
|
+ <el-table-column prop="工单编号B" label="工单编号B" width="100" />
|
|
|
+ <el-table-column prop="印件名称B" label="印件名称B" width="100" />
|
|
|
+ <el-table-column prop="印件工序B" label="印件工序B" width="150" />
|
|
|
+ <el-table-column prop="码包号B" label="码包号B" width="80" />
|
|
|
+ <el-table-column prop="清场项目A" label="菲林_标样_签样品_留样品" width="190" />
|
|
|
+ <el-table-column prop="清场项目B" label="版材_纸张_电化铝_油墨" width="190" />
|
|
|
+ <el-table-column prop="清场项目C" label="过版纸_废品_次品" width="170" />
|
|
|
+ <el-table-column prop="清场项目D" label="半成品_成品_零头" width="170" />
|
|
|
+ <el-table-column prop="清场项目E" label="操作台桌面_抽屉_地面" width="180" />
|
|
|
+ <el-table-column prop="机长" label="机长" width="80" />
|
|
|
+ <el-table-column prop="班长" label="带班长" width="80" />
|
|
|
+ <el-table-column prop="质量巡查员" label="质量巡查员" width="100" />
|
|
|
+ <el-table-column prop="创建时间" label="创建时间" width="120" />
|
|
|
+ <el-table-column prop="UNIQID" label="UNIQID" width="80" />
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog v-model="chanliangVisible" destroy-on-close
|
|
|
+ width="80%" style="height: 94vh;margin-top: 1%;padding: 10px 10px 0px 10px;" :before-close="closechanliangVisible" :title="type2 === 'create' ? '新增' : '修改'">
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="height: 40px;">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="工单编号:" prop="flatFeed" class="mab" >
|
|
|
+ <el-input v-model="formdata3.value.工单编号" id="工单编号" @blur="getCPMCsubmit()" @keydown="ent1($event)" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-form-item label="产品名称:" prop="perTenThousand" class="mab" label-width="150">
|
|
|
+ <el-input v-model="formdata3.value.cpmc" id="产品名称" readonly @keydown="ent1($event)" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="height: 40px;">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="印件号:" prop="flatFeed" class="mab"label-width="70">
|
|
|
+ <el-input v-model="formdata3.value.yjno" id="印件号" @keydown="ent1($event)" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-form-item label="印件名称:" prop="perTenThousand" class="mab" label-width="150">
|
|
|
+ <el-input v-model="formdata3.value.yjmc" id="印件名称" @keydown="ent1($event)" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="height: 40px;">
|
|
|
+ <el-col :span="14">
|
|
|
+ <el-form-item label="工序名称:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.gxmc" id="工序名称" @focus="gxmcHandleFocus()" @blur="getGXsubmit()" @keydown="ent1($event)" style="width: 350px;" />
|
|
|
+ <el-input v-model="formdata3.value.gxh" id="工序号" :readonly=true :clearable="true" style="width: 80px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="工艺名称:" prop="perTenThousand" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.gymc" id="工艺名称" @keydown="ent1($event)" :readonly=true :clearable="true" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="height: 40px;">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="日期:" prop="flatFeed" class="mab" label-width="70">
|
|
|
+ <el-date-picker v-model="formdata3.value.rq" type="datetime" format="YYYY/MM/DD" value-format="YYYY-MM-DD" @keydown="ent1($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="机器:" class="mab" prop="remark">
|
|
|
+ <el-select v-model="formdata3.value.sczl_jtbh"
|
|
|
+ id="机器" @keydown="ent1($event)" @change="jtbh_change()"
|
|
|
+ style="flex: 1; height: auto; width: 100px;">
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in gdzl_MachineList_address.data"
|
|
|
+ :key="index"
|
|
|
+ :label="item.split('-->')[0].trim()"
|
|
|
+ :value="item.split('-->')[0].trim()">
|
|
|
+ {{ item }}
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="开工时间:" prop="flatFeed" class="mab">
|
|
|
+ <el-date-picker v-model="formdata3.value.starttime" type="datetime" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" @keydown="ent1($event)" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5" style="margin-top:0px; margin-bottom: 1px;">
|
|
|
+ <el-form-item label="流程单号" prop="id" style="margin-top:0px; margin-bottom: 1px;">
|
|
|
+ <el-input v-model="formdata3.value.num" id="流程单号" style="margin-top:0px; margin-bottom: 1px;" @keydown="ent1($event)" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="height: 40px;">
|
|
|
+ <el-col :span="9">
|
|
|
+ <el-form-item label="上机时间:" prop="flatFeed" class="mab">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formdata3.value.sj1"
|
|
|
+ type="datetime"
|
|
|
+ format="YYYY/MM/DD hh:mm:ss"
|
|
|
+ value-format="YYYY-MM-DD h:m:s"
|
|
|
+ @keydown="ent1($event)"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="9">
|
|
|
+ <el-form-item label="下机时间:" prop="flatFeed" class="mab">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="formdata3.value.sj2"
|
|
|
+ type="datetime"
|
|
|
+ format="YYYY/MM/DD hh:mm:ss"
|
|
|
+ value-format="YYYY-MM-DD h:m:s"
|
|
|
+ @keydown="ent1($event)"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="墨色:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.色度数" id="墨色" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="加工联数:" prop="flatFeed" class="mab" >
|
|
|
+ <el-input v-model="formdata3.value.联数" id="加工联数" @keydown="ent1($event)" style="width: 100px; margin-right: 30px;" />
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="产量:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.产量" id="产量" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="制程废品:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.制程废品" id="制程废品" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="height: 40px;">
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label="制程次品:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.制程次品" id="制程次品" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label="前工序废:" prop="flatFeed" class="mab" >
|
|
|
+ <el-input v-model="formdata3.value.前工序废" id="前工序废" @keydown="ent1($event)" style="width: 100px; margin-right: 30px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="来料异常:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.来料异常" id="来料异常" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="10">
|
|
|
+ <el-form-item label="换型类型:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.换型类型" id="换型类型" disabled style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ <el-row :gutter="30" style="height: 40px;">
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="装版总工时:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.装版总工时" id="装版总工时" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="装版补产工时:" prop="flatFeed" class="mab" >
|
|
|
+ <el-input v-model="formdata3.value.装版工时" id="装版补产工时" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="打样总工时:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.打样总工时" id="打样总工时" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="打样补产工时:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.打样工时" id="打样补产工时" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label="保养工时:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.保养工时" id="保养工时" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="异常总工时:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.异常总工时" id="异常总工时" style="margin-top:0px; margin-bottom: 1px;" @keydown="ent1($event)" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="异常类型:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.异常类型" disabled id="异常类型" style="width: 100px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5" style="margin-top:0px; margin-bottom: 1px;">
|
|
|
+ <el-form-item label="异常补贴工时" prop="id" style="margin-top:0px; margin-bottom: 1px;">
|
|
|
+ <el-input v-model="formdata3.value.异常补时" id="异常补贴工时" style="margin-top:0px; margin-bottom: 1px;" @keydown="ent1($event)" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="height: 40px;">
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="通电工时:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.通电工时" id="通电工时" @keydown="ent1($event)" style="width: 100px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5" style="margin-top:0px; margin-bottom: 1px;">
|
|
|
+ <el-form-item label="定额代号" prop="id" style="margin-top:0px; margin-bottom: 1px;">
|
|
|
+ <el-input v-model="formdata3.value.dedh" id="定额代号" readonly style="margin-top:0px; margin-bottom: 1px;" @keydown="ent1($event)" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="3" style="margin-top:0px; margin-bottom: 1px;">
|
|
|
+ <el-form-item label="码包" prop="id" style="margin-top:0px; margin-bottom: 1px;">
|
|
|
+ <el-input v-model="formdata3.value.码包" id="码包" style="margin-top:0px; margin-bottom: 1px;" @keydown="ent1($event)" placeholder="" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ <el-row :gutter="24" style="height: 40px;">
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="码开始行:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.码开始行" id="码开始行" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="码结束行:" prop="flatFeed" class="mab" >
|
|
|
+ <el-input v-model="formdata3.value.码结束行" id="码结束行" @keydown="ent1($event)" style="width: 100px; margin-right: 30px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="5">
|
|
|
+ <el-form-item label="主电表:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.主电表" id="主电表" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="7">
|
|
|
+ <el-form-item label="辅电表:" prop="flatFeed" class="mab">
|
|
|
+ <el-input v-model="formdata3.value.辅电表" id="辅电表" @keydown="ent1($event)" style="width: 200px;" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div style="width: 95vh;">组员及分配比例</div>
|
|
|
+ <div style="width: 9vh;margin-left: 70px;">特殊组员</div>
|
|
|
+ <div style="">拉料人员</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-row :gutter="10" style="margin-top: 1vh;">
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.bzdh" id="bzdh" @keydown="ent1($event)"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员1['编号']" id="bh1" @keyup.enter.native="GetYg($event, '1')"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员2['编号']" id="bh2" @keyup.enter.native="GetYg($event, '2')"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员3['编号']" id="bh3" @keyup.enter.native="GetYg($event, '3')"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员4['编号']" id="bh4" @keyup.enter.native="GetYg($event, '4')"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员5['编号']" id="bh5" @keyup.enter.native="GetYg($event, '5')"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员6['编号']" id="bh6" @keyup.enter.native="GetYg($event, '6')"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员7['编号']" id="bh7" @keyup.enter.native="GetYg($event, '7')"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员8['编号']" id="bh8" @keyup.enter.native="GetYg($event, '8')"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员9['编号']" id="bh9" @keyup.enter.native="GetYg($event, '9')"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员10['编号']" id="bh10" @keyup.enter.native="GetYg($event, '10')"/></el-col>
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-select v-model="formdata3.value.拉料['编号']" id="bh11" @change="GetLl('create')">
|
|
|
+ <el-option label="" value="" />
|
|
|
+ <el-option label="自备" value="自备" />
|
|
|
+ <el-option label="李有文" value="李有文" />
|
|
|
+ <el-option label="张杭强" value="张杭强" />
|
|
|
+ <el-option label="朱喜文" value="朱喜文" />
|
|
|
+ <el-option label="刘旭青" value="刘旭青" />
|
|
|
+ <el-option label="刘芳民" value="刘芳民" />
|
|
|
+ <el-option label="李当林" value="李当林" />
|
|
|
+ <el-option label="王赞文" value="王赞文" />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" style="margin-top: 10px;">
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员1['姓名']" id="name1"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员2['姓名']" id="name2"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员3['姓名']" id="name3"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员4['姓名']" id="name4"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员5['姓名']" id="name5"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员6['姓名']" id="name6"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员7['姓名']" id="name7"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员8['姓名']" id="name8"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员9['姓名']" id="name9"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员10['姓名']" id="name10"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.拉料['姓名']" id="name11"/></el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" style="margin-top: 10px;">
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员1['比例']" id="rate1" @input="updateTotal" @keydown="ent($event, 'bh11', 'rate1', 'rate2')" placeholder="" /></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员2['比例']" id="rate2" @input="updateTotal" @keydown="ent($event, 'rate1', 'rate2', 'rate3')" placeholder="" /></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员3['比例']" id="rate3" @input="updateTotal" @keydown="ent($event, 'rate2', 'rate3', 'rate4')" placeholder="" /></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员4['比例']" id="rate4" @input="updateTotal" @keydown="ent($event, 'rate3', 'rate4', 'rate5')" placeholder="" /></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员5['比例']" id="rate5" @input="updateTotal" @keydown="ent($event, 'rate4', 'rate5', 'rate6')" placeholder="" /></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员6['比例']" id="rate6" @input="updateTotal" @keydown="ent($event, 'rate5', 'rate6', 'rate7')" placeholder="" /></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员7['比例']" id="rate7" @input="updateTotal" @keydown="ent($event, 'rate6', 'rate7', 'rate8')" placeholder="" /></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员8['比例']" id="rate8" @input="updateTotal" @keydown="ent($event, 'rate7', 'rate8', 'rate9')" placeholder="" /></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员9['比例']" id="rate9" @input="updateTotal" @keydown="ent($event, 'rate8', 'rate9', 'rate10')" placeholder="" /></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="formdata3.value.组员10['比例']" id="rate10" @input="updateTotal" @keydown="ent($event, 'rate9', 'rate10', '工单编号')" placeholder="" /></el-col>
|
|
|
+ <el-col :span="2"></el-col>
|
|
|
+ </el-row>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="closeDialog">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="chanliangenterDialog">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- JP机新增定额代号弹窗 -->
|
|
|
+ <el-dialog v-model="FJPGetDedhVisible" id="tableFplb" @keydown="FJPent($event)" style="margin-top: 5%;" >
|
|
|
+ <el-form>
|
|
|
+ <el-form-item label="选择定额代号" class="mab" prop="keyOrder"></el-form-item>
|
|
|
+ <div style="border:1px solid #eee; width:100%; height: 600px; overflow-y: auto;">
|
|
|
+ <el-tree :data="FJPGetDedhtreeData" ref="FJPtable_fplb"
|
|
|
+ @keydown="FJPhandleTreeKeydown"
|
|
|
+ :props="{ children: 'children',label: 'label'}"
|
|
|
+ node-key="id" @node-click="FJPhandleFplbClick">
|
|
|
+ </el-tree>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- JP机台独立页面 新增-->
|
|
|
+ <el-dialog v-model="JPchanliangVisible" :before-close="JPcloseDialog" style="width: 60%;margin-top: 5%;" :title="'新增班组产量提报'" destroy-on-close>
|
|
|
+ <el-row>
|
|
|
+ <el-form :model="JPformdata" label-position="right" ref="elFormRef" :rules="rule" >
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="工单编号:" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdata['工单编号']" style="width: 110px;" placeholder="Enter回车" id="新增工单编号" @blur="JPgetCPMCsubmit()" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="产品名称:" prop="customerName" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdata['产品名称']" readonly style="width: 520px;" id="产品名称"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="印件号:" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdata['印件号']" style="width: 110px;" id="印件号" placeholder="Enter回车" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="印件名称:" prop="customerName" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdata['印件名称']" readonly style="width: 520px;" id="印件名称" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="工序号:" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdata['工序号']" style="width: 110px;" id="工序号" placeholder="Enter回车" @blur="JPgetGXsubmit()" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="工序名称" prop="customerName" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdata['工序名称']" readonly style="width: 300px;" id="工序名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="检验类别:" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdata['检验类别']" readonly placeholder="Enter回车" style="width: 100px;" id="检验类别" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="废品率系数:" prop="customerCode" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdata['废品率系数']" style="width: 100px;" id="废品率系数" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="日期: " label-width="90">
|
|
|
+ <el-input type="date" max="9999-12-31" v-model="JPformdata['日期']" id = '日期' @keydown="JPent($event)" @focus="rqHandleFocus()"
|
|
|
+ style="width: 110px;" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="机器:" prop="customerCode" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdata['机器']" style="width: 110px;" placeholder="Enter回车" id="机器" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="流程标牌:" prop="customerCode" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdata['流程标牌']" style="width: 80px;" id="流程标牌" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="计件箱数:" prop="customerCode" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdata['计件箱数']" style="width: 100px;" id="计件箱数" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="每箱数量:" prop="customerCode" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdata['每箱数量']" style="width: 100px;" id="每箱数量" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="换膜总工时" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdata['换膜总工时']" style="width: 100px;" id="换膜总工时" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="换膜补产工时" prop="customerCode" class="mab" label-width="110">
|
|
|
+ <el-input v-model="JPformdata['换膜补产工时']" style="width: 100px;" id="换膜总工时" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="保养工时:" prop="customerCode" class="mab" label-width="290">
|
|
|
+ <el-input v-model="JPformdata['保养工时']" style="width: 100px;" id="保养工时" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="异常总工时:" prop="customerCode" class="mab" label-width="110">
|
|
|
+ <el-input v-model="JPformdata['异常总工时']" style="width: 100px;" id="异常总工时" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="异常类型:" prop="customerCode" class="mab" label-width="110">
|
|
|
+ <el-input v-model="JPformdata['异常类型']" style="width: 100px;" id="异常类型" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="异常补贴工时:" prop="customerCode" class="mab" label-width="290">
|
|
|
+ <el-input v-model="JPformdata['异常补贴工时']" style="width: 100px;" id="异常补贴工时" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="通电工时" prop="customerCode" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdata['通电工时']" style="width: 100px;" id="通电工时" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="定额代号:" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdata['定额代号']" style="width: 160px;" placeholder="Enter回车" id="定额代号" @keydown="JPent($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <br>
|
|
|
+
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div>组员及分配比例</div>
|
|
|
+ </div>
|
|
|
+ <el-row :gutter="10" style="margin-top: 1vh;">
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-input v-model="JPformdata['bzdh']" id="bzdh" @keydown="JPent($event)"/>
|
|
|
+ </el-col>
|
|
|
+ <el-col v-for="i in 10" :key="i" :span="2">
|
|
|
+ <el-input v-model="JPformdata['组员' + i]['编号']" :id="'bh' + i" @keydown="JPent($event,i,'1')"/>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" style="margin-top: 1vh;">
|
|
|
+ <el-col :span="2">
|
|
|
+ <!-- 空列,用于对齐 -->
|
|
|
+ </el-col>
|
|
|
+ <el-col v-for="i in 10" :key="i" :span="2">
|
|
|
+ <el-input v-model="JPformdata['组员' + i]['姓名']" :id="'xm' + i" readonly/>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" style="margin-top: 1vh;">
|
|
|
+ <el-col :span="2">
|
|
|
+ <!-- 空列,用于对齐 -->
|
|
|
+ </el-col>
|
|
|
+ <el-col v-for="i in 10" :key="i" :span="2">
|
|
|
+ <el-input v-model="JPformdata['组员' + i]['比例']" :id="'bl' + i" @keydown="JPent($event,i,'比例')" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-row>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer" style="text-align: right;">
|
|
|
+ <el-button @click="JPcloseDialog">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="JPenterDialog">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- JP检品独立 印件选择-->
|
|
|
+ <el-dialog v-model="JPdialogSelectVisible_Yj" title="选择" destroy-on-close width="600px" style='height: 400px;' @keydown="JPselect_Yj($event)" >
|
|
|
+ <el-table tooltip-effect="dark" :data="JPselectData_Yj"
|
|
|
+ row-key="ID" highlight-current-row="true"
|
|
|
+ border style="width:100%"
|
|
|
+ :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }"
|
|
|
+ :header-row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
+ @row-dblclick="JPhandleSelectClick_Yj" >
|
|
|
+ <el-table-column prop="yjno" label="印件号" width="80" />
|
|
|
+ <el-table-column prop="yjmc" label="印件名称" width="480" />
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- JP检品独立 新增机台机器-->
|
|
|
+ <el-dialog v-model="JPdialogVisible_JT" title="机台机器选择" destroy-on-close width="600px" style="height: 600px;" @keydown="JPselect_JT($event)">
|
|
|
+ <el-table tooltip-effect="dark" :data="JPselectData_JT" row-key="ID" highlight-current-row="true"
|
|
|
+ border style="width:100%" ref="table_JT" :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }"
|
|
|
+ :header-row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }" @row-dblclick="JPhandleSelectClick_JT">
|
|
|
+ <el-table-column prop="机台" label="机台" />
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- JP检品独立 新增印件选择 -->
|
|
|
+ <el-dialog v-model="JPdialogSelectVisible_Gx" title="选择" destroy-on-close width="600px" style="margin-top: 2%;" @keydown="JPselect_xz($event)" >
|
|
|
+ <el-table tooltip-effect="dark" :data="JPselectData_Gx" ref="table_gx"
|
|
|
+ row-key="ID" highlight-current-row="true"
|
|
|
+ :row-style="{ height: '0px' }" :cell-style="{ padding: '0px' }"
|
|
|
+ :header-row-style="{ height: '0px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
+ border style="width:100%"
|
|
|
+ @row-dblclick="JPhandleSelectClick_Gx">
|
|
|
+ <el-table-column prop="name" label="" width="560" />
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog v-model="JPdialogSelectVisible_LX" title="选择" destroy-on-close width="300px" @keydown="JPselect_jylb($event)" >
|
|
|
+ <el-table
|
|
|
+ :data="JPtableData"
|
|
|
+ ref="jylb_table" row-key="ID"
|
|
|
+ :row-style="{ height: '50px' }"
|
|
|
+ :cell-style="{ padding: '0px' }"
|
|
|
+ :header-row-style="{ height: '0px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ @row-dblclick="JPhandleRowClick"
|
|
|
+ highlight-current-row
|
|
|
+ >
|
|
|
+ <el-table-column prop="name" label="名称" width="150"></el-table-column>
|
|
|
+ <el-table-column prop="type" label="类别" width="100"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog v-model="MachineVisible" :before-close="closeMachineVisible" :title="type === '0' ? '新增' : '机台状态显示'"
|
|
|
+ destroy-on-close width="80%" style="height: 100%;">
|
|
|
+ <div class="button-container">
|
|
|
+ <button v-for="(item, index) in machineData" :key="index" class="custom-button" @click="handleButtonClick(item.设备编号)">
|
|
|
+ <img :src="`/src/assets/${item.状态}.png`" :alt="altText" style="max-width: 100%; height: auto;"/>
|
|
|
+ <span style="margin-top: 8px;">{{ item.设备编号 + ' - ' + item.设备名称 }}</span>
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- JP机新增定额代号弹窗 -->
|
|
|
+ <el-dialog v-model="GetDedhVisible" id="tableFplb" @keydown="ent($event)" style="margin-top: 5%;" >
|
|
|
+ <el-form>
|
|
|
+ <el-form-item label="选择定额代号" class="mab" prop="keyOrder"></el-form-item>
|
|
|
+ <div style="border:1px solid #eee; width:100%; height: 600px; overflow-y: auto;">
|
|
|
+ <el-tree :data="GetDedhtreeData" ref="table_fplb"
|
|
|
+ @keydown="handleTreeKeydown"
|
|
|
+ :props="{ children: 'children',label: 'label'}"
|
|
|
+ node-key="id" @node-click="handleFplbClick">
|
|
|
+ </el-tree>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <!--当日上报产量 组员及分配比例-->
|
|
|
+ <el-dialog v-model="blModellist" :before-close="() => blModellist = false" style="width: 20%" @keydown="selectBZRRs($event)">
|
|
|
+ <el-form>
|
|
|
+ <div>
|
|
|
+ <el-table :data="employeeDatalist" border :show-overflow-tooltip="true" :cell-class-name="blplanUsageCellClass"
|
|
|
+ ref="tableBZRRs"
|
|
|
+ highlight-current-row="true"
|
|
|
+ @row-click="tablebllickHandlerlist($event)">
|
|
|
+ <el-table-column prop="员工编号" label="员工编号"></el-table-column>
|
|
|
+ <el-table-column prop="ygxm" label="员工姓名"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!--当日上报产量 组员及分配比例-->
|
|
|
+ <el-dialog v-model="JPblModellist" style="width: 20%" @keydown="JPselect_zyfp($event)" >
|
|
|
+ <el-form>
|
|
|
+ <div>
|
|
|
+ <el-table :data="JPemployeeDatalist"
|
|
|
+ ref="zyfp_table" row-key="ID"
|
|
|
+ :row-style="{ height: '0px' }"
|
|
|
+ :cell-style="{ padding: '0px' }"
|
|
|
+ :header-row-style="{ height: '0px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ highlight-current-row
|
|
|
+ border :show-overflow-tooltip="true" :cell-class-name="JPblplanUsageCellClass" @row-click="JPtablebllickHandlerlist($event)">
|
|
|
+ <el-table-column prop="员工编号" label="员工编号"></el-table-column>
|
|
|
+ <el-table-column prop="ygxm" label="员工姓名"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 修改班组产量提报 -->
|
|
|
+ <el-dialog v-model="JPchanliangVisibleedit" :before-close="JPcloseDialogedit" style="width: 60%;margin: 50px auto" :title="'修改班组产量提报'" destroy-on-close>
|
|
|
+ <el-row>
|
|
|
+ <el-form :model="JPformdata" label-position="right" ref="elFormRef" :rules="rule" >
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="工单编号:" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdataedit['工单编号']" style="width: 110px;" placeholder="Enter回车" id="修改工单编号" @blur="JPgetCPMCsubmitedit()" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="customerName" class="mab" >
|
|
|
+ <el-input v-model="JPformdataedit['产品名称']" readonly style="width: 520px;" id="产品名称" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="印件号:" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdataedit['印件号']" style="width: 110px;" id="印件号" placeholder="Enter回车" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="customerName" class="mab">
|
|
|
+ <el-input v-model="JPformdataedit['印件名称']" readonly style="width: 520px;" id="印件名称" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="工序号" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdataedit['工序号']" style="width: 110px;" id="工序号" placeholder="Enter回车" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="" prop="customerName" class="mab">
|
|
|
+ <el-input v-model="JPformdataedit['工序名称']" readonly style="width: 520px;" id="工序名称" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="检验类别:" prop="customerCode" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdataedit['检验类别']" readonly style="width: 110px;" id="检验类别" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="废品率系数:" prop="customerCode" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdataedit['废品率系数']" style="width: 110px;" id="废品率系数" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="日期:" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-date-picker v-model="JPformdataedit['日期']" style="width: 130px;" type="datetime" format="YYYY/MM/DD" value-format="YYYY-MM-DD" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="机器:" prop="customerCode" class="mab" label-width="80">
|
|
|
+ <el-input v-model="JPformdataedit['机器']" style="width: 90px;" id="机器" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="流程标牌:" prop="customerCode" class="mab" label-width="80">
|
|
|
+ <el-input v-model="JPformdataedit['流程标牌']" style="width: 110px;" id="流程标牌" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="计件箱数:" prop="customerCode" class="mab" label-width="180">
|
|
|
+ <el-input v-model="JPformdataedit['计件箱数']" style="width: 110px;" id="计件箱数" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="每箱数量:" prop="customerCode" class="mab" label-width="100">
|
|
|
+ <el-input v-model="JPformdataedit['每箱数量']" style="width: 110px;" id="每箱数量" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="换膜总工时" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdataedit['换膜总工时']" style="width: 110px;" id="换膜总工时" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="换膜补产工时:" prop="customerCode" class="mab" label-width="130">
|
|
|
+ <el-input v-model="JPformdataedit['换膜补产工时']" style="width: 110px;" id="换膜补产工时" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="保养工时" prop="customerCode" class="mab" label-width="320">
|
|
|
+ <el-input v-model="JPformdataedit['保养工时']" style="width: 110px;" id="保养工时:" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="异常总工时" prop="customerCode" class="mab" label-width="110">
|
|
|
+ <el-input v-model="JPformdataedit['异常总工时']" style="width: 110px;" id="异常总工时" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="异常类型:" prop="customerCode" class="mab" label-width="130">
|
|
|
+ <el-input v-model="JPformdataedit['异常类型']" style="width: 110px;" id="异常类型" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="异常补贴工时" prop="customerCode" class="mab" label-width="350">
|
|
|
+ <el-input v-model="JPformdataedit['异常补贴工时']" style="width: 110px;" id="异常补贴工时" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="通电工时" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdataedit['通电工时']" style="width: 110px;" id="通电工时" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-form-item label="定额代号" prop="customerCode" class="mab" label-width="90">
|
|
|
+ <el-input v-model="JPformdataedit['定额代号']" style="width: 200px;" readonly id="定额代号" @keydown="JPentedit($event)"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+
|
|
|
+ <div style="display: flex;">
|
|
|
+ <div>组员及分配比例</div>
|
|
|
+ </div>
|
|
|
+ <el-row :gutter="10" style="margin-top: 1vh;">
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-input v-model="JPformdataedit['bzdh']" id="bzdh" @keydown="JPentedit($event)"/>
|
|
|
+ </el-col>
|
|
|
+ <el-col v-for="i in 10" :key="i" :span="2">
|
|
|
+ <el-input v-model="JPformdataedit['组员' + i]['编号']" :id="'bh' + i" @keydown="JPentedit($event,i,'1')"/>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" style="margin-top: 1vh;">
|
|
|
+ <el-col :span="2">
|
|
|
+ <!-- 空列,用于对齐 -->
|
|
|
+ </el-col>
|
|
|
+ <el-col v-for="i in 10" :key="i" :span="2">
|
|
|
+ <el-input readonly v-model="JPformdataedit['组员' + i]['姓名']" :id="'xm' + i" @keydown="JPentedit($event)"/>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="10" style="margin-top: 1vh;">
|
|
|
+ <el-col :span="2">
|
|
|
+ <!-- 空列,用于对齐 -->
|
|
|
+ </el-col>
|
|
|
+ <el-col v-for="i in 10" :key="i" :span="2">
|
|
|
+ <el-input v-model="JPformdataedit['组员' + i]['比例']" :id="'bl' + i" @keydown="JPentedit($event)" />
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </el-row>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer" style="text-align: right;">
|
|
|
+ <el-button @click="JPcloseDialogedit">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="JPenterDialogedit">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 修改 JP检品独立 印件选择-->
|
|
|
+ <el-dialog v-model="JPdialogSelectVisible_Yjedit" title="选择" destroy-on-close width="600px" @keydown="JPselect_Yjedit($event)" >
|
|
|
+ <el-table tooltip-effect="dark" :data="JPselectData_Yjedit"
|
|
|
+ row-key="ID" highlight-current-row="true"
|
|
|
+ border style="width:100%"
|
|
|
+ @row-dblclick="JPhandleSelectClick_Yjedit" >
|
|
|
+ <el-table-column prop="yjno" label="印件号" width="80" />
|
|
|
+ <el-table-column prop="yjmc" label="印件名称" width="480" />
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 修改 JP检品独立 印件选择 -->
|
|
|
+ <el-dialog v-model="JPdialogSelectVisible_Gxedit" title="选择" destroy-on-close width="600px" style="margin-top: 2%;" @keydown="JPselect_xzedit($event)">
|
|
|
+ <el-table tooltip-effect="dark" :data="JPselectData_Gxedit" ref="table_gxedit"
|
|
|
+ row-key="ID" highlight-current-row="true"
|
|
|
+ :row-style="{ height: '0px' }" :cell-style="{ padding: '0px' }"
|
|
|
+ :header-row-style="{ height: '0px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
+ border style="width:100%"
|
|
|
+ @row-dblclick="JPhandleSelectClick_Gxedit">
|
|
|
+ <el-table-column prop="name" label="" width="560" />
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- JP检品独立 修改机台机器-->
|
|
|
+ <el-dialog v-model="JPdialogVisible_JTedit" title="机台机器选择" destroy-on-close width="600px" style="height: 600px;" @keydown="JPselect_JTedit($event)">
|
|
|
+ <el-table tooltip-effect="dark" :data="JPselectData_JTedit" row-key="ID" highlight-current-row="true"
|
|
|
+ border style="width:100%" ref="table_JTedit" :row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }"
|
|
|
+ :header-row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }" @row-dblclick="JPhandleSelectClick_JTedit">
|
|
|
+ <el-table-column prop="机台" label="机台" />
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog v-model="JPdialogSelectVisible_LXedit" title="选择" destroy-on-close width="300px" @keydown="JPselect_jylbedit($event)">
|
|
|
+ <el-table :data="JPtableDataedit" ref="jylbedit_table"
|
|
|
+ :row-style="{ height: '50px' }" :cell-style="{ padding: '0px' }"
|
|
|
+ :header-row-style="{ height: '0px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
+ @row-dblclick="JPhandleRowClickedit" highlight-current-row>
|
|
|
+ <el-table-column prop="name" label="名称" width="150"></el-table-column>
|
|
|
+ <el-table-column prop="type" label="类别" width="100"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- JP机修改定额代号弹窗 -->
|
|
|
+ <el-dialog v-model="GetDedhVisibleedit" id="tableFplb" @keydown="entedit($event)" style="margin-top: 5%;" >
|
|
|
+ <el-form>
|
|
|
+ <el-form-item label="选择定额代号" class="mab" prop="keyOrder"></el-form-item>
|
|
|
+ <div style="border:1px solid #eee; width:100%; height: 600px; overflow-y: auto;">
|
|
|
+ <el-tree :data="GetDedhtreeDataedit" ref="table_fplbedit" @keydown="handleTreeKeydownedit"
|
|
|
+ :props="{ children: 'children',label: 'label'}" node-key="id" @node-click="handleFplbClickedit">
|
|
|
+ </el-tree>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!--修改 JP检品机 当日上报产量 组员及分配比例-->
|
|
|
+ <el-dialog v-model="JPblModellistedit" style="width: 20%" @keydown="JPselect_zyfpedit($event)" >
|
|
|
+ <el-form>
|
|
|
+ <div>
|
|
|
+ <el-table :data="JPemployeeDatalistedit" ref="zyfpedit_table" row-key="ID" highlight-current-row
|
|
|
+ :row-style="{ height: '0px' }" :cell-style="{ padding: '10px' }"
|
|
|
+ :header-row-style="{ height: '0px' }" :header-cell-style="{ padding: '10px' }"
|
|
|
+ border :show-overflow-tooltip="true" :cell-class-name="JPblplanUsageCellClassedit"
|
|
|
+ @row-click="JPtablebllickHandlerlistedit($event)">
|
|
|
+ <el-table-column prop="员工编号" label="员工编号"></el-table-column>
|
|
|
+ <el-table-column prop="ygxm" label="员工姓名"></el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog v-model="hesuanVisible" :before-close="closehesuanVisible" title="核算参数调整" destroy-on-close width="40%" style="height: 50%;">
|
|
|
+ <div>
|
|
|
+ <el-radio-group v-model="selected" @change="agreeChange" style="display: flex; flex-direction: column;">
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
+ <label>参数类型:</label>
|
|
|
+ <el-radio label="难度调整系数"></el-radio>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; align-items: center;margin-left: 40px;">
|
|
|
+ <el-radio label="凹印版距"></el-radio>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; align-items: center;margin-left: 25px;">
|
|
|
+ <el-radio label="色度数"></el-radio>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; align-items: center;margin-left: 55px;">
|
|
|
+ <el-radio label="废品率系数"></el-radio>
|
|
|
+ </div>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="margin-left: 70px;">
|
|
|
+ <el-col :span="15">
|
|
|
+ <el-form-item label="废品率系数:" prop="flatFeed" class="mab" v-if="FPlxs === true">
|
|
|
+ <el-input v-model="hesuanValue.废品率系数" id="辅电表" @keydown="ent1($event)" style="width: 200px;" v-if="FPlxs === true"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="缩放系数:" prop="flatFeed" class="mab" v-if="SFType === true">
|
|
|
+ <el-input v-model="hesuanValue.缩放系数" id="辅电表" @keydown="ent1($event)" style="width: 200px;" v-if="SFType === true"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="产品板距:" prop="flatFeed" class="mab" v-if="CPType === true">
|
|
|
+ <el-input v-model="hesuanValue.产品板距" id="辅电表" @keydown="ent1($event)" style="width: 200px;" v-if="CPType === true"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="印刷方式:" prop="flatFeed" class="mab" v-if="CPType === true">
|
|
|
+ <el-select v-model="hesuanValue.印刷方式" placeholder="" style="width: 190px;" v-if="CPType === true" >
|
|
|
+ <el-option label="卷对卷" value="卷对卷"></el-option>
|
|
|
+ <el-option label="卷对张" value="卷对张"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="色度数 :" prop="flatFeed" class="mab" v-if="SDType === true">
|
|
|
+ <el-input v-model="hesuanValue.色度数" id="辅电表" @keydown="ent1($event)" :clearable="true" style="width: 200px;" v-if="SDType === true" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="hesuanVisiblecloseDialog">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="hesuanenterDialog">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!--工序产量核查【弹窗】-->
|
|
|
+ <el-dialog v-model="gd_gxclhclist" title="工序产量核查" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
|
|
|
+ <el-button type="" @click="gxclhcCancel">退出</el-button>
|
|
|
+ <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
|
|
|
+ <div style="width: 100%; height: 60px; padding: 0px; display: flex; align-items: center;">
|
|
|
+ <el-form-item label="工单编号" prop="currentProcess" style="margin-right: 20px; padding: 20px 0 0 0">
|
|
|
+ <el-input v-model="gxclhcformData['gdbh']" @keyup.enter="gxclhcProductValue" />
|
|
|
+ </el-form-item>
|
|
|
+ 印件选择:
|
|
|
+ <el-select v-model="gdwhformData.yjno" placeholder="请选择" allow-create filterable style="width: 100px;margin-right: 20px; padding: 0px;">
|
|
|
+ <el-option v-for="option in gdwhformData.yinjian" @click="ongdwhfanclick" :key="option" :label="option" :value="option" />
|
|
|
+ </el-select>
|
|
|
+ <el-input v-model="inputCpmc" readonly style="width: 50vw; margin-right: 0px;" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-table ref="paichengRef"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ :row-style="{ height: '0px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ style="width: 100%;height: 70vh" border tooltip-effect="dark"
|
|
|
+ highlight-current-row="true"
|
|
|
+ @row-click="gxclhc_tableRowClick"
|
|
|
+ :data="gxclhc_Data" row-key="ID"
|
|
|
+ :cell-class-name="gxclhcCellClass">
|
|
|
+ <template v-for="(item, idx) in gxclhc_Columns">
|
|
|
+ <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
|
|
|
+ {{row[item.prop]}}
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
+ <!--修正核算参数-->
|
|
|
+ <el-dialog v-model="xzhscslist" title="修正核算参数" style="width: 100%;height: 100%;margin: 0px;padding: 0px">
|
|
|
+ <el-button type="primary" @click="xzhscsConfirm">更新</el-button>
|
|
|
+ <el-button type="" @click="sxzhscsCancel">退出</el-button>
|
|
|
+ <div style="width: 100%; height: 60px; padding: 0px; margin: 10px 0px 0px 0px; display: flex; align-items: center;">
|
|
|
+ <el-form-item label="当前工单 :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
|
|
|
+ <el-input v-model="xzhscsformData['gdbh']" @keyup.enter="xzhscsgetProductValue" style="width: 200px;"/>
|
|
|
+ <el-input v-model="xzhscsformData['cpdh']" disabled style="width: 120px;margin-left: 10px;"/>
|
|
|
+ <el-input v-model="xzhscsformData['gdmc']" disabled style="width: 500px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div style="width: 100%; height: 60px; padding: 0px; margin: 5px 0px 0px 260px; display: flex; align-items: center;">
|
|
|
+ <el-form-item label=" :" prop="currentProcess" style="margin-right: 20px; padding: 0px">
|
|
|
+ <el-input v-model="xzhscsformData['yjdh']" disabled style="width: 120px;margin-left: 10px;"/>
|
|
|
+ <el-input v-model="xzhscsformData['yjmc']" disabled style="width: 500px;"/>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <el-table ref="paichengRef" :show-overflow-tooltip="true"
|
|
|
+ :row-style="{ height: '0px' }" :header-cell-style="{ padding: '0px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '0px' }"
|
|
|
+ style="width: 100%;height: 74vh" border tooltip-effect="dark"
|
|
|
+ :data="sxzhscstableData" row-key="ID" :cell-class-name="sxzhscsCellClass">
|
|
|
+ <template v-for="(item, idx) in xzhstableColumns">
|
|
|
+ <el-table-column #default="{ row, column, $index }" align="left" :label="item.label" :width="item.width" >
|
|
|
+ <div v-if="['难度系数', '损耗代号', '印刷方式', '版距','计损色数', '损耗系数'].includes(item.prop)">
|
|
|
+ <el-input v-model="row[item.prop]" :clearable="false" :id="`input${idx}${$index}`" />
|
|
|
+ </div>
|
|
|
+ <div v-else>{{ row[item.prop] }}</div>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog v-model="gzSelVisible" title="员工工资明细查询" destroy-on-close fullscreen style="font-size: 50px;font-weight: bold;">
|
|
|
+ <el-button v-for="ygbh in gz_bzbh" type="primary" @click="gz_ontable(ygbh)">{{ ygbh }}</el-button>
|
|
|
+ <!-- 数据展示 -->
|
|
|
+ <el-table ref="gz_multipleTable" style="width: 100%;height: 40vh;padding-top: 5px;" tooltip-effect="dark" :data="gz_tableData" row-key="ID"
|
|
|
+ highlight-current-row="true" border :show-overflow-tooltip="true"
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }">
|
|
|
+ <el-table-column v-for="column in tableCols1" :key="column.prop" :prop="column.prop" :label="column.label" :width="column.width" show-overflow-tooltip="true" sortable/>
|
|
|
+ </el-table>
|
|
|
+ <!-- 数据展示 -->
|
|
|
+ <el-table ref="gz_multipleTable2" style="width: 100%;height: 40vh;padding-top: 30px;" tooltip-effect="dark" :data="gz_tableData2" row-key="ID"
|
|
|
+ highlight-current-row="true" border
|
|
|
+ :row-style="{ height: '20px' }"
|
|
|
+ :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :header-cell-style="{ padding: '0px' }"
|
|
|
+ :show-overflow-tooltip="true">
|
|
|
+ <el-table-column v-for="column in tableCols2" :key="column.prop" :prop="column.prop" :label="column.label" :width="column.width" show-overflow-tooltip="true" sortable/>
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 印件选择 -->
|
|
|
+ <el-dialog v-model="dialogSelectVisible_Yj" title="选择" destroy-on-close width="600px" @keydown="select_Yj($event)" >
|
|
|
+ <el-table tooltip-effect="dark" :data="selectData_Yj"
|
|
|
+ row-key="ID" highlight-current-row="true"
|
|
|
+ border style="width:100%" @row-dblclick="handleSelectClick_Yj">
|
|
|
+ <el-table-column prop="yjno" label="印件号" width="80" />
|
|
|
+ <el-table-column prop="yjmc" label="印件名称" width="480" />
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 工序名称选择 -->
|
|
|
+ <el-dialog v-model="dialogSelectVisible_Gx" title="工序名称选择" @keydown="select_gxmc($event)"
|
|
|
+ destroy-on-close width="600px" style="margin-top: 3%;" >
|
|
|
+ <el-table tooltip-effect="dark" :data="selectData_Gx" ref="table_GXMC"
|
|
|
+ row-key="ID" highlight-current-row="true" border style="width:100%"
|
|
|
+ @row-dblclick="handleSelectClick_Gx">
|
|
|
+ <el-table-column prop="name" label="" width="560" />
|
|
|
+ </el-table>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <!-- 拉料导出弹窗 -->
|
|
|
+ <el-dialog v-model="onllexcel" title="拉料数据导出" destroy-on-close style="height: 20%;width: 20%;">
|
|
|
+ <el-form-item label="选择年月" label-width="100px">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="onllexcelrq"
|
|
|
+ type="month"
|
|
|
+ placeholder="选择年月"
|
|
|
+ :default-value="new Date()"
|
|
|
+ @change="onchange_data"
|
|
|
+ style="width: 200px;"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer" style="text-align: right;">
|
|
|
+ <el-button @click="rcgdsjcloseDialog">取消</el-button>
|
|
|
+ <el-button type="primary" @click="rcgdsjonDialog">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <Shebeizhuangtai
|
|
|
+ v-if="dialogSbyxgl"
|
|
|
+ v-model="dialogSbyxgl"
|
|
|
+ :title="titinfo"
|
|
|
+ :formData="formData" />
|
|
|
+ </el-main>
|
|
|
+ </el-container>
|
|
|
+ </el-container>
|
|
|
+
|
|
|
+ <PrintPage ref="printPageRef" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import {
|
|
|
+ createCompany,
|
|
|
+ deleteCompany,
|
|
|
+ deleteCompanyByIds,
|
|
|
+ updateCompany,
|
|
|
+ findCompany,
|
|
|
+ getCompanyList
|
|
|
+} from '@/api/company'
|
|
|
+import {
|
|
|
+ EquipmentSchedulingEdit, Procedure,
|
|
|
+ teamDel, WorkList, WorkOrderDel,PrintDetailList,
|
|
|
+ getOrderProcessLeft,
|
|
|
+ getOrderProcessRight
|
|
|
+} from "@/api/yunyin/yunying";
|
|
|
+import {
|
|
|
+ facilityTab,
|
|
|
+ facilitychanLiang,
|
|
|
+ facilityInspect,
|
|
|
+ facilityProduction,
|
|
|
+ facilityTeam,
|
|
|
+ facilityMachineList,
|
|
|
+ facilitySpotCheckItem,
|
|
|
+ facilityInspectionItem,
|
|
|
+ reportProduceInfo,
|
|
|
+ reportName,
|
|
|
+ reportInfo,
|
|
|
+ reportMachineMac,
|
|
|
+ facilityWorklist,
|
|
|
+ setProcessStatus,
|
|
|
+ submitDailyProduction,
|
|
|
+ facilityDetail,
|
|
|
+ inspectionRecord,
|
|
|
+ getYg,
|
|
|
+ facilityProcedure,
|
|
|
+ facilityPrintGetTab,
|
|
|
+ facilityPrintDetail,
|
|
|
+ ProcessInspectionRecordsItem,
|
|
|
+ InspectionItemAdd,
|
|
|
+ MachineDetailList,
|
|
|
+ ComplaintRecord,
|
|
|
+ remodelGetTab,
|
|
|
+ ModelChangeRecord,
|
|
|
+ MachineChanliangDetail,
|
|
|
+ chanliangEdit,
|
|
|
+ productionGdmc,
|
|
|
+ productionYjmc,
|
|
|
+ ChanliangDel,
|
|
|
+ ChanliangAdd,
|
|
|
+ MachineChanliangDetailEdit,
|
|
|
+ ChanliangWorkorder,
|
|
|
+ ChanliangPrintDetail,
|
|
|
+ ChanliangProcessDetail,
|
|
|
+ EmployeeData,
|
|
|
+ RemodelDetail,
|
|
|
+ AdditionalInspectionRecordAdd,
|
|
|
+ ProcessInspectionRecordsItemAdd,
|
|
|
+ CoefficientEdit,
|
|
|
+ ChromaDataEdit,
|
|
|
+ PrintingModeDataEdit,
|
|
|
+ dailysearch,
|
|
|
+ dailygetGzByYgbh,
|
|
|
+ productionDedh,
|
|
|
+ JPproductionDedh,
|
|
|
+ YieldTeamEdit,
|
|
|
+ getTimelist,
|
|
|
+ JPmachineDetail,
|
|
|
+ JpChanliangEdit,
|
|
|
+ JpUploade,
|
|
|
+ getRejectRate,
|
|
|
+ LazhiGongData
|
|
|
+} from '@/api/jixiaoguanli/jitairibaobiao'
|
|
|
+import{
|
|
|
+ AccountingParameter,
|
|
|
+ ProductNameData,
|
|
|
+ AccountingParameterEdit,
|
|
|
+ gdzl_MachineList,
|
|
|
+ getOrderProcessCount,
|
|
|
+ RejectionEdit,
|
|
|
+ JPchanliangDetailList
|
|
|
+ } from "@/api/yunyin/yunying";
|
|
|
+import {
|
|
|
+MachineTeamAdd,
|
|
|
+ setMachineTeam,
|
|
|
+ PrintDetailAdd,
|
|
|
+ PrintDetailEdit
|
|
|
+} from '@/api/jixiaoguanli/baogong'
|
|
|
+import {
|
|
|
+ FieldInspectionRecord,
|
|
|
+ StaGetOrderList,
|
|
|
+ StaGetList,
|
|
|
+ StaProcessList,
|
|
|
+ StaGetOrderDetail,
|
|
|
+ StaProcessAnomaly,
|
|
|
+} from "@/api/mes/job";
|
|
|
+import Shebeizhuangtai from '@/view/performance/09-workOrderVerification/componets/shebeizhuangtai.vue'
|
|
|
+// 全量引入格式化工具 请按需保留
|
|
|
+import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
|
|
|
+import * as XLSX from 'xlsx'
|
|
|
+import FileSaver from 'file-saver'
|
|
|
+import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
|
|
|
+import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
+import { ref, reactive,watch,onMounted, registerRuntimeCompiler } from 'vue'
|
|
|
+import { useUserStore } from '@/pinia/modules/user'
|
|
|
+// import PrintPage from './components/print.vue'
|
|
|
+
|
|
|
+const userStore = useUserStore()
|
|
|
+const sys_id='['+userStore.userInfo.userName+'/'+userStore.userInfo.nickName+']'
|
|
|
+
|
|
|
+defineOptions({
|
|
|
+ name: 'Company'
|
|
|
+})
|
|
|
+
|
|
|
+// 获取当前日期
|
|
|
+const today = new Date();
|
|
|
+ const year = today.getFullYear();
|
|
|
+ const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要补零
|
|
|
+ const day = String(today.getDate()).padStart(2, '0');
|
|
|
+ const hours = String(today.getHours()).padStart(2, '0');
|
|
|
+ const minutes = String(today.getMinutes()).padStart(2, '0');
|
|
|
+ const seconds = String(today.getSeconds()).padStart(2, '0');
|
|
|
+ const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
+ const currentDates = `${year}-${month}-${day}`;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+const printPageRef = ref()
|
|
|
+const DelType = ref(false)
|
|
|
+const AddType = ref(false)
|
|
|
+const gytableData = ref([])
|
|
|
+const drzcDatas =ref([])
|
|
|
+const detailData = reactive([])
|
|
|
+const treeData=ref([])
|
|
|
+const yinbantreeData=ref([])
|
|
|
+let dianjiantreeData;
|
|
|
+let JTMC=ref()
|
|
|
+let date=ref()
|
|
|
+let titinfo=ref()
|
|
|
+let JTMCOn=ref()
|
|
|
+let showbutton=ref()
|
|
|
+let dateOn=ref()
|
|
|
+const activName = ref('first')
|
|
|
+let productCode=ref()
|
|
|
+const sbzyData = reactive([])
|
|
|
+const FPData = reactive([])
|
|
|
+const CLMXData = reactive([])
|
|
|
+let JYData = reactive([])
|
|
|
+const selectData = ref([])
|
|
|
+const isJPJT = ref(false)
|
|
|
+const handleNodeClick = (nodeData,node) => {
|
|
|
+ //清空流程单查询的工单
|
|
|
+ lcd_Gd_gdbh.value=''
|
|
|
+ lcd_Gd_gdbh.value=formData.value.工单编号;
|
|
|
+ // 取消所有节点的颜色
|
|
|
+ const allNodes = document.querySelectorAll('.treecolor .el-tree-node');
|
|
|
+ allNodes.forEach(node => {
|
|
|
+ node.querySelector('.el-tree-node__label').style.color = '';
|
|
|
+ });
|
|
|
+ // 获取点击的节点
|
|
|
+ console.log(node)
|
|
|
+ const clickedNodeId = node['id'];
|
|
|
+ const clickedNode = document.querySelector(`.treecolor .el-tree-node[data-key="${clickedNodeId}"]`);
|
|
|
+ if (clickedNode) {
|
|
|
+ // 给当前点击的节点改变颜色
|
|
|
+ clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //存放当前节点的nodeId
|
|
|
+ if (nodeData.level === 1) {
|
|
|
+ CJMC.value=node.label
|
|
|
+ showbutton.value=true
|
|
|
+ JTMCOn.value=false
|
|
|
+ dateOn.value=false
|
|
|
+ MachinelList()
|
|
|
+ DelType.value = false
|
|
|
+ AddType.value = false
|
|
|
+ // MachineVisible.value=true
|
|
|
+ } else if (nodeData.level === 2) {
|
|
|
+ sbzyData.length = 0;
|
|
|
+ FPData.length=0;
|
|
|
+ CLMXData.length=0;
|
|
|
+ JYData.length=0;
|
|
|
+ JTMC=node.label.split("-")[0]
|
|
|
+ CJMC.value=nodeData.parentNode.label
|
|
|
+ JTMCOn.value=true
|
|
|
+ dateOn.value=false
|
|
|
+ showbutton.value=false
|
|
|
+ FacilityProduction()
|
|
|
+ FacilityWorklist()
|
|
|
+ DelType.value = false
|
|
|
+ AddType.value = false
|
|
|
+ } else if (nodeData.level === 3) {
|
|
|
+ CJMC.value=nodeData.parentNode.parentNode.label
|
|
|
+ JTMC=nodeData.machineName.split("-")[0]
|
|
|
+ // 等于JP开头的机台
|
|
|
+ if (/^JP.+/.test(JTMC)) {
|
|
|
+ isJPJT.value = true
|
|
|
+ JTMCOn.value=false
|
|
|
+ dateOn.value=true
|
|
|
+ FacilityInspect()
|
|
|
+ JPmachineDetails(JTMC, nodeData.label);
|
|
|
+
|
|
|
+ date=node.label
|
|
|
+ JPgytableData.value=[]
|
|
|
+ drzcDatas.value=[]
|
|
|
+ columnNames=[]
|
|
|
+ drzcData=[]
|
|
|
+ showbutton.value=false
|
|
|
+ DelType.value = true
|
|
|
+ AddType.value = true
|
|
|
+ } else {
|
|
|
+ isJPJT.value = false
|
|
|
+ JTMCOn.value=false
|
|
|
+ dateOn.value=true
|
|
|
+ date=node.label
|
|
|
+ gytableData.value=[]
|
|
|
+ drzcDatas.value=[]
|
|
|
+ columnNames=[]
|
|
|
+ drzcData=[]
|
|
|
+ showbutton.value=false
|
|
|
+ FacilityInspect()
|
|
|
+ FacilitychanLiang()
|
|
|
+ DelType.value = true
|
|
|
+ AddType.value = true
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+// JP当日上报产量
|
|
|
+const JPgytableData = ref([])
|
|
|
+const JPmachineDetails = async (jt, riqi) => {
|
|
|
+ const JPmachineDetail_data = await JPmachineDetail({machine: jt, date: riqi});
|
|
|
+
|
|
|
+ _rclsb_gdbh.value = JPmachineDetail_data.data[0]['工单编号']
|
|
|
+ _rclsb_yjno.value = JPmachineDetail_data.data[0]['yjno']
|
|
|
+ if (JPmachineDetail_data.code === 0) {
|
|
|
+ let totalA = JPmachineDetail_data.data.totalA
|
|
|
+ let totalB = JPmachineDetail_data.data.totalB
|
|
|
+
|
|
|
+ // 对 totalA 和 totalB 进行排序 结果放在 sortedTotalA 和 sortedTotalB 中
|
|
|
+ const sortedTotalA = totalA.sort((a, b) => {
|
|
|
+ const typeOrder = {
|
|
|
+ "": 1, // 空字符串排在最前面
|
|
|
+ "次品版": 2,
|
|
|
+ "废品版": 3,
|
|
|
+ "正品版": 4
|
|
|
+ };
|
|
|
+
|
|
|
+ // 如果某个类型不存在于typeOrder中,则默认它排在最后(可以调整这个逻辑)
|
|
|
+ const orderA = typeOrder[a["检验类型"]] || Infinity;
|
|
|
+ const orderB = typeOrder[b["检验类型"]] || Infinity;
|
|
|
+
|
|
|
+ return orderA - orderB; // 升序排序
|
|
|
+ });
|
|
|
+ const sortedTotalB = totalB.sort((a, b) => {
|
|
|
+ const typeOrder = {
|
|
|
+ "": 1, // 空字符串排在最前面
|
|
|
+ "次品版": 2,
|
|
|
+ "废品版": 3,
|
|
|
+ "正品版": 4
|
|
|
+ };
|
|
|
+
|
|
|
+ // 如果某个类型不存在于typeOrder中,则默认它排在最后(可以调整这个逻辑)
|
|
|
+ const orderA = typeOrder[a["检验类型"]] || Infinity;
|
|
|
+ const orderB = typeOrder[b["检验类型"]] || Infinity;
|
|
|
+
|
|
|
+ return orderA - orderB; // 升序排序
|
|
|
+ });
|
|
|
+ delete JPmachineDetail_data.data.totalA
|
|
|
+ delete JPmachineDetail_data.data.totalB
|
|
|
+ JPgytableData.value = Object.values(JPmachineDetail_data.data)
|
|
|
+ // 遍历 sortedTotalA 和 sortedTotalB 数组,将每个元素添加到新的行中
|
|
|
+ if (sortedTotalA.length !== 0) {
|
|
|
+ sortedTotalA.forEach((item) => {
|
|
|
+ let rowA = {
|
|
|
+ 产品名称: `A班${item.检验类型}合计:`,
|
|
|
+ 计件箱数: `${item.箱数}`, // 添加合计箱数字段
|
|
|
+ isTotal: true //标识合计行改变颜色
|
|
|
+ };
|
|
|
+ JPgytableData.value.push(rowA);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+if (sortedTotalB.length !== 0) {
|
|
|
+ sortedTotalB.forEach((item) => {
|
|
|
+ let rowB = {
|
|
|
+ 产品名称: `B班${item.检验类型}合计:`,
|
|
|
+ 计件箱数: `${item.箱数}`,// 添加合计箱数字段
|
|
|
+ isTotal: true //标识合计行改变颜色
|
|
|
+ };
|
|
|
+ JPgytableData.value.push(rowB);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // return require(`@/assets/${machineData.状态}.png`);
|
|
|
+ // MachineVisible.value=true
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 定义方法来确定合计行的CSS类名
|
|
|
+function totalClassName({ row }) {
|
|
|
+ console.log(row)
|
|
|
+ // if (row.计件箱数=== ) {
|
|
|
+
|
|
|
+ // }
|
|
|
+ return row.isTotal ? 'total-row' : '';
|
|
|
+}
|
|
|
+
|
|
|
+//表格文字颜色
|
|
|
+const tableDataCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
+ if (column.property === '计件箱数'||column.property === '每箱数量') {
|
|
|
+ return 'plan-usage-low';
|
|
|
+ }
|
|
|
+}
|
|
|
+const hesuanVisible = ref(false)
|
|
|
+const MachineVisible = ref(false)
|
|
|
+const machineData = reactive([])
|
|
|
+const hesuanValue = reactive({})
|
|
|
+const MachinelList = async () => {
|
|
|
+ const response = await MachineDetailList({workshop:CJMC.value});
|
|
|
+ if (response.code === 0) {
|
|
|
+ machineData.splice(0, machineData.length, ...response.data);
|
|
|
+ console.log(machineData)
|
|
|
+ // return require(`@/assets/${machineData.状态}.png`);
|
|
|
+ // MachineVisible.value=true
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+//设置机台状态
|
|
|
+function handleButtonClick(deviceId) {
|
|
|
+ console.log(deviceId);
|
|
|
+ MachineVisible.value=false
|
|
|
+ // dialogSbyxgl.value=true
|
|
|
+ JTMC=deviceId.split("-")[0]
|
|
|
+ // JTMCOn.value=true
|
|
|
+ // dateOn.value=false
|
|
|
+ console.log(JTMC)
|
|
|
+ GetdialogSbyxgl()
|
|
|
+
|
|
|
+ // GetdialogSbyxgl(deviceId)
|
|
|
+
|
|
|
+}
|
|
|
+const GetdialogSbyxgl = async () => {
|
|
|
+ const response = await facilityProduction({machine:JTMC});
|
|
|
+ if (response.code === 0) {
|
|
|
+ console.log(response)
|
|
|
+ // 填充formData对象的基本字段
|
|
|
+ // formData.value.工单编号 = response.data.工单编号;
|
|
|
+ // formData.value.印件编号 = response.data.印件号;
|
|
|
+ // formData.value.工序名称 = response.data.工序名称;
|
|
|
+ // formData.value.产品名称 = response.data.产品名称;
|
|
|
+ // formData.value.班组 = response.data.班组编号;
|
|
|
+ formData.value.工单编号 = response.data.工单编号;
|
|
|
+ formData.value.印件号 = response.data.印件号;
|
|
|
+ formData.value.工序号 = response.data.工序名称.substring(0,2);
|
|
|
+ formData.value.工序名称 = response.data.工序名称;
|
|
|
+ formData.value.产品名称 = response.data.产品名称;
|
|
|
+ formData.value.班组成员 = response.data.班组成员;
|
|
|
+ formData.value.班组Id=response.data.班组Id
|
|
|
+ formData.value.machine=JTMC
|
|
|
+ formData.value.状态=response.data.状态
|
|
|
+ let time = new Date();
|
|
|
+ time.setDate(time.getDate() - 0); // 今天的前N天的日期,N自定义
|
|
|
+ titinfo = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}`;
|
|
|
+ titinfo+='【'+JTMC+response.data.工单编号+response.data.产品名称+'】'+response.data.工序名称
|
|
|
+ let sczl_bhkey=''
|
|
|
+ let sczl_namekey=''
|
|
|
+ if (response.data.班组成员) {
|
|
|
+ for (let i = 0; i < Math.min(Object.keys(response.data.班组成员).length, 6); i++) {
|
|
|
+ sczl_bhkey=`sczl_bh${i+1}`
|
|
|
+ sczl_namekey=`sczl_name${i+1}`
|
|
|
+ formData.value[sczl_bhkey] = response.data.班组成员[i]['编号'];
|
|
|
+ formData.value[sczl_namekey] = response.data.班组成员[i]['姓名'];
|
|
|
+ console.log(response.data.班组成员[i]['编号'])
|
|
|
+ classbz.value[i]=response.data.班组成员[i]['编号']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ formData.value.class=classbz.value.join(',')
|
|
|
+ console.log(formData.value.class)
|
|
|
+ formData.value.JTMC=JTMC
|
|
|
+ const responses = await MachineDetailList({workshop:CJMC.value});
|
|
|
+ if(responses.code===0){
|
|
|
+ responses.data.map(item=>{
|
|
|
+ if(item.设备编号==JTMC){
|
|
|
+ formData.value.status=item.状态
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // console.log(formData.value.工单编号)
|
|
|
+
|
|
|
+ }
|
|
|
+ FacilityWorklist()
|
|
|
+ onstatus()
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const gzSelVisible = ref(false)
|
|
|
+const gz_tableData = reactive([])
|
|
|
+const gz_tableData2 = reactive([])
|
|
|
+let gz_bzbh = [];
|
|
|
+
|
|
|
+const tableCols1 = [
|
|
|
+ { label: '员工编号', prop: 'bh', width: '105' },
|
|
|
+ { label: '员工姓名', prop: '员工姓名', width: '105' },
|
|
|
+ { label: '日期', prop: 'sczl_rq', width: '120' },
|
|
|
+ { label: '计件工资', prop: '计件工资', width: '105' },
|
|
|
+ { label: '加班工资', prop: '加班工资', width: '105' },
|
|
|
+ { label: '计时时数', prop: '计时时数', width: '105' },
|
|
|
+ { label: '计时工资', prop: '计时工资', width: '135' },
|
|
|
+ { label: '日工资合计', prop: '日工资合计', width: '135' },
|
|
|
+]
|
|
|
+const tableCols2 = [
|
|
|
+ { label: '日期', prop: 'sczl_rq', width: '100' },
|
|
|
+ { label: '工单编号', prop: 'sczl_gdbh', width: '105' },
|
|
|
+ { label: '产品名称', prop: 'Gd_cpmc', width: '120' },
|
|
|
+ { label: '印件及工序', prop: 'sczl_type', width: '120' },
|
|
|
+ { label: '机台', prop: 'sczl_jtbh', width: '87' },
|
|
|
+ { label: '车头产量', prop: '班组车头产量', width: '105' },
|
|
|
+ { label: '计件产量', prop: '计件产量', width: '105' },
|
|
|
+ { label: '补产产量', prop: '补产产量', width: '105' },
|
|
|
+ { label: '核算产量', prop: '核算产量', width: '105' },
|
|
|
+ { label: '达标定额', prop: '达标定额', width: '105' },
|
|
|
+ { label: '千件工价', prop: '千件工价', width: '105' },
|
|
|
+ { label: '计件工资', prop: '个人计件工资', width: '105' },
|
|
|
+ { label: '加班工资', prop: '个人加班工资', width: '105' },
|
|
|
+ { label: '装版工时', prop: '装版工时', width: '120' },
|
|
|
+ { label: '保养工时', prop: '保养工时', width: '105' },
|
|
|
+ { label: '打样工时', prop: '打样工时', width: '105' },
|
|
|
+ { label: '异常停机', prop: '异常停机工时', width: '105' },
|
|
|
+ { label: '补产标准', prop: '补产标准', width: '120' },
|
|
|
+ { label: '分摊比例', prop: 'Rate', width: '105' },
|
|
|
+]
|
|
|
+
|
|
|
+//员工工资查询
|
|
|
+const gzSel = () =>{
|
|
|
+ if(formData.value.班组成员==undefined){
|
|
|
+ ElMessage({ type: 'warning', message: '请先选择机台' });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(formData.value.班组成员.length==0){
|
|
|
+ ElMessage({ type: 'warning', message: '未获取到员工' });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for (let index in formData.value.班组成员) {
|
|
|
+ gz_bzbh[index] = formData.value.班组成员[index]['编号']
|
|
|
+ }
|
|
|
+ gzSelVisible.value=true
|
|
|
+}
|
|
|
+// 查询
|
|
|
+const gz_ontable = (ygbh) => {
|
|
|
+ // 创建一个Date对象
|
|
|
+ var currentDate = new Date();
|
|
|
+ // 获取年份
|
|
|
+ var year = currentDate.getFullYear();
|
|
|
+ // 获取月份(注意,月份从0开始,所以需要加1)
|
|
|
+ var month = currentDate.getMonth() + 1;
|
|
|
+ if (month < 10) {
|
|
|
+ month = "0" + month;
|
|
|
+ }
|
|
|
+ var date = year+ "" +month
|
|
|
+ const response = dailysearch({date: date, search: ygbh}).then(response=>{
|
|
|
+ if (response.code === 0) {
|
|
|
+ const originalData = response.data;
|
|
|
+ const summaryData = generateSummaryData(originalData);
|
|
|
+ // 将合计数据插入到原始数据中
|
|
|
+ const combinedData = [];
|
|
|
+ originalData.forEach((item, index) => {
|
|
|
+ combinedData.push(item);
|
|
|
+ const nextItem = originalData[index + 1];
|
|
|
+ if (nextItem==undefined) {
|
|
|
+ // 如果下一个员工姓名与当前不同,插入合计数据
|
|
|
+ const currentSummary = summaryData.shift();
|
|
|
+ combinedData.push(currentSummary);
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 更新表格数据
|
|
|
+ gz_tableData.splice(0, gz_tableData.length, ...combinedData);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ dailygetGzByYgbh({date:date,code:ygbh}).then(response=>{
|
|
|
+ if(response.code==0){
|
|
|
+ gz_tableData2.splice(0, gz_tableData2.length, ...response.data);
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+const generateSummaryData = (data) => {
|
|
|
+ const summaryData = [];
|
|
|
+ let currentName = null;
|
|
|
+ let currentSummary = null;
|
|
|
+
|
|
|
+ data.forEach((item) => {
|
|
|
+ const name = item['员工姓名'].trim(); // 获取员工姓名并去除空格
|
|
|
+ if (name !== currentName) {
|
|
|
+ // 如果员工姓名发生改变,说明需要插入合计数据
|
|
|
+ if (currentSummary) {
|
|
|
+ // 将上一个员工的合计数据插入到数组中
|
|
|
+ summaryData.push(currentSummary);
|
|
|
+ }
|
|
|
+ // 创建新的合计数据
|
|
|
+ currentSummary = {
|
|
|
+ '员工姓名': name,
|
|
|
+ '日期': 0,
|
|
|
+ '计件工资': 0,
|
|
|
+ '加班工资': 0,
|
|
|
+ '计时时数': 0,
|
|
|
+ '计时工资': 0,
|
|
|
+ '日工资合计': 0
|
|
|
+ };
|
|
|
+ currentName = name;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 更新合计数据
|
|
|
+ currentSummary['日期']++;
|
|
|
+ currentSummary['计件工资'] += parseFloat(item['计件工资']);
|
|
|
+ currentSummary['加班工资'] += parseFloat(item['加班工资']);
|
|
|
+ currentSummary['计时时数'] += parseFloat(item['计时时数']);
|
|
|
+ currentSummary['计时工资'] += parseFloat(item['计时工资']);
|
|
|
+ currentSummary['日工资合计'] += parseFloat(item['日工资合计']);
|
|
|
+ currentSummary['员工姓名']='合计('+currentSummary['日期']+'天)';
|
|
|
+ });
|
|
|
+
|
|
|
+ // 将最后一个员工的合计数据插入到数组中
|
|
|
+ if (currentSummary) {
|
|
|
+ summaryData.push(currentSummary);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将日期填充到表格中
|
|
|
+ summaryData.forEach((summary) => {
|
|
|
+ summary['计件工资'] = summary['计件工资'].toFixed(2); // 保留两位小数
|
|
|
+ summary['加班工资'] = summary['加班工资'].toFixed(2);
|
|
|
+ summary['计时时数'] = summary['计时时数'].toFixed(2);
|
|
|
+ summary['计时工资'] = summary['计时工资'].toFixed(2);
|
|
|
+ summary['日工资合计'] = summary['日工资合计'].toFixed(2);
|
|
|
+ });
|
|
|
+
|
|
|
+ return summaryData;
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// const getImagePath = async (machineData.状态) => {
|
|
|
+// return require(`@/assets/${status}.png`);
|
|
|
+// }
|
|
|
+const classbz=ref([])
|
|
|
+const GDBH=ref()
|
|
|
+//当前生产订单
|
|
|
+const FacilityProduction = async () => {
|
|
|
+ const response = await facilityProduction({machine:JTMC});
|
|
|
+ if (response.code === 0) {
|
|
|
+ console.log(response)
|
|
|
+ if(response.data===null){
|
|
|
+ formData.value.工单编号 = '';
|
|
|
+ formData.value.印件号 = '';
|
|
|
+ formData.value.工序号 = '';
|
|
|
+ formData.value.工序名称 = '';
|
|
|
+ formData.value.产品名称 = '';
|
|
|
+ formData.value.班组Id=''
|
|
|
+ formData.value.machine=JTMC
|
|
|
+ formData.value.状态=''
|
|
|
+ let sczl_bhkey=''
|
|
|
+ let sczl_namekey=''
|
|
|
+ for (let i = 0; i < 6; i++) {
|
|
|
+ sczl_bhkey=`sczl_bh${i+1}`
|
|
|
+ sczl_namekey=`sczl_name${i+1}`
|
|
|
+ formData.value[sczl_bhkey] = '';
|
|
|
+ formData.value[sczl_namekey] = '';
|
|
|
+ }
|
|
|
+ console.log(sbzyData)
|
|
|
+ }else{
|
|
|
+ // 填充formData对象的基本字段
|
|
|
+ // formData.value.工单编号 = response.data.工单编号;
|
|
|
+ // formData.value.印件编号 = response.data.印件号;
|
|
|
+ // formData.value.工序名称 = response.data.工序名称;
|
|
|
+ // formData.value.产品名称 = response.data.产品名称;
|
|
|
+ // formData.value.班组 = response.data.班组编号;
|
|
|
+ formData.value.工单编号 = response.data.工单编号;
|
|
|
+ formData.value.印件号 = response.data.印件号;
|
|
|
+ formData.value.工序号 = response.data.工序名称.substring(0,2);
|
|
|
+ formData.value.工序名称 = response.data.工序名称;
|
|
|
+ formData.value.产品名称 = response.data.产品名称;
|
|
|
+ formData.value.班组成员 = response.data.班组成员;
|
|
|
+ formData.value.班组Id=response.data.班组Id
|
|
|
+ formData.value.machine=JTMC
|
|
|
+ formData.value.状态=response.data.状态
|
|
|
+
|
|
|
+ let sczl_bhkey=''
|
|
|
+ let sczl_namekey=''
|
|
|
+ if (response.data.班组成员) {
|
|
|
+ for (let i = 0; i < Math.min(Object.keys(response.data.班组成员).length, 6); i++) {
|
|
|
+ sczl_bhkey=`sczl_bh${i+1}`
|
|
|
+ sczl_namekey=`sczl_name${i+1}`
|
|
|
+ formData.value[sczl_bhkey] = response.data.班组成员[i]['编号'];
|
|
|
+ formData.value[sczl_namekey] = response.data.班组成员[i]['姓名'];
|
|
|
+
|
|
|
+ classbz.value[i]=response.data.班组成员[i]['编号']
|
|
|
+ }
|
|
|
+ }
|
|
|
+ formData.value.class=classbz.value.join(',')
|
|
|
+ formData.value.JTMC=JTMC
|
|
|
+ const responses = await MachineDetailList({workshop:CJMC.value});
|
|
|
+ if(responses.code===0){
|
|
|
+ responses.data.map(item=>{
|
|
|
+ if(item.设备编号==JTMC){
|
|
|
+ formData.value.status=item.状态
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // getTableData()
|
|
|
+}
|
|
|
+let CJMC=ref()
|
|
|
+//设备工作清单
|
|
|
+const FacilityWorklist = async () => {
|
|
|
+ const response = await facilityWorklist({machine:JTMC});
|
|
|
+ if (response.code === 0) {
|
|
|
+ // console.log(response)
|
|
|
+ sbzyData.splice(0, sbzyData.length, ...response.data);
|
|
|
+ const res = await facilityProcedure({ Gd_gdbh: sbzyData[0]['工单编号|质量信息'].substring(0, 7) })
|
|
|
+ formData.value.productCode= response.data[0]['产品代号']
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === 0) {
|
|
|
+ selectData.value = res.data
|
|
|
+ }
|
|
|
+ // console.log('33333')
|
|
|
+ FacilityTeam(JTMC)
|
|
|
+ }
|
|
|
+}
|
|
|
+//检验记录
|
|
|
+const InspectionRecord = async () => {
|
|
|
+ console.log(formData.value.班组)
|
|
|
+ const response = await inspectionRecord({machine:JTMC,Gd_gdbh:formData.value.工单编号,team:BZMC.value});
|
|
|
+ // const response = await inspectionRecord({machine:'JY01#',Gd_gdbh:'2311114',team:'A班'});
|
|
|
+ // const response = await inspectionRecord({machine:'JY01#',Gd_gdbh:'2312191',team:'A班'});
|
|
|
+ console.log(response)
|
|
|
+ if(response.code==0){
|
|
|
+ // 提取 inspectiontime 作为列名
|
|
|
+ // Extract inspectiontime as columnNames
|
|
|
+ columnNames = response.data.inspectiontime;
|
|
|
+
|
|
|
+ // Populate drzcData with row data
|
|
|
+ for (const key in response.data) {
|
|
|
+ if (key !== 'inspectiontime') {
|
|
|
+ const item = response.data[key];
|
|
|
+ const rowData = {
|
|
|
+ '工单编号': item['工单编号'],
|
|
|
+ '印件号': item['印件号'],
|
|
|
+ '工序名称': item['工序名称'],
|
|
|
+ '检验项目': item['检验项目']
|
|
|
+ };
|
|
|
+
|
|
|
+ // Initialize time columns with '—'
|
|
|
+ columnNames.forEach(time => {
|
|
|
+ rowData[time] = '';
|
|
|
+ });
|
|
|
+
|
|
|
+ // Split inspectresult and fill the corresponding time columns
|
|
|
+ const results = item['inspectresult'].split(',');
|
|
|
+ results.forEach(result => {
|
|
|
+ if (columnNames.includes(result)) {
|
|
|
+ rowData[result] = '√';
|
|
|
+ }else{rowData[result] = ''}
|
|
|
+ });
|
|
|
+
|
|
|
+ // Add the row data to drzcData
|
|
|
+ JYData.push(rowData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(JYData);
|
|
|
+ }
|
|
|
+}
|
|
|
+const dbclSelection = ref('')
|
|
|
+//当班产量明细复选框
|
|
|
+const dbclmxSelectionChange = (selection, type) => {
|
|
|
+ console.log("selection",selection)
|
|
|
+ if (selection.length > 1) {
|
|
|
+ ElMessage({type: 'warning',message: '您只能选择一条进行删除!'})
|
|
|
+ // 重置选择项
|
|
|
+ dbclSelection.value = ''; // 清空之前的选择
|
|
|
+ selection.splice(0, selection.length); // 清空当前选择数组
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ const ids = selection.map(item => item.UniqId);
|
|
|
+ dbclSelection.value = ids.join(',');
|
|
|
+ console.log(dbclSelection.value)
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//当班产量明细
|
|
|
+const deldbcl_onclick = async () => {
|
|
|
+ console.log(dbclSelection.value)
|
|
|
+ if (dbclSelection.value !== '') {
|
|
|
+ try {
|
|
|
+ //产量上报数据删除
|
|
|
+ const res1 = await ChanliangDel({UniqId: dbclSelection.value})
|
|
|
+ if(res1.code === 0){
|
|
|
+ ElMessage.success('当班产量明细删除成功')
|
|
|
+ //当班产量明细
|
|
|
+ const response = await facilityDetail({ machine: JTMC, Gd_gdbh: formData.value.工单编号, team: BZMC.value });
|
|
|
+ console.log(response);
|
|
|
+ if (response.code === 0) {
|
|
|
+ CLMXData.splice(0, CLMXData.length, ...Object.values(response.data));
|
|
|
+ formData.value.production_now=response.data[0].产量
|
|
|
+ formData.value.production_all=response.data.total.产量
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch(err) {
|
|
|
+ ElMessage.error(err)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+const FacilityDetail = async () => {
|
|
|
+ console.log('123123')
|
|
|
+ console.log(JTMC)
|
|
|
+ console.log('123123')
|
|
|
+ console.log(formData.value.工单编号)
|
|
|
+ console.log('123123')
|
|
|
+ console.log(formData.value.班组)
|
|
|
+ formData.value.production_now=0
|
|
|
+ formData.value.production_all=0
|
|
|
+ // const response = await facilityDetail({ machine: JTMC, Gd_gdbh: formData.value.工单编号, team: formData.value.班组 });
|
|
|
+ const response = await facilityDetail({ machine: JTMC, Gd_gdbh: formData.value.工单编号, team: BZMC.value });
|
|
|
+ // const response = await facilityDetail({ machine: JTMC, Gd_gdbh: '2311114', team:'A班' });
|
|
|
+ if (response.code === 0) {
|
|
|
+ console.log('123123')
|
|
|
+ console.log(response);
|
|
|
+ CLMXData.splice(0, CLMXData.length, ...Object.values(response.data));
|
|
|
+ formData.value.production_now=response.data[0].产量
|
|
|
+ formData.value.production_all=response.data.total.产量
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+// 验证规则
|
|
|
+const rule = reactive({
|
|
|
+})
|
|
|
+
|
|
|
+const searchRule = reactive({
|
|
|
+ createdAt: [
|
|
|
+ { validator: (rule, value, callback) => {
|
|
|
+ if (searchInfo.value.startCreatedAt && !searchInfo.value.endCreatedAt) {
|
|
|
+ callback(new Error('请填写结束日期'))
|
|
|
+ } else if (!searchInfo.value.startCreatedAt && searchInfo.value.endCreatedAt) {
|
|
|
+ callback(new Error('请填写开始日期'))
|
|
|
+ } else if (searchInfo.value.startCreatedAt && searchInfo.value.endCreatedAt && (searchInfo.value.startCreatedAt.getTime() === searchInfo.value.endCreatedAt.getTime() || searchInfo.value.startCreatedAt.getTime() > searchInfo.value.endCreatedAt.getTime())) {
|
|
|
+ callback(new Error('开始日期应当早于结束日期'))
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ }, trigger: 'change' }
|
|
|
+ ],
|
|
|
+})
|
|
|
+
|
|
|
+const elFormRef = ref()
|
|
|
+const elSearchFormRef = ref()
|
|
|
+
|
|
|
+// =========== 表格控制部分 ===========
|
|
|
+const page = ref(1)
|
|
|
+const total = ref(0)
|
|
|
+const pageSize = ref(10)
|
|
|
+const tableData = ref([])
|
|
|
+const searchInfo = ref({})
|
|
|
+const xunchaVisible = ref(false)
|
|
|
+
|
|
|
+
|
|
|
+const xunchatreeData=ref([{label: '现场巡查记录',} ])
|
|
|
+
|
|
|
+// 重置
|
|
|
+const onReset = () => {
|
|
|
+ searchInfo.value = {}
|
|
|
+ getTableData()
|
|
|
+}
|
|
|
+
|
|
|
+// 搜索
|
|
|
+const onSubmit = () => {
|
|
|
+ elSearchFormRef.value?.validate(async(valid) => {
|
|
|
+ if (!valid) return
|
|
|
+ page.value = 1
|
|
|
+ pageSize.value = 10
|
|
|
+ getTableData()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 分页
|
|
|
+const handleSizeChange = (val) => {
|
|
|
+ pageSize.value = val
|
|
|
+ getTableData()
|
|
|
+}
|
|
|
+
|
|
|
+// 修改页面容量
|
|
|
+const handleCurrentChange = (val) => {
|
|
|
+ page.value = val
|
|
|
+ getTableData()
|
|
|
+}
|
|
|
+
|
|
|
+const getTableData = async () => {
|
|
|
+ const response = await facilityTab();
|
|
|
+ if (response.code === 0 && response.data) {
|
|
|
+ const workshops = response.data; // 车间数据
|
|
|
+
|
|
|
+ // 在推送新项之前将 treeData 重置为空数组
|
|
|
+ treeData.value = []; // 使用 .value 访问响应式引用的值
|
|
|
+
|
|
|
+ for (const workshopName in workshops) {
|
|
|
+ const workshopNode = {
|
|
|
+ label: workshopName,
|
|
|
+ children: [],
|
|
|
+ level: 1 // 添加层级属性
|
|
|
+ };
|
|
|
+
|
|
|
+ const machines = workshops[workshopName]; // 车间下的机器
|
|
|
+
|
|
|
+ for (const machineName in machines) {
|
|
|
+ const machineNode = {
|
|
|
+ label: machineName,
|
|
|
+ children: [],
|
|
|
+ level: 2, // 添加层级属性
|
|
|
+ parentNode: workshopNode
|
|
|
+ };
|
|
|
+
|
|
|
+ // Now that machineNode is initialized, you can refer to it
|
|
|
+ const childrenNodes = machines[machineName].map(dateTime => {
|
|
|
+ const dateOnly = dateTime.split(' ')[0];
|
|
|
+ return {
|
|
|
+ label: dateOnly,
|
|
|
+ machineName:machineName,
|
|
|
+ level: 3, // 添加层级属性
|
|
|
+ parentNode: machineNode
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ // Assign the childrenNodes to the machineNode's children property
|
|
|
+ machineNode.children = childrenNodes;
|
|
|
+
|
|
|
+ // Finally, push the machineNode to the workshopNode's children array
|
|
|
+ workshopNode.children.push(machineNode);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将 workshopNode 推送到响应式 treeData 数组
|
|
|
+ treeData.value.push(workshopNode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+// 查询
|
|
|
+const getTableList = async() => {
|
|
|
+ const table = await getCompanyList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value })
|
|
|
+ if (table.code === 0) {
|
|
|
+ tableData.value = table.data.list
|
|
|
+ total.value = table.data.total
|
|
|
+ page.value = table.data.page
|
|
|
+ pageSize.value = table.data.pageSize
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+getTableData()
|
|
|
+const type2 = ref('')
|
|
|
+
|
|
|
+// 修改班组产量提报
|
|
|
+const JPchanliangVisibleedit = ref(false)
|
|
|
+const JPformdataedit = reactive({
|
|
|
+ '工单编号':'',
|
|
|
+ '产品名称':'',
|
|
|
+ '印件号':'',
|
|
|
+ '印件名称':'',
|
|
|
+ '工序号':'',
|
|
|
+ '工序名称':'',
|
|
|
+ '日期':'',
|
|
|
+ '流程标牌':'',
|
|
|
+ '检验类别':'',
|
|
|
+ '废品率系数':'',
|
|
|
+ '计件箱数':'',
|
|
|
+ '每箱数量':'',
|
|
|
+ '换膜总工时':'',
|
|
|
+ '通电工时':'',
|
|
|
+ '定额代号':'',
|
|
|
+ '组员1': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员2': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员3': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员4': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员5': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员6': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员7': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员8': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员9': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员10': {'编号': '','姓名': '','比例': '',}
|
|
|
+})
|
|
|
+
|
|
|
+// 双击JP当日上报产量
|
|
|
+const JPgytableDatadoubleClick = async (row) => {
|
|
|
+ console.log(row)
|
|
|
+ const response = await JPchanliangDetailList({UniqId:row.UniqId})
|
|
|
+ console.log(response)
|
|
|
+ JPformdataedit['工单编号'] = response.data['工单编号'];
|
|
|
+ JPformdataedit['产品名称'] = response.data['成品名称'];
|
|
|
+ JPformdataedit['印件号'] = response.data['yjno'];
|
|
|
+ JPformdataedit['印件名称'] = response.data['产品名称'];
|
|
|
+ JPformdataedit['工序号'] = response.data['gxh'];
|
|
|
+ JPformdataedit['工序名称'] = response.data['gxmc'];
|
|
|
+ JPformdataedit['检验类别'] = response.data['检验类型'];
|
|
|
+ JPformdataedit['废品率系数'] = response.data['废品率系数'];
|
|
|
+ JPformdataedit['日期'] = response.data['sczl_rq'];
|
|
|
+ JPformdataedit['机器'] = JTMC;
|
|
|
+ JPformdataedit['流程标牌'] = response.data['num'];
|
|
|
+ JPformdataedit['计件箱数'] = response.data['计件箱数'];
|
|
|
+ JPformdataedit['每箱数量'] = response.data['每箱数量'];
|
|
|
+ JPformdataedit['换膜总工时'] = response.data['换膜总工时'];
|
|
|
+ JPformdataedit['换膜补产工时'] = response.data['换膜补时'];
|
|
|
+ JPformdataedit['保养工时'] = response.data['保养工时'];
|
|
|
+ JPformdataedit['异常总工时'] = response.data['异常总工时'];
|
|
|
+ JPformdataedit['异常类型'] = response.data['异常类型'];
|
|
|
+ JPformdataedit['异常补贴工时'] = response.data['异常补时'];
|
|
|
+ JPformdataedit['通电工时'] = response.data['通电工时'];
|
|
|
+ JPformdataedit['定额代号'] = response.data['定额代号'];
|
|
|
+ JPformdataedit['bzdh'] = response.data['bzdh'];
|
|
|
+
|
|
|
+ for (let i = 1; i <= 10; i++) {
|
|
|
+ JPformdataedit[`组员${i}`]['编号'] = response.data[`sczl_bh${i}`];
|
|
|
+ }
|
|
|
+ for (let i = 1; i <= 10; i++) {
|
|
|
+ JPformdataedit[`组员${i}`]['姓名'] = response.data[`sczl_name${i}`];
|
|
|
+ }
|
|
|
+ for (let i = 1; i <= 10; i++) {
|
|
|
+ JPformdataedit[`组员${i}`]['比例'] = response.data[`sczl_rate${i}`];
|
|
|
+ }
|
|
|
+ //自动聚焦光标
|
|
|
+ setTimeout(() => {
|
|
|
+ const inputElement = document.getElementById('修改工单编号');
|
|
|
+ if (inputElement) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+ // Object.assign(JPformdataedit,row);
|
|
|
+ JPchanliangVisibleedit.value = true
|
|
|
+}
|
|
|
+
|
|
|
+//当日上报产量确定
|
|
|
+const JPenterDialogedit = async () => {
|
|
|
+ // console.log(JPformdataedit)
|
|
|
+ const JPformattedData = {
|
|
|
+ UniqId:uid.value,
|
|
|
+ sczl_jtbh:JTMC+'#',
|
|
|
+ sczl_gdbh: JPformdataedit['工单编号'],
|
|
|
+ sczl_yjno: JPformdataedit['印件号'],
|
|
|
+ sczl_gxh: JPformdataedit['工序号'],
|
|
|
+ sczl_gxmc: JPformdataedit['工序名称'],
|
|
|
+ sczl_type: JPformdataedit['检验类别'],
|
|
|
+ sczl_废品率系数: JPformdataedit['废品率系数'],
|
|
|
+
|
|
|
+ sczl_rq: JPformdataedit['日期'],
|
|
|
+ sczl_jtbh: JPformdataedit['机器'],
|
|
|
+ sczl_num: JPformdataedit['流程标牌'],
|
|
|
+ sczl_cl: JPformdataedit['计件箱数'],
|
|
|
+ sczl_Pgcl: JPformdataedit['每箱数量'],
|
|
|
+
|
|
|
+ sczl_装版总工时: JPformdataedit['换膜总工时'],
|
|
|
+ sczl_装版工时: JPformdataedit['换膜补产工时'],
|
|
|
+ sczl_保养工时: JPformdataedit['保养工时'],
|
|
|
+
|
|
|
+ sczl_异常停机工时: JPformdataedit['异常总工时'],
|
|
|
+ sczl_异常类型1: JPformdataedit['异常类型'],
|
|
|
+ sczl_异常工时1: JPformdataedit['异常补贴工时'],
|
|
|
+
|
|
|
+ sczl_设备运行工时: JPformdataedit['通电工时'],
|
|
|
+ sczl_dedh: JPformdataedit['定额代号'],
|
|
|
+ sczl_bzdh: JPformdataedit['bzdh'],
|
|
|
+ sczl_bh1: JPformdataedit.组员1['编号'],
|
|
|
+ sczl_bh2: JPformdataedit.组员2['编号'],
|
|
|
+ sczl_bh3: JPformdataedit.组员3['编号'],
|
|
|
+ sczl_bh4: JPformdataedit.组员4['编号'],
|
|
|
+ sczl_bh5: JPformdataedit.组员5['编号'],
|
|
|
+ sczl_bh6: JPformdataedit.组员6['编号'],
|
|
|
+ sczl_bh7: JPformdataedit.组员7['编号'],
|
|
|
+ sczl_bh8: JPformdataedit.组员8['编号'],
|
|
|
+ sczl_bh9: JPformdataedit.组员9['编号'],
|
|
|
+ sczl_bh10: JPformdataedit.组员10['编号'],
|
|
|
+ sczl_bh98:'',
|
|
|
+ sczl_rate1: JPformdataedit.组员1['比例'],
|
|
|
+ sczl_rate2: JPformdataedit.组员2['比例'],
|
|
|
+ sczl_rate3: JPformdataedit.组员3['比例'],
|
|
|
+ sczl_rate4: JPformdataedit.组员4['比例'],
|
|
|
+ sczl_rate5: JPformdataedit.组员5['比例'],
|
|
|
+ sczl_rate6: JPformdataedit.组员6['比例'],
|
|
|
+ sczl_rate7: JPformdataedit.组员7['比例'],
|
|
|
+ sczl_rate8: JPformdataedit.组员8['比例'],
|
|
|
+ sczl_rate9: JPformdataedit.组员9['比例'],
|
|
|
+ sczl_rate10: JPformdataedit.组员10['比例'],
|
|
|
+
|
|
|
+ };
|
|
|
+ console.log(JPformattedData)
|
|
|
+ const JpChanliangEdit_edit = await JpChanliangEdit(JPformattedData);
|
|
|
+ console.log(JpChanliangEdit_edit)
|
|
|
+ if (JpChanliangEdit_edit.code === 0) {
|
|
|
+ JPchanliangVisibleedit.value = false
|
|
|
+ JPmachineDetails(JTMC,date);
|
|
|
+ ElMessage({type: 'success',message: '修改成功'})
|
|
|
+ } else {
|
|
|
+ ElMessage({type: 'error',message: '修改失败'})
|
|
|
+ }
|
|
|
+}
|
|
|
+//当日上报产量取消
|
|
|
+const JPcloseDialogedit = async () => {
|
|
|
+ JPchanliangVisibleedit.value = false
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+//班组产量提报 JP检品机单独页面
|
|
|
+const JPchanliangVisible = ref(false)
|
|
|
+const JPformdata = reactive({
|
|
|
+ '工单编号':'',
|
|
|
+ '产品名称':'',
|
|
|
+ '印件号':'',
|
|
|
+ '印件名称':'',
|
|
|
+ '工序号':'',
|
|
|
+ '工序名称':'',
|
|
|
+ '日期':'',
|
|
|
+ '机器':'',
|
|
|
+ '流程标牌':'',
|
|
|
+ '检验类别':'',
|
|
|
+ '废品率系数':'',
|
|
|
+ '计件箱数':'',
|
|
|
+ '每箱数量':'',
|
|
|
+ '换膜总工时':'',
|
|
|
+
|
|
|
+ '换膜补产工时':'',
|
|
|
+ '保养工时':'',
|
|
|
+ '异常总工时':'',
|
|
|
+ '异常类型':'',
|
|
|
+ '异常补贴工时':'',
|
|
|
+
|
|
|
+ '通电工时':'',
|
|
|
+ '定额代号':'',
|
|
|
+ '组员1': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员2': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员3': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员4': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员5': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员6': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员7': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员8': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员9': {'编号': '','姓名': '','比例': '',},
|
|
|
+ '组员10': {'编号': '','姓名': '','比例': '',}
|
|
|
+})
|
|
|
+
|
|
|
+//班组产量提报 JP检品机 班组产量提报确定
|
|
|
+const JPenterDialog = async() => {
|
|
|
+ const JPformattedData = {
|
|
|
+ sczl_jtbh:JTMC+'#',
|
|
|
+ sczl_gdbh: JPformdata['工单编号'],
|
|
|
+ sczl_yjno: JPformdata['印件号'],
|
|
|
+ sczl_gxh: JPformdata['工序号'],
|
|
|
+ sczl_gxmc: JPformdata['工序名称'],
|
|
|
+ sczl_type: JPformdata['检验类别'],
|
|
|
+ sczl_废品率系数: JPformdata['废品率系数'],
|
|
|
+
|
|
|
+ sczl_rq: JPformdata['日期'],
|
|
|
+ sczl_jtbh: JPformdata['机器'],
|
|
|
+ sczl_num: JPformdata['流程标牌'],
|
|
|
+ sczl_cl: JPformdata['计件箱数'],
|
|
|
+ sczl_Pgcl: JPformdata['每箱数量'],
|
|
|
+
|
|
|
+ sczl_装版总工时: JPformdata['换膜总工时'],
|
|
|
+ sczl_装版工时: JPformdata['换膜补产工时'],
|
|
|
+ sczl_保养工时: JPformdata['保养工时'],
|
|
|
+
|
|
|
+
|
|
|
+ sczl_异常停机工时: JPformdata['异常总工时'],
|
|
|
+ sczl_异常类型1: JPformdata['异常类型'],
|
|
|
+ sczl_异常工时1: JPformdata['异常补贴工时'],
|
|
|
+
|
|
|
+ sczl_设备运行工时: JPformdata['通电工时'],
|
|
|
+ sczl_dedh: JPformdata['定额代号'],
|
|
|
+ sczl_bzdh: JPformdata['bzdh'],
|
|
|
+ sczl_bh1: JPformdata.组员1['编号'],
|
|
|
+ sczl_bh2: JPformdata.组员2['编号'],
|
|
|
+ sczl_bh3: JPformdata.组员3['编号'],
|
|
|
+ sczl_bh4: JPformdata.组员4['编号'],
|
|
|
+ sczl_bh5: JPformdata.组员5['编号'],
|
|
|
+ sczl_bh6: JPformdata.组员6['编号'],
|
|
|
+ sczl_bh7: JPformdata.组员7['编号'],
|
|
|
+ sczl_bh8: JPformdata.组员8['编号'],
|
|
|
+ sczl_bh9: JPformdata.组员9['编号'],
|
|
|
+ sczl_bh10: JPformdata.组员10['编号'],
|
|
|
+ sczl_bh98:'',
|
|
|
+ sczl_rate1: JPformdata.组员1['比例'],
|
|
|
+ sczl_rate2: JPformdata.组员2['比例'],
|
|
|
+ sczl_rate3: JPformdata.组员3['比例'],
|
|
|
+ sczl_rate4: JPformdata.组员4['比例'],
|
|
|
+ sczl_rate5: JPformdata.组员5['比例'],
|
|
|
+ sczl_rate6: JPformdata.组员6['比例'],
|
|
|
+ sczl_rate7: JPformdata.组员7['比例'],
|
|
|
+ sczl_rate8: JPformdata.组员8['比例'],
|
|
|
+ sczl_rate9: JPformdata.组员9['比例'],
|
|
|
+ sczl_rate10: JPformdata.组员10['比例'],
|
|
|
+
|
|
|
+ };
|
|
|
+ console.log(JPformattedData)
|
|
|
+ // console.log("新增了")
|
|
|
+ console.log(JTMC)
|
|
|
+ console.log(date)
|
|
|
+
|
|
|
+ const JpUploade_add = await JpUploade(JPformattedData);
|
|
|
+ console.log(JpUploade_add)
|
|
|
+ if (JpUploade_add.code === 0) {
|
|
|
+ // JPchanliangVisible.value = false
|
|
|
+ ElMessage({type: 'success',message: '添加成功'})
|
|
|
+ JPmachineDetails(JTMC+'#',date);
|
|
|
+ //自动聚焦光标
|
|
|
+ setTimeout(() => {
|
|
|
+ const inputElement = document.getElementById('新增工单编号');
|
|
|
+ if (inputElement) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+ JPformdata['流程标牌'] = ''
|
|
|
+ JPformdata['检验类别'] = ''
|
|
|
+ JPformdata['换膜总工时'] = ''
|
|
|
+ JPformdata['换膜补产工时'] = ''
|
|
|
+ JPformdata['保养工时'] = ''
|
|
|
+ JPformdata['异常总工时'] = ''
|
|
|
+ JPformdata['异常类型'] = ''
|
|
|
+ JPformdata['异常补贴工时'] = ''
|
|
|
+ JPformdata['通电工时'] = ''
|
|
|
+ JPformdata['计件箱数'] = 0
|
|
|
+ } else {
|
|
|
+ ElMessage({type: 'error',message: '添加失败'})
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//班组产量提报 JP检品机 班组产量提报取消
|
|
|
+const JPcloseDialog = async() => {
|
|
|
+ JPchanliangVisible.value = false
|
|
|
+}
|
|
|
+
|
|
|
+//班组产量提报 回车
|
|
|
+const JPblModellistedit = ref(false)
|
|
|
+const JPdialogSelectVisible_LXedit = ref(false)
|
|
|
+
|
|
|
+const JPtableDataedit = reactive([
|
|
|
+ { name: ' ', type: ' ' },
|
|
|
+ { name: '废品版', type: '废品版' },
|
|
|
+ { name: '正品版', type: '正品版' },
|
|
|
+ { name: '次品版', type: '次品版' },
|
|
|
+])
|
|
|
+
|
|
|
+const JPhandleRowClickedit = async (row) => {
|
|
|
+ JPformdataedit['检验类别'] = row['name']
|
|
|
+ JPdialogSelectVisible_LXedit.value = false
|
|
|
+ const fplxs = await getRejectRate({order:JPformdataedit['工单编号'],yjno:JPformdataedit['印件号'],gxh:JPformdataedit['工序号'],type:JPformdataedit['检验类别']})
|
|
|
+ if (fplxs.code === 0) {
|
|
|
+ JPformdataedit['废品率系数'] = fplxs.data
|
|
|
+ }
|
|
|
+}
|
|
|
+const currentIndex_jylbedit = ref(0);
|
|
|
+//弹窗键盘事件
|
|
|
+const JPselect_jylbedit = (event) => {
|
|
|
+ if (event.keyCode === 40) { // 向下箭头
|
|
|
+ if (currentIndex_jylbedit.value < JPtableDataedit.length - 1) {
|
|
|
+ currentIndex_jylbedit.value++;
|
|
|
+ setCurrent_jylbedit(JPtableDataedit[currentIndex_jylbedit.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_jylbedit.value = 0;
|
|
|
+ setCurrent_jylbedit(JPtableDataedit[currentIndex_jylbedit.value]); // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ if (currentIndex_jylbedit.value > 0) {
|
|
|
+ currentIndex_jylbedit.value--;
|
|
|
+ setCurrent_jylbedit(JPtableDataedit[currentIndex_jylbedit.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_jylbedit.value = JPtableDataedit.length - 1;
|
|
|
+ setCurrent_jylbedit(JPtableDataedit[currentIndex_jylbedit.value]); // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) { // 回车键
|
|
|
+ JPdialogSelectVisible_LXedit.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+const jylbedit_table = ref()
|
|
|
+const setCurrent_jylbedit = async (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ jylbedit_table.value?.setCurrentRow(row)
|
|
|
+ const {name} = row
|
|
|
+ JPformdataedit['检验类别'] = name
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//工单编号回车事件
|
|
|
+ const JPgetCPMCsubmitedit = () => {
|
|
|
+ if(JPformdataedit.工单编号!=''){
|
|
|
+ ChanliangWorkorder({search:JPformdataedit['工单编号'],machine:JTMC}).then(response=>{
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data){
|
|
|
+ JPformdataedit['产品名称'] = response.data[0].cpmc
|
|
|
+ document.getElementById('产品名称').style.color = 'red';
|
|
|
+ // JPgetYJMCsubmit()
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: response.msg
|
|
|
+ })
|
|
|
+ JPformdataedit['工单编号'] = '';
|
|
|
+ JPformdataedit['产品名称'] = '';
|
|
|
+ document.getElementById('产品名称').style.color = 'black';
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ JPformdataedit['工单编号'] = '';
|
|
|
+ JPformdataedit['产品名称'] = '';
|
|
|
+ document.getElementById('产品名称').style.color = 'black';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请注意, 工单编号输入空置, 除非有特殊需要!'
|
|
|
+ })
|
|
|
+ gxmc.value = '';
|
|
|
+ document.getElementById('产品名称').style.color = 'black';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //印件选择
|
|
|
+ const JPdialogSelectVisible_Yjedit = ref(false)
|
|
|
+ const JPselectData_Yjedit = reactive([])
|
|
|
+ // 处理选择框
|
|
|
+ const JPhandleSelectClick_Yjedit = (row, column, event) => {
|
|
|
+ const { yjno, yjmc, ls } = row
|
|
|
+ JPformdataedit['印件号'] = yjno
|
|
|
+ JPformdataedit['印件名称'] = yjmc
|
|
|
+ JPdialogSelectVisible_Yjedit.value = false
|
|
|
+ }
|
|
|
+ const JPselect_Yjedit = (event) => {
|
|
|
+ if (event.keyCode === 40) { // 向下箭头
|
|
|
+ if (currentIndex.value < JPselectData_Yjedit.length - 1) {
|
|
|
+ currentIndex.value++;
|
|
|
+ JPsetCurrent_Yjedit(JPselectData_Yjedit[currentIndex.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex.value = 0;
|
|
|
+ JPsetCurrent_Yjedit(JPselectData_Yjedit[currentIndex.value]); // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ if (currentIndex.value > 0) {
|
|
|
+ currentIndex.value--;
|
|
|
+ JPsetCurrent_Yjedit(JPselectData_Yjedit[currentIndex.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex.value = JPselectData_Yjedit.length - 1;
|
|
|
+ JPsetCurrent_Yjedit(JPselectData_Yjedit[currentIndex.value]); // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) { // 回车键
|
|
|
+ JPdialogSelectVisible_Yjedit.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //工序选择
|
|
|
+ const JPdialogSelectVisible_Gxedit = ref(false)
|
|
|
+ const JPselectData_Gxedit = reactive([])
|
|
|
+ const JPtable_Gxedit = ref()
|
|
|
+ // 处理选择框
|
|
|
+ const JPhandleSelectClick_Gxedit = (row, column, event) => {
|
|
|
+ const { gxh, name, gxmc } = row
|
|
|
+ JPformdataedit['工序号'] = gxh
|
|
|
+ JPformdataedit['工序名称'] = name
|
|
|
+ JPdialogSelectVisible_Gxedit.value = false
|
|
|
+ }
|
|
|
+ const currentIndex_gxedit = ref(0);
|
|
|
+ //弹窗键盘事件
|
|
|
+ const JPselect_xzedit = (event) => {
|
|
|
+ if (event.keyCode === 40) { // 向下箭头
|
|
|
+ if (currentIndex_gxedit.value < JPselectData_Gxedit.length - 1) {
|
|
|
+ currentIndex_gxedit.value++;
|
|
|
+ setCurrent_gxedit(JPselectData_Gxedit[currentIndex_gxedit.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_gxedit.value = 0;
|
|
|
+ setCurrent_gxedit(JPselectData_Gxedit[currentIndex_gxedit.value]); // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ if (currentIndex_gxedit.value > 0) {
|
|
|
+ currentIndex_gxedit.value--;
|
|
|
+ setCurrent_gxedit(JPselectData_Gxedit[currentIndex_gxedit.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_gxedit.value = JPselectData_Gxedit.length - 1;
|
|
|
+ setCurrent_gxedit(JPselectData_Gxedit[currentIndex_gxedit.value]); // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) { // 回车键
|
|
|
+ JPdialogSelectVisible_Gxedit.value = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const table_gxedit = ref()
|
|
|
+ const setCurrent_gxedit = (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ table_gxedit.value?.setCurrentRow(row)
|
|
|
+ const { gxh, name, gxmc } = row
|
|
|
+ JPformdataedit['工序号'] = gxh
|
|
|
+ JPformdataedit['工序名称'] = name
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+const JPentedit = async (event,key,val) => {
|
|
|
+ if(event.keyCode === 13){
|
|
|
+ //组员及比例分配
|
|
|
+ if(event.keyCode === 13 && val === '1'){
|
|
|
+ let bzyg=''
|
|
|
+ bzyg=`组员${key}`
|
|
|
+ let bzxm=''
|
|
|
+ bzxm=`组员${key}`
|
|
|
+ if(JPformdataedit[bzyg]['编号']){
|
|
|
+ const getYg_response = await getYg({sczl_bh:JPformdataedit[bzyg]['编号']});
|
|
|
+ if (getYg_response.code === 0) {
|
|
|
+ if(getYg_response.data.length === 1){
|
|
|
+ JPformdataedit[bzyg]['姓名'] = getYg_response.data[0].ygxm
|
|
|
+ JPformdataedit[bzyg]['编号'] = getYg_response.data[0].员工编号
|
|
|
+ }else{
|
|
|
+ JPblModellistedit.value = true;
|
|
|
+ JPemployeeDatalistedit.value = getYg_response.data // 假设响应数据是数组
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 阻止回车键的默认行为
|
|
|
+ event.preventDefault();
|
|
|
+ event.stopPropagation();
|
|
|
+
|
|
|
+ // 获取所有以 "bh" 开头的输入框
|
|
|
+ const inputs = document.querySelectorAll('input[id^="bh"]');
|
|
|
+ const currentIndex = Array.from(inputs).indexOf(event.target); // 获取当前触发事件的input索引
|
|
|
+
|
|
|
+ // 判断是否是最后一个输入框
|
|
|
+ if (currentIndex === inputs.length - 1) {
|
|
|
+ console.log('当前是最后一个输入框');
|
|
|
+ if(JPblModellist.value === false){
|
|
|
+ // 弹出存盘确认框
|
|
|
+ ElMessageBox.confirm('数据存盘?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ // 用户点击“确定”,执行存盘操作
|
|
|
+ JPenterDialogedit();
|
|
|
+ }).catch(() => {
|
|
|
+ console.log('用户取消了存盘操作');
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(event.target.id === '检验类别'){
|
|
|
+ JPdialogSelectVisible_LXedit.value = true
|
|
|
+ }
|
|
|
+ if(event.target.id === '印件号'){
|
|
|
+ if(JPformdataedit['工单编号']!=''){
|
|
|
+ //获取印件名称
|
|
|
+ ChanliangPrintDetail({gdbh:JPformdataedit['工单编号']}).then(response=>{
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data){
|
|
|
+ if(response.data.length==1){
|
|
|
+ JPformdataedit['印件号'] = response.data[0].yjno
|
|
|
+ JPformdataedit['印件名称'] = response.data[0].yjmc
|
|
|
+ setColorReadonly('印件名称')
|
|
|
+ }else{
|
|
|
+ JPselectData_Yjedit.splice(0, JPselectData_Yjedit.length, ...response.data)
|
|
|
+ JPdialogSelectVisible_Yjedit.value=true
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: response.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '印件编号不存在, 将恢复默认值, 请仔细确认数据准确性!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(event.target.id === '工序号'){
|
|
|
+ document.getElementById('工序名称').style.color = 'red';
|
|
|
+ //弹出选择
|
|
|
+ ChanliangProcessDetail({gdbh:JPformdataedit['工单编号'],yjno:JPformdataedit['印件号'],machine:''}).then(response=>{
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data){
|
|
|
+ if(response.data.length === 1){
|
|
|
+ JPformdataedit['工序号']=response.data[0].gxh
|
|
|
+ JPformdataedit['工序名称']=response.data[0].name
|
|
|
+ }else{
|
|
|
+ JPselectData_Gxedit.splice(0, JPselectData_Gxedit.length, ...response.data)
|
|
|
+ JPdialogSelectVisible_Gxedit.value = true
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: response.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (event.target.id === '机器') {
|
|
|
+ // 获取当前输入框的值
|
|
|
+ const machineInputValue = JPformdataedit['机器'];
|
|
|
+
|
|
|
+ // 调用接口获取机台数据
|
|
|
+ const MachineListdata = await gdzl_MachineList({ address: CJMC.value });
|
|
|
+ console.log("MachineListdata", MachineListdata);
|
|
|
+
|
|
|
+ //机台列表数据
|
|
|
+ JPselectData_JTedit.value = MachineListdata.data.map((item, index) => ({
|
|
|
+ ID: index + 1,
|
|
|
+ 机台: item,
|
|
|
+ }));
|
|
|
+ JPselectData_JTedit.splice(0, JPselectData_JTedit.length, ...JPselectData_JTedit.value);
|
|
|
+
|
|
|
+ // 检查输入的机器名称是否存在于接口返回的数据中
|
|
|
+ const isMachineValid = JPselectData_JTedit.value.some(item => item.机台 === machineInputValue);
|
|
|
+ //完全匹配时,输入错误在弹窗
|
|
|
+ // const isMachineValid = JPselectData_JT.value.some(item => item.机台.split('-->')[0] === machineInputValue);
|
|
|
+ if (!isMachineValid) {
|
|
|
+ // 如果机器名称无效,则弹出弹窗
|
|
|
+ JPdialogVisible_JTedit.value = true;
|
|
|
+ // console.log('输入的机器不在列表中,弹出弹窗');
|
|
|
+ } else {
|
|
|
+ // console.log('输入的机器匹配列表,弹窗不显示');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (event.target.id === '定额代号') {
|
|
|
+ if(JPformdataedit['机器'] === ''){
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请先选择机台!'
|
|
|
+ })
|
|
|
+ //自动聚焦光标
|
|
|
+ setTimeout(() => {
|
|
|
+ const inputElement = document.getElementById('机器');
|
|
|
+ if (inputElement) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+ }else{
|
|
|
+ getDedhsubmitedit();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const inputs = document.getElementsByTagName('input');
|
|
|
+ const currentIndex = Array.from(inputs).indexOf(event.target);
|
|
|
+ if (event.keyCode === 13 || event.keyCode === 40) { // Enter 或向下箭头
|
|
|
+ let nextIndex = currentIndex + 1;
|
|
|
+ while (nextIndex < inputs.length) {
|
|
|
+ if (inputs[nextIndex].disabled) {
|
|
|
+ console.log("当前输入框为disabled,跳过");
|
|
|
+ nextIndex++; // 跳过disabled的输入框
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!inputs[nextIndex].readOnly) {
|
|
|
+ nextTick(() => {
|
|
|
+ inputs[nextIndex].focus();
|
|
|
+ inputs[nextIndex].select();
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ nextIndex++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // } else if (event.keyCode === 8) { // 删除箭头
|
|
|
+ // if (event.target.selectionStart === 0) {
|
|
|
+ // for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ // if (!inputs[i].readOnly) {
|
|
|
+ // nextTick(()=>{
|
|
|
+ // inputs[i].focus();
|
|
|
+ // inputs[i].setSelectionRange(0, 0);
|
|
|
+ // })
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ } else if (event.keyCode === 37) { // 向左箭头
|
|
|
+ if (event.target.selectionStart === 0) {
|
|
|
+ for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 39) { // 向右箭头
|
|
|
+ if (event.target.selectionStart === event.target.value.length) {
|
|
|
+ for (let i = currentIndex + 1; i < inputs.length; i++) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+/*
|
|
|
+ 机台机器选择修改
|
|
|
+*/
|
|
|
+const JPdialogVisible_JTedit = ref(false) // 弹窗
|
|
|
+const JPselectData_JTedit = reactive([]) // table data
|
|
|
+const currentIndex_JTedit = ref(0);
|
|
|
+//双击事件
|
|
|
+const JPhandleSelectClick_JTedit = async (row) => {
|
|
|
+ // 使用 split() 截取 '机器' 字符串中 '-->' 前面的部分
|
|
|
+ const machineName = row['机台'].split('-->')[0];
|
|
|
+ JPformdataedit['机器'] = machineName;
|
|
|
+}
|
|
|
+// 键盘事件
|
|
|
+const JPselect_JTedit = async (event) => {
|
|
|
+ if (event.keyCode === 40) { // 向下箭头
|
|
|
+ if (currentIndex_JTedit.value < JPselectData_JTedit.length - 1) {
|
|
|
+ currentIndex_JTedit.value++;
|
|
|
+ setCurrent_JTedit(JPselectData_JTedit[currentIndex_JTedit.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_JTedit.value = 0;
|
|
|
+ setCurrent_JTedit(JPselectData_JTedit[currentIndex_JTedit.value]); // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ if (currentIndex_JTedit.value > 0) {
|
|
|
+ currentIndex_JTedit.value--;
|
|
|
+ setCurrent_JTedit(JPselectData_JTedit[currentIndex_JTedit.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_JTedit.value = JPselectData_JTedit.length - 1;
|
|
|
+ setCurrent_JTedit(JPselectData_JTedit[currentIndex_JTedit.value]); // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) { // 回车键
|
|
|
+ JPdialogVisible_JTedit.value = false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// ref属性
|
|
|
+const table_JTedit = ref();
|
|
|
+
|
|
|
+const setCurrent_JTedit = (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ table_JTedit.value?.setCurrentRow(row);
|
|
|
+ // 使用 split() 截取 '机器' 字符串中 '-->' 前面的部分
|
|
|
+ const machineName = row['机台'].split('-->')[0];
|
|
|
+ JPformdataedit['机器'] = machineName;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+//班组产量提报 打开新增页面
|
|
|
+const onADD = async() => {
|
|
|
+ //判断是否为JP 检品机器【是检品机独立页面】
|
|
|
+ if (JTMC.startsWith('JP')) {
|
|
|
+ JPchanliangVisible.value = true
|
|
|
+ //获取当天日期接口
|
|
|
+ getTimelistss();
|
|
|
+ //获取产量上报数据信息接口
|
|
|
+ getMachineReportInfos();
|
|
|
+
|
|
|
+ } else {
|
|
|
+ type2.value="create"
|
|
|
+ //通过车间名称查询机台【机器】
|
|
|
+ gdzl_MachineList({address:CJMC.value}).then( MachineList_jitai =>{
|
|
|
+ gdzl_MachineList_address.data = MachineList_jitai.data;
|
|
|
+ });
|
|
|
+ console.log('点击新增')
|
|
|
+ //打开新增按钮获取
|
|
|
+ qita_jitaidata();
|
|
|
+
|
|
|
+ if(uid.value == undefined){
|
|
|
+ initfordata3()
|
|
|
+ chanliangVisible.value=true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const response = await MachineChanliangDetail({UniqId:uid.value});
|
|
|
+ if (response.code === 0) {
|
|
|
+ chanliangVisible.value=true
|
|
|
+ formdata3.value=response.data
|
|
|
+ const result=formdata3.value.gxmc.match(/-(.{2})/)
|
|
|
+ formdata3.value.gymc=result[1]
|
|
|
+ formdata3.value.sczl_jtbh=JTMC
|
|
|
+ formdata3.value.yjmc=response.data.印件名称
|
|
|
+ formdata3.value.rq=date
|
|
|
+ if (formdata3.value.bzdh === 'A班') {
|
|
|
+ formdata3.value.starttime = ''; // 清空值
|
|
|
+ setTimeout(()=>{
|
|
|
+ formdata3.value.starttime = date + " 08:30:00"; // 设置为 20:30:00
|
|
|
+ })
|
|
|
+ } else if (formdata3.value.bzdh === 'B班') {
|
|
|
+ formdata3.value.starttime = ''; // 清空值
|
|
|
+ setTimeout(()=>{
|
|
|
+ formdata3.value.starttime = date + " 20:30:00"; // 设置为 20:30:00
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //部分数据置空
|
|
|
+ formdata3.value.产量 = '';
|
|
|
+ formdata3.value.制程废品 = '0.0';
|
|
|
+ formdata3.value.制程次品 = '0.0';
|
|
|
+ formdata3.value.前工序废 = '0.0';
|
|
|
+ formdata3.value.来料异常 = '0.0';
|
|
|
+ formdata3.value.装版工时 = '0.00';
|
|
|
+ formdata3.value.装版补产工时 = '0.00';
|
|
|
+ formdata3.value.打样工时 = '0.00';
|
|
|
+ formdata3.value.打样补产工时 = '0.00';
|
|
|
+ formdata3.value.保养工时 = '0.00';
|
|
|
+ formdata3.value.异常总工时 = '0.00';
|
|
|
+ formdata3.value.通电工时 = '0.00';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //自动聚焦光标
|
|
|
+ setTimeout(() => {
|
|
|
+ const inputElement = document.getElementById('新增工单编号');
|
|
|
+ if (inputElement) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+ //自动聚焦光标
|
|
|
+ setTimeout(() => {
|
|
|
+ const inputElement = document.getElementById('工单编号');
|
|
|
+ if (inputElement) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//班组产量提报 获取当天日期接口
|
|
|
+const getTimelistss = async () => {
|
|
|
+ const getTimelistss = await getTimelist();
|
|
|
+ JPformdata['日期'] = getTimelistss.data.date
|
|
|
+}
|
|
|
+
|
|
|
+//班组产量提报 获取产量上报数据信息接口
|
|
|
+const getMachineReportInfos = async () => {
|
|
|
+ const getMachineReportInfos = await reportInfo({machine:JTMC = JTMC.replace(/#/g, '')});
|
|
|
+ JPformdata['bzdh'] = getMachineReportInfos.data.class.sczl_bzdh
|
|
|
+ JPformdata['工单编号'] = _rclsb_gdbh.value
|
|
|
+ JPformdata['产品名称'] = getMachineReportInfos.data.order_info.product_name
|
|
|
+ // JPformdata['定额代号'] = getMachineReportInfos.data.order_info.dedh
|
|
|
+
|
|
|
+ for (let i = 1; i <= 10; i++) {
|
|
|
+ JPformdata[`组员${i}`]['比例'] = getMachineReportInfos.data.class[`sczl_rate${i}`];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+ //工单编号回车事件
|
|
|
+ const JPgetCPMCsubmit = () => {
|
|
|
+ if(JPformdata.工单编号!=''){
|
|
|
+ ChanliangWorkorder({search:JPformdata['工单编号'],machine:JTMC}).then(response=>{
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data){
|
|
|
+ JPformdata['产品名称'] = response.data[0].cpmc
|
|
|
+ document.getElementById('产品名称').style.color = 'red';
|
|
|
+ // JPgetYJMCsubmit()
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: response.msg
|
|
|
+ })
|
|
|
+ JPformdata['工单编号'] = '';
|
|
|
+ JPformdata['产品名称'] = '';
|
|
|
+ document.getElementById('产品名称').style.color = 'black';
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ JPformdata['工单编号'] = '';
|
|
|
+ JPformdata['产品名称'] = '';
|
|
|
+ document.getElementById('产品名称').style.color = 'black';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请注意, 工单编号输入空置, 除非有特殊需要!'
|
|
|
+ })
|
|
|
+ gxmc.value = '';
|
|
|
+ document.getElementById('产品名称').style.color = 'black';
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //印件选择
|
|
|
+const JPdialogSelectVisible_Yj = ref(false)
|
|
|
+const JPselectData_Yj = reactive([])
|
|
|
+// 处理选择框
|
|
|
+const JPhandleSelectClick_Yj = (row, column, event) => {
|
|
|
+ const { yjno, yjmc, ls } = row
|
|
|
+ JPformdata['印件号'] = yjno
|
|
|
+ JPformdata['印件名称'] = yjmc
|
|
|
+ JPdialogSelectVisible_Yj.value = false
|
|
|
+}
|
|
|
+const JPselect_Yj = (event) => {
|
|
|
+ if (event.keyCode === 40) { // 向下箭头
|
|
|
+ if (currentIndex.value < JPselectData_Yj.length - 1) {
|
|
|
+ currentIndex.value++;
|
|
|
+ JPsetCurrent_Yj(JPselectData_Yj[currentIndex.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex.value = 0;
|
|
|
+ JPsetCurrent_Yj(JPselectData_Yj[currentIndex.value]); // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ if (currentIndex.value > 0) {
|
|
|
+ currentIndex.value--;
|
|
|
+ JPsetCurrent_Yj(JPselectData_Yj[currentIndex.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex.value = JPselectData_Yj.length - 1;
|
|
|
+ JPsetCurrent_Yj(JPselectData_Yj[currentIndex.value]); // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) { // 回车键
|
|
|
+ JPdialogSelectVisible_Yj.value = false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+ 工序选择
|
|
|
+*/
|
|
|
+const JPdialogSelectVisible_Gx = ref(false)//弹窗控件
|
|
|
+const JPselectData_Gx = reactive([])//表格data数据
|
|
|
+// const JPtable_Gx = ref()
|
|
|
+//点击事件
|
|
|
+const JPhandleSelectClick_Gx = (row, column, event) => {
|
|
|
+ const { gxh, name, gxmc } = row
|
|
|
+ JPformdata['工序号'] = gxh
|
|
|
+ JPformdata['工序名称'] = name
|
|
|
+ JPdialogSelectVisible_Gx.value = false
|
|
|
+}
|
|
|
+const currentIndex_gx = ref(0);
|
|
|
+//弹窗键盘事件
|
|
|
+const JPselect_xz = (event) => {
|
|
|
+ if (event.keyCode === 40) { // 向下箭头
|
|
|
+ if (currentIndex_gx.value < JPselectData_Gx.length - 1) {
|
|
|
+ currentIndex_gx.value++;
|
|
|
+ setCurrent_gx(JPselectData_Gx[currentIndex_gx.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_gx.value = 0;
|
|
|
+ setCurrent_gx(JPselectData_Gx[currentIndex_gx.value]); // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ if (currentIndex_gx.value > 0) {
|
|
|
+ currentIndex_gx.value--;
|
|
|
+ setCurrent_gx(JPselectData_Gx[currentIndex_gx.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_gx.value = JPselectData_Gx.length - 1;
|
|
|
+ setCurrent_gx(JPselectData_Gx[currentIndex_gx.value]); // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) { // 回车键
|
|
|
+ JPdialogSelectVisible_Gx.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+const table_gx = ref()
|
|
|
+const setCurrent_gx = (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ table_gx.value?.setCurrentRow(row)
|
|
|
+ const { gxh, name, gxmc } = row
|
|
|
+ JPformdata['工序号'] = gxh
|
|
|
+ JPformdata['工序名称'] = gxmc
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//班组产量提报 回车
|
|
|
+const JPblModellist = ref(false)
|
|
|
+const JPdialogSelectVisible_LX = ref(false)
|
|
|
+
|
|
|
+const JPtableData = reactive([
|
|
|
+ { name: ' ', type: ' ' },
|
|
|
+ { name: '废品版', type: '废品版' },
|
|
|
+ { name: '正品版', type: '正品版' },
|
|
|
+ { name: '次品版', type: '次品版' },
|
|
|
+])
|
|
|
+
|
|
|
+const JPhandleRowClick = async (row) => {
|
|
|
+ JPformdata['检验类别'] = row['name']
|
|
|
+ JPdialogSelectVisible_LX.value = false
|
|
|
+ const fplxs = await getRejectRate({order:JPformdata['工单编号'],yjno:JPformdata['印件号'],gxh:JPformdata['工序号'],type:JPformdata['检验类别']})
|
|
|
+ if (fplxs.code === 0) {
|
|
|
+ JPformdata['废品率系数'] = fplxs.data
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const currentIndex_jylb = ref(0);
|
|
|
+//弹窗键盘事件
|
|
|
+const JPselect_jylb = (event) => {
|
|
|
+ if (event.keyCode === 40) { // 向下箭头
|
|
|
+ if (currentIndex_jylb.value < JPtableData.length - 1) {
|
|
|
+ currentIndex_jylb.value++;
|
|
|
+ setCurrent_jylb(JPtableData[currentIndex_jylb.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_jylb.value = 0;
|
|
|
+ setCurrent_jylb(JPtableData[currentIndex_jylb.value]); // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ if (currentIndex_jylb.value > 0) {
|
|
|
+ currentIndex_jylb.value--;
|
|
|
+ setCurrent_jylb(JPtableData[currentIndex_jylb.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_jylb.value = JPtableData.length - 1;
|
|
|
+ setCurrent_jylb(JPtableData[currentIndex_jylb.value]); // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) { // 回车键
|
|
|
+ JPdialogSelectVisible_LX.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+const jylb_table = ref()
|
|
|
+const setCurrent_jylb = async (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ jylb_table.value?.setCurrentRow(row)
|
|
|
+ const {name} = row
|
|
|
+ JPformdata['检验类别'] = name
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//日期获得焦点事件
|
|
|
+const rqHandleFocus = () => {
|
|
|
+ if (JPformdata['日期'] == undefined || JPformdata['日期'] == '') {
|
|
|
+ JPformdata['日期'] = new Date().toISOString().split('T')[0]
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//回车事件
|
|
|
+const JPent = async (event,key,val) => {
|
|
|
+ if(event.keyCode === 13){
|
|
|
+ //组员及比例分配
|
|
|
+ if (val === '1') {
|
|
|
+ let bzyg = `组员${key}`;
|
|
|
+
|
|
|
+ if (JPformdata[bzyg] && JPformdata[bzyg]['编号']) {
|
|
|
+ try {
|
|
|
+ const getYg_response = await getYg({ sczl_bh: JPformdata[bzyg]['编号'] });
|
|
|
+
|
|
|
+ if (getYg_response.code === 0) {
|
|
|
+ if (getYg_response.data.length === 1) {
|
|
|
+ JPformdata[bzyg]['姓名'] = getYg_response.data[0].ygxm;
|
|
|
+ JPformdata[bzyg]['编号'] = getYg_response.data[0].员工编号;
|
|
|
+ } else {
|
|
|
+ // 显示员工选择列表
|
|
|
+ JPblModellist.value = true;
|
|
|
+ JPemployeeDatalist.value = getYg_response.data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error("获取员工信息失败", error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 阻止回车键的默认行为
|
|
|
+ event.preventDefault();
|
|
|
+ event.stopPropagation();
|
|
|
+
|
|
|
+ // 获取所有以 "bh" 开头的输入框
|
|
|
+ const inputs = document.querySelectorAll('input[id^="bh"]');
|
|
|
+ const currentIndex = Array.from(inputs).indexOf(event.target); // 获取当前触发事件的input索引
|
|
|
+
|
|
|
+ // 判断是否是最后一个输入框
|
|
|
+ if (currentIndex === inputs.length - 1) {
|
|
|
+ console.log('当前是最后一个输入框');
|
|
|
+ if(JPblModellist.value === false){
|
|
|
+ // 弹出存盘确认框
|
|
|
+ ElMessageBox.confirm('数据存盘?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ // 用户点击“确定”,执行存盘操作
|
|
|
+ JPenterDialog(); // 存盘函数
|
|
|
+ }).catch(() => {
|
|
|
+ console.log('用户取消了存盘操作');
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(event.target.id === '检验类别'){
|
|
|
+ JPdialogSelectVisible_LX.value = true
|
|
|
+ }
|
|
|
+ if(event.target.id === '印件号'){
|
|
|
+ if(JPformdata['工单编号']!=''){
|
|
|
+ //获取印件名称
|
|
|
+ ChanliangPrintDetail({gdbh:JPformdata['工单编号']}).then(response=>{
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data){
|
|
|
+ if(response.data.length==1){
|
|
|
+ JPformdata['印件号'] = response.data[0].yjno
|
|
|
+ JPformdata['印件名称'] = response.data[0].yjmc
|
|
|
+ setColorReadonly('印件名称')
|
|
|
+ }else{
|
|
|
+ JPselectData_Yj.splice(0, JPselectData_Yj.length, ...response.data)
|
|
|
+ JPdialogSelectVisible_Yj.value=true
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: response.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '印件编号不存在, 将恢复默认值, 请仔细确认数据准确性!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(event.target.id === '工序号'){
|
|
|
+ document.getElementById('工序名称').style.color = 'red';
|
|
|
+ //弹出选择
|
|
|
+ ChanliangProcessDetail({gdbh:JPformdata['工单编号'],yjno:JPformdata['印件号'],machine: CJMC.value}).then(response=>{
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data){
|
|
|
+ if(response.data.length === 1){
|
|
|
+ JPformdata['工序号']=response.data[0].gxh
|
|
|
+ JPformdata['工序名称']=response.data[0].name
|
|
|
+ }else{
|
|
|
+ JPselectData_Gx.splice(0, JPselectData_Gx.length, ...response.data)
|
|
|
+ JPdialogSelectVisible_Gx.value = true
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: response.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (event.target.id === '机器') {
|
|
|
+ // 获取当前输入框的值
|
|
|
+ const machineInputValue = JPformdata['机器'];
|
|
|
+
|
|
|
+ // 调用接口获取机台数据
|
|
|
+ const MachineListdata = await gdzl_MachineList({ address: CJMC.value });
|
|
|
+ console.log("MachineListdata", MachineListdata);
|
|
|
+
|
|
|
+ //机台列表数据
|
|
|
+ JPselectData_JT.value = MachineListdata.data.map((item, index) => ({
|
|
|
+ ID: index + 1,
|
|
|
+ 机台: item,
|
|
|
+ }));
|
|
|
+ JPselectData_JT.splice(0, JPselectData_JT.length, ...JPselectData_JT.value);
|
|
|
+
|
|
|
+ // 检查输入的机器名称是否存在于接口返回的数据中
|
|
|
+ const isMachineValid = JPselectData_JT.value.some(item => item.机台 === machineInputValue);
|
|
|
+ //完全匹配时,输入错误在弹窗
|
|
|
+ // const isMachineValid = JPselectData_JT.value.some(item => item.机台.split('-->')[0] === machineInputValue);
|
|
|
+ if (!isMachineValid) {
|
|
|
+ // 如果机器名称无效,则弹出弹窗
|
|
|
+ JPdialogVisible_JT.value = true;
|
|
|
+ // console.log('输入的机器不在列表中,弹出弹窗');
|
|
|
+ } else {
|
|
|
+ // console.log('输入的机器匹配列表,弹窗不显示');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (event.target.id === '定额代号') {
|
|
|
+ if(JPformdata['机器'] === ''){
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请先选择机台!'
|
|
|
+ })
|
|
|
+ //自动聚焦光标
|
|
|
+ setTimeout(() => {
|
|
|
+ const inputElement = document.getElementById('机器');
|
|
|
+ if (inputElement) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+ }else{
|
|
|
+ getDedhsubmit();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const inputs = document.getElementsByTagName('input');
|
|
|
+ const currentIndex = Array.from(inputs).indexOf(event.target);
|
|
|
+ if (event.keyCode === 13 || event.keyCode === 40) { // Enter 或向下箭头
|
|
|
+ let nextIndex = currentIndex + 1;
|
|
|
+ while (nextIndex < inputs.length) {
|
|
|
+ if (inputs[nextIndex].disabled) {
|
|
|
+ console.log("当前输入框为disabled,跳过");
|
|
|
+ nextIndex++; // 跳过disabled的输入框
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!inputs[nextIndex].readOnly) {
|
|
|
+ nextTick(() => {
|
|
|
+ inputs[nextIndex].focus();
|
|
|
+ inputs[nextIndex].select();
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ nextIndex++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // } else if (event.keyCode === 8) { // 删除箭头
|
|
|
+ // if (event.target.selectionStart === 0) {
|
|
|
+ // for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ // if (!inputs[i].readOnly) {
|
|
|
+ // nextTick(()=>{
|
|
|
+ // inputs[i].focus();
|
|
|
+ // inputs[i].setSelectionRange(0, 0);
|
|
|
+ // })
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ } else if (event.keyCode === 37) { // 向左箭头
|
|
|
+ if (event.target.selectionStart === 0) {
|
|
|
+ for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 39) { // 向右箭头
|
|
|
+ if (event.target.selectionStart === event.target.value.length) {
|
|
|
+ for (let i = currentIndex + 1; i < inputs.length; i++) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /*
|
|
|
+ 机台机器选择新增
|
|
|
+*/
|
|
|
+const JPdialogVisible_JT = ref(false) // 弹窗
|
|
|
+const JPselectData_JT = reactive([]) // table data
|
|
|
+const currentIndex_JT = ref(0);
|
|
|
+//双击事件
|
|
|
+const JPhandleSelectClick_JT = async (row) => {
|
|
|
+ // 使用 split() 截取 '机器' 字符串中 '-->' 前面的部分
|
|
|
+ const machineName = row['机台'].split('-->')[0];
|
|
|
+ JPformdata['机器'] = machineName;
|
|
|
+}
|
|
|
+// 键盘事件
|
|
|
+const JPselect_JT = async (event) => {
|
|
|
+ if (event.keyCode === 40) { // 向下箭头
|
|
|
+ if (currentIndex_JT.value < JPselectData_JT.length - 1) {
|
|
|
+ currentIndex_JT.value++;
|
|
|
+ setCurrent_JT(JPselectData_JT[currentIndex_JT.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_JT.value = 0;
|
|
|
+ setCurrent_JT(JPselectData_JT[currentIndex_JT.value]); // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ if (currentIndex_JT.value > 0) {
|
|
|
+ currentIndex_JT.value--;
|
|
|
+ setCurrent_JT(JPselectData_JT[currentIndex_JT.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex_JT.value = JPselectData_JT.length - 1;
|
|
|
+ setCurrent_JT(JPselectData_JT[currentIndex_JT.value]); // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) { // 回车键
|
|
|
+ JPdialogVisible_JT.value = false;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// ref属性
|
|
|
+const table_JT = ref();
|
|
|
+
|
|
|
+const setCurrent_JT = (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ table_JT.value?.setCurrentRow(row);
|
|
|
+ // 使用 split() 截取 '机器' 字符串中 '-->' 前面的部分
|
|
|
+ const machineName = row['机台'].split('-->')[0];
|
|
|
+ JPformdata['机器'] = machineName;
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+ /*
|
|
|
+ 组员及分配比例弹窗
|
|
|
+ */
|
|
|
+ const JPclickedlist = ref(false);
|
|
|
+ const JPemployeeDatalist = ref('')
|
|
|
+
|
|
|
+ // 当前选中的行索引
|
|
|
+ const currentIndex_zyfp = ref(0);
|
|
|
+
|
|
|
+ // 表格引用
|
|
|
+ const zyfp_table = ref(null);
|
|
|
+
|
|
|
+ // 设置当前选中行
|
|
|
+ const setCurrent_zyfp = (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ zyfp_table.value?.setCurrentRow(row);
|
|
|
+ console.log("当前选中行:", row);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+// 表格行点击处理(用于将数据填充到表单中)
|
|
|
+const JPtablebllickHandlerlist = (row, column, event) => {
|
|
|
+ if (JPclickedlist.value) return; // 如果短时间内重复点击,直接退出
|
|
|
+
|
|
|
+ let nextIndex = 1; // 从组员1开始检查
|
|
|
+ while (JPformdata[`组员${nextIndex}`]['姓名'] !== "") {
|
|
|
+ nextIndex++; // 找到下一个空的组员字段
|
|
|
+ if (nextIndex > 10) return; // 如果超过最大组员数量(10个),直接退出
|
|
|
+ }
|
|
|
+
|
|
|
+ // 清空所有姓名为空的列的编号(避免之前的编号残留)
|
|
|
+ for (let i = 1; i <= 10; i++) {
|
|
|
+ if (JPformdata[`组员${i}`]['姓名'] === "") {
|
|
|
+ JPformdata[`组员${i}`]['编号'] = ""; // 清空编号
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将选中的员工信息填充到表单中
|
|
|
+ JPformdata[`组员${nextIndex}`]['编号'] = row.员工编号;
|
|
|
+ JPformdata[`组员${nextIndex}`]['姓名'] = row.ygxm;
|
|
|
+
|
|
|
+ JPblModellist.value = false; // 关闭弹窗
|
|
|
+
|
|
|
+ // 防止短时间内重复点击(设置点击锁)
|
|
|
+ JPclickedlist.value = true;
|
|
|
+ setTimeout(() => (JPclickedlist.value = false), 300); // 300毫秒后解除锁定
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+ // 键盘事件处理
|
|
|
+ const JPselect_zyfp = (event) => {
|
|
|
+ if (!JPemployeeDatalist.value.length) return;
|
|
|
+
|
|
|
+ if (event.keyCode === 40) {
|
|
|
+ // 向下箭头
|
|
|
+ if (currentIndex_zyfp.value < JPemployeeDatalist.value.length - 1) {
|
|
|
+ currentIndex_zyfp.value++;
|
|
|
+ } else {
|
|
|
+ currentIndex_zyfp.value = 0; // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ setCurrent_zyfp(JPemployeeDatalist.value[currentIndex_zyfp.value]);
|
|
|
+ } else if (event.keyCode === 38) {
|
|
|
+ // 向上箭头
|
|
|
+ if (currentIndex_zyfp.value > 0) {
|
|
|
+ currentIndex_zyfp.value--;
|
|
|
+ } else {
|
|
|
+ currentIndex_zyfp.value = JPemployeeDatalist.value.length - 1; // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ setCurrent_zyfp(JPemployeeDatalist.value[currentIndex_zyfp.value]);
|
|
|
+ } else if (event.keyCode === 13) {
|
|
|
+ // 回车键
|
|
|
+ const currentRow = JPemployeeDatalist.value[currentIndex_zyfp.value];
|
|
|
+ if (currentRow) {
|
|
|
+ JPtablebllickHandlerlist(currentRow);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ /*
|
|
|
+ 修改组员及分配比例弹窗
|
|
|
+ */
|
|
|
+ const JPclickedlistedit = ref(false);
|
|
|
+ const JPemployeeDatalistedit = ref('')
|
|
|
+
|
|
|
+ // 当前选中的行索引
|
|
|
+ const currentIndex_zyfpedit = ref(0);
|
|
|
+
|
|
|
+ // 表格引用
|
|
|
+ const zyfpedit_table = ref(null);
|
|
|
+
|
|
|
+ // 设置当前选中行
|
|
|
+ const setCurrent_zyfpedit = (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ zyfpedit_table.value?.setCurrentRow(row);
|
|
|
+ console.log("当前选中行:", row);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+// // 表格行点击处理(用于将数据填充到表单中)
|
|
|
+const JPtablebllickHandlerlistedit = (row, column, event) => {
|
|
|
+ if (JPclickedlistedit.value) return; // 如果短时间内重复点击,直接退出
|
|
|
+
|
|
|
+ // 判断并清空所有包含字母的编号及对应的姓名
|
|
|
+ for (let i = 1; i <= 10; i++) {
|
|
|
+ const current编号 = JPformdataedit[`组员${i}`]['编号'];
|
|
|
+ if (/[a-zA-Z]/.test(current编号)) { // 使用正则检测编号中是否包含字母
|
|
|
+ JPformdataedit[`组员${i}`]['编号'] = ""; // 清空编号
|
|
|
+ JPformdataedit[`组员${i}`]['姓名'] = ""; // 清空姓名
|
|
|
+ console.log(`组员${i}的编号包含字母,已清空编号和姓名`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 从第1个组员开始检查空位
|
|
|
+ let nextIndex = 1; // 从组员1开始检查
|
|
|
+ while (JPformdataedit[`组员${nextIndex}`]['姓名'] !== "") {
|
|
|
+ nextIndex++; // 找到下一个空的组员字段
|
|
|
+ if (nextIndex > 10) return; // 如果超过最大组员数量(10个),直接退出
|
|
|
+ }
|
|
|
+
|
|
|
+ // 清空所有姓名为空的列的编号(避免之前的编号残留)
|
|
|
+ for (let i = 1; i <= 10; i++) {
|
|
|
+ if (JPformdataedit[`组员${i}`]['姓名'] === "") {
|
|
|
+ JPformdataedit[`组员${i}`]['编号'] = ""; // 清空编号
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将选中的员工信息填充到表单中
|
|
|
+ JPformdataedit[`组员${nextIndex}`]['编号'] = row.员工编号;
|
|
|
+ JPformdataedit[`组员${nextIndex}`]['姓名'] = row.ygxm;
|
|
|
+ console.log(`填充数据到组员${nextIndex}:`, {
|
|
|
+ 编号: row.员工编号,
|
|
|
+ 姓名: row.ygxm
|
|
|
+ });
|
|
|
+
|
|
|
+ JPblModellistedit.value = false; // 关闭弹窗
|
|
|
+
|
|
|
+ // 防止短时间内重复点击(设置点击锁)
|
|
|
+ JPclickedlistedit.value = true;
|
|
|
+ setTimeout(() => (JPclickedlistedit.value = false), 300); // 300毫秒后解除锁定
|
|
|
+};
|
|
|
+// const JPtablebllickHandlerlistedit = (row, column, event) => {
|
|
|
+// if (JPclickedlistedit.value) return; // 如果短时间内重复点击,直接退出
|
|
|
+
|
|
|
+// let nextIndex = 1; // 从组员1开始检查
|
|
|
+// while (JPformdataedit[`组员${nextIndex}`]['姓名'] !== "") {
|
|
|
+// nextIndex++; // 找到下一个空的组员字段
|
|
|
+// if (nextIndex > 10) return; // 如果超过最大组员数量(10个),直接退出
|
|
|
+// }
|
|
|
+
|
|
|
+// // 清空所有姓名为空的列的编号(避免之前的编号残留)
|
|
|
+// for (let i = 1; i <= 10; i++) {
|
|
|
+// if (JPformdataedit[`组员${i}`]['姓名'] === "") {
|
|
|
+// JPformdataedit[`组员${i}`]['编号'] = ""; // 清空编号
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// // 将选中的员工信息填充到表单中
|
|
|
+// JPformdataedit[`组员${nextIndex}`]['编号'] = row.员工编号;
|
|
|
+// JPformdataedit[`组员${nextIndex}`]['姓名'] = row.ygxm;
|
|
|
+
|
|
|
+// JPblModellistedit.value = false; // 关闭弹窗
|
|
|
+
|
|
|
+// // 防止短时间内重复点击(设置点击锁)
|
|
|
+// JPclickedlistedit.value = true;
|
|
|
+// setTimeout(() => (JPclickedlistedit.value = false), 300); // 300毫秒后解除锁定
|
|
|
+// };
|
|
|
+
|
|
|
+
|
|
|
+ // 键盘事件处理
|
|
|
+ const JPselect_zyfpedit = (event) => {
|
|
|
+ if (!JPemployeeDatalistedit.value.length) return;
|
|
|
+
|
|
|
+ if (event.keyCode === 40) {
|
|
|
+ // 向下箭头
|
|
|
+ if (currentIndex_zyfpedit.value < JPemployeeDatalistedit.value.length - 1) {
|
|
|
+ currentIndex_zyfpedit.value++;
|
|
|
+ } else {
|
|
|
+ currentIndex_zyfpedit.value = 0; // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ setCurrent_zyfpedit(JPemployeeDatalistedit.value[currentIndex_zyfpedit.value]);
|
|
|
+ } else if (event.keyCode === 38) {
|
|
|
+ // 向上箭头
|
|
|
+ if (currentIndex_zyfpedit.value > 0) {
|
|
|
+ currentIndex_zyfpedit.value--;
|
|
|
+ } else {
|
|
|
+ currentIndex_zyfpedit.value = JPemployeeDatalistedit.value.length - 1; // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ setCurrent_zyfpedit(JPemployeeDatalistedit.value[currentIndex_zyfpedit.value]);
|
|
|
+ } else if (event.keyCode === 13) {
|
|
|
+ // 回车键
|
|
|
+ const currentRow = JPemployeeDatalistedit.value[currentIndex_zyfpedit.value];
|
|
|
+ if (currentRow) {
|
|
|
+ JPtablebllickHandlerlistedit(currentRow);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+const multipleTable = ref(null) // 确保已经获取表格ref
|
|
|
+const JPmultipleTable = ref(null)
|
|
|
+const Selection_ids = ref('')
|
|
|
+const customer = ref('')
|
|
|
+// // 印件资料多选、工艺资料多选
|
|
|
+// const selectionChange = (selection) => {
|
|
|
+// if(selection.length !==0){
|
|
|
+// customer.value = selection[0].工单编号
|
|
|
+// }else{
|
|
|
+// customer.value = ''
|
|
|
+// }
|
|
|
+// const ids = selection.map(item => {
|
|
|
+// return item.UniqId
|
|
|
+// })
|
|
|
+// Selection_ids.value = ids.join(',')
|
|
|
+// }
|
|
|
+
|
|
|
+// const checkboxT = (row, index) => {
|
|
|
+// if(customer.value != ''){
|
|
|
+// return row.工单编号 === customer.value
|
|
|
+// }else{
|
|
|
+// return true
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// 复选框变化时记录工单编号
|
|
|
+const selectionChange = (selection) => {
|
|
|
+ if (selection.length !== 0) {
|
|
|
+ customer.value = selection[0].工单编号
|
|
|
+ } else {
|
|
|
+ customer.value = ''
|
|
|
+ }
|
|
|
+
|
|
|
+ const ids = selection.map(item => item.UniqId)
|
|
|
+ Selection_ids.value = ids.join(',')
|
|
|
+}
|
|
|
+
|
|
|
+// 全选同工单(自动识别当前表格类型)
|
|
|
+const selectSameWorkOrder = () => {
|
|
|
+ if (!customer.value) return ElMessage.warning('请先选择一条数据')
|
|
|
+
|
|
|
+ // 动态获取当前表格数据
|
|
|
+ const currentTableData = isJPJT.value ? JPgytableData.value : gytableData.value
|
|
|
+
|
|
|
+ const validData = currentTableData.filter(item =>
|
|
|
+ !item.isTotal &&
|
|
|
+ !(item.产品名称?.includes('A班产量:') || item.产品名称?.includes('B班产量:'))
|
|
|
+ )
|
|
|
+
|
|
|
+ // 找出相同工单的数据
|
|
|
+ const sameWorkOrderItems = validData.filter(item =>
|
|
|
+ item.工单编号 === customer.value
|
|
|
+ )
|
|
|
+
|
|
|
+ // 根据 isJPJT.value 选择对应的表格引用
|
|
|
+ const tableRef = isJPJT.value ? JPmultipleTable.value : multipleTable.value
|
|
|
+
|
|
|
+ // 清除选择
|
|
|
+ tableRef.clearSelection()
|
|
|
+
|
|
|
+ // 选择相同工单的行
|
|
|
+ sameWorkOrderItems.forEach(row => {
|
|
|
+ tableRef.toggleRowSelection(row, true)
|
|
|
+ })
|
|
|
+
|
|
|
+ Selection_ids.value = sameWorkOrderItems.map(item => item.UniqId).join(',')
|
|
|
+}
|
|
|
+
|
|
|
+const invertSelection = async () => {
|
|
|
+ // 动态获取当前表格数据
|
|
|
+ const currentTableData = isJPJT.value ? JPgytableData.value : gytableData.value
|
|
|
+
|
|
|
+ const validData = currentTableData.filter(item =>
|
|
|
+ !item.isTotal &&
|
|
|
+ !(item.产品名称?.includes('A班产量:') || item.产品名称?.includes('B班产量:'))
|
|
|
+ )
|
|
|
+
|
|
|
+ // 根据 isJPJT.value 选择对应的表格引用
|
|
|
+ const tableRef = isJPJT.value ? JPmultipleTable.value : multipleTable.value
|
|
|
+
|
|
|
+ // 获取当前选择
|
|
|
+ const currentSelected = tableRef.getSelectionRows()
|
|
|
+
|
|
|
+ // 清除选择
|
|
|
+ tableRef.clearSelection()
|
|
|
+
|
|
|
+ // 反选操作
|
|
|
+ validData.forEach(row => {
|
|
|
+ tableRef.toggleRowSelection(
|
|
|
+ row,
|
|
|
+ !currentSelected.some(selected => selected.UniqId === row.UniqId)
|
|
|
+ )
|
|
|
+ })
|
|
|
+
|
|
|
+ Selection_ids.value = tableRef
|
|
|
+ .getSelectionRows()
|
|
|
+ .map(item => item.UniqId)
|
|
|
+ .join(',')
|
|
|
+}
|
|
|
+
|
|
|
+//删除
|
|
|
+function onDel() {
|
|
|
+ Chanliangdel()
|
|
|
+}
|
|
|
+
|
|
|
+// 日产量上报删除
|
|
|
+const Chanliangdel = async() => {
|
|
|
+ if(!Selection_ids.value){
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请勾选要删除的数据'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const res = await ChanliangDel({ UniqId:Selection_ids.value})
|
|
|
+ if (res.code === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ FacilitychanLiang()
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '失败'
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//核算调整
|
|
|
+function hesuan(){
|
|
|
+ hesuanVisible.value=true
|
|
|
+}
|
|
|
+//制程检验
|
|
|
+const zhichengstatus=ref(false)
|
|
|
+const xunchaData = ref([]);
|
|
|
+const zhichengVisible = ref(false)
|
|
|
+const zhichengtreeData=ref([{
|
|
|
+ label: '首件与过程确认'
|
|
|
+},{
|
|
|
+ label: '机台检验'
|
|
|
+},{
|
|
|
+ label: 'IPQC检验'
|
|
|
+}])
|
|
|
+const onzhicheng = async () => {
|
|
|
+ zhichengstatus.value=false
|
|
|
+ xunchaData.value=[]
|
|
|
+ const response = await reportProduceInfo({machine:JTMC.split("#")[0]});
|
|
|
+ if (response.code === 0) {
|
|
|
+ xunchaData.value.order=response.data.order
|
|
|
+ xunchaData.value.yjno=response.data.yjno
|
|
|
+ xunchaData.value.product_name=response.data.product_name
|
|
|
+ xunchaData.value.gxmc=response.data.gxmc
|
|
|
+ xunchaData.value.lcdh=0
|
|
|
+ xunchaData.value.sczl_bh=''
|
|
|
+ xunchaData.value.sczl_name=''
|
|
|
+ xunchaData.value.remark=''
|
|
|
+ zhichengVisible.value = true;
|
|
|
+ }
|
|
|
+}
|
|
|
+const category =ref()
|
|
|
+const zhibiaoselectData=ref([])
|
|
|
+const fujiaselectData=ref([])
|
|
|
+const zhichengNodeClick = (node, check) => {
|
|
|
+ if(node.label){
|
|
|
+ zhichengstatus.value=true
|
|
|
+ category.value=node.label
|
|
|
+ processInspectionRecordsItem()
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+//工单打印
|
|
|
+const pd_gdprintonClick = () => {
|
|
|
+ if(formData.value.工单编号==''){
|
|
|
+ ElMessage({ type: 'warning', message: '未获取到工单' });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ printPageRef.value.open(formData.value.工单编号)
|
|
|
+}
|
|
|
+
|
|
|
+const processInspectionRecordsItem = async (value) => {
|
|
|
+ const response = await ProcessInspectionRecordsItem({ process: xunchaData.value.gxmc });
|
|
|
+ if (response.code === 0) {
|
|
|
+ zhibiaoselectData.value=response.data.首件.指标检验.map(item=>{
|
|
|
+ item.notjc=true;
|
|
|
+ item.zc=false;
|
|
|
+ item.yc=false;
|
|
|
+ item.remark=''
|
|
|
+ item.category=category.value
|
|
|
+ item.workOrder=xunchaData.value.order
|
|
|
+ item.yjno=xunchaData.value.yjno
|
|
|
+ item.flow=xunchaData.value.lcdh
|
|
|
+ item.team=BZMC.value
|
|
|
+ item.machine=JTMC.split("#")[0]
|
|
|
+ item.selected = '不检测';
|
|
|
+ return item
|
|
|
+ })
|
|
|
+ fujiaselectData.value=response.data.首件.附加.map(item=>{
|
|
|
+ item.notjc=true;
|
|
|
+ item.workOrder=xunchaData.value.order
|
|
|
+ item.yjno=xunchaData.value.yjno
|
|
|
+ item.flow=xunchaData.value.lcdh
|
|
|
+ item.machine=JTMC.split("#")[0]
|
|
|
+ return item
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const zhichengDialog = async () => {
|
|
|
+ let arr =[]
|
|
|
+ zhibiaoselectData.value.map(item=>{
|
|
|
+ if(item.zc==true){
|
|
|
+ item.result='合格'
|
|
|
+ item.item=item.检验项目
|
|
|
+ item.instrument=item.检测方法
|
|
|
+ item.standard=item.相关标准
|
|
|
+ delete item.notjc
|
|
|
+ delete item.zc
|
|
|
+ delete item.yc
|
|
|
+ delete item.检验项目
|
|
|
+ delete item.检测方法
|
|
|
+ delete item.相关标准
|
|
|
+ delete item.检验频率
|
|
|
+ arr.push(item)
|
|
|
+ return item
|
|
|
+ }
|
|
|
+ if(item.yc==true){
|
|
|
+ item.result='不合格'
|
|
|
+ item.item=item.检验项目
|
|
|
+ item.instrument=item.检测方法
|
|
|
+ item.standard=item.相关标准
|
|
|
+ delete item.notjc
|
|
|
+ delete item.zc
|
|
|
+ delete item.yc
|
|
|
+ delete item.检验项目
|
|
|
+ delete item.检测方法
|
|
|
+ delete item.相关标准
|
|
|
+ delete item.检验频率
|
|
|
+ arr.push(item)
|
|
|
+ return item
|
|
|
+ }
|
|
|
+ if(item.notjc==true){
|
|
|
+ item.result='不检测'
|
|
|
+ item.item=item.检验项目
|
|
|
+ item.instrument=item.检测方法
|
|
|
+ item.standard=item.相关标准
|
|
|
+ delete item.notjc
|
|
|
+ delete item.zc
|
|
|
+ delete item.yc
|
|
|
+ delete item.检验项目
|
|
|
+ delete item.检测方法
|
|
|
+ delete item.相关标准
|
|
|
+ delete item.检验频率
|
|
|
+ // arr.push(item)
|
|
|
+ return item
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ let arrs=[]
|
|
|
+ let fujiastatus=0
|
|
|
+ fujiaselectData.value.map(item=>{
|
|
|
+ if(item.notjc==true){
|
|
|
+ return item
|
|
|
+ }else{
|
|
|
+ fujiastatus=1
|
|
|
+ item.remark=item.缺陷备注
|
|
|
+ delete item.notjc
|
|
|
+ delete item.缺陷备注
|
|
|
+ delete item.编号
|
|
|
+ arrs.push(item)
|
|
|
+ return item
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ // return
|
|
|
+ if(fujiastatus==1){
|
|
|
+ const responses = await AdditionalInspectionRecordAdd(arrs);
|
|
|
+ fujiastatus=0
|
|
|
+ }
|
|
|
+ // 使用filter方法过滤掉所有result为"不检测"的对象
|
|
|
+ const filteredData = zhibiaoselectData.value.filter(item => item.selected !== "不检测");
|
|
|
+ const response = await ProcessInspectionRecordsItemAdd(filteredData);
|
|
|
+ if (response.code === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ zhichengVisible.value=false
|
|
|
+ zhibiaoselectData.value=[]
|
|
|
+ fujiaselectData.value=[]
|
|
|
+ }
|
|
|
+}
|
|
|
+const closezhichengDialog = async () => {
|
|
|
+ zhichengVisible.value=false
|
|
|
+}
|
|
|
+//设置机台状态
|
|
|
+const dialogSbyxgl=ref(false)
|
|
|
+function onstatus() {
|
|
|
+ dialogSbyxgl.value=true
|
|
|
+ SetMachineStatus()
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//设置机台状态
|
|
|
+const SetMachineStatus = async () => {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+//客诉记录
|
|
|
+const complaintsShow = ref(false)
|
|
|
+const complaintsData = reactive([])
|
|
|
+function oncomplaints() {
|
|
|
+ Complaints()
|
|
|
+
|
|
|
+}
|
|
|
+// 客诉记录表格填充
|
|
|
+const Complaints = async() => {
|
|
|
+ if(finishedcode.value==null){
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请先选择产品',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const res = await ComplaintRecord({productCode :finishedcode.value})
|
|
|
+ if (res.code === 0) {
|
|
|
+ if(res.data==null){
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '此产品暂无客诉记录',
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ complaintsData.splice(0, complaintsData.length, ...res.data);
|
|
|
+ selectedRowData.value=complaintsData[0]
|
|
|
+ complaintsShow.value=true
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+const selectedRowData = ref({
|
|
|
+
|
|
|
+})
|
|
|
+//客诉表格单击
|
|
|
+const complaintshandle = (val, row) => {
|
|
|
+ selectedRowData.value=val
|
|
|
+};
|
|
|
+//换型清场
|
|
|
+const huanxingVisible = ref(false)
|
|
|
+const huanxingtreeData=ref([])
|
|
|
+const huanxingselectData = ref([])
|
|
|
+const huanxingstatus=ref(false)
|
|
|
+const activNames=ref('first')
|
|
|
+function onClear() {
|
|
|
+ huanxingVisible.value=true
|
|
|
+ RemodelGetTab()
|
|
|
+}
|
|
|
+// function onClear2() {
|
|
|
+// console.log(formData.value.工单编号)
|
|
|
+// console.log(BZMC)
|
|
|
+// }
|
|
|
+const RemodelGetTab = async() => {
|
|
|
+ const response = await remodelGetTab()
|
|
|
+ let arr=[]
|
|
|
+ if (response.code === 0) {
|
|
|
+ for(let key in response.data){
|
|
|
+ if(response.data[key][0]){
|
|
|
+ let children =[]
|
|
|
+ for (let i = 0; i < response.data[key].length; i++) {
|
|
|
+ children.push({label:response.data[key][i],machine:key})
|
|
|
+ }
|
|
|
+ arr.push({
|
|
|
+ label:key,
|
|
|
+ children:children
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ arr.push({label:key})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ huanxingtreeData.value=arr
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请注意, 工单编号输入空置, 除非有特殊需要!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const huanxingNodeClick = (node) => {
|
|
|
+ //存放当前节点的nodeId
|
|
|
+ if(node.machine){
|
|
|
+ huanxingstatus.value=true
|
|
|
+ remodelDetail(node.label.split('/')[1])
|
|
|
+ modelChangeRecord(node.machine)
|
|
|
+ }else{
|
|
|
+ console.log('2')
|
|
|
+ }
|
|
|
+}
|
|
|
+const huanxingData = ref({})
|
|
|
+const remodelDetail = async (val) => {
|
|
|
+ const response = await RemodelDetail({UniqId:val});
|
|
|
+ if (response.code === 0) {
|
|
|
+ huanxingData.value=response.data
|
|
|
+ if(response.data.项目1==1){
|
|
|
+ huanxingData.value.项目1=true
|
|
|
+ }else{
|
|
|
+ huanxingData.value.项目1=false
|
|
|
+ }
|
|
|
+ if(response.data.项目2==1){
|
|
|
+ huanxingData.value.项目2=true
|
|
|
+ }else{
|
|
|
+ huanxingData.value.项目2=false
|
|
|
+ }
|
|
|
+ if(response.data.项目3==1){
|
|
|
+ huanxingData.value.项目3=true
|
|
|
+ }else{
|
|
|
+ huanxingData.value.项目3=false
|
|
|
+ }
|
|
|
+ if(response.data.项目4==1){
|
|
|
+ huanxingData.value.项目4=true
|
|
|
+ }else{
|
|
|
+ huanxingData.value.项目4=false
|
|
|
+ }
|
|
|
+ if(response.data.项目5==1){
|
|
|
+ huanxingData.value.项目5=true
|
|
|
+ }else{
|
|
|
+ huanxingData.value.项目5=false
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请注意, 工单编号输入空置, 除非有特殊需要!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
+const modelChangeRecord = async (val) => {
|
|
|
+ const response = await ModelChangeRecord({machine:val});
|
|
|
+ if (response.code === 0) {
|
|
|
+ huanxingselectData.value=response.data
|
|
|
+ }
|
|
|
+}
|
|
|
+import { nextTick } from 'vue';
|
|
|
+//设备点检
|
|
|
+function ondianjian() {
|
|
|
+ getSpotCheckItem(JTMC).then(treeData => {
|
|
|
+ if (treeData) {
|
|
|
+ // 如果获取成功,treeData 就是我们需要的树形结构数据
|
|
|
+ dianjiantreeData = treeData;
|
|
|
+ // 使用 nextTick 来确保在更新 dianjianVisible 后立即刷新视图
|
|
|
+ nextTick(() => {
|
|
|
+ dianjianVisible.value = true;
|
|
|
+ });
|
|
|
+ // 这里可以处理treeData,例如将其赋值给某个状态管理变量或者用于渲染界面
|
|
|
+ } else {
|
|
|
+ // 如果获取失败,则treeData为null
|
|
|
+ console.log('获取巡检项目树形结构数据失败');
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+const onyinban = async() => {
|
|
|
+ console.log(formData.value.productCode)
|
|
|
+ const res = await facilityPrintGetTab({productCode:formData.value.productCode})
|
|
|
+ if(res.code===0){
|
|
|
+ yinbantreeData.value=[{
|
|
|
+ label:'产品印版库',
|
|
|
+ children:res.data.map(item=>({
|
|
|
+ label:item.印版分类,
|
|
|
+ code:item.编号
|
|
|
+ }))
|
|
|
+ }]
|
|
|
+ // console.log(res.data.map(item=>({
|
|
|
+ // label:item.印版分类,
|
|
|
+ // code:item.编号
|
|
|
+ // })))
|
|
|
+ yinbanVisible.value = true;
|
|
|
+ }
|
|
|
+}
|
|
|
+const onxuncha = async() => {
|
|
|
+ xunchaVisible.value=true
|
|
|
+}
|
|
|
+
|
|
|
+//获取设备点检->检验项目
|
|
|
+const FacilityInspectionItem = async (value) => {
|
|
|
+ try {
|
|
|
+ // 调用接口获取巡检项目数据
|
|
|
+ const response = await facilityInspectionItem({ unitName: value ,machine:JTMC.split("#")[0]});
|
|
|
+ // 检查接口返回的状态码
|
|
|
+ if (response.code === 0) {
|
|
|
+ dianjianselectData.splice(0, dianjianselectData.length, ...response.data.map(item=>{
|
|
|
+ item.notjc=true;
|
|
|
+ item.zc=false;
|
|
|
+ item.yc=false;
|
|
|
+ item.remark=''
|
|
|
+ item.unitName=value
|
|
|
+ item.team=BZMC.value
|
|
|
+ item.machine=JTMC
|
|
|
+ return item
|
|
|
+ }))
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ // 捕获并打印异常
|
|
|
+ console.error("获取巡检项目数据出错:" + error);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+};
|
|
|
+//机台印版领用->右侧详情
|
|
|
+const facilityPrintDetailItem = async (value) => {
|
|
|
+ try {
|
|
|
+ // 调用接口获取巡检项目数据
|
|
|
+ const response = await facilityPrintDetail({ workOrder: formData.value.工单编号,code:value,productCode:formData.value.productCode });
|
|
|
+ // 检查接口返回的状态码
|
|
|
+ if (response.code === 0) {
|
|
|
+ yinbanselectData.value=response.data
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ // 捕获并打印异常
|
|
|
+ console.error("获取数据出错:" + error);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+let currentSelection = ref([]); // 存储选中的数据
|
|
|
+
|
|
|
+// 勾选回调
|
|
|
+const yinbanSelectionChange = (selection) => {
|
|
|
+ currentSelection.value = selection; // 更新选中的数据
|
|
|
+ console.log("当前勾选数据:", currentSelection.value);
|
|
|
+};
|
|
|
+
|
|
|
+const onout = async () => {
|
|
|
+ try {
|
|
|
+ console.log("当前选中数据:", currentSelection.value);
|
|
|
+
|
|
|
+ // 检查必填字段
|
|
|
+ const missingFields = [];
|
|
|
+ const requestData = currentSelection.value.map((item, index) => {
|
|
|
+ const 印数 = item.印数 != null ? item.印数.toString() : '0';
|
|
|
+ // 定义必填字段及其映射关系
|
|
|
+ const requiredFields = {
|
|
|
+ '工单编号': formData.value.工单编号,
|
|
|
+ '存货编码': item.存货编码,
|
|
|
+ '供方批号': item.供方批号,
|
|
|
+ '印数':印数,
|
|
|
+ '印件号': formData.value.印件号,
|
|
|
+ '系统ID': sys_id
|
|
|
+ };
|
|
|
+
|
|
|
+ // 检查必填字段是否为空
|
|
|
+ Object.entries(requiredFields).forEach(([fieldName, value]) => {
|
|
|
+ if (value === undefined || value === null || value === "") {
|
|
|
+ missingFields.push(`第${index + 1}条数据的${fieldName}`);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 构建请求数据对象
|
|
|
+ return {
|
|
|
+ Yb_工单编号: formData.value.工单编号,
|
|
|
+ Yb_存货编码: item.存货编码,
|
|
|
+ Yb_供方批号: item.供方批号,
|
|
|
+ Yb_领用机台: JTMC,
|
|
|
+ Yb_印数: 印数,
|
|
|
+ Yb_印件号: formData.value.印件号,
|
|
|
+ Sys_id: sys_id
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ // 如果有缺失字段,抛出错误
|
|
|
+ if (missingFields.length > 0) {
|
|
|
+ throw new Error(`以下字段为必填项且不能为空:\n${missingFields.join("\n")}`);
|
|
|
+ }
|
|
|
+
|
|
|
+ console.log("提交数据:", requestData);
|
|
|
+ const response = await PrintDetailAdd(requestData);
|
|
|
+
|
|
|
+ if (response?.code === 0) {
|
|
|
+ ElMessage.success("领出成功!");
|
|
|
+ } else {
|
|
|
+ ElMessage.error(`领出失败: ${response?.msg || "未知错误"}`);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error("领出失败:", error);
|
|
|
+ ElMessage.error(`调用失败: ${error.message}`);
|
|
|
+ }
|
|
|
+};
|
|
|
+const dialogwithdrawVisible = ref(false)
|
|
|
+const Plate = ref({ 印数: '' });
|
|
|
+const onwithdraw = async () => {
|
|
|
+ console.log(currentSelection.value);
|
|
|
+
|
|
|
+ // 检查是否有印数为 null 或 undefined
|
|
|
+ const hasInvalidUniqId = currentSelection.value.some(item => {
|
|
|
+ return item?.UniqId === null || item?.UniqId === undefined;
|
|
|
+ });
|
|
|
+
|
|
|
+ if (hasInvalidUniqId) {
|
|
|
+ ElMessage.error("选择的数据中有未领用的印版,无法收回!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 所有 UniqId 都有效,才打开弹窗
|
|
|
+ dialogwithdrawVisible.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+ // 删除操作
|
|
|
+const rawenterDialog = async () => {
|
|
|
+ console.log(Plate.value.印数)
|
|
|
+ try {
|
|
|
+ await ElMessageBox.confirm('确定收回吗', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ console.log('收回选中的数据:', currentSelection.value)
|
|
|
+ const uniqIds = currentSelection.value.map(item => item.UniqId).join(',');
|
|
|
+ console.log(uniqIds);
|
|
|
+ // 调用收回API,假设是批量删除接口
|
|
|
+ const res = await PrintDetailEdit({ id: uniqIds,number:Plate.value.印数})
|
|
|
+
|
|
|
+ if (res.code === 0) {
|
|
|
+ ElMessage.success('收回成功')
|
|
|
+ rawcloseDialog()
|
|
|
+ // 清空选中
|
|
|
+ currentSelection.value = []
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.msg || '收回失败')
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ if (error !== 'cancel') {
|
|
|
+ console.error('收回失败:', error)
|
|
|
+ ElMessage.error('收回操作已取消')
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const rawcloseDialog = () => {
|
|
|
+ Plate.印数 = ''
|
|
|
+ dialogwithdrawVisible.value = false
|
|
|
+}
|
|
|
+
|
|
|
+const yinbanmultipleTable = ref(null); // 表格ref
|
|
|
+const yinbaninvertSelection = () => {
|
|
|
+ // 1. 获取当前表格的所有有效数据(排除不需要的行)
|
|
|
+ const validData = yinbanselectData.value.filter(item =>
|
|
|
+ !item.isTotal &&
|
|
|
+ !(item.产品名称?.includes('A班产量:') || item.产品名称?.includes('B班产量:'))
|
|
|
+ );
|
|
|
+
|
|
|
+ // 2. 获取当前已选中的行
|
|
|
+ const currentSelected = yinbanmultipleTable.value?.getSelectionRows() || [];
|
|
|
+
|
|
|
+ // 3. 清除当前所有选择
|
|
|
+ yinbanmultipleTable.value?.clearSelection();
|
|
|
+
|
|
|
+ // 4. 执行反选操作
|
|
|
+ validData.forEach(row => {
|
|
|
+ yinbanmultipleTable.value?.toggleRowSelection(
|
|
|
+ row,
|
|
|
+ !currentSelected.some(selected => selected.UniqId === row.UniqId)
|
|
|
+ );
|
|
|
+ });
|
|
|
+
|
|
|
+};
|
|
|
+//树形结构单机
|
|
|
+const dianjianselectData = reactive([])
|
|
|
+const yinbanselectData = ref([])
|
|
|
+const xunchaselectData = ref([])
|
|
|
+const dianjianNodeClick = (node, check, nodeData) => {
|
|
|
+ if (node.children && node.children.length > 0) {
|
|
|
+ // 点击的是父节点,且有子节点
|
|
|
+ } else {
|
|
|
+ FacilityInspectionItem(node.label,)
|
|
|
+ }
|
|
|
+};
|
|
|
+const yinbanNodeClick = (node, check, nodeData) => {
|
|
|
+ if (node.children && node.children.length > 0) {
|
|
|
+ // 点击的是父节点,且有子节点
|
|
|
+ } else {
|
|
|
+ facilityPrintDetailItem(node.code)
|
|
|
+ }
|
|
|
+};
|
|
|
+const xunchaNodeClick = (node, check, nodeData) => {
|
|
|
+ if(node){
|
|
|
+ fieldInspectionRecord()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const fieldInspectionRecord = async () => {
|
|
|
+ let time = new Date();
|
|
|
+ time.setDate(time.getDate() - 0); // 今天的前N天的日期,N自定义
|
|
|
+ time= `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}`;
|
|
|
+ const response = await FieldInspectionRecord({ workOrder: formData.value.工单编号,team:BZMC.value,start:time+' 08:30:00' });
|
|
|
+ if (response.code === 0) {
|
|
|
+ xunchaselectData.value=response.data
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+let pandingfangfa=ref()
|
|
|
+//检验项目单击
|
|
|
+const dianjianhandle = (val, row) => {
|
|
|
+ try {
|
|
|
+ pandingfangfa.value = val.判定标准;
|
|
|
+ } catch (error) {
|
|
|
+ console.error('An error occurred:', error);
|
|
|
+ }
|
|
|
+};
|
|
|
+const notjcClick = (val) => {
|
|
|
+ console.log("不检测")
|
|
|
+ val.notjc=true
|
|
|
+ val.zc=false
|
|
|
+ val.yc=false
|
|
|
+};
|
|
|
+const zcClick = (val) => {
|
|
|
+ console.log("合格")
|
|
|
+ val.notjc=false
|
|
|
+ val.zc=true
|
|
|
+ val.yc=false
|
|
|
+};
|
|
|
+const ycClick = (val) => {
|
|
|
+ console.log("不合格")
|
|
|
+ val.notjc=false
|
|
|
+ val.zc=false
|
|
|
+ val.yc=true
|
|
|
+};
|
|
|
+
|
|
|
+const rowClassName = (row, column) => {
|
|
|
+ try {
|
|
|
+ if (row.unchecked) {
|
|
|
+ return 'row-yellow';
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ } catch (error) {
|
|
|
+ console.error('An error occurred:', error);
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 异步函数,用于获取指定设备的巡检项目,并且将结果格式化为树形结构数据
|
|
|
+const getSpotCheckItem = async (machineName) => {
|
|
|
+ try {
|
|
|
+ // 调用接口获取巡检项目数据
|
|
|
+ const response = await facilitySpotCheckItem({ machine: machineName });
|
|
|
+ // 检查接口返回的状态码
|
|
|
+ if (response.code === 0) {
|
|
|
+ // 构建树形结构数据
|
|
|
+ const childrenData = Object.entries(response.data).map(([id, label]) => {
|
|
|
+ return {
|
|
|
+ id, // 子节点的唯一标识
|
|
|
+ label, // 子节点的标签
|
|
|
+ children: [] // 初始化子节点数组
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ // 创建包含父节点的树形结构数据
|
|
|
+ const treeData = [{
|
|
|
+ id: machineName, // 父节点的唯一标识
|
|
|
+ label: machineName, // 父节点的标签
|
|
|
+ children: childrenData // 子节点数据
|
|
|
+ }];
|
|
|
+
|
|
|
+ // 返回构建好的树形结构数据
|
|
|
+ return treeData;
|
|
|
+ } else {
|
|
|
+ // 如果接口返回的状态码不是0,打印错误信息
|
|
|
+ console.error("接口返回错误:" + response.msg);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ // 捕获并打印异常
|
|
|
+ console.error("获取巡检项目数据出错:" + error);
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const dianjianenterDialog = async () => {
|
|
|
+ // 转换数据格式
|
|
|
+ const formattedData = dianjianselectData.map(item => {
|
|
|
+ // 判断状态
|
|
|
+ let status;
|
|
|
+ if (item.notjc) {
|
|
|
+ status = "不检测";
|
|
|
+ } else if (item.yc) {
|
|
|
+ status = "不合格";
|
|
|
+ } else if (item.zc) {
|
|
|
+ status = "合格";
|
|
|
+ } else {
|
|
|
+ status = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ // 返回接口需要的格式
|
|
|
+ return {
|
|
|
+ team: item.team,
|
|
|
+ machine: item.machine,
|
|
|
+ unitName: item.unitName,
|
|
|
+ itemName: item.检验项目,
|
|
|
+ method: item.点检方法,
|
|
|
+ status: status,
|
|
|
+ remark: item.remark,
|
|
|
+ standard: item.判定标准,
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log("转换后的数据:", formattedData);
|
|
|
+
|
|
|
+ // 调用接口提交数据
|
|
|
+ try {
|
|
|
+ const res = await InspectionItemAdd(formattedData); // 替换成你的 API 方法
|
|
|
+ if (res.code === 0) {
|
|
|
+ ElMessage.success("提交成功!");
|
|
|
+ dianjianVisible.value = false;
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.msg || "提交失败!");
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error("请求出错:" + error.message);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const dianjiancloseDialog = () => {
|
|
|
+ dianjianVisible.value = false;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//班组维护
|
|
|
+// function onBZ() {
|
|
|
+const onBZ = async () => {
|
|
|
+ FacilityTeam(JTMC)
|
|
|
+ fetchData()
|
|
|
+ detailShow.value=true
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+// 班组人员及分配比例
|
|
|
+const FacilityTeam = async (value) => {
|
|
|
+ const response = await facilityTeam({ machine: value });
|
|
|
+ if (response.code === 0) {
|
|
|
+ BZMC.value=response.data[0]['班组号']
|
|
|
+ InspectionRecord()
|
|
|
+ FacilityDetail()
|
|
|
+ // 清空 bzData 数组
|
|
|
+ bzData.splice(0, bzData.length);
|
|
|
+ FPData.splice(0, FPData.length);
|
|
|
+ // 遍历接口返回的数据,并给每个对象添加 JTMC 属性
|
|
|
+ const updatedData = response.data.map(item => {
|
|
|
+ return { ...item, JTMC: value }; // 添加 JTMC 属性
|
|
|
+ });
|
|
|
+ // 将更新后的数据添加到 bzData 数组
|
|
|
+ bzData.push(...updatedData)
|
|
|
+ FPData.push(...updatedData)
|
|
|
+ return 1
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+//日产量批量维护
|
|
|
+function onRCL() {
|
|
|
+ if(!Selection_ids.value){
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请先勾选数据'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ FacilityTeam_rcl(JTMC)
|
|
|
+ detailShow_rcl.value=true
|
|
|
+ console.log('333')
|
|
|
+}
|
|
|
+let BZMC_rcl=ref()
|
|
|
+const bzData_rcl = reactive([])
|
|
|
+const selectedOption_rcl = ref('');
|
|
|
+// 班组人员及分配比例
|
|
|
+const FacilityTeam_rcl = async (value) => {
|
|
|
+ const response = await facilityTeam({ machine: value });
|
|
|
+ if (response.code === 0) {
|
|
|
+ // formData.value.班组 = response.data[0]['班组号'];
|
|
|
+ BZMC_rcl.value = response.data[0]['班组号']
|
|
|
+ selectedOption_rcl.value = JTMC
|
|
|
+
|
|
|
+ // 清空 bzData 数组
|
|
|
+ bzData_rcl.splice(0, bzData_rcl.length);
|
|
|
+
|
|
|
+ // 遍历接口返回的数据,并给每个对象添加 JTMC 属性
|
|
|
+ const updatedData = response.data.map(item => {
|
|
|
+ return { ...item, JTMC: value }; // 添加 JTMC 属性
|
|
|
+ });
|
|
|
+
|
|
|
+ // 将更新后的数据添加到 bzData 数组
|
|
|
+ bzData_rcl.push(...updatedData);
|
|
|
+ return 1
|
|
|
+ }
|
|
|
+};
|
|
|
+//班组单击
|
|
|
+const currentBz_rcl ={}
|
|
|
+const BZvalue_rcl=ref()
|
|
|
+const BZhandle_rcl = (val) => {
|
|
|
+ currentBz_rcl.value = val
|
|
|
+ BZvalue_rcl.value=val.ID
|
|
|
+ formDatas_rcl.value = {};
|
|
|
+ let sczl_bhkey_rcl = ''
|
|
|
+ let sczl_namekey_rcl = ''
|
|
|
+ let percentagekey_rcl = ''
|
|
|
+ if (currentBz_rcl.value[9]) {
|
|
|
+ for (let i = 1; i <= 9; i++) {
|
|
|
+ sczl_bhkey_rcl = `code${i}`
|
|
|
+ sczl_namekey_rcl = `name${i}`
|
|
|
+ percentagekey_rcl = `percentage${i}`
|
|
|
+ formDatas_rcl.value[sczl_bhkey_rcl] = '';
|
|
|
+ formDatas_rcl.value[sczl_namekey_rcl] = '';
|
|
|
+ formDatas_rcl.value[percentagekey_rcl] = '';
|
|
|
+ }
|
|
|
+ formDatas_rcl.value.code8 = currentBz_rcl.value[9].split(' ')[0];
|
|
|
+ formDatas_rcl.value.name8 = currentBz_rcl.value[9].split(' ')[1]
|
|
|
+ formDatas_rcl.value.percentage8 = Math.round((parseFloat(currentBz_rcl.value[9].split(' ')[2].split('(')[1].split(')')[0]) / 100 * 10000)) / 10000;
|
|
|
+
|
|
|
+ for (let i = 1; i <= Math.min(Object.keys(currentBz_rcl.value).length - 5, 6); i++) {
|
|
|
+ sczl_bhkey_rcl = `code${i}`
|
|
|
+ sczl_namekey_rcl = `name${i}`
|
|
|
+ percentagekey_rcl = `percentage${i}`
|
|
|
+ formDatas_rcl.value[sczl_bhkey_rcl] = currentBz_rcl.value[i - 1].split(' ')[0];
|
|
|
+ formDatas_rcl.value[sczl_namekey_rcl] = currentBz_rcl.value[i - 1].split(' ')[1];
|
|
|
+ if(isNaN(parseFloat(currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0]))){
|
|
|
+ formDatas_rcl.value[percentagekey_rcl] = currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0];
|
|
|
+ }else{
|
|
|
+ formDatas_rcl.value[percentagekey_rcl] = Math.round((parseFloat(currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0]) / 100 * 10000)) / 10000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (let i = 1; i <= 10; i++) {
|
|
|
+ sczl_bhkey_rcl = `code${i}`
|
|
|
+ sczl_namekey_rcl = `name${i}`
|
|
|
+ percentagekey_rcl = `percentage${i}`
|
|
|
+ formDatas_rcl.value[sczl_bhkey_rcl] = '';
|
|
|
+ formDatas_rcl.value[sczl_namekey_rcl] = '';
|
|
|
+ formDatas_rcl.value[percentagekey_rcl] = '';
|
|
|
+ }
|
|
|
+ for (let i = 1; i <= Math.min(Object.keys(currentBz_rcl.value).length - 4, 6); i++) {
|
|
|
+ sczl_bhkey_rcl = `code${i}`
|
|
|
+ sczl_namekey_rcl = `name${i}`
|
|
|
+ percentagekey_rcl = `percentage${i}`
|
|
|
+ formDatas_rcl.value[sczl_bhkey_rcl] = currentBz_rcl.value[i - 1].split(' ')[0];
|
|
|
+ formDatas_rcl.value[sczl_namekey_rcl] = currentBz_rcl.value[i - 1].split(' ')[1];
|
|
|
+ if(isNaN(parseFloat(currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0]))){
|
|
|
+ formDatas_rcl.value[percentagekey_rcl] = currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0];
|
|
|
+ }else{
|
|
|
+ formDatas_rcl.value[percentagekey_rcl] = Math.round((parseFloat(currentBz_rcl.value[i - 1].split(' ')[2].split('(')[1].split(')')[0]) / 100 * 10000)) / 10000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ BZMC_rcl.value=val.班组号
|
|
|
+};
|
|
|
+
|
|
|
+const selectBz_rcl = () => {
|
|
|
+ if(currentBz_rcl.value==undefined){
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择班组'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ YieldTeamEdit({'Uniqid': Selection_ids.value, 'teamID': currentBz_rcl.value.ID}).then( res => {
|
|
|
+ if(res.code==0){
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ closeDetailShow_rcl()
|
|
|
+ FacilitychanLiang()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// =========== 流程单查询 ===========
|
|
|
+
|
|
|
+const pd_lcdlist = ref(false);
|
|
|
+const pd_lcdformData = reactive({
|
|
|
+ gdbh: '',
|
|
|
+ code: '',
|
|
|
+ name: '',
|
|
|
+ yjno: '',
|
|
|
+});
|
|
|
+// 流程单查询按钮
|
|
|
+const processList = ref([]);
|
|
|
+const pd_lcdlistonClick = async () => {
|
|
|
+ if(formData.value.工单编号 === ''){
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择一条工单'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ console.log(formData)
|
|
|
+ if(lcd_Gd_yjno.value === '' || lcd_Gd_yjno.value === null){
|
|
|
+ console.log(formData.value.工单编号)
|
|
|
+ console.log(formData.value.印件号)
|
|
|
+ pd_lcdformData['gdbh'] = formData.value.工单编号;
|
|
|
+ pd_lcdformData['yjno'] = formData.value.印件号;
|
|
|
+ // ElMessage({type: 'warning',message: '请选择具体的工单,在进行操作'})
|
|
|
+ // return false;
|
|
|
+ }else{
|
|
|
+ pd_lcdformData['gdbh'] = lcd_Gd_gdbh.value;
|
|
|
+ pd_lcdformData['yjno'] = lcd_Gd_yjno.value;
|
|
|
+ console.log(pd_lcdformData)
|
|
|
+ }
|
|
|
+ pd_lcdlist.value = true;
|
|
|
+ processList.value = []
|
|
|
+ _getOrderProcessLeft_list();
|
|
|
+}
|
|
|
+const pd_lcdProductValue = async () => {
|
|
|
+ _getOrderProcessLeft_list();
|
|
|
+}
|
|
|
+const pd_lcd_treeData = ref([]);
|
|
|
+const _getOrderProcessLeft_list = async () => {
|
|
|
+ const order = pd_lcdformData['gdbh'];
|
|
|
+ const yjno = pd_lcdformData['yjno']
|
|
|
+ // console.log(order)
|
|
|
+ try {
|
|
|
+ //5.1流程单查询-工单工序生产进程菜单栏
|
|
|
+ const getOrderProcessLeft_list = await getOrderProcessLeft({ order:order,yjno:yjno});
|
|
|
+ console.log(getOrderProcessLeft_list)
|
|
|
+ pd_lcdformData['code'] = getOrderProcessLeft_list.data.Gd_info['code'];
|
|
|
+ pd_lcdformData['name'] = getOrderProcessLeft_list.data.Gd_info['name'];
|
|
|
+ pd_lcd_treeData.value = [{
|
|
|
+ label: order + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
|
|
|
+ // label: order + '-' + getOrderProcessLeft_list.data.Gd_info['code'] + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
|
|
|
+ value: undefined,
|
|
|
+ children: []
|
|
|
+ }]
|
|
|
+ const newData = [];
|
|
|
+ for (let key in getOrderProcessLeft_list.data.Gy_info) {
|
|
|
+ let temp = getOrderProcessLeft_list.data.Gy_info[key];
|
|
|
+ let concatenatedValue = `${temp.Gy0_yjno}-${temp.Gy0_gxh} ---> ${temp.Gy0_gxmc}`;
|
|
|
+ newData.push({ label: concatenatedValue,value: temp.Gy0_gxh });
|
|
|
+ }
|
|
|
+ pd_lcd_treeData.value[0].children = newData;
|
|
|
+ //5.2流程单查询-获取工单工序生产进程右侧【进入页面默认显示第一个】
|
|
|
+ const getOrderProcessRight_list = await getOrderProcessRight({order:order, gxNo:newData[0].value,yjno:yjno});
|
|
|
+ processList.value = getOrderProcessRight_list.data
|
|
|
+ } catch (error) {
|
|
|
+ console.error(error);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const pd_lcd_handleNodeClick = async (node) => {
|
|
|
+ if (node.value === undefined) return
|
|
|
+ const order = pd_lcdformData['gdbh'];
|
|
|
+ const yjno = pd_lcdformData['yjno'];
|
|
|
+ ////5.2流程单查询-获取工单工序生产进程右侧
|
|
|
+ const getOrderProcessRight_list = await getOrderProcessRight({order:order, gxNo:node.value,yjno:yjno});
|
|
|
+ console.log(getOrderProcessRight_list)
|
|
|
+ processList.value = getOrderProcessRight_list.data
|
|
|
+};
|
|
|
+
|
|
|
+// 流程单查询退出
|
|
|
+const pd_lcdCancel = async () => {
|
|
|
+ pd_lcdlist.value = false;
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ 工单生产批次信息查询
|
|
|
+*/
|
|
|
+const scpconlist = ref(false);
|
|
|
+const scpconClick = async () => {
|
|
|
+ console.log(formData.value.工单编号)
|
|
|
+ if(lcd_Gd_gdbh.value){
|
|
|
+ searchInfolcd.value = lcd_Gd_gdbh.value
|
|
|
+ }else{
|
|
|
+ searchInfolcd.value = formData.value.工单编号
|
|
|
+ }
|
|
|
+
|
|
|
+ scpconlist.value = true;
|
|
|
+ tableDatalcd.splice(0,tableDatalcd.length,...[]);//表格数据
|
|
|
+ onSubmitlcd()//调用接口
|
|
|
+}
|
|
|
+//进入页面默认光标加载
|
|
|
+setTimeout(() => {
|
|
|
+ const inputElement = document.getElementById('searchInfo');
|
|
|
+ if (inputElement) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+}, 100);
|
|
|
+
|
|
|
+//搜索
|
|
|
+const searchInfolcd = ref('');
|
|
|
+const tableDatalcd = reactive([])
|
|
|
+//查询按钮
|
|
|
+const onSubmitlcd = () => {
|
|
|
+ _StaGetOrderList()
|
|
|
+};
|
|
|
+//搜索回车
|
|
|
+const Enterkeysearch = (event) => {
|
|
|
+ if (event.key === 'Enter') {
|
|
|
+ _StaGetOrderList();
|
|
|
+ }
|
|
|
+};
|
|
|
+//调用接口
|
|
|
+const _StaGetOrderList = async (node) => {
|
|
|
+ const StaGetOrderListdata = await StaGetOrderList({search:searchInfolcd.value});
|
|
|
+ console.log(StaGetOrderListdata)
|
|
|
+ if (StaGetOrderListdata.data === null) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '未搜索具体查询条件',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ tableDatalcd.splice(0,tableDatalcd.length,...StaGetOrderListdata.data);//表格数据
|
|
|
+};
|
|
|
+
|
|
|
+// 树形节点属性映射
|
|
|
+const treeDatalcd = reactive([]);
|
|
|
+const defaultProps = {
|
|
|
+ label: 'label',
|
|
|
+ children: 'children',
|
|
|
+};
|
|
|
+//全局调用工单编号、印件号
|
|
|
+const _Gd_gdbhlcd = ref(null)
|
|
|
+const _Gd_yjnolcd = ref(null)
|
|
|
+const _GetorderDetail = ref(null)
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+ 弹窗页面
|
|
|
+*/
|
|
|
+const popdialog = ref(false);
|
|
|
+const currentRow = ref('');
|
|
|
+// 获取当前行数据
|
|
|
+const tableRowClicklcd = (row) => {
|
|
|
+ currentRow.value = row; // 保存当前选中行
|
|
|
+};
|
|
|
+
|
|
|
+// 按钮点击逻辑
|
|
|
+const onstatsuclick = async () => {
|
|
|
+ console.log(currentRow)
|
|
|
+ if (!currentRow.value) {
|
|
|
+ ElMessage({
|
|
|
+ type: "warning",
|
|
|
+ message: "请先点击选择一行数据",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ await updateCompanyFunclcd(currentRow.value);
|
|
|
+};
|
|
|
+//双击
|
|
|
+const updateCompanyFunclcd = async (row) => {
|
|
|
+ console.log("双击",row)
|
|
|
+ _Gd_gdbhlcd.value = row['Gd_gdbh']
|
|
|
+ _Gd_yjnolcd.value =row['行号']
|
|
|
+
|
|
|
+ const StaGetOrderDetaildata = await StaGetOrderDetail({ gdbh: row['Gd_gdbh'], yjno: row['行号'] });
|
|
|
+ let resultData = StaGetOrderDetaildata.data;
|
|
|
+ // 遍历对象,将 null 值替换为空字符串
|
|
|
+ Object.keys(resultData).forEach((key) => {
|
|
|
+ if (resultData[key] === null) {
|
|
|
+ resultData[key] = '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ _GetorderDetail.value = resultData;
|
|
|
+ // console.log("_GetorderDetail.value", _GetorderDetail.value);
|
|
|
+ _StaGetList(row)
|
|
|
+}
|
|
|
+
|
|
|
+//左侧树形节点点击事件
|
|
|
+const handleNodeClicklcd = (node) => {
|
|
|
+ _StaProcessList(node['num'])
|
|
|
+ _StaProcessAnomaly()
|
|
|
+};
|
|
|
+
|
|
|
+//获取左侧菜单栏
|
|
|
+const _StaGetList = async (row) => {
|
|
|
+ const StaGetListdata = await StaGetList({ gdbh: row['Gd_gdbh'], yjno: row['行号'] });
|
|
|
+
|
|
|
+ if (StaGetListdata.msg === '成功') {
|
|
|
+ // 转换数据:确保每个节点有 label 属性
|
|
|
+ const formattedData = StaGetListdata.data.map(item => ({
|
|
|
+ ...item,
|
|
|
+ label: item.流程单 || `流程单-${item.num}`,
|
|
|
+ }));
|
|
|
+
|
|
|
+ treeDatalcd.splice(0, treeDatalcd.length, ...formattedData);
|
|
|
+ popdialog.value = true;
|
|
|
+ } else {
|
|
|
+ ElMessage({ type: 'warning', message: StaGetListdata.msg });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+//工艺及生产班组
|
|
|
+const lcdtableData = reactive([])
|
|
|
+const _StaProcessList = async (node) => {
|
|
|
+ const StaProcessListdata = await StaProcessList({gdbh:_Gd_gdbhlcd.value,yjno:_Gd_yjnolcd.value,num:node});
|
|
|
+ lcdtableData.splice(0,lcdtableData.length,...StaProcessListdata.data);
|
|
|
+};
|
|
|
+
|
|
|
+//制程异常记录
|
|
|
+const zcycjltableData = reactive([])
|
|
|
+const _StaProcessAnomaly = async () => {
|
|
|
+ const StaProcessAnomalydata = await StaProcessAnomaly({gdbh:_Gd_gdbhlcd.value,yjno:_Gd_yjnolcd.value});
|
|
|
+ zcycjltableData.splice(0,zcycjltableData.length,...StaProcessAnomalydata.data);
|
|
|
+};
|
|
|
+
|
|
|
+//退出按钮
|
|
|
+const ontuicclick = async () => {
|
|
|
+ popdialog.value = false
|
|
|
+};
|
|
|
+
|
|
|
+//退出按钮
|
|
|
+const ontuicclicks = async () => {
|
|
|
+ scpconlist.value = false
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+ 特殊机台组员及分配比例
|
|
|
+*/
|
|
|
+const blModel = ref(false)
|
|
|
+const employeeData = ref('')
|
|
|
+const bz_Special = ref('')
|
|
|
+const getbzyg = async (value,key) => {
|
|
|
+ bz_Special.value = key
|
|
|
+ let bzyg=''
|
|
|
+ bzyg=`code${key}`
|
|
|
+ let bzxm=''
|
|
|
+ bzxm=`name${key}`
|
|
|
+ const response = await getYg({sczl_bh:formDatas.value[bzyg]});
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data.length === 1){
|
|
|
+ formDatas.value[bzxm]= response.data[0].ygxm
|
|
|
+ formDatas.value[bzyg]= response.data[0].员工编号
|
|
|
+ }else{
|
|
|
+ blModel.value = true;
|
|
|
+ employeeData.value = response.data // 假设响应数据是数组
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+const clicked = ref(false);
|
|
|
+const currentIndex = ref(0);
|
|
|
+const tableBZRR = ref();
|
|
|
+// 模拟点击某一行
|
|
|
+const setCurrent = (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ tableBZRR.value?.setCurrentRow(row);
|
|
|
+ const { 员工编号, ygxm } = row;
|
|
|
+ console.log("选中行数据:", row);
|
|
|
+ });
|
|
|
+};
|
|
|
+// 键盘事件处理逻辑
|
|
|
+const selectBZRR = (event) => {
|
|
|
+ if (event.keyCode === 40) {
|
|
|
+ // 向下箭头
|
|
|
+ if (currentIndex.value < employeeData.value.length - 1) {
|
|
|
+ currentIndex.value++;
|
|
|
+ } else {
|
|
|
+ // 如果是最后一行,回到第一行
|
|
|
+ currentIndex.value = 0;
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) {
|
|
|
+ // 向上箭头
|
|
|
+ if (currentIndex.value > 0) {
|
|
|
+ currentIndex.value--;
|
|
|
+ } else {
|
|
|
+ // 如果是第一行,跳到最后一行
|
|
|
+ currentIndex.value = employeeData.value.length - 1;
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) {
|
|
|
+ // 回车键,模拟触发点击事件
|
|
|
+ const row = employeeData.value[currentIndex.value];
|
|
|
+ tablebllickHandler(row); // 手动调用行点击事件
|
|
|
+ }
|
|
|
+ //高亮当前选中的行
|
|
|
+ setCurrent(employeeData.value[currentIndex.value]);
|
|
|
+};
|
|
|
+
|
|
|
+// 表格行点击事件处理
|
|
|
+const tablebllickHandler = async (row, column, event) => {
|
|
|
+ if (clicked.value) {
|
|
|
+ // 如果已经点击过一次,则不再执行操作
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (let i = 1; i <= 8; i++) {
|
|
|
+ const codeKey = `code${i}`;
|
|
|
+ const nameKey = `name${i}`;
|
|
|
+ // 如果 code 有值,且对应的 name 没有值,则清空 code 的值
|
|
|
+ if (formDatas.value[codeKey] !== '' && formDatas.value[nameKey] === '') {
|
|
|
+ formDatas.value[codeKey] = '';
|
|
|
+ // console.log(`清空了 ${codeKey} 的值,因为 ${nameKey} 为空`);
|
|
|
+ }
|
|
|
+ // 检查 code 是否包含字母(使用正则表达式)
|
|
|
+ if (/[a-zA-Z]/.test(formDatas.value[codeKey])) {
|
|
|
+ formDatas.value[codeKey] = ''; // 清空 code
|
|
|
+ formDatas.value[nameKey] = ''; // 清空 name
|
|
|
+ // console.log(`清空了 ${codeKey} 和 ${nameKey} 的值,因为 ${codeKey} 中包含字母`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let nextIndex = 1;
|
|
|
+ // 找到下一个需要填充的空位置
|
|
|
+ while (
|
|
|
+ formDatas.value[`code${nextIndex}`] !== '' &&
|
|
|
+ formDatas.value[`name${nextIndex}`] !== ''
|
|
|
+ ) {
|
|
|
+ nextIndex++;
|
|
|
+ if (nextIndex > 8) { // 这里只处理8个输入框的情况
|
|
|
+ // 如果所有字段都已经填满,则不做任何事情并退出函数
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 特殊情况:直接填充到第8个位置
|
|
|
+ if (bz_Special.value === "8") {
|
|
|
+ formDatas.value.code8 = row.员工编号;
|
|
|
+ formDatas.value.name8 = row.ygxm;
|
|
|
+ // 弹窗关闭并防止重复点击
|
|
|
+ setTimeout(() => {
|
|
|
+ blModel.value = false;
|
|
|
+ clicked.value = false;
|
|
|
+ }, 300);
|
|
|
+ } else {
|
|
|
+ // 当前按下回车的输入框索引
|
|
|
+ const currentInputIndex = currentIndex.value + 1;
|
|
|
+ // 如果找到的空位不是当前输入框,则填充前面的空位
|
|
|
+ if (nextIndex !== currentInputIndex) {
|
|
|
+ // 填充前面空位
|
|
|
+ formDatas.value[`code${nextIndex}`] = row.员工编号;
|
|
|
+ formDatas.value[`name${nextIndex}`] = row.ygxm;
|
|
|
+ // 检查当前输入框是否需要清空
|
|
|
+ if (formDatas.value[`name${currentInputIndex}`] === '' &&formDatas.value[`code${currentInputIndex}`] !== '') {
|
|
|
+ // 如果当前输入框的 name 为空,但 code 有值,清空当前输入框
|
|
|
+ formDatas.value[`code${currentInputIndex}`] = '';
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 如果当前输入框就是下一个空位,则直接填充到当前输入框
|
|
|
+ formDatas.value[`code${currentInputIndex}`] = row.员工编号;
|
|
|
+ formDatas.value[`name${currentInputIndex}`] = row.ygxm;
|
|
|
+ }
|
|
|
+ // 弹窗关闭并防止重复点击
|
|
|
+ setTimeout(() => {
|
|
|
+ blModel.value = false; // 延迟关闭弹窗
|
|
|
+ clicked.value = false; // 恢复点击标志
|
|
|
+ }, 300);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+ 组员及分配比例规则算法
|
|
|
+*/
|
|
|
+const fpsum = ref();
|
|
|
+const fpsum2 = ref();
|
|
|
+//自动计算分配系数和
|
|
|
+function updateTotal() {
|
|
|
+ //机台班组维护中分配系数字段
|
|
|
+ const relevantKeys = ['percentage1', 'percentage2', 'percentage3', 'percentage4', 'percentage5', 'percentage6', 'percentage7'];
|
|
|
+ const values = relevantKeys.map(key => parseFloat(formDatas.value[key], 10) * 100 || 0); // 转换为百分比
|
|
|
+ const sum = values.reduce((sum, value) => sum + value, 0);
|
|
|
+ fpsum.value = Math.round(sum * 100) / 10000; // 四舍五入到2位小数
|
|
|
+
|
|
|
+ //修改中分配系数字段
|
|
|
+ const relevantKeys2 = ['组员1', '组员2','组员3','组员4','组员5','组员6','组员7','组员8','组员9',];
|
|
|
+ const valuess = relevantKeys2.map(key => parseFloat(formdata3.value[key]['比例'], 10) * 100 || 0);
|
|
|
+ const sum2 = valuess.reduce((sum, value) => sum + value, 0);
|
|
|
+ fpsum2.value = Math.round(sum2 * 100) / 10000; // 四舍五入到2位小数
|
|
|
+}
|
|
|
+
|
|
|
+// 在组件初始化时就设置监听
|
|
|
+const setupWatchers = () => {
|
|
|
+ for (let i = 1; i <= 8; i++) {
|
|
|
+ const codeKey = `code${i}`;
|
|
|
+ const nameKey = `name${i}`;
|
|
|
+ const percentageKey = `percentage${i}`;
|
|
|
+
|
|
|
+ watch(
|
|
|
+ () => formDatas.value[codeKey],
|
|
|
+ (newVal) => {
|
|
|
+ if (!newVal) {
|
|
|
+ formDatas.value[nameKey] = '';
|
|
|
+ formDatas.value[percentageKey] = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 在组件创建时调用
|
|
|
+onMounted(() => {
|
|
|
+ setupWatchers();
|
|
|
+});
|
|
|
+
|
|
|
+//机台班组维护新增
|
|
|
+const addBz = async() => {
|
|
|
+ //数据初始化
|
|
|
+ updateTotal()
|
|
|
+ //判断机台和班组是否为空
|
|
|
+ if(!selectedOption.value || !BZMC.value){
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '机台或者班组编号不能为空'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const jt = selectedOption.value.split('|')[0]//获取车间数据
|
|
|
+ //判断车间是否是【SY、PM】
|
|
|
+ const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM');
|
|
|
+ const relevantKeys = ['percentage1', 'percentage2', 'percentage3', 'percentage4', 'percentage5', 'percentage6', 'percentage7', 'percentage8'];
|
|
|
+ let hasValidMember = false; // 标志变量,用于检查是否有有效的组员
|
|
|
+ console.log(fpsum.value)
|
|
|
+
|
|
|
+ // 循环检查每个成员
|
|
|
+ for (let i = 1; i <= relevantKeys.length; i++) {
|
|
|
+ const codeKey = `code${i}`;
|
|
|
+ const nameKey = `name${i}`;
|
|
|
+ const percentageKey = `percentage${i}`;
|
|
|
+ const percentageValue = parseFloat(formDatas.value[percentageKey], 10); //获取分配系数的值
|
|
|
+
|
|
|
+ if (formDatas.value[codeKey] || formDatas.value[nameKey]) {
|
|
|
+ console.log('有组员');
|
|
|
+ if (isNaN(percentageValue) || percentageValue <= 0 || percentageValue > 1) {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "没有填写有效的组员或分配系数有误",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ hasValidMember = true; // 如果有有效的百分比值,则设置标志变量为true
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 循环结束后检查标志变量
|
|
|
+if (!hasValidMember) {
|
|
|
+ // 如果没有有效的组员(即所有百分比值都无效或为空),则显示错误消息
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "没有填写有效的组员或分配系数有误",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+}else if (shouldCheckLessThanOne && fpsum.value < 1) {//如果有组员,并且 shouldCheckLessThanOne 为 true(不是PM和SY机器),则检查 fpsum.value < 1
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "分配系数相加不能小于1",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }else if(fpsum.value > 1) { //所有机器的分配系数之和不能大于1
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "分配系数相加不能大于1",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const response = await MachineTeamAdd({
|
|
|
+ sczl_jtbh: selectedOption.value.split('|')[0],
|
|
|
+ sczl_bzdh: BZMC.value,
|
|
|
+ sczl_bh1: formDatas.value.code1,
|
|
|
+ sczl_bh2: formDatas.value.code2,
|
|
|
+ sczl_bh3: formDatas.value.code3,
|
|
|
+ sczl_bh4: formDatas.value.code4,
|
|
|
+ sczl_bh5: formDatas.value.code5,
|
|
|
+ sczl_bh6: formDatas.value.code6,
|
|
|
+ sczl_bh7: formDatas.value.code7,
|
|
|
+ sczl_bh8: formDatas.value.code10,
|
|
|
+ sczl_bh9: formDatas.value.code9,
|
|
|
+ sczl_bh10: formDatas.value.code8,
|
|
|
+ sczl_rate1: formDatas.value.percentage1,
|
|
|
+ sczl_rate2: formDatas.value.percentage2,
|
|
|
+ sczl_rate3: formDatas.value.percentage3,
|
|
|
+ sczl_rate4: formDatas.value.percentage4,
|
|
|
+ sczl_rate5: formDatas.value.percentage5,
|
|
|
+ sczl_rate6: formDatas.value.percentage6,
|
|
|
+ sczl_rate7: formDatas.value.percentage7,
|
|
|
+ sczl_rate8: formDatas.value.percentage10,
|
|
|
+ sczl_rate9: formDatas.value.percentage9,
|
|
|
+ sczl_rate10: formDatas.value.percentage8,
|
|
|
+ sys_id: sys_id
|
|
|
+ })
|
|
|
+ if (response.code === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ FacilityTeam(JTMC)
|
|
|
+ fetchData()
|
|
|
+ // FacilityProduction()
|
|
|
+ }
|
|
|
+}
|
|
|
+const currentBz ={}
|
|
|
+const selectBz = async() => {
|
|
|
+ initfordata3()
|
|
|
+ updateTotal()
|
|
|
+ if(!selectedOption.value || !BZMC.value){
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '机台或者班组不能为空'
|
|
|
+ })
|
|
|
+ return;
|
|
|
+}
|
|
|
+ const jt = selectedOption.value.split('|')[0]//获取车间数据
|
|
|
+ //判断车间分配比例【SY、PM】
|
|
|
+ const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM');
|
|
|
+ const relevantKeys = ['percentage1', 'percentage2', 'percentage3', 'percentage4', 'percentage5', 'percentage6', 'percentage7', 'percentage8'];
|
|
|
+ const values = relevantKeys.reduce((acc, key) => {
|
|
|
+ const value = parseFloat(formDatas.value[key], 10);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ acc.push(value); // 只有当 value 不是 NaN 时才添加到数组中
|
|
|
+ }
|
|
|
+ return acc;
|
|
|
+ }, []); // 初始化为空数组
|
|
|
+ const hasInvalidValue = values.some(value => value <= 0 || value > 1);
|
|
|
+ if (hasInvalidValue) {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "某人分配系数有误",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (fpsum.value > 1) {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "分配系数相加不能大于1",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 只有当 shouldCheckLessThanOne 为 true 时才检查 fpsum.value < 1
|
|
|
+ if (shouldCheckLessThanOne && fpsum.value < 1) {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "分配系数相加不能小于1",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(currentBz.value){
|
|
|
+ BZMC.value=currentBz.value.班组号
|
|
|
+ let sczl_bhkey=''
|
|
|
+ let sczl_namekey=''
|
|
|
+ if (currentBz.value[9]) {
|
|
|
+ for (let i = 1; i <= 9; i++) {
|
|
|
+ sczl_bhkey=`sczl_bh${i}`
|
|
|
+ sczl_namekey=`sczl_name${i}`
|
|
|
+ formData.value[sczl_bhkey] = '';
|
|
|
+ formData.value[sczl_namekey] = '';
|
|
|
+ }
|
|
|
+ formData.value.sczl_bh10 = currentBz.value[9].split(' ')[0];
|
|
|
+ formData.value.sczl_name10=currentBz.value[9].split(' ')[1]
|
|
|
+ for (let i = 1; i <= Math.min(Object.keys(currentBz.value).length-5, 6); i++) {
|
|
|
+ sczl_bhkey=`sczl_bh${i}`
|
|
|
+ sczl_namekey=`sczl_name${i}`
|
|
|
+ formData.value[sczl_bhkey] = currentBz.value[i-1].split(' ')[0];
|
|
|
+ formData.value[sczl_namekey] = currentBz.value[i-1].split(' ')[1];
|
|
|
+ classbz.value[i-1]=currentBz.value[i-1].split(' ')[0]
|
|
|
+ }
|
|
|
+ classbz.value.push(currentBz.value[9].split(' ')[0])
|
|
|
+ formData.value.class=classbz.value.join(',')
|
|
|
+ }else{
|
|
|
+ for (let i = 1; i <= 10; i++) {
|
|
|
+ sczl_bhkey=`sczl_bh${i}`
|
|
|
+ sczl_namekey=`sczl_name${i}`
|
|
|
+ formData.value[sczl_bhkey] = '';
|
|
|
+ formData.value[sczl_namekey] = '';
|
|
|
+ }
|
|
|
+ for (let i = 1; i <= Math.min(Object.keys(currentBz.value).length-4, 6); i++) {
|
|
|
+ sczl_bhkey=`sczl_bh${i}`
|
|
|
+ sczl_namekey=`sczl_name${i}`
|
|
|
+ formData.value[sczl_bhkey] = currentBz.value[i-1].split(' ')[0];
|
|
|
+ formData.value[sczl_namekey] = currentBz.value[i-1].split(' ')[1];
|
|
|
+ classbz.value[i-1]=currentBz.value[i-1].split(' ')[0]
|
|
|
+ }
|
|
|
+ formData.value.class=classbz.value.join(',')
|
|
|
+ }
|
|
|
+ const response = await setMachineTeam({
|
|
|
+ machine: JTMC.split("#")[0],
|
|
|
+ order:formData.value.工单编号,
|
|
|
+ yjno:formData.value.印件号,
|
|
|
+ gy_name:formData.value.工序名称,
|
|
|
+ sczl_bzdh:BZMC.value,
|
|
|
+ status:'生产',
|
|
|
+ production_now:0,
|
|
|
+ production_all:0,
|
|
|
+ team_id:currentBz.value.ID
|
|
|
+ })
|
|
|
+ if(response.code===0){
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ FacilityProduction()
|
|
|
+ }
|
|
|
+ // currentBz.value={}
|
|
|
+ }
|
|
|
+
|
|
|
+ detailShow.value = false;
|
|
|
+}
|
|
|
+const delBz = async() => {
|
|
|
+
|
|
|
+ const UniqId=currentBz.value.ID
|
|
|
+ if(currentBz.value){
|
|
|
+ ElMessageBox.confirm('确定要删除吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ const response = teamDel({UniqId:UniqId})
|
|
|
+ response.then(result => {
|
|
|
+ if(result.code===0){
|
|
|
+ let messageType = 'success';
|
|
|
+ // 检查 result.msg 是否包含特定的错误提示
|
|
|
+ if (result.msg.includes('无法删除正在生产的班组资料,请先切换班组')) {
|
|
|
+ messageType = 'error';
|
|
|
+ }
|
|
|
+ ElMessage({
|
|
|
+ type: messageType,
|
|
|
+ message: result.msg
|
|
|
+ })
|
|
|
+ FacilityTeam(JTMC)
|
|
|
+ fetchData()
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ currentBz.value={}
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const selected = ref('');
|
|
|
+// 下拉框选项数据
|
|
|
+const dropdownOptions = ref([]);
|
|
|
+// 选中的选项
|
|
|
+const selectedOption = ref('');
|
|
|
+// 获取接口数据并转换为下拉框需要的格式
|
|
|
+const fetchData = async () => {
|
|
|
+ try {
|
|
|
+ const response = await facilityMachineList();
|
|
|
+ if (response.code === 0) {
|
|
|
+ const options = response.data.map((item) => ({
|
|
|
+ label: item,
|
|
|
+ value: item
|
|
|
+ }));
|
|
|
+ const selectionValue = options.find(item => {
|
|
|
+ return item.value.indexOf(JTMC) !== -1
|
|
|
+ })
|
|
|
+
|
|
|
+ selectedOption.value = selectionValue.value ?? options[0].value
|
|
|
+ dropdownOptions.value = options
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('Error fetching data:', error);
|
|
|
+ // Handle the error appropriately
|
|
|
+ }
|
|
|
+};
|
|
|
+// formData
|
|
|
+let BZMC=ref()
|
|
|
+let lastCellValue=ref()
|
|
|
+let parts =reactive([])
|
|
|
+// 自动化生成的字典(可能为空)以及字段
|
|
|
+const formData= ref({
|
|
|
+ 工单编号:'',
|
|
|
+ 印件编号:'',
|
|
|
+ 工序名称:'',
|
|
|
+ 产品名称:'',
|
|
|
+ sczl_bh1:'',
|
|
|
+ sczl_bh2:'',
|
|
|
+ sczl_bh3:'',
|
|
|
+ sczl_bh4:'',
|
|
|
+ sczl_bh5:'',
|
|
|
+ sczl_bh6:'',
|
|
|
+ sczl_bh7:'',
|
|
|
+ sczl_bh8:'',
|
|
|
+ sczl_bh9:'',
|
|
|
+ sczl_bh10:'',
|
|
|
+ sczl_name1:'',
|
|
|
+ sczl_name2:'',
|
|
|
+ sczl_name3:'',
|
|
|
+ sczl_name4:'',
|
|
|
+ sczl_name5:'',
|
|
|
+ sczl_name6:'',
|
|
|
+ sczl_name7:'',
|
|
|
+ sczl_name8:'',
|
|
|
+ sczl_name9:'',
|
|
|
+ sczl_name10:'',
|
|
|
+})
|
|
|
+const formDatasData= reactive([])
|
|
|
+
|
|
|
+const formDatas = ref({
|
|
|
+ code1:'',
|
|
|
+ code2:'',
|
|
|
+ code3:'',
|
|
|
+ code4:'',
|
|
|
+ code5:'',
|
|
|
+ code6:'',
|
|
|
+ code7:'',
|
|
|
+ code8:'',
|
|
|
+ code9:'',
|
|
|
+ code10:'',
|
|
|
+ name1:'',
|
|
|
+ name2:'',
|
|
|
+ name3:'',
|
|
|
+ name4:'',
|
|
|
+ name5:'',
|
|
|
+ name6:'',
|
|
|
+ name7:'',
|
|
|
+ name8:'',
|
|
|
+ name9:'',
|
|
|
+ name10:'',
|
|
|
+ percentage1:'',
|
|
|
+ percentage2:'',
|
|
|
+ percentage3:'',
|
|
|
+ percentage4:'',
|
|
|
+ percentage5:'',
|
|
|
+ percentage6:'',
|
|
|
+ percentage7:'',
|
|
|
+ percentage8:'',
|
|
|
+ percentage9:'',
|
|
|
+ percentage10:'',
|
|
|
+})
|
|
|
+const formDatas_rcl = ref({
|
|
|
+ code1:'',
|
|
|
+ code2:'',
|
|
|
+ code3:'',
|
|
|
+ code4:'',
|
|
|
+ code5:'',
|
|
|
+ code6:'',
|
|
|
+ code7:'',
|
|
|
+ code8:'',
|
|
|
+ code9:'',
|
|
|
+ code10:'',
|
|
|
+ name1:'',
|
|
|
+ name2:'',
|
|
|
+ name3:'',
|
|
|
+ name4:'',
|
|
|
+ name5L:'',
|
|
|
+ name6:'',
|
|
|
+ name7:'',
|
|
|
+ name8:'',
|
|
|
+ name9:'',
|
|
|
+ name10:'',
|
|
|
+ percentage1:'',
|
|
|
+ percentage2:'',
|
|
|
+ percentage3:'',
|
|
|
+ percentage4:'',
|
|
|
+ percentage5:'',
|
|
|
+ percentage6:'',
|
|
|
+ percentage7:'',
|
|
|
+ percentage8:'',
|
|
|
+ percentage9:'',
|
|
|
+ percentage10:'',
|
|
|
+})
|
|
|
+
|
|
|
+//班组单击
|
|
|
+const BZvalue=ref()
|
|
|
+const BZhandle = (val) => {
|
|
|
+ currentBz.value = val
|
|
|
+ BZvalue.value=val.ID
|
|
|
+ formDatas.value = {};
|
|
|
+ let sczl_bhkey = ''
|
|
|
+ let sczl_namekey = ''
|
|
|
+ let percentagekey = ''
|
|
|
+ console.log(currentBz.value)
|
|
|
+ if (currentBz.value[9]) {
|
|
|
+ for (let i = 1; i <= 9; i++) {
|
|
|
+ sczl_bhkey = `code${i}`
|
|
|
+ sczl_namekey = `name${i}`
|
|
|
+ percentagekey = `percentage${i}`
|
|
|
+ formDatas.value[sczl_bhkey] = '';
|
|
|
+ formDatas.value[sczl_namekey] = '';
|
|
|
+ formDatas.value[percentagekey] = '';
|
|
|
+ }
|
|
|
+ formDatas.value.code8 = currentBz.value[9].split(' ')[0];
|
|
|
+ formDatas.value.name8 = currentBz.value[9].split(' ')[1]
|
|
|
+ formDatas.value.percentage8 = Math.round((parseFloat(currentBz.value[9].split(' ')[2].split('(')[1].split(')')[0]) / 100 * 10000)) / 10000;
|
|
|
+ for (let i = 1; i <= Math.min(Object.keys(currentBz.value).length - 5, 6); i++) {
|
|
|
+ sczl_bhkey = `code${i}`
|
|
|
+ sczl_namekey = `name${i}`
|
|
|
+ percentagekey = `percentage${i}`
|
|
|
+ formDatas.value[sczl_bhkey] = currentBz.value[i - 1].split(' ')[0];
|
|
|
+ formDatas.value[sczl_namekey] = currentBz.value[i - 1].split(' ')[1];
|
|
|
+ if(isNaN(parseFloat(currentBz.value[i - 1].split(' ')[2].split('(')[1].split(')')[0]))){
|
|
|
+ formDatas.value[percentagekey] = currentBz.value[i - 1].split(' ')[2].split('(')[1].split(')')[0];
|
|
|
+ }else{
|
|
|
+ formDatas.value[percentagekey] = Math.round((parseFloat(currentBz.value[i - 1].split(' ')[2].split('(')[1].split(')')[0]) / 100 * 10000)) / 10000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (let i = 1; i <= 10; i++) {
|
|
|
+ sczl_bhkey = `code${i}`
|
|
|
+ sczl_namekey = `name${i}`
|
|
|
+ percentagekey = `percentage${i}`
|
|
|
+ formDatas.value[sczl_bhkey] = '';
|
|
|
+ formDatas.value[sczl_namekey] = '';
|
|
|
+ formDatas.value[percentagekey] = '';
|
|
|
+ }
|
|
|
+ for (let i = 1; i <= Math.min(Object.keys(currentBz.value).length - 4, 6); i++) {
|
|
|
+ sczl_bhkey = `code${i}`
|
|
|
+ sczl_namekey = `name${i}`
|
|
|
+ percentagekey = `percentage${i}`
|
|
|
+ formDatas.value[sczl_bhkey] = currentBz.value[i - 1].split(' ')[0];
|
|
|
+ formDatas.value[sczl_namekey] = currentBz.value[i - 1].split(' ')[1];
|
|
|
+ if(isNaN(parseFloat(currentBz.value[i - 1].split(' ')[2].split('(')[1].split(')')[0]))){
|
|
|
+ formDatas.value[percentagekey] = currentBz.value[i - 1].split(' ')[2].split('(')[1].split(')')[0];
|
|
|
+ }else{
|
|
|
+ formDatas.value[percentagekey] = Math.round((parseFloat(currentBz.value[i - 1].split(' ')[2].split('(')[1].split(')')[0]) / 100 * 10000)) / 10000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ BZMC.value=val.班组号
|
|
|
+};
|
|
|
+
|
|
|
+const chanliangVisible = ref(false)
|
|
|
+const formdata3=reactive([])
|
|
|
+const initfordata3 = () => {
|
|
|
+ formdata3.value = {
|
|
|
+ '工单编号':'',
|
|
|
+ 'cpmc':'',
|
|
|
+ 'yjno':'',
|
|
|
+ 'yjmc':'',
|
|
|
+ 'gxmc':'',
|
|
|
+ 'gxh':'',
|
|
|
+ 'gymc':'',
|
|
|
+ 'rq':'',
|
|
|
+ 'sczl_jtbh':'',
|
|
|
+ 'starttime':'',
|
|
|
+ 'num':'',
|
|
|
+ 'sj1':'',
|
|
|
+ '色度数':'',
|
|
|
+ '联数':'',
|
|
|
+ '产量':'',
|
|
|
+ '制程废品':'',
|
|
|
+ '制程次品':'',
|
|
|
+ '前工序废':'',
|
|
|
+ '来料异常':'',
|
|
|
+ '换型类型':'',
|
|
|
+ '装版总工时':'',
|
|
|
+ '装版工时':'',
|
|
|
+ '打样总工时':'',
|
|
|
+ '打样工时':'',
|
|
|
+ '保养工时':'',
|
|
|
+ '异常总工时':'',
|
|
|
+ '异常类型':'',
|
|
|
+ '异常补时':'',
|
|
|
+ '通电工时':'',
|
|
|
+ 'dedh':'',
|
|
|
+ '码包':'',
|
|
|
+ '码开始行':'',
|
|
|
+ '码结束行':'',
|
|
|
+ '主电表':'',
|
|
|
+ '辅电表':'',
|
|
|
+ '组员1':{
|
|
|
+ '编号':'',
|
|
|
+ '姓名':'',
|
|
|
+ '比例':'',
|
|
|
+ },
|
|
|
+ '组员2':{
|
|
|
+ '编号':'',
|
|
|
+ '姓名':'',
|
|
|
+ '比例':'',
|
|
|
+ },
|
|
|
+ '组员3':{
|
|
|
+ '编号':'',
|
|
|
+ '姓名':'',
|
|
|
+ '比例':'',
|
|
|
+ },
|
|
|
+ '组员4':{
|
|
|
+ '编号':'',
|
|
|
+ '姓名':'',
|
|
|
+ '比例':'',
|
|
|
+ },
|
|
|
+ '组员5':{
|
|
|
+ '编号':'',
|
|
|
+ '姓名':'',
|
|
|
+ '比例':'',
|
|
|
+ },
|
|
|
+ '组员6':{
|
|
|
+ '编号':'',
|
|
|
+ '姓名':'',
|
|
|
+ '比例':'',
|
|
|
+ },
|
|
|
+ '组员7':{
|
|
|
+ '编号':'',
|
|
|
+ '姓名':'',
|
|
|
+ '比例':'',
|
|
|
+ },
|
|
|
+ '组员8':{
|
|
|
+ '编号':'',
|
|
|
+ '姓名':'',
|
|
|
+ '比例':'',
|
|
|
+ },
|
|
|
+ '组员9':{
|
|
|
+ '编号':'',
|
|
|
+ '姓名':'',
|
|
|
+ '比例':'',
|
|
|
+ },
|
|
|
+ '组员10':{
|
|
|
+ '编号':'',
|
|
|
+ '姓名':'',
|
|
|
+ '比例':'',
|
|
|
+ },
|
|
|
+ '拉料':{
|
|
|
+ '编号':'',
|
|
|
+ '姓名':'',
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+initfordata3()
|
|
|
+for (let i = 1; i <= 10; i++) {
|
|
|
+ (function(index) {
|
|
|
+ watch(
|
|
|
+ () => formdata3.value[`组员${index}`].编号,
|
|
|
+ (newVal, oldVal) => {
|
|
|
+ if (!newVal) {
|
|
|
+ formdata3.value[`组员${index}`].姓名 = '';
|
|
|
+ formdata3.value[`组员${index}`].比例 = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ })(i); // 使用立即执行的函数表达式(IIFE)来捕获当前的i值
|
|
|
+}
|
|
|
+
|
|
|
+function gytableDatadoubleClick(row, column, event) {
|
|
|
+ type2.value="update"
|
|
|
+ MachineChanliang(row.UniqId)
|
|
|
+}
|
|
|
+const uid=ref()
|
|
|
+const _Gd_gdbh=ref()
|
|
|
+function getUid(row, column, event) {
|
|
|
+ console.log(row)
|
|
|
+ uid.value=row['UniqId']
|
|
|
+ _Gd_gdbh.value=row['工单编号']
|
|
|
+ _gdbhlist.value=row['工单编号']
|
|
|
+ lcd_Gd_gdbh.value = row['工单编号']
|
|
|
+ lcd_Gd_yjno.value = row['yjno']
|
|
|
+ console.log("工单编号"+lcd_Gd_gdbh.value)
|
|
|
+ console.log("UniqId"+uid.value)
|
|
|
+}
|
|
|
+
|
|
|
+//班组产量提报 获取当天日期接口
|
|
|
+const qita_jitaidata = async () => {
|
|
|
+ const qita_jitaidata = await getTimelist();
|
|
|
+ formdata3.value.rq = qita_jitaidata.data.date
|
|
|
+}
|
|
|
+
|
|
|
+//获取详细信息
|
|
|
+const MachineChanliang = async(value) => {
|
|
|
+ //打开新增按钮获取
|
|
|
+ qita_jitaidata();
|
|
|
+
|
|
|
+ if(uid.value == undefined){
|
|
|
+ initfordata3()
|
|
|
+ chanliangVisible.value=true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const response = await MachineChanliangDetail({UniqId:value});
|
|
|
+ if (response.code === 0) {
|
|
|
+ chanliangVisible.value=true
|
|
|
+ formdata3.value=response.data
|
|
|
+ const result=formdata3.value.gxmc.match(/-(.{2})/)
|
|
|
+ formdata3.value.gymc=result[1]
|
|
|
+ formdata3.value.sczl_jtbh=JTMC
|
|
|
+ formdata3.value.yjmc=response.data.印件名称
|
|
|
+ formdata3.value.rq=date
|
|
|
+ if (formdata3.value.bzdh === 'A班') {
|
|
|
+ formdata3.value.starttime = ''; // 清空值
|
|
|
+ setTimeout(()=>{
|
|
|
+ formdata3.value.starttime = date + " 08:30:00"; // 设置为 20:30:00
|
|
|
+ })
|
|
|
+ } else if (formdata3.value.bzdh === 'B班') {
|
|
|
+ formdata3.value.starttime = ''; // 清空值
|
|
|
+ setTimeout(()=>{
|
|
|
+ formdata3.value.starttime = date + " 20:30:00"; // 设置为 20:30:00
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const yjnoArr = ref([0])
|
|
|
+ const gxmc = ref('')
|
|
|
+ //工单编号回车事件
|
|
|
+ const getCPMCsubmit = () => {
|
|
|
+ if(formdata3.value.工单编号!=''){
|
|
|
+ ChanliangWorkorder({search:formdata3.value.工单编号,machine:JTMC}).then(response=>{
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data){
|
|
|
+ formdata3.value.cpmc = response.data[0].cpmc
|
|
|
+ document.getElementById('产品名称').style.color = 'red';
|
|
|
+ getYJMCsubmit()
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: response.msg
|
|
|
+ })
|
|
|
+ formdata3.value.工单编号 = '';
|
|
|
+ formdata3.value.cpmc = '';
|
|
|
+ document.getElementById('产品名称').style.color = 'black';
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ formdata3.value.工单编号 = '';
|
|
|
+ formdata3.value.cpmc = '';
|
|
|
+ document.getElementById('产品名称').style.color = 'black';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请注意, 工单编号输入空置, 除非有特殊需要!'
|
|
|
+ })
|
|
|
+ gxmc.value = '';
|
|
|
+ document.getElementById('产品名称').style.color = 'black';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const yjnoHandleFocus = () =>{
|
|
|
+ if(yjnoArr.value[0] == 0){
|
|
|
+ formdata3.value.yjno = 1;
|
|
|
+ }else{
|
|
|
+ formdata3.value.yjno = yjnoArr.value[0];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //印件号失去焦点事件
|
|
|
+ const getYJMCsubmit = () => {
|
|
|
+ if(formdata3.value.工单编号!=''){
|
|
|
+ //获取印件名称
|
|
|
+ ChanliangPrintDetail({gdbh:formdata3.value.工单编号}).then(response=>{
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data){
|
|
|
+ if(response.data.length==1){
|
|
|
+ formdata3.value.yjmc = response.data[0].yjmc
|
|
|
+ formdata3.value.yjno = response.data[0].yjno
|
|
|
+ formdata3.value.联数 = response.data[0].ls
|
|
|
+ setColorReadonly('印件名称')
|
|
|
+ }else{
|
|
|
+ selectData_Yj.splice(0, selectData_Yj.length, ...response.data)
|
|
|
+ dialogSelectVisible_Yj.value=true
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: response.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '印件编号不存在, 将恢复默认值, 请仔细确认数据准确性!'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //印件选择
|
|
|
+ const dialogSelectVisible_Yj = ref(false)
|
|
|
+ const selectData_Yj = reactive([])
|
|
|
+ // 处理选择框
|
|
|
+ const handleSelectClick_Yj = (row, column, event) => {
|
|
|
+ const { yjno, yjmc, ls } = row
|
|
|
+ formdata3.value.yjno = yjno
|
|
|
+ formdata3.value.yjmc = yjmc
|
|
|
+ formdata3.value.联数 = ls
|
|
|
+ dialogSelectVisible_Yj.value = false
|
|
|
+ }
|
|
|
+
|
|
|
+ const select_Yj = (event) => {
|
|
|
+ if (event.keyCode === 40) { // 向下箭头
|
|
|
+ if (currentIndex.value < selectData_Yj.length - 1) {
|
|
|
+ currentIndex.value++;
|
|
|
+ setCurrent_Yj(selectData_Yj[currentIndex.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex.value = 0;
|
|
|
+ setCurrent_Yj(selectData_Yj[currentIndex.value]); // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ if (currentIndex.value > 0) {
|
|
|
+ currentIndex.value--;
|
|
|
+ setCurrent_Yj(selectData_Yj[currentIndex.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex.value = selectData_Yj.length - 1;
|
|
|
+ setCurrent_Yj(selectData_Yj[currentIndex.value]); // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) { // 回车键
|
|
|
+ dialogSelectVisible_Yj.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //工序选择
|
|
|
+ const dialogSelectVisible_Gx = ref(false)
|
|
|
+ const selectData_Gx = reactive([])
|
|
|
+const table_Gx = ref()
|
|
|
+ // 处理选择框
|
|
|
+ const handleSelectClick_Gx = (row, column, event) => {
|
|
|
+ const { gxh, name, gxmc } = row
|
|
|
+ formdata3.value.gxh = gxh
|
|
|
+ formdata3.value.gxmc = name
|
|
|
+ formdata3.value.gymc = gxmc
|
|
|
+ dialogSelectVisible_Gx.value = false
|
|
|
+ }
|
|
|
+ const select_gxmc = (event) => {
|
|
|
+ if (event.keyCode === 40) { // 向下箭头
|
|
|
+ if (currentIndex.value < selectData_Gx.length - 1) {
|
|
|
+ currentIndex.value++;
|
|
|
+ setCurrent_GXMC(selectData_Gx[currentIndex.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex.value = 0;
|
|
|
+ setCurrent_GXMC(selectData_Gx[currentIndex.value]); // 到达最后一行时回到第一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ if (currentIndex.value > 0) {
|
|
|
+ currentIndex.value--;
|
|
|
+ setCurrent_GXMC(selectData_Gx[currentIndex.value]);
|
|
|
+ } else {
|
|
|
+ currentIndex.value = selectData_Gx.length - 1;
|
|
|
+ setCurrent_GXMC(selectData_Gx[currentIndex.value]); // 到达第一行时回到最后一行
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) { // 回车键
|
|
|
+ dialogSelectVisible_Gx.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const table_GXMC = ref();
|
|
|
+ const setCurrent_GXMC = (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ table_GXMC.value?.setCurrentRow(row);
|
|
|
+ const { gxh, name, gxmc } = row
|
|
|
+ formdata3.value.gxh = row.gxh
|
|
|
+ formdata3.value.gxmc = row.name
|
|
|
+ formdata3.value.gymc = row.gxmc
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ //工序失去焦点事件
|
|
|
+ const getGXsubmit = () => {
|
|
|
+ //弹出选择
|
|
|
+ ChanliangProcessDetail({gdbh:formdata3.value.工单编号,yjno:formdata3.value.yjno,machine:''}).then(response=>{
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data){
|
|
|
+ if(response.data.length==1){
|
|
|
+ formdata3.value.gxmc=response.data[0].name
|
|
|
+ formdata3.value.gxh=response.data[0].gxh
|
|
|
+ formdata3.value.gymc=response.data[0].gxmc
|
|
|
+ }else{
|
|
|
+ selectData_Gx.splice(0, selectData_Gx.length, ...response.data)
|
|
|
+ dialogSelectVisible_Gx.value = true
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: response.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+//机台编号失去焦点事件
|
|
|
+ const GetjtbhVisible = ref(false)
|
|
|
+ const JTBHselectData = reactive([])
|
|
|
+ const getJtbhsubmit = () => {
|
|
|
+ gdzl_MachineList({address:CJMC.value}).then(response=>{
|
|
|
+ if(response.code==0){
|
|
|
+ if(response.data.length!=0 && !response.data.some(item => item.jtbh === formData.value.sczl_jtbh)){
|
|
|
+ JTBHselectData.splice(0, selectData.length, ...response.data)
|
|
|
+ GetjtbhVisible.value=true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ const JTBHSelectClick = (row, column, event) => {
|
|
|
+ const { jtbh, jtmc } = row
|
|
|
+ formdata3.value.sczl_jtbh=jtbh
|
|
|
+ GetjtbhVisible.value = false
|
|
|
+ }
|
|
|
+ //点击设备编号
|
|
|
+const gdzl_MachineList_address = reactive({
|
|
|
+ data: []
|
|
|
+});
|
|
|
+
|
|
|
+//选择机台编号确定工艺以及开工时间
|
|
|
+const jtbh_change = () => {
|
|
|
+ //弹出选择
|
|
|
+ productionDedh({sczl_jtbh:formdata3.value.sczl_jtbh}).then(response=>{
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data){
|
|
|
+ formdata3.value.dedh=response.data.sys_bh
|
|
|
+ }else{
|
|
|
+ formdata3.value.dedh=''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//获取拉料人员
|
|
|
+const GetLl = (falg) => {
|
|
|
+ let llyg = {
|
|
|
+ '自备':'自备',
|
|
|
+ '李有文':1027,
|
|
|
+ '张杭强':1024,
|
|
|
+ '朱喜文':2022,
|
|
|
+ '刘旭青':2021,
|
|
|
+ '刘芳民':2020,
|
|
|
+ '李当林':2019,
|
|
|
+ '王赞文':2018,
|
|
|
+ }
|
|
|
+ switch(falg){
|
|
|
+ case 'create':
|
|
|
+ if(formdata3.value.拉料['编号']){
|
|
|
+ formdata3.value.拉料['姓名'] = formdata3.value.拉料['编号']
|
|
|
+ formdata3.value.拉料['编号'] = llyg[formdata3.value.拉料['姓名']]
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case create:
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+ 其他机台组员及分配比例
|
|
|
+*/
|
|
|
+const blModellist = ref(false)
|
|
|
+const employeeDatalist = ref('')
|
|
|
+const Special = ref('')
|
|
|
+const GetYg = async (event,key) => {
|
|
|
+ Special.value = key
|
|
|
+ let bzyg=''
|
|
|
+ bzyg=`组员${key}`
|
|
|
+ let bzxm=''
|
|
|
+ bzxm=`组员${key}`
|
|
|
+ const response = await getYg({sczl_bh:formdata3.value[bzyg]['编号']});
|
|
|
+ formdata3.value[bzyg]['编号'] = ""
|
|
|
+ if (response.code === 0) {
|
|
|
+ if(response.data.length === 1){
|
|
|
+ formdata3.value[bzxm]['姓名'] = response.data[0].ygxm
|
|
|
+ formdata3.value[bzyg]['编号'] = response.data[0].员工编号
|
|
|
+ }else{
|
|
|
+ blModellist.value = true;
|
|
|
+ employeeDatalist.value = response.data // 假设响应数据是数组
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const clickeds = ref(false);
|
|
|
+const currentIndexs = ref(0);
|
|
|
+const tableBZRRs = ref();
|
|
|
+// 模拟点击某一行
|
|
|
+const setCurrents = (row) => {
|
|
|
+ setTimeout(() => {
|
|
|
+ tableBZRRs .value?.setCurrentRow(row); // 高亮选中当前行
|
|
|
+ const { 员工编号, ygxm } = row;
|
|
|
+ console.log("选中行数据:", row);
|
|
|
+ });
|
|
|
+};
|
|
|
+// 键盘事件处理逻辑
|
|
|
+const selectBZRRs = (event) => {
|
|
|
+ if (event.keyCode === 40) {
|
|
|
+ // 向下箭头
|
|
|
+ if (currentIndexs.value < employeeDatalist.value.length - 1) {
|
|
|
+ currentIndexs.value++;
|
|
|
+ } else {
|
|
|
+ // 如果是最后一行,回到第一行
|
|
|
+ currentIndexs.value = 0;
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 38) {
|
|
|
+ // 向上箭头
|
|
|
+ if (currentIndexs.value > 0) {
|
|
|
+ currentIndexs.value--;
|
|
|
+ } else {
|
|
|
+ // 如果是第一行,跳到最后一行
|
|
|
+ currentIndexs.value = employeeDatalist.value.length - 1;
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 13) {
|
|
|
+ // 回车键,模拟触发点击事件
|
|
|
+ const row = employeeDatalist.value[currentIndexs.value];
|
|
|
+ tablebllickHandlerlist(row); // 手动调用行点击事件
|
|
|
+ }
|
|
|
+ setCurrents(employeeDatalist.value[currentIndexs.value]); // 高亮当前选中的行
|
|
|
+};
|
|
|
+
|
|
|
+// 表格行点击事件处理
|
|
|
+const tablebllickHandlerlist = async (row, column, event) => {
|
|
|
+ if (clickeds.value) {
|
|
|
+ // 如果已经点击过一次,则不再执行操作
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let nextIndex = 1;
|
|
|
+ // 检查每个组员是否有空位
|
|
|
+ while (formdata3.value[`组员${nextIndex}`]['编号'] !== '' && formdata3.value[`组员${nextIndex}`]['姓名'] !== '') {
|
|
|
+ nextIndex++;
|
|
|
+ if (nextIndex > 10) {
|
|
|
+ // 如果所有组员字段已填满,则不做任何操作,直接退出
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 在填充数据之前,检查当前组员编号是否包含字母,如果包含字母,则清空该组员的编号和姓名
|
|
|
+ const current编号 = formdata3.value[`组员${nextIndex}`]['编号'];
|
|
|
+ if (/[a-zA-Z]/.test(current编号)) { // 判断编号中是否包含字母
|
|
|
+ formdata3.value[`组员${nextIndex}`]['编号'] = "";
|
|
|
+ formdata3.value[`组员${nextIndex}`]['姓名'] = "";
|
|
|
+ console.log(`组员${nextIndex}的编号包含字母,已清空编号和姓名`);
|
|
|
+ }
|
|
|
+ // 如果 Special 的值是 10,则直接填充到组员10
|
|
|
+ if (Special.value === "10") {
|
|
|
+ formdata3.value.组员10['编号'] = row.员工编号;
|
|
|
+ formdata3.value.组员10['姓名'] = row.ygxm;
|
|
|
+ blModellist.value = false;
|
|
|
+ clickedlist.value = true;
|
|
|
+ } else {
|
|
|
+ // 否则填充到下一个空的组员位置
|
|
|
+ formdata3.value[`组员${nextIndex}`]['编号'] = row.员工编号;
|
|
|
+ formdata3.value[`组员${nextIndex}`]['姓名'] = row.ygxm;
|
|
|
+ blModellist.value = false;
|
|
|
+ clickedlist.value = true;
|
|
|
+ }
|
|
|
+ // 设置点击锁,防止短时间内重复点击
|
|
|
+ setTimeout(() => {
|
|
|
+ clickedlist.value = false;
|
|
|
+ }, 300); // 300毫秒内再次点击不会触发事件,可以根据需要调整这个延迟时间
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+ 除JP定额代号弹窗
|
|
|
+*/
|
|
|
+const FJPGetDedhtreeData = reactive([]);
|
|
|
+const FJPGetDedhVisible = ref(false);
|
|
|
+const FJPtable_fplb = ref(null); // el-tree 的 ref
|
|
|
+const FJPgetDedhsubmit = async () => {
|
|
|
+try {
|
|
|
+ const response = await productionDedh({
|
|
|
+ sczl_jtbh: formdata3.value.sczl_jtbh, // 请求参数
|
|
|
+ });
|
|
|
+
|
|
|
+ if (response.code === 0) {
|
|
|
+ const data = response.data;
|
|
|
+
|
|
|
+ // 处理单条记录的情况,直接赋值
|
|
|
+ if (!Array.isArray(data) && !data.bh_mc) {
|
|
|
+ formdata3.value.dedh = data.sys_bh;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 定义递归函数,用于构造树形结构
|
|
|
+ const buildTree = (node) => {
|
|
|
+ const treeNode = {
|
|
|
+ id: node.sys_bh,
|
|
|
+ label: node.sys_bh + (node.sys_mc ? `【${node.sys_mc}】` : ""), // 显示内容
|
|
|
+ children: [],
|
|
|
+ key: node.Key_ || node.sys_bh, // 保留 key 属性,用于操作
|
|
|
+ };
|
|
|
+
|
|
|
+ // 如果有子节点,递归处理
|
|
|
+ if (node.bh_mc && Array.isArray(node.bh_mc)) {
|
|
|
+ treeNode.children = node.bh_mc.map((childNode) => buildTree(childNode));
|
|
|
+ }
|
|
|
+
|
|
|
+ return treeNode;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 处理数组数据结构,生成树形结构并展示弹窗
|
|
|
+ if (Array.isArray(data)) {
|
|
|
+ FJPGetDedhtreeData.splice(
|
|
|
+ 0,
|
|
|
+ FJPGetDedhtreeData.length,
|
|
|
+ ...data.map((item) => ({
|
|
|
+ id: item.sys_bh,
|
|
|
+ label: item.sys_bh,
|
|
|
+ children: [],
|
|
|
+ key: item.sys_bh,
|
|
|
+ }))
|
|
|
+ );
|
|
|
+ FJPGetDedhVisible.value = true; // 展示弹窗
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理嵌套的树形结构数据
|
|
|
+ if (!Array.isArray(data) && data.bh_mc) {
|
|
|
+ FJPGetDedhtreeData.splice(0, FJPGetDedhtreeData.length, buildTree(data));
|
|
|
+ FJPGetDedhVisible.value = true; // 展示弹窗
|
|
|
+ }
|
|
|
+
|
|
|
+ // 使用 nextTick 确保树形组件渲染完成后执行操作
|
|
|
+ nextTick(() => {
|
|
|
+ const tree = FJPtable_fplb.value; // 获取树形组件实例
|
|
|
+ if (tree) {
|
|
|
+ const firstNode = tree.getNode(0); // 获取树形的第一个节点
|
|
|
+ if (firstNode) {
|
|
|
+ firstNode.el.focus(); // 聚焦到第一个节点
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error("获取数据失败:", error);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+//键盘事件
|
|
|
+const FJPhandleTreeKeydown = (event) => {
|
|
|
+ const tree = FJPtable_fplb.value; // 获取树实例
|
|
|
+ if (!tree) {
|
|
|
+ console.error("树组件未加载");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const focusedElement = document.activeElement;
|
|
|
+ const focusedNodeId = focusedElement?.getAttribute("data-key"); // 获取 DOM 的 data-key 属性
|
|
|
+
|
|
|
+ if (event.keyCode === 13 && focusedNodeId) { // 判断是否是回车键
|
|
|
+ tree.setCurrentKey(focusedNodeId); // 设置当前节点为选中
|
|
|
+ tree.$nextTick(() => {
|
|
|
+ const currentNode = tree.getCurrentNode(); // 获取当前选中的节点
|
|
|
+ if (!currentNode) {
|
|
|
+ console.warn("没有选中的节点");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 清除上一次的选中状态
|
|
|
+ FJPclearPreviousSelection(tree);
|
|
|
+ // 收起所有其他节点
|
|
|
+ Object.keys(tree.store.nodesMap).forEach((key) => {
|
|
|
+ tree.store.nodesMap[key].expanded = false; // 收起所有节点
|
|
|
+ });
|
|
|
+
|
|
|
+ // 展开当前节点
|
|
|
+ tree.store.nodesMap[currentNode.id].expanded = true;
|
|
|
+
|
|
|
+ // 如果当前节点有子节点,选中第一个子节点
|
|
|
+ if (currentNode.children && currentNode.children.length > 0) {
|
|
|
+ const firstChild = currentNode.children[0];
|
|
|
+ if (firstChild) {
|
|
|
+ const firstChildKey = firstChild.id.toString();
|
|
|
+ tree.setCurrentKey(firstChildKey); // 设置第一个子节点为选中
|
|
|
+ setTimeout(() => {
|
|
|
+ const firstChildDom = tree.$el.querySelector(`[data-key="${firstChildKey}"]`);
|
|
|
+ if (firstChildDom) {
|
|
|
+ firstChildDom.focus();
|
|
|
+ firstChildDom.scrollIntoView({ block: "nearest" });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("当前子节点:", currentNode.label);
|
|
|
+ // 如果节点没有子节点,打印节点名称
|
|
|
+ formdata3.value.dedh = currentNode.label.split("【")[0];
|
|
|
+ FJPGetDedhVisible.value = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (event.keyCode === 38 || event.keyCode === 40) { // 上下箭头键
|
|
|
+ const currentNode = tree.getCurrentNode();
|
|
|
+ if (currentNode) {
|
|
|
+ const currentNodeDom = tree.$el.querySelector(`[data-key="${currentNode.id}"]`);
|
|
|
+ if (currentNodeDom) {
|
|
|
+ currentNodeDom.focus();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 清除之前的选中状态
|
|
|
+const FJPclearPreviousSelection = (tree) => {
|
|
|
+ const selectedNodes = tree.getCheckedNodes();
|
|
|
+ selectedNodes.forEach(node => {
|
|
|
+ tree.setChecked(node, false);
|
|
|
+ });
|
|
|
+ tree.setCurrentKey(null);
|
|
|
+};
|
|
|
+
|
|
|
+// 弹出框键盘事件
|
|
|
+const FJPent = (event) => {
|
|
|
+ if (document.activeElement.id === "tableFplb") {
|
|
|
+ if (FJPtable_fplb.value) {
|
|
|
+ const tree = FJPtable_fplb.value?.$el;
|
|
|
+ if (tree) {
|
|
|
+ const node = tree.querySelector("[data-key]");
|
|
|
+ if (event.keyCode === 13) {
|
|
|
+ // GetDedhVisible.value = false;
|
|
|
+ }
|
|
|
+ if (node) {
|
|
|
+ node.scrollIntoView({ block: "nearest" }); // 确保节点可见
|
|
|
+ node.focus(); // 确保焦点正确
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+//点击事件
|
|
|
+const FJPhandleFplbClick = (nodeData, node, component) => {
|
|
|
+ //存放当前节点的nodeId
|
|
|
+ if (!nodeData.children || nodeData.children.length === 0) {
|
|
|
+ // 如果节点没有子节点,打印节点名称
|
|
|
+ formdata3.value.dedh= nodeData.label.split("【")[0];
|
|
|
+ FJPGetDedhVisible.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+/*
|
|
|
+ JP定额代号弹窗
|
|
|
+*/
|
|
|
+const GetDedhtreeData = reactive([]);
|
|
|
+const GetDedhVisible = ref(false);
|
|
|
+const table_fplb = ref(null); // el-tree 的 ref
|
|
|
+const getDedhsubmit = async () => {
|
|
|
+try {
|
|
|
+ const response = await JPproductionDedh({
|
|
|
+ sczl_jtbh: JPformdata['机器']
|
|
|
+ });
|
|
|
+ if (response.code === 0) {
|
|
|
+ const data = response.data;
|
|
|
+
|
|
|
+ // 处理单条记录的情况,直接赋值
|
|
|
+ if (!Array.isArray(data) && !data.bh_mc) {
|
|
|
+ JPformdata['定额代号'] = data.sys_bh;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 定义递归函数,用于构造树形结构
|
|
|
+ const buildTree = (node) => {
|
|
|
+ const treeNode = {
|
|
|
+ id: node.sys_bh,
|
|
|
+ label: node.sys_bh + (node.sys_mc ? `【${node.sys_mc}】` : ""), // 显示内容
|
|
|
+ children: [],
|
|
|
+ key: node.Key_ || node.sys_bh, // 保留 key 属性,用于操作
|
|
|
+ };
|
|
|
+
|
|
|
+ // 如果有子节点,递归处理
|
|
|
+ if (node.bh_mc && Array.isArray(node.bh_mc)) {
|
|
|
+ treeNode.children = node.bh_mc.map((childNode) => buildTree(childNode));
|
|
|
+ }
|
|
|
+
|
|
|
+ return treeNode;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 处理数组数据结构,生成树形结构并展示弹窗
|
|
|
+ if (Array.isArray(data)) {
|
|
|
+ GetDedhtreeData.splice(
|
|
|
+ 0,
|
|
|
+ GetDedhtreeData.length,
|
|
|
+ ...data.map((item) => ({
|
|
|
+ id: item.sys_bh,
|
|
|
+ label: item.sys_bh + (item.sys_mc ? `【${item.sys_mc}】` : ""),
|
|
|
+ children: [],
|
|
|
+ key: item.sys_bh,
|
|
|
+ }))
|
|
|
+ );
|
|
|
+ GetDedhVisible.value = true; // 展示弹窗
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理嵌套的树形结构数据
|
|
|
+ if (!Array.isArray(data) && data.bh_mc) {
|
|
|
+ GetDedhtreeData.splice(0, GetDedhtreeData.length, buildTree(data));
|
|
|
+ GetDedhVisible.value = true; // 展示弹窗
|
|
|
+ }
|
|
|
+
|
|
|
+ // 使用 nextTick 确保树形组件渲染完成后执行操作
|
|
|
+ nextTick(() => {
|
|
|
+ const tree = table_fplb.value; // 获取树形组件实例
|
|
|
+ if (tree) {
|
|
|
+ const firstNode = tree.getNode(0); // 获取树形的第一个节点
|
|
|
+ if (firstNode) {
|
|
|
+ firstNode.el.focus(); // 聚焦到第一个节点
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error("获取数据失败:", error);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+//键盘事件
|
|
|
+const handleTreeKeydown = (event) => {
|
|
|
+ const tree = table_fplb.value; // 获取树实例
|
|
|
+ if (!tree) {
|
|
|
+ console.error("树组件未加载");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const focusedElement = document.activeElement;
|
|
|
+ const focusedNodeId = focusedElement?.getAttribute("data-key"); // 获取 DOM 的 data-key 属性
|
|
|
+
|
|
|
+ if (event.keyCode === 13 && focusedNodeId) { // 判断是否是回车键
|
|
|
+ tree.setCurrentKey(focusedNodeId); // 设置当前节点为选中
|
|
|
+ tree.$nextTick(() => {
|
|
|
+ const currentNode = tree.getCurrentNode(); // 获取当前选中的节点
|
|
|
+ if (!currentNode) {
|
|
|
+ console.warn("没有选中的节点");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 清除上一次的选中状态
|
|
|
+ clearPreviousSelection(tree);
|
|
|
+ // 收起所有其他节点
|
|
|
+ Object.keys(tree.store.nodesMap).forEach((key) => {
|
|
|
+ tree.store.nodesMap[key].expanded = false; // 收起所有节点
|
|
|
+ });
|
|
|
+
|
|
|
+ // 展开当前节点
|
|
|
+ tree.store.nodesMap[currentNode.id].expanded = true;
|
|
|
+
|
|
|
+ // 如果当前节点有子节点,选中第一个子节点
|
|
|
+ if (currentNode.children && currentNode.children.length > 0) {
|
|
|
+ const firstChild = currentNode.children[0];
|
|
|
+ if (firstChild) {
|
|
|
+ const firstChildKey = firstChild.id.toString();
|
|
|
+ tree.setCurrentKey(firstChildKey); // 设置第一个子节点为选中
|
|
|
+ setTimeout(() => {
|
|
|
+ const firstChildDom = tree.$el.querySelector(`[data-key="${firstChildKey}"]`);
|
|
|
+ if (firstChildDom) {
|
|
|
+ firstChildDom.focus();
|
|
|
+ firstChildDom.scrollIntoView({ block: "nearest" });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("当前子节点:", currentNode.label);
|
|
|
+ // 如果节点没有子节点,打印节点名称
|
|
|
+ JPformdata['定额代号'] = currentNode.label.split("【")[0];
|
|
|
+ GetDedhVisible.value = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (event.keyCode === 38 || event.keyCode === 40) { // 上下箭头键
|
|
|
+ const currentNode = tree.getCurrentNode();
|
|
|
+ if (currentNode) {
|
|
|
+ const currentNodeDom = tree.$el.querySelector(`[data-key="${currentNode.id}"]`);
|
|
|
+ if (currentNodeDom) {
|
|
|
+ currentNodeDom.focus();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 清除之前的选中状态
|
|
|
+const clearPreviousSelection = (tree) => {
|
|
|
+ const selectedNodes = tree.getCheckedNodes();
|
|
|
+ selectedNodes.forEach(node => {
|
|
|
+ tree.setChecked(node, false);
|
|
|
+ });
|
|
|
+ tree.setCurrentKey(null);
|
|
|
+};
|
|
|
+
|
|
|
+// 弹出框键盘事件
|
|
|
+const ent = (event) => {
|
|
|
+ if (document.activeElement.id === "tableFplb") {
|
|
|
+ if (table_fplb.value) {
|
|
|
+ const tree = table_fplb.value?.$el;
|
|
|
+ if (tree) {
|
|
|
+ const node = tree.querySelector("[data-key]");
|
|
|
+ if (event.keyCode === 13) {
|
|
|
+ // GetDedhVisible.value = false;
|
|
|
+ }
|
|
|
+ if (node) {
|
|
|
+ node.scrollIntoView({ block: "nearest" }); // 确保节点可见
|
|
|
+ node.focus(); // 确保焦点正确
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+//点击事件
|
|
|
+const handleFplbClick = (nodeData, node, component) => {
|
|
|
+ //存放当前节点的nodeId
|
|
|
+ if (!nodeData.children || nodeData.children.length === 0) {
|
|
|
+ // 如果节点没有子节点,打印节点名称
|
|
|
+ JPformdata['定额代号']= nodeData.label.split("【")[0];
|
|
|
+ GetDedhVisible.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+/*
|
|
|
+ JP修改定额代号弹窗
|
|
|
+*/
|
|
|
+const GetDedhtreeDataedit = reactive([]);
|
|
|
+const GetDedhVisibleedit = ref(false);
|
|
|
+const table_fplbedit = ref(null); // el-tree 的 ref
|
|
|
+
|
|
|
+const getDedhsubmitedit = async () => {
|
|
|
+ try {
|
|
|
+ const response = await JPproductionDedh({
|
|
|
+ sczl_jtbh: JPformdataedit['机器']
|
|
|
+ });
|
|
|
+console.log(response)
|
|
|
+ if (response.code === 0) {
|
|
|
+ const data = response.data;
|
|
|
+
|
|
|
+ // 处理单条记录的情况,直接赋值
|
|
|
+ if (!Array.isArray(data) && !data.bh_mc) {
|
|
|
+ JPformdataedit['定额代号'] = data.sys_bh;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 定义递归函数,用于构造树形结构
|
|
|
+ const buildTree = (node) => {
|
|
|
+ const treeNode = {
|
|
|
+ id: node.sys_bh,
|
|
|
+ // label: node.sys_bh + (node.sys_mc ? `【${node.sys_mc}】` : ""), // 显示内容
|
|
|
+ label: node.sys_bh + (node.sys_mc ? `【${node.sys_mc}】` : ""),
|
|
|
+ children: [],
|
|
|
+ key: node.Key_ || node.sys_bh, // 保留 key 属性,用于操作
|
|
|
+ };
|
|
|
+
|
|
|
+ // 如果有子节点,递归处理
|
|
|
+ if (node.bh_mc && Array.isArray(node.bh_mc)) {
|
|
|
+ treeNode.children = node.bh_mc.map((childNode) => buildTree(childNode));
|
|
|
+ }
|
|
|
+
|
|
|
+ return treeNode;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 处理数组数据结构,生成树形结构并展示弹窗
|
|
|
+ if (Array.isArray(data)) {
|
|
|
+ GetDedhtreeDataedit.splice(
|
|
|
+ 0,
|
|
|
+ GetDedhtreeDataedit.length,
|
|
|
+ ...data.map((item) => ({
|
|
|
+ id: item.sys_bh,
|
|
|
+ // label: item.sys_bh,
|
|
|
+ label: item.sys_bh + (item.sys_mc ? `【${item.sys_mc}】` : ""),
|
|
|
+ children: [],
|
|
|
+ key: item.sys_bh,
|
|
|
+ }))
|
|
|
+ );
|
|
|
+ GetDedhVisibleedit.value = true; // 展示弹窗
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理嵌套的树形结构数据
|
|
|
+ if (!Array.isArray(data) && data.bh_mc) {
|
|
|
+ GetDedhtreeDataedit.splice(0, GetDedhtreeDataedit.length, buildTree(data));
|
|
|
+ GetDedhVisibleedit.value = true; // 展示弹窗
|
|
|
+ }
|
|
|
+
|
|
|
+ // 使用 nextTick 确保树形组件渲染完成后执行操作
|
|
|
+ nextTick(() => {
|
|
|
+ const tree = table_fplb.value; // 获取树形组件实例
|
|
|
+ if (tree) {
|
|
|
+ const firstNode = tree.getNode(0); // 获取树形的第一个节点
|
|
|
+ if (firstNode) {
|
|
|
+ firstNode.el.focus(); // 聚焦到第一个节点
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error("获取数据失败:", error);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+//键盘事件
|
|
|
+const handleTreeKeydownedit = (event) => {
|
|
|
+ const tree = table_fplbedit.value; // 获取树实例
|
|
|
+ if (!tree) {
|
|
|
+ console.error("树组件未加载");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ const focusedElement = document.activeElement;
|
|
|
+ const focusedNodeId = focusedElement?.getAttribute("data-key"); // 获取 DOM 的 data-key 属性
|
|
|
+
|
|
|
+ if (event.keyCode === 13 && focusedNodeId) { // 判断是否是回车键
|
|
|
+ tree.setCurrentKey(focusedNodeId); // 设置当前节点为选中
|
|
|
+ tree.$nextTick(() => {
|
|
|
+ const currentNode = tree.getCurrentNode(); // 获取当前选中的节点
|
|
|
+ if (!currentNode) {
|
|
|
+ console.warn("没有选中的节点");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 清除上一次的选中状态
|
|
|
+ clearPreviousSelectionedit(tree);
|
|
|
+ // 收起所有其他节点
|
|
|
+ Object.keys(tree.store.nodesMap).forEach((key) => {
|
|
|
+ tree.store.nodesMap[key].expanded = false; // 收起所有节点
|
|
|
+ });
|
|
|
+
|
|
|
+ // 展开当前节点
|
|
|
+ tree.store.nodesMap[currentNode.id].expanded = true;
|
|
|
+
|
|
|
+ // 如果当前节点有子节点,选中第一个子节点
|
|
|
+ if (currentNode.children && currentNode.children.length > 0) {
|
|
|
+ const firstChild = currentNode.children[0];
|
|
|
+ if (firstChild) {
|
|
|
+ const firstChildKey = firstChild.id.toString();
|
|
|
+ tree.setCurrentKey(firstChildKey); // 设置第一个子节点为选中
|
|
|
+ setTimeout(() => {
|
|
|
+ const firstChildDom = tree.$el.querySelector(`[data-key="${firstChildKey}"]`);
|
|
|
+ if (firstChildDom) {
|
|
|
+ firstChildDom.focus();
|
|
|
+ firstChildDom.scrollIntoView({ block: "nearest" });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("当前子节点:", currentNode.label);
|
|
|
+ // 如果节点没有子节点,打印节点名称
|
|
|
+ JPformdataedit['定额代号'] = currentNode.label.split("【")[0];
|
|
|
+ GetDedhVisibleedit.value = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (event.keyCode === 38 || event.keyCode === 40) { // 上下箭头键
|
|
|
+ const currentNode = tree.getCurrentNode();
|
|
|
+ if (currentNode) {
|
|
|
+ const currentNodeDom = tree.$el.querySelector(`[data-key="${currentNode.id}"]`);
|
|
|
+ if (currentNodeDom) {
|
|
|
+ currentNodeDom.focus();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 清除之前的选中状态
|
|
|
+const clearPreviousSelectionedit = (tree) => {
|
|
|
+ const selectedNodes = tree.getCheckedNodes();
|
|
|
+ selectedNodes.forEach(node => {
|
|
|
+ tree.setChecked(node, false);
|
|
|
+ });
|
|
|
+ tree.setCurrentKey(null);
|
|
|
+};
|
|
|
+
|
|
|
+// 弹出框键盘事件
|
|
|
+const entedit = (event) => {
|
|
|
+ if (document.activeElement.id === "tableFplb") {
|
|
|
+ if (table_fplbedit.value) {
|
|
|
+ const tree = table_fplbedit.value?.$el;
|
|
|
+ if (tree) {
|
|
|
+ const node = tree.querySelector("[data-key]");
|
|
|
+ if (event.keyCode === 13) {
|
|
|
+ // GetDedhVisibleedit.value = false;
|
|
|
+ }
|
|
|
+ if (node) {
|
|
|
+ node.scrollIntoView({ block: "nearest" }); // 确保节点可见
|
|
|
+ node.focus(); // 确保焦点正确
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+//点击事件
|
|
|
+const handleFplbClickedit = (nodeData, node, component) => {
|
|
|
+ //存放当前节点的nodeId
|
|
|
+ if (!nodeData.children || nodeData.children.length === 0) {
|
|
|
+ // 如果节点没有子节点,打印节点名称
|
|
|
+ JPformdataedit['定额代号']= nodeData.label.split("【")[0];
|
|
|
+ GetDedhVisibleedit.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+ //追加字体颜色和不可输入
|
|
|
+ const setColorReadonly = (id) => {
|
|
|
+ const newInput = document.getElementById(id)
|
|
|
+ newInput.style.color = 'red';
|
|
|
+ newInput.setAttribute('readonly', true);
|
|
|
+ }
|
|
|
+
|
|
|
+ //追加字体颜色和可输入
|
|
|
+ const unsetColorReadonly = (id) => {
|
|
|
+ const newInput = document.getElementById(id)
|
|
|
+ newInput.style.color = 'black';
|
|
|
+ newInput.removeAttribute('readonly');
|
|
|
+ }
|
|
|
+ //日报表修改弹窗确定
|
|
|
+ const chanliangenterDialog = async () => {
|
|
|
+ updateTotal()
|
|
|
+ const jt = formdata3.value.sczl_jtbh
|
|
|
+ // 定义一个变量来决定是否应该检查 fpsum2.value < 1
|
|
|
+const shouldCheckLessThanOne = !jt.includes('SY') && !jt.includes('PM');
|
|
|
+const relevantKeys2 = ['组员1', '组员2','组员3','组员4','组员5','组员6','组员7','组员8','组员9',];
|
|
|
+ const values = relevantKeys2.reduce((acc, key) => {
|
|
|
+ const value = parseFloat(formDatas.value[key], 10);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ acc.push(value); // 只有当 value 不是 NaN 时才添加到数组中
|
|
|
+ }
|
|
|
+ return acc;
|
|
|
+ }, []); // 初始化为空数组
|
|
|
+
|
|
|
+ const hasInvalidValue = values.some(value => value <= 0 || value > 1);
|
|
|
+ if (hasInvalidValue) {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "某人分配系数有误",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ console.log(1145,fpsum2)
|
|
|
+ if (fpsum2.value > 1) {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "分配系数相加不能大于1",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 只有当 shouldCheckLessThanOne 为 true 时才检查 fpsum2.value < 1
|
|
|
+ if (shouldCheckLessThanOne && fpsum2.value < 1) {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "分配系数相加不能小于1",
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //判断是否选择了拉料人员
|
|
|
+ if(formdata3.value.拉料['编号'] === ''){
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ message: "请选择拉料人员",
|
|
|
+ });
|
|
|
+ }else if (type2.value === 'update') {
|
|
|
+ SubmitDailyProduction()
|
|
|
+ } else if (type2.value === 'create') {
|
|
|
+ add()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //日报表新增
|
|
|
+ const add = async () => {
|
|
|
+ const rate1=(parseFloat(formdata3.value.组员1['比例'])).toFixed(5)
|
|
|
+ const rate2=(parseFloat(formdata3.value.组员2['比例'])).toFixed(5)
|
|
|
+ const rate3=(parseFloat(formdata3.value.组员3['比例'])).toFixed(5)
|
|
|
+ const rate4=(parseFloat(formdata3.value.组员4['比例'])).toFixed(5)
|
|
|
+ const rate5=(parseFloat(formdata3.value.组员5['比例'])).toFixed(5)
|
|
|
+ const rate6=(parseFloat(formdata3.value.组员6['比例'])).toFixed(5)
|
|
|
+ const rate7=(parseFloat(formdata3.value.组员7['比例'])).toFixed(5)
|
|
|
+ const rate8=(parseFloat(formdata3.value.组员8['比例'])).toFixed(5)
|
|
|
+ const rate9=(parseFloat(formdata3.value.组员9['比例'])).toFixed(5)
|
|
|
+ const rate10=(parseFloat(formdata3.value.组员10['比例'])).toFixed(5)
|
|
|
+ const restoredData = {
|
|
|
+ sczl_gdbh:formdata3.value.工单编号,
|
|
|
+ sczl_yjno:formdata3.value.yjno,
|
|
|
+ sczl_gxh:formdata3.value.gxh,
|
|
|
+ sczl_gxmc: formdata3.value.gxmc,
|
|
|
+ sczl_bzdh: formdata3.value.bzdh,
|
|
|
+ sczl_bh1: formdata3.value.组员1['编号'],
|
|
|
+ sczl_bh2: formdata3.value.组员2['编号'],
|
|
|
+ sczl_bh3: formdata3.value.组员3['编号'],
|
|
|
+ sczl_bh4: formdata3.value.组员4['编号'],
|
|
|
+ sczl_bh5: formdata3.value.组员5['编号'],
|
|
|
+ sczl_bh6: formdata3.value.组员6['编号'],
|
|
|
+ sczl_bh7: formdata3.value.组员7['编号'],
|
|
|
+ sczl_bh8: formdata3.value.组员8['编号'],
|
|
|
+ sczl_bh9: formdata3.value.组员9['编号'],
|
|
|
+ sczl_bh10: formdata3.value.组员10['编号'],
|
|
|
+ // sczl_bh98: formdata3.value.拉料['编号'],
|
|
|
+ sczl_bh98:formdata3.value.拉料['编号'] === '自备' ? '' : formdata3.value.拉料['编号'],
|
|
|
+ sczl_rate1: rate1,
|
|
|
+ sczl_rate2: rate2,
|
|
|
+ sczl_rate3: rate3,
|
|
|
+ sczl_rate4: rate4,
|
|
|
+ sczl_rate5: rate5,
|
|
|
+ sczl_rate6: rate6,
|
|
|
+ sczl_rate7: rate7,
|
|
|
+ sczl_rate8: rate8,
|
|
|
+ sczl_rate9: rate9,
|
|
|
+ sczl_rate10: rate10,
|
|
|
+ sczl_jtbh: formdata3.value.sczl_jtbh,
|
|
|
+ 开工时间:formdata3.value.starttime,
|
|
|
+ 码开始行:formdata3.value.码开始行,
|
|
|
+ 码结束行:formdata3.value.码结束行,
|
|
|
+ sys_id:sys_id,
|
|
|
+ sczl_装版工时:formdata3.value.装版工时,
|
|
|
+ sczl_打样工时:formdata3.value.打样工时,
|
|
|
+ sczl_异常类型1:formdata3.value.异常类型,
|
|
|
+ sczl_异常停机工时:formdata3.value.异常总工时,
|
|
|
+ sczl_异常工时1:formdata3.value.异常补时,
|
|
|
+ sczl_保养工时:formdata3.value.保养工时,
|
|
|
+ sczl_dedh:formdata3.value.dedh,
|
|
|
+ sczl_rq: formdata3.value.rq,
|
|
|
+ sczl_num: formdata3.value.num,
|
|
|
+ sczl_cl: formdata3.value.产量,
|
|
|
+ sczl_zcfp: formdata3.value.制程废品,
|
|
|
+ sczl_zccp: formdata3.value.制程次品,
|
|
|
+ sczl_前工序废: formdata3.value.前工序废,
|
|
|
+ sczl_来料少数: formdata3.value.来料异常,
|
|
|
+ sczl_ls: formdata3.value.联数,
|
|
|
+ sczl_ms: formdata3.value.色度数,
|
|
|
+ sczl_装版总工时: formdata3.value.装版总工时,
|
|
|
+ sczl_打样总工时: formdata3.value.打样总工时,
|
|
|
+ sczl_设备运行工时: formdata3.value.通电工时,
|
|
|
+ 码包: formdata3.value.码包,
|
|
|
+ 辅电表: formdata3.value.辅电表,
|
|
|
+ 主电表:formdata3.value.主电表,
|
|
|
+ }
|
|
|
+
|
|
|
+ if(restoredData.开工时间==undefined){
|
|
|
+ restoredData.开工时间 = '1900-01-01 00:00:00'
|
|
|
+ }
|
|
|
+ const response = await ChanliangAdd(restoredData);
|
|
|
+ if (response.code === 0) {
|
|
|
+ ElMessage({type: 'success',message: '成功'})
|
|
|
+ FacilitychanLiang()
|
|
|
+ FacilityDetail()
|
|
|
+ chanliangVisible.value=false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //日报表上传
|
|
|
+ const SubmitDailyProduction = async () => {
|
|
|
+ const rate1=(parseFloat(formdata3.value.组员1['比例'])).toFixed(5)
|
|
|
+ const rate2=(parseFloat(formdata3.value.组员2['比例'])).toFixed(5)
|
|
|
+ const rate3=(parseFloat(formdata3.value.组员3['比例'])).toFixed(5)
|
|
|
+ const rate4=(parseFloat(formdata3.value.组员4['比例'])).toFixed(5)
|
|
|
+ const rate5=(parseFloat(formdata3.value.组员5['比例'])).toFixed(5)
|
|
|
+ const rate6=(parseFloat(formdata3.value.组员6['比例'])).toFixed(5)
|
|
|
+ const rate7=(parseFloat(formdata3.value.组员7['比例'])).toFixed(5)
|
|
|
+ const rate8=(parseFloat(formdata3.value.组员8['比例'])).toFixed(5)
|
|
|
+ const rate9=(parseFloat(formdata3.value.组员9['比例'])).toFixed(5)
|
|
|
+ const rate10=(parseFloat(formdata3.value.组员10['比例'])).toFixed(5)
|
|
|
+ const restoredData = {
|
|
|
+ sczl_gdbh:formdata3.value.工单编号,
|
|
|
+ sczl_yjno:formdata3.value.yjno,
|
|
|
+ sczl_gxh:formdata3.value.gxh,
|
|
|
+ sczl_gxmc: formdata3.value.gxmc,
|
|
|
+ sczl_bzdh: formdata3.value.bzdh,
|
|
|
+ sczl_bh1: formdata3.value.组员1['编号'],
|
|
|
+ sczl_bh2: formdata3.value.组员2['编号'],
|
|
|
+ sczl_bh3: formdata3.value.组员3['编号'],
|
|
|
+ sczl_bh4: formdata3.value.组员4['编号'],
|
|
|
+ sczl_bh5: formdata3.value.组员5['编号'],
|
|
|
+ sczl_bh6: formdata3.value.组员6['编号'],
|
|
|
+ sczl_bh7: formdata3.value.组员7['编号'],
|
|
|
+ sczl_bh8: formdata3.value.组员8['编号'],
|
|
|
+ sczl_bh9: formdata3.value.组员9['编号'],
|
|
|
+ sczl_bh10: formdata3.value.组员10['编号'],
|
|
|
+ sczl_bh98:formdata3.value.拉料['编号'] === '自备' ? '' : formdata3.value.拉料['编号'],
|
|
|
+ sczl_rate1: rate1,
|
|
|
+ sczl_rate2: rate2,
|
|
|
+ sczl_rate3: rate3,
|
|
|
+ sczl_rate4: rate4,
|
|
|
+ sczl_rate5: rate5,
|
|
|
+ sczl_rate6: rate6,
|
|
|
+ sczl_rate7: rate7,
|
|
|
+ sczl_rate8: rate8,
|
|
|
+ sczl_rate9: rate9,
|
|
|
+ sczl_rate10: rate10,
|
|
|
+ sczl_jtbh: formdata3.value.sczl_jtbh,
|
|
|
+ 开工时间:"2024-03-12 08:30:00",
|
|
|
+ 码开始行:formdata3.value.码开始行,
|
|
|
+ 码结束行:formdata3.value.码结束行,
|
|
|
+ sys_id:sys_id,
|
|
|
+ sczl_装版工时:formdata3.value.装版工时,
|
|
|
+ sczl_打样工时:formdata3.value.打样工时,
|
|
|
+ sczl_异常类型1:formdata3.value.异常类型,
|
|
|
+ sczl_异常停机工时:formdata3.value.异常总工时,
|
|
|
+ sczl_异常工时1:formdata3.value.异常补时,
|
|
|
+ sczl_保养工时:formdata3.value.保养工时,
|
|
|
+ sczl_dedh:formdata3.value.dedh,
|
|
|
+ sczl_rq: formdata3.value.rq,
|
|
|
+ // sczl_rq: date,
|
|
|
+ sczl_num: formdata3.value.num,
|
|
|
+ // sczl_rq: formData3.value.sczl_rq,
|
|
|
+ sczl_cl: formdata3.value.产量,
|
|
|
+ sczl_zcfp: formdata3.value.制程废品,
|
|
|
+ sczl_zccp: formdata3.value.制程次品,
|
|
|
+ sczl_前工序废: formdata3.value.前工序废,
|
|
|
+ sczl_来料少数: formdata3.value.来料异常,
|
|
|
+ sczl_ls: formdata3.value.联数,
|
|
|
+ sczl_ms: formdata3.value.色度数,
|
|
|
+ sczl_装版总工时: formdata3.value.装版总工时,
|
|
|
+ sczl_打样总工时: formdata3.value.打样总工时,
|
|
|
+ sczl_设备运行工时: formdata3.value.通电工时,
|
|
|
+ 码包: formdata3.value.码包,
|
|
|
+ 辅电表: formdata3.value.辅电表,
|
|
|
+ 主电表:formdata3.value.主电表,
|
|
|
+ UniqId:uid.value
|
|
|
+ }
|
|
|
+ const response = await MachineChanliangDetailEdit(restoredData);
|
|
|
+ if (response.code === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ FacilitychanLiang()
|
|
|
+ FacilityDetail()
|
|
|
+ chanliangVisible.value=false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ selected.value='难度调整系数'
|
|
|
+
|
|
|
+ const SFType=ref(false)
|
|
|
+ const CPType=ref(false)
|
|
|
+ const SDType=ref(false)
|
|
|
+ const FPlxs=ref(false)
|
|
|
+if(selected.value==='难度调整系数'){
|
|
|
+ SFType.value=true
|
|
|
+ CPType.value=false
|
|
|
+ SDType.value=false
|
|
|
+ }else if(selected.value=== '凹印版距'){
|
|
|
+ CPType.value=true
|
|
|
+ SFType.value=false
|
|
|
+ SDType.value=false
|
|
|
+ }else if(selected.value=== '色度数'){
|
|
|
+ SDType.value=true
|
|
|
+ SFType.value=false
|
|
|
+ CPType.value=false
|
|
|
+ }
|
|
|
+ //选择变化
|
|
|
+ const agreeChange = async () => {
|
|
|
+ if(selected.value=== '难度调整系数'){
|
|
|
+ SFType.value=true
|
|
|
+ CPType.value=false
|
|
|
+ SDType.value=false
|
|
|
+ FPlxs.value=false
|
|
|
+ }else if(selected.value=== '凹印版距'){
|
|
|
+ CPType.value=true
|
|
|
+ SFType.value=false
|
|
|
+ SDType.value=false
|
|
|
+ FPlxs.value=false
|
|
|
+ }else if(selected.value=== '色度数'){
|
|
|
+ SDType.value=true
|
|
|
+ SFType.value=false
|
|
|
+ CPType.value=false
|
|
|
+ FPlxs.value=false
|
|
|
+ }else if(selected.value=== '废品率系数'){
|
|
|
+ FPlxs.value=true
|
|
|
+ SFType.value= false
|
|
|
+ SDType.value= false
|
|
|
+ CPType.value=false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+ //核算调整弹窗确定
|
|
|
+ const hesuanenterDialog = async () => {
|
|
|
+ if(selected.value==='难度调整系数'){
|
|
|
+ const res = await CoefficientEdit({id:Selection_ids.value,工价系数:hesuanValue.缩放系数 })
|
|
|
+ if(res.code===0){
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ hesuanVisible.value=false
|
|
|
+ FacilitychanLiang()
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '失败'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else if(selected.value=== '凹印版距'){
|
|
|
+ const res = await PrintingModeDataEdit({id:Selection_ids.value,plate:hesuanValue.产品板距,mode:hesuanValue.印刷方式 })
|
|
|
+ if(res.code===0){
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ hesuanVisible.value=false
|
|
|
+ FacilitychanLiang()
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '失败'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else if(selected.value=== '色度数'){
|
|
|
+ const res = await ChromaDataEdit({id:Selection_ids.value,ms:hesuanValue.色度数 })
|
|
|
+ if(res.code===0){
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ hesuanVisible.value=false
|
|
|
+ FacilitychanLiang()
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '失败'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else if(selected.value=== '废品率系数'){
|
|
|
+ const res = await RejectionEdit({id:Selection_ids.value,rejection:hesuanValue.废品率系数 })
|
|
|
+ if(res.code===0){
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '成功'
|
|
|
+ })
|
|
|
+ hesuanVisible.value=false
|
|
|
+ FacilitychanLiang()
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '失败'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 核算参数调整取消
|
|
|
+ const hesuanVisiblecloseDialog = async () => {
|
|
|
+ hesuanVisible.value = false
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const ent1 = async (event) => {
|
|
|
+ const inputs = document.getElementsByTagName('input');
|
|
|
+ const currentIndex = Array.from(inputs).indexOf(event.target);
|
|
|
+
|
|
|
+ if (event.keyCode === 13 || event.keyCode === 40) { // Enter 或向下箭头
|
|
|
+ if (event.target.id === '定额代号') {
|
|
|
+ if(formdata3.value.sczl_jtbh === ''){
|
|
|
+ ElMessage({
|
|
|
+ type: 'error',
|
|
|
+ message: '请先选择机台!'
|
|
|
+ })
|
|
|
+ //自动聚焦光标
|
|
|
+ setTimeout(() => {
|
|
|
+ const inputElement = document.getElementById('机器');
|
|
|
+ if (inputElement) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
+ }else{
|
|
|
+ FJPgetDedhsubmit();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let nextIndex = currentIndex + 1;
|
|
|
+ while (nextIndex < inputs.length) {
|
|
|
+ if (inputs[nextIndex].disabled) {
|
|
|
+ console.log("当前输入框为disabled,跳过");
|
|
|
+ nextIndex++; // 跳过disabled的输入框
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!inputs[nextIndex].readOnly) {
|
|
|
+ nextTick(() => {
|
|
|
+ inputs[nextIndex].focus();
|
|
|
+ inputs[nextIndex].select();
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ nextIndex++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (event.keyCode === 38) { // 向上箭头
|
|
|
+ for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // } else if (event.keyCode === 8) { // 删除箭头
|
|
|
+ // if (event.target.selectionStart === 0) {
|
|
|
+ // for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ // if (!inputs[i].readOnly) {
|
|
|
+ // nextTick(()=>{
|
|
|
+ // inputs[i].focus();
|
|
|
+ // inputs[i].setSelectionRange(0, 0);
|
|
|
+ // })
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ } else if (event.keyCode === 37) { // 向左箭头
|
|
|
+ if (event.target.selectionStart === 0) {
|
|
|
+ for (let i = currentIndex - 1; i >= 0; i--) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (event.keyCode === 39) { // 向右箭头
|
|
|
+ if (event.target.selectionStart === event.target.value.length) {
|
|
|
+ for (let i = currentIndex + 1; i < inputs.length; i++) {
|
|
|
+ if (!inputs[i].readOnly) {
|
|
|
+ nextTick(()=>{
|
|
|
+ inputs[i].focus();
|
|
|
+ inputs[i].select();
|
|
|
+ })
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+// =========== 修正核算参数 ===========
|
|
|
+const xzhstableColumns = ref(
|
|
|
+ [
|
|
|
+ { label: '方案', prop: '方案', width: '65' },
|
|
|
+ { label: '印件号及工序名称', prop: '印件号及工序名称', width: '300' },
|
|
|
+ { label: '参照设备', prop: '参照设备', width: '90' },
|
|
|
+ { label: '难度系数', prop: 'sxzhscsold_难度系数', width: '90' },
|
|
|
+ { label: '新难度系数', prop: '难度系数', width: '100' },
|
|
|
+ { label: '原损耗代号', prop: 'sxzhscsold_损耗代号', width: '150' },
|
|
|
+ { label: '基础损耗', prop: '基础损耗', width: '90' },
|
|
|
+ { label: '新损耗代号', prop: '损耗代号', width: '150' },
|
|
|
+ { label: '原印刷方式', prop: 'sxzhscsold_印刷方式', width: '150' },
|
|
|
+ { label: '原来版距', prop: 'sxzhscsold_版距', width: '100' },
|
|
|
+ { label: '新印刷方式', prop: '印刷方式', width: '100' },
|
|
|
+ { label: '新来版距', prop: '版距', width: '90' },
|
|
|
+ { label: '原计损色数', prop: 'sxzhscsold_计损色数', width: '100' },
|
|
|
+ { label: '新计损色数', prop: '计损色数', width: '100' },
|
|
|
+ { label: '原损耗系数', prop: 'sxzhscsold_损耗系数', width: '100' },
|
|
|
+ { label: '新损耗系数', prop: '损耗系数', width: '100' },
|
|
|
+ ]
|
|
|
+)
|
|
|
+const handleKeyDown = (event, x, y, prop) => {
|
|
|
+ const currentElement = document.getElementById(`input${x}${y}`);
|
|
|
+ if (currentElement === null && currentElement === undefined) return
|
|
|
+ let move = 0
|
|
|
+ switch (event.keyCode) {
|
|
|
+ case 13: // Enter
|
|
|
+ case 40: // 向下箭头
|
|
|
+ if (y < sxzhscstableData.value.length )
|
|
|
+ document.getElementById(`input${x}${y + 1}`).focus();
|
|
|
+ break;
|
|
|
+ case 38: // 向上箭头
|
|
|
+ if ( y > 0) {
|
|
|
+ document.getElementById(`input${x}${y - 1}`).focus();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 39: // 向左箭头
|
|
|
+ if ( x === 4) {
|
|
|
+ move = x + 3
|
|
|
+ } else if(x === 7){
|
|
|
+ move = x + 3
|
|
|
+ } else if( x === 10){
|
|
|
+ move = x + 1
|
|
|
+ }else if( x === 11){
|
|
|
+ move = x + 2
|
|
|
+ }else if( x === 13){
|
|
|
+ move = x + 2
|
|
|
+ }
|
|
|
+ document.getElementById(`input${move}${y}`).focus();
|
|
|
+ break;
|
|
|
+ case 37: // 向右箭头
|
|
|
+ if ( x === 15) {
|
|
|
+ move = x - 2
|
|
|
+ } else if (x=== 13) {
|
|
|
+ move = x - 2
|
|
|
+ }else if (x=== 11) {
|
|
|
+ move = x - 1
|
|
|
+ }else if (x=== 10) {
|
|
|
+ move = x - 3
|
|
|
+ }else if (x=== 7) {
|
|
|
+ move = x - 3
|
|
|
+ }
|
|
|
+ document.getElementById(`input${move}${y}`).focus();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+}
|
|
|
+const xzhscslist = ref(false);
|
|
|
+const xzhscsformData = reactive({
|
|
|
+ gdbh: '',
|
|
|
+ cpdh: '',
|
|
|
+ gdmc: '',
|
|
|
+ yjdh:'',
|
|
|
+ yjmc:'',
|
|
|
+});
|
|
|
+const sxzhscstableData = ref([]);
|
|
|
+//修正核算参数按钮
|
|
|
+const onxzhscsclick = () => {
|
|
|
+ if(_gdbhlist.value == null || _gdbhlist.value == ''){
|
|
|
+ xzhscslist.value = false;
|
|
|
+ ElMessage({type: 'warning',message: '请选择 设备作业清单工单后,再操作此功能' })
|
|
|
+ }else{
|
|
|
+ xzhscsformData['gdbh'] = _gdbhlist.value;
|
|
|
+ _AccountingParameterdata();
|
|
|
+ xzhscslist.value = true;
|
|
|
+ }
|
|
|
+};
|
|
|
+//修正核算参数回车
|
|
|
+const xzhscsgetProductValue = () => {
|
|
|
+ _AccountingParameterdata()
|
|
|
+};
|
|
|
+// 修正工单核算参数表格数据
|
|
|
+const _AccountingParameterdata = async ()=>{
|
|
|
+ const ProductNamedata = await ProductNameData({workOrder:xzhscsformData['gdbh']});
|
|
|
+ if(ProductNamedata.code===0){
|
|
|
+ xzhscsformData['cpdh']=ProductNamedata.data.产品代号
|
|
|
+ xzhscsformData['gdmc']=ProductNamedata.data.产品名称
|
|
|
+ xzhscsformData['yjdh']=ProductNamedata.data.印件代号
|
|
|
+ xzhscsformData['yjmc']=ProductNamedata.data.印件名称
|
|
|
+ }
|
|
|
+
|
|
|
+ let workOrder = xzhscsformData['gdbh'];
|
|
|
+ try {
|
|
|
+ const AccountingParameterdata = await AccountingParameter({workOrder:workOrder});
|
|
|
+ sxzhscstableData.value = AccountingParameterdata.data;
|
|
|
+ const formattedData = AccountingParameterdata.data.map(item=>{
|
|
|
+ item.sxzhscsold_难度系数 = item.难度系数;
|
|
|
+ item.sxzhscsold_损耗代号 = item.损耗代号;
|
|
|
+ item.sxzhscsold_印刷方式 = item.印刷方式;
|
|
|
+ item.sxzhscsold_版距 = item.版距;
|
|
|
+ item.sxzhscsold_计损色数 = item.计损色数;
|
|
|
+ item.sxzhscsold_损耗系数 = item.损耗系数;
|
|
|
+ return item
|
|
|
+ });
|
|
|
+ } catch (error) {
|
|
|
+ console.error(error);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//修正核算参数更新
|
|
|
+const xzhscsConfirm = async () => {
|
|
|
+ const firstCharValid = sxzhscstableData.value.map(item => {
|
|
|
+ const firstChar = item["损耗代号"] ? item["损耗代号"].charAt(0) : '';
|
|
|
+ return firstChar === '0' || firstChar === '';
|
|
|
+ });
|
|
|
+ if (sxzhscstableData.value) {
|
|
|
+ const formattedData = sxzhscstableData.value.map(item => {
|
|
|
+ return {
|
|
|
+ Uniqid: parseInt(item.UniqId),
|
|
|
+ chromatic: parseFloat(item.计损色数) ?? '',
|
|
|
+ difficulty: parseFloat(item.难度系数) ?? '',
|
|
|
+ loss: item.损耗代号 ??'',
|
|
|
+ plate: parseInt(item.版距) ?? '',
|
|
|
+ printMode: item.印刷方式 ?? '',
|
|
|
+ wastage: parseFloat(item.损耗系数),
|
|
|
+ }
|
|
|
+ });
|
|
|
+ const AccountingParameterEditdata = await AccountingParameterEdit(formattedData);
|
|
|
+ if (AccountingParameterEditdata.code === 0) {
|
|
|
+ xzhscslist.value = false;
|
|
|
+ ElMessage({ type: 'success', message: '更新成功' });
|
|
|
+ sxzhscstableData.value =''
|
|
|
+ xzhscsformData=''
|
|
|
+ } else {
|
|
|
+ ElMessage({ type: 'error', message: '更新失败' });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.error("数据错误");
|
|
|
+ }
|
|
|
+};
|
|
|
+//修正核算参数退出
|
|
|
+const sxzhscsCancel = () => {
|
|
|
+ xzhscslist.value = false;
|
|
|
+ sxzhscstableData.value =''
|
|
|
+ xzhscsformData=''
|
|
|
+};
|
|
|
+//修正核算参数颜色
|
|
|
+const sxzhscsCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
+ if (column.label === '新难度系数' || column.label === '新损耗代号' || column.label === '新印刷方式' || column.label === '新来版距' || column.label === '新计损色数' || column.label === '新损耗系数') {
|
|
|
+ return 'background-plan-usage-low';
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//=========工序产量核查===========
|
|
|
+const gd_gxclhclist = ref(false);
|
|
|
+const gxclhc_Data = ref([]);
|
|
|
+const gxclhc_Columns = ref(
|
|
|
+ [
|
|
|
+ { label: '印件及工序名称', prop: 'concatenatedData', width: '380' },
|
|
|
+ // { label: '印件', prop: 'Gy0_yjno', width: '130' },
|
|
|
+ // { label: '工序', prop: 'Gy0_gxh', width: '130' },
|
|
|
+ // { label: '名称', prop: 'Gy0_gxmc', width: '130' },
|
|
|
+ { label: '工序计划产量', prop: 'Gy0_计划接货数', width: '120' },
|
|
|
+ { label: '联数', prop: 'Gy0_ls', width: '70' },
|
|
|
+ { label: '折算车头产量', prop: '折算车头产量', width: '120' },
|
|
|
+ { label: '实际上报产量', prop: 'sczl_cl', width: '120' },
|
|
|
+ { label: '制程废品', prop: 'sczl_zcfp', width: '120' },
|
|
|
+ { label: '制程废品率', prop: '制程废品率', width: '120' },
|
|
|
+ { label: '来料异常', prop: '来料异常', width: '90' },
|
|
|
+ { label: '流程单数', prop: 'process_num', width: '90' },
|
|
|
+ { label: '当前设备', prop: 'Gy0_sbbh', width: '120' },
|
|
|
+ { label: '工序状态', prop: 'PD_WG', width: '90'},
|
|
|
+ { label: '首板生产日期', prop: 'sczl_rq', width: '160' },
|
|
|
+ ]
|
|
|
+)
|
|
|
+const gxclhcformData = reactive({
|
|
|
+ gdbh: '',
|
|
|
+ gdmc: '',
|
|
|
+ yjno: '',
|
|
|
+});
|
|
|
+const gdwhformData = reactive({
|
|
|
+ // 下拉框选项数据
|
|
|
+ yinjian: [],
|
|
|
+ // 设置默认值
|
|
|
+ yjno: '',
|
|
|
+});
|
|
|
+const inputCpmc = ref('')
|
|
|
+// 工序产量核查按钮
|
|
|
+const gd_gxclhconClick = async () => {
|
|
|
+ if(_rclsb_gdbh.value === '' || _rclsb_gdbh.value === null){
|
|
|
+ ElMessage({type: 'warning',message: '请选择具体的工单,在进行操作'})
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ gxclhcformData['gdbh'] = _rclsb_gdbh.value;
|
|
|
+ gxclhcformData['yjno'] = _rclsb_yjno.value;
|
|
|
+ gd_gxclhclist.value = true;
|
|
|
+ const response = await PrintDetailList ({workOrder:_Gd_gdbh.value});
|
|
|
+ gdwhformData.yjno = response.data[0].no
|
|
|
+ inputCpmc.value = response.data[0].name
|
|
|
+ if (response.code === 0) {
|
|
|
+ const noFields = response.data.map(item => item.no);
|
|
|
+ gdwhformData.yinjian = noFields
|
|
|
+ } else {
|
|
|
+ console.error('查询失败:', response.msg);
|
|
|
+ }
|
|
|
+ _getOrderProcessCount();
|
|
|
+};
|
|
|
+
|
|
|
+//点击印件下拉框
|
|
|
+const ongdwhfanclick = async() => {
|
|
|
+ _PrintDetailList();
|
|
|
+ _getOrderProcessCount();
|
|
|
+}
|
|
|
+
|
|
|
+//工序产量核查回车
|
|
|
+const gxclhcProductValue = async () => {
|
|
|
+ const response = await PrintDetailList ({workOrder:gxclhcformData['gdbh']});
|
|
|
+ gdwhformData.yjno = response.data[0].no
|
|
|
+ inputCpmc.value = response.data[0].name
|
|
|
+ if (response.code === 0) {
|
|
|
+ const noFields = response.data.map(item => item.no);
|
|
|
+ gdwhformData.yinjian = noFields
|
|
|
+ } else {
|
|
|
+ console.error('查询失败:', response.msg);
|
|
|
+ }
|
|
|
+ _getOrderProcessCount();
|
|
|
+ _PrintDetailList();
|
|
|
+}
|
|
|
+//工序产量核查退出
|
|
|
+const gxclhcCancel = async () => {
|
|
|
+ gd_gxclhclist.value = false;
|
|
|
+};
|
|
|
+
|
|
|
+//印件编号获取方法接口
|
|
|
+const _PrintDetailList = async () => {
|
|
|
+ const order = gxclhcformData['gdbh'];
|
|
|
+ const response = await PrintDetailList ({workOrder:order});
|
|
|
+ const matchingItem = response.data.find(item => item.no === gdwhformData.yjno);
|
|
|
+ if (matchingItem) {
|
|
|
+ inputCpmc.value = matchingItem.name;
|
|
|
+ } else {
|
|
|
+ console.log(`No matching item found for no: ${gdwhformData.yjno}`);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//工序产量核查方法接口
|
|
|
+const _getOrderProcessCount = async () => {
|
|
|
+ const order = gxclhcformData['gdbh'];
|
|
|
+ const yjno = gdwhformData.yjno;
|
|
|
+ const getOrderProcessCount_list = await getOrderProcessCount({order:order,yjno:yjno});
|
|
|
+ const concatenatedData = getOrderProcessCount_list.data.map(item => {
|
|
|
+ // 优化后的代码,使用模板字符串连接字段值并在单个数字前添加零
|
|
|
+ const formattedYjno = item.Gy0_yjno.length === 1 ? `0${item.Gy0_yjno}` : item.Gy0_yjno;
|
|
|
+ const formattedGxh = item.Gy0_gxh.length === 1 ? `0${item.Gy0_gxh}` : item.Gy0_gxh;
|
|
|
+ const concatenatedValue = `${formattedYjno}-${formattedGxh} ${item.Gy0_gxmc} 【${item.Add_gxmc} 】`;
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ concatenatedData: concatenatedValue, // 使用新属性名
|
|
|
+ };
|
|
|
+ });
|
|
|
+ gxclhc_Data.value = concatenatedData;
|
|
|
+};
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// 获取需要的字典 可能为空 按需保留
|
|
|
+const setOptions = async () =>{
|
|
|
+}
|
|
|
+
|
|
|
+// 获取需要的字典 可能为空 按需保留
|
|
|
+setOptions()
|
|
|
+
|
|
|
+// 多选数据
|
|
|
+const multipleSelection = reactive([])
|
|
|
+// 多选
|
|
|
+const handleSelectionChange = (val) => {
|
|
|
+ multipleSelection.value= val
|
|
|
+}
|
|
|
+
|
|
|
+// 删除行
|
|
|
+const deleteRow = (row) => {
|
|
|
+ ElMessageBox.confirm('确定要删除吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ deleteCompanyFunc(row)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+// 批量删除控制标记
|
|
|
+const deleteVisible = ref(false)
|
|
|
+
|
|
|
+// 多选删除
|
|
|
+const onDelete = async() => {
|
|
|
+ const ids = []
|
|
|
+ if (multipleSelection.value.length === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'warning',
|
|
|
+ message: '请选择要删除的数据'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ multipleSelection.value &&
|
|
|
+ multipleSelection.value.map(item => {
|
|
|
+ ids.push(item.ID)
|
|
|
+ })
|
|
|
+ const res = await deleteCompanyByIds({ ids })
|
|
|
+ if (res.code === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功'
|
|
|
+ })
|
|
|
+ if (tableData.value.length === ids.length && page.value > 1) {
|
|
|
+ page.value--
|
|
|
+ }
|
|
|
+ deleteVisible.value = false
|
|
|
+ getTableData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// 行为控制标记(弹窗内部需要增还是改)
|
|
|
+const type = ref('')
|
|
|
+
|
|
|
+// 更新行
|
|
|
+const updateCompanyFunc = async(row) => {
|
|
|
+ const res = await findCompany({ ID: row.ID })
|
|
|
+ type.value = 'update'
|
|
|
+ if (res.code === 0) {
|
|
|
+ formData.value = res.data.recompany
|
|
|
+ dialogFormVisible.value = true
|
|
|
+ }
|
|
|
+}
|
|
|
+const cpcode=ref('')
|
|
|
+const finishedcode=ref()
|
|
|
+const _gdbhlist = ref('')
|
|
|
+const lcd_Gd_gdbh = ref(null)
|
|
|
+const lcd_Gd_yjno = ref(null)
|
|
|
+const yjupdateCompanyFunc = async(row) => {
|
|
|
+ lcd_Gd_gdbh.value = row['工单编号|质量信息'].replace(/\|$/, '')
|
|
|
+ lcd_Gd_yjno.value = row['印件号'].slice(0, 2)
|
|
|
+ const Procedurelist = await Procedure({ Gd_gdbh: row['工单编号|质量信息'].replace(/\|$/, '') })
|
|
|
+ selectData.value = Procedurelist.data;
|
|
|
+ cpcode.value=row.产品代号
|
|
|
+ formData.value.工单编号 = row['工单编号|质量信息'].replace(/\|$/, '')
|
|
|
+ formData.value.印件号 = row['印件号'].slice(0, 2)
|
|
|
+ formData.value.productCode = row.产品代号
|
|
|
+ formData.value.产品名称 = row.产品名称
|
|
|
+ _gdbhlist.value = row['工单编号|质量信息'].split('|')[0]
|
|
|
+ finishedcode.value=row.产品代号
|
|
|
+}
|
|
|
+
|
|
|
+// 删除行
|
|
|
+const deleteCompanyFunc = async (row) => {
|
|
|
+ const res = await deleteCompany({ ID: row.ID })
|
|
|
+ if (res.code === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '删除成功'
|
|
|
+ })
|
|
|
+ if (tableData.value.length === 1 && page.value > 1) {
|
|
|
+ page.value--
|
|
|
+ }
|
|
|
+ getTableData()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 弹窗控制标记
|
|
|
+const dialogFormVisible = ref(false)
|
|
|
+const dianjianVisible = ref(false)
|
|
|
+const yinbanVisible = ref(false)
|
|
|
+// 查看详情控制标记
|
|
|
+const detailShow = ref(false)
|
|
|
+const bzData = reactive([])
|
|
|
+// 打开详情弹窗
|
|
|
+const openDetailShow = () => {
|
|
|
+ detailShow.value = true
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 打开详情
|
|
|
+const getDetails = async (row) => {
|
|
|
+ // 打开弹窗
|
|
|
+ const res = await findCompany({ ID: row.ID })
|
|
|
+ if (res.code === 0) {
|
|
|
+ formData.value = res.data.recompany
|
|
|
+ openDetailShow()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 关闭详情弹窗
|
|
|
+const closeDetailShow = () => {
|
|
|
+ detailShow.value = false
|
|
|
+}
|
|
|
+const detailShow_rcl = ref(false)
|
|
|
+// 关闭详情弹窗
|
|
|
+const closeDetailShow_rcl = () => {
|
|
|
+ detailShow_rcl.value = false
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 打开弹窗
|
|
|
+const openDialog = () => {
|
|
|
+ FacilityInspect()
|
|
|
+ FacilitychanLiang()
|
|
|
+ dialogFormVisible.value = true
|
|
|
+}
|
|
|
+let drzcData=[]
|
|
|
+let columnNames=[]
|
|
|
+//当日制程检验记录
|
|
|
+const FacilityInspect = async () => {
|
|
|
+ const response = await facilityInspect({machine:JTMC,date:date});
|
|
|
+ if(response.code==0){
|
|
|
+ columnNames = response.data.InspectionTime;
|
|
|
+ for (const key in response.data.row[0]) {
|
|
|
+ if (key !== 'InspectionTime') {
|
|
|
+ const item = response.data.row[0][key];
|
|
|
+ const rowData = {
|
|
|
+ '工单编号': item['工单编号'],
|
|
|
+ '印件号': item['印件号'],
|
|
|
+ '工序名称': item['工序名称'],
|
|
|
+ '检验项目': item['检验项目']
|
|
|
+ };
|
|
|
+ columnNames.forEach(time => {
|
|
|
+ rowData[time] = '';
|
|
|
+ });
|
|
|
+ const results = item['time'].split(',');
|
|
|
+ results.forEach(result => {
|
|
|
+ if (columnNames.includes(result)) {
|
|
|
+ rowData[result] = '√';
|
|
|
+ }else{rowData[result] = ''}
|
|
|
+ });
|
|
|
+ drzcData.push(rowData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ drzcDatas.value=drzcData
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const _rclsb_gdbh = ref('')
|
|
|
+const _rclsb_yjno = ref('')
|
|
|
+// 当日上报产量数据
|
|
|
+const FacilitychanLiang = async () => {
|
|
|
+ const response = await facilitychanLiang({machine:JTMC,date:date});
|
|
|
+ _rclsb_gdbh.value = response.data[0]['工单编号']
|
|
|
+ _rclsb_yjno.value = response.data[0]['yjno']
|
|
|
+ if(response.code==0){
|
|
|
+ let totalA = response.data['totalA']
|
|
|
+ let totalB = response.data['totalB']
|
|
|
+ let 保养工时A = response.data['保养工时A']
|
|
|
+ let 保养工时B = response.data['保养工时B']
|
|
|
+ let 制程废品A = response.data['制程废品A']
|
|
|
+ let 制程废品B = response.data['制程废品B']
|
|
|
+ let 制程次品A = response.data['制程次品A']
|
|
|
+ let 制程次品B = response.data['制程次品B']
|
|
|
+ let 前工序废A = response.data['前工序废A']
|
|
|
+ let 前工序废B = response.data['前工序废B']
|
|
|
+ let 异常工时A = response.data['异常工时A']
|
|
|
+ let 异常工时B = response.data['异常工时B']
|
|
|
+ let 异常补时工时A = response.data['异常补时工时A']
|
|
|
+ let 异常补时工时B = response.data['异常补时工时B']
|
|
|
+ let 打样工时A = response.data['打样工时A']
|
|
|
+ let 打样工时B = response.data['打样工时B']
|
|
|
+ let 来料异常A = response.data['来料异常A']
|
|
|
+ let 来料异常B = response.data['来料异常B']
|
|
|
+ let 装版工时A = response.data['装版工时A']
|
|
|
+ let 装版工时B = response.data['装版工时B']
|
|
|
+ let 通电工时A = response.data['通电工时A']
|
|
|
+ let 通电工时B = response.data['通电工时B']
|
|
|
+ delete response.data['totalA']
|
|
|
+ delete response.data['totalB']
|
|
|
+ delete response.data['保养工时A']
|
|
|
+ delete response.data['保养工时B']
|
|
|
+ delete response.data['制程废品A']
|
|
|
+ delete response.data['制程废品B']
|
|
|
+ delete response.data['制程次品A']
|
|
|
+ delete response.data['制程次品B']
|
|
|
+ delete response.data['前工序废A']
|
|
|
+ delete response.data['前工序废B']
|
|
|
+ delete response.data['异常工时A']
|
|
|
+ delete response.data['异常工时B']
|
|
|
+ delete response.data['异常补时工时A']
|
|
|
+ delete response.data['异常补时工时B']
|
|
|
+ delete response.data['打样工时A']
|
|
|
+ delete response.data['打样工时B']
|
|
|
+ delete response.data['来料异常A']
|
|
|
+ delete response.data['来料异常B']
|
|
|
+ delete response.data['装版工时A']
|
|
|
+ delete response.data['装版工时B']
|
|
|
+ delete response.data['通电工时A']
|
|
|
+ delete response.data['通电工时B']
|
|
|
+ gytableData.value=Object.values(response.data)
|
|
|
+ if(totalA){
|
|
|
+ let rowA = {
|
|
|
+ 产品名称: 'A班产量:',
|
|
|
+ UniqId: "",bzdh: "",cpmc: "",dedh: "",gxh: "",gxmc: "",num: "",sczl_bh98: "",sj1: "",sj2: "",yjno: "",
|
|
|
+ 主电表: "",产量:totalA,保养工时: 保养工时A,制程废品: 制程废品A,制程次品:制程次品A,前工序废: 前工序废A,千件工价: "",印刷方式: "",备注: "",
|
|
|
+ 工单编号: "",工序: "",异常总工时: 异常工时A,异常类型: "",异常补时: 异常补时工时A,打样工时: 打样工时A,日定额: "",更新时间: "",来料异常: 来料异常A,用户: "",码包: "",
|
|
|
+ 码开始行: "",码结束行: "",组员1: "",组员2: "",组员3: "",色度数: "",装版工时: 装版工时A,辅电表: "",通电工时: 通电工时A,难度系数: "",isTotal: true,
|
|
|
+ }
|
|
|
+ gytableData.value.push(rowA)
|
|
|
+ }
|
|
|
+ if(totalB){
|
|
|
+ let rowB = {
|
|
|
+ 产品名称: 'B班产量:',
|
|
|
+ UniqId: "",bzdh: "",cpmc: "",dedh: "",gxh: "",gxmc: "",num: "",sczl_bh98: "",sj1: "",sj2: "",yjno: "",
|
|
|
+ 主电表: "",产量:totalB,保养工时: 保养工时B,制程废品: 制程废品B,制程次品:制程次品B,前工序废: 前工序废B,千件工价: "",印刷方式: "",备注: "",
|
|
|
+ 工单编号: "",工序: "",异常总工时: 异常工时B,异常类型: "",异常补时: 异常补时工时B,打样工时: 打样工时B,日定额: "",更新时间: "",来料异常: 来料异常B,用户: "",码包: "",
|
|
|
+ 码开始行: "",码结束行: "",组员1: "",组员2: "",组员3: "",色度数: "",装版工时: 装版工时B,辅电表: "",通电工时: 通电工时B,难度系数: "",isTotal: true,
|
|
|
+ }
|
|
|
+ gytableData.value.push(rowB)
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 关闭弹窗
|
|
|
+const closeDialog = () => {
|
|
|
+ dialogFormVisible.value = false
|
|
|
+ chanliangVisible.value=false
|
|
|
+ formData.value = {
|
|
|
+ address: '',
|
|
|
+ image: '',
|
|
|
+ name: '',
|
|
|
+ }
|
|
|
+}
|
|
|
+// 弹窗确定
|
|
|
+const enterDialog = async () => {
|
|
|
+ elFormRef.value?.validate( async (valid) => {
|
|
|
+ if (!valid) return
|
|
|
+ let res
|
|
|
+ switch (type.value) {
|
|
|
+ case 'create':
|
|
|
+ res = await createCompany(formData.value)
|
|
|
+ break
|
|
|
+ case 'update':
|
|
|
+ res = await updateCompany(formData.value)
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ res = await createCompany(formData.value)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ if (res.code === 0) {
|
|
|
+ ElMessage({
|
|
|
+ type: 'success',
|
|
|
+ message: '创建/更改成功'
|
|
|
+ })
|
|
|
+ closeDialog()
|
|
|
+ getTableData()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//点击label获取表格数据
|
|
|
+function duohandleClick(table) {
|
|
|
+ if(table.props.label === '设备作业清单'){
|
|
|
+ FacilityWorklist();
|
|
|
+ }
|
|
|
+ if(table.props.label === '班组人员及分配比例'){
|
|
|
+ FacilityTeam(JTMC)
|
|
|
+ }
|
|
|
+ if(table.props.label === '检验记录'){
|
|
|
+ InspectionRecord()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+/*
|
|
|
+ 样式事件
|
|
|
+*/
|
|
|
+const blplanUsageCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
+ if (column.property === '员工编号' || column.property === 'ygxm') {
|
|
|
+ return 'plan-usage-low';
|
|
|
+ }
|
|
|
+}
|
|
|
+const JPblplanUsageCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
+ if (column.property === '员工编号' || column.property === 'ygxm') {
|
|
|
+ return 'plan-usage-low';
|
|
|
+ }
|
|
|
+}
|
|
|
+//修改 JP检品机 当日上报产量 组员及分配比例
|
|
|
+const JPblplanUsageCellClassedit = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
+ if (column.property === '员工编号' || column.property === 'ygxm') {
|
|
|
+ return 'plan-usage-low';
|
|
|
+ }
|
|
|
+}
|
|
|
+//设备作业清单 正在生产中 背景颜色
|
|
|
+const sbzyqdsatusCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
+ if (row.status === 1) {
|
|
|
+ return 'status-plan-usage-low';
|
|
|
+ }
|
|
|
+}
|
|
|
+//工序产量核查
|
|
|
+const gxclhcCellClass = ({row, column, rowIndex, columnIndex}) =>{
|
|
|
+ if (column.label === '实际上报产量' ||column.label === '制程废品' || column.label === '制程废品率' ||
|
|
|
+ column.label === '来料异常' || column.label === '流程单数' || column.label === '当前设备') {
|
|
|
+ return 'lan-plan-usage-lows';
|
|
|
+ }
|
|
|
+ if (column.label === '折算车头产量') {
|
|
|
+ return 'gxclhc—color-column-red';
|
|
|
+ }
|
|
|
+ // 如果不是 'PD_WG' 列,返回空字符串或其他样式类
|
|
|
+ if (column.label === '工序状态'){
|
|
|
+ if(row['PD_WG'] === '完工'){
|
|
|
+ return 'lan-plan-usage-lowshui';
|
|
|
+ }else{
|
|
|
+ return 'pczccolor-column-lan';
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//拉料导出弹窗
|
|
|
+const onllexcel = ref(false)
|
|
|
+const onllexcelrq = ref('')
|
|
|
+const llexporttoExcel = async () => {
|
|
|
+console.log('导出')
|
|
|
+onllexcelrq.value = currentDates.split('-').slice(0, 2).join('-')
|
|
|
+onllexcel.value = true
|
|
|
+}
|
|
|
+
|
|
|
+//选择日期
|
|
|
+const onchange_data = (val) => {
|
|
|
+ if (val) {
|
|
|
+ // 将日期对象转换为本地时间的年月格式
|
|
|
+ const year = val.getFullYear()
|
|
|
+ const month = (val.getMonth() + 1).toString().padStart(2, '0')
|
|
|
+ onllexcelrq.value = `${year}-${month}`
|
|
|
+ } else {
|
|
|
+ onllexcelrq.value = ''
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//导出确认
|
|
|
+const rcgdsjonDialog = async () => {
|
|
|
+ try {
|
|
|
+ // 获取数据
|
|
|
+ const response = await LazhiGongData({ mouth: onllexcelrq.value });
|
|
|
+ const originalData = response.data;
|
|
|
+
|
|
|
+ // 创建工作表
|
|
|
+ const worksheet = XLSX.utils.json_to_sheet(originalData);
|
|
|
+ //从某列开始转化成数字
|
|
|
+ //设置从C列开始为数字格式
|
|
|
+ const range = XLSX.utils.decode_range(worksheet['!ref']);
|
|
|
+ for (let col = 2; col <= range.e.c; col++) { // 从C列(索引2)开始
|
|
|
+ for (let row = range.s.r + 1; row <= range.e.r; row++) { // 跳过表头行
|
|
|
+ const cellAddress = XLSX.utils.encode_cell({ r: row, c: col });
|
|
|
+ if (worksheet[cellAddress]) {
|
|
|
+ // 尝试转换为数字
|
|
|
+ const cellValue = worksheet[cellAddress].v;
|
|
|
+ const numValue = Number(cellValue);
|
|
|
+
|
|
|
+ if (!isNaN(numValue)) {
|
|
|
+ worksheet[cellAddress].t = 'n'; // 数字类型
|
|
|
+ worksheet[cellAddress].v = numValue; // 更新值
|
|
|
+ worksheet[cellAddress].z = '0.0'; // 数字格式
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 创建并导出工作簿
|
|
|
+ const workbook = XLSX.utils.book_new();
|
|
|
+ XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
|
|
+ XLSX.writeFile(workbook, '拉料人员数据.xlsx');
|
|
|
+
|
|
|
+ } catch (error) {
|
|
|
+ console.error('导出失败:', error);
|
|
|
+ ElMessage.error('导出数据失败,请重试');
|
|
|
+ }
|
|
|
+};
|
|
|
+const rcgdsjcloseDialog = () => {onllexcel.value = false}
|
|
|
+
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+/* .button-container {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+} */
|
|
|
+.bt{
|
|
|
+ /* margin-left: 2px !important;
|
|
|
+ padding: 3px !important;
|
|
|
+ font-size: 12px; */
|
|
|
+ margin-bottom: 5px !important;
|
|
|
+}
|
|
|
+.button-container {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ justify-content: flex-start;
|
|
|
+}
|
|
|
+
|
|
|
+.custom-button {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ text-align: center;
|
|
|
+ flex: 0 0 150px;
|
|
|
+ height: 170px;
|
|
|
+ margin: 7px;
|
|
|
+}
|
|
|
+
|
|
|
+.custom-button img {
|
|
|
+ max-width: 100%;
|
|
|
+}
|
|
|
+.JKWTree-container {
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+
|
|
|
+.JKWTree-tree {
|
|
|
+ width: 440px;
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 10px;
|
|
|
+ margin-right: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.JKWTree-tree h3 {
|
|
|
+ font-size: 15px;
|
|
|
+ font-weight: 700;
|
|
|
+ margin: 10px 0;
|
|
|
+}
|
|
|
+
|
|
|
+.JKWTree-content {
|
|
|
+ flex: 1;
|
|
|
+}
|
|
|
+/*!* 选中某行时的背景色*/
|
|
|
+:deep(.el-table__body tr.current-row)>td {
|
|
|
+ background: #ff80ff !important;
|
|
|
+}
|
|
|
+:deep(.statusy-plan-usage-low div) {
|
|
|
+ color: #8c939d !important;
|
|
|
+}
|
|
|
+/* 设备作业清单 正在生产中 背景颜色 */
|
|
|
+:deep(.status-plan-usage-low ) {
|
|
|
+ background: yellow !important;
|
|
|
+}
|
|
|
+::v-deep .el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
|
|
|
+ color: white;
|
|
|
+ background-color: #4d70ff;
|
|
|
+}
|
|
|
+.groupbox{
|
|
|
+ margin:10px;
|
|
|
+ width:500px;
|
|
|
+ height:500px;
|
|
|
+ border:thin solid black;
|
|
|
+ padding:10px
|
|
|
+}
|
|
|
+.grouptitle{
|
|
|
+ display:block;
|
|
|
+ margin-top:-24px;
|
|
|
+ margin-left:20px;
|
|
|
+ width:150px;
|
|
|
+ text-align:center;
|
|
|
+ background-color:white
|
|
|
+}
|
|
|
+/*工序产量核查*/
|
|
|
+:deep(.gxclhc—color-column-red div) {
|
|
|
+ color: red !important;
|
|
|
+}
|
|
|
+:deep(.lan-plan-usage-lows div) {
|
|
|
+ color: blue !important;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+:deep(.lan-plan-usage-lowshui div) {
|
|
|
+ color: #8c939d !important;
|
|
|
+}
|
|
|
+:deep(.plan-usage-low div) {
|
|
|
+ color: blue !important;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style scoped>
|
|
|
+:deep(.el-table td .cell) {
|
|
|
+ line-height: 20px !important;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-tabs__header) {
|
|
|
+ margin-bottom: 0;
|
|
|
+}
|
|
|
+ .search {
|
|
|
+ margin-left: 0px !important;
|
|
|
+ margin-right: 10px !important;
|
|
|
+}
|
|
|
+/* .bt {
|
|
|
+ margin-left: 2px !important;
|
|
|
+ padding: 3px !important;
|
|
|
+ font-size: 12px;
|
|
|
+} */
|
|
|
+
|
|
|
+.el-tabs__header {
|
|
|
+ margin: 0px !important;
|
|
|
+}
|
|
|
+.gva-table-box {
|
|
|
+ padding: 0px !important;
|
|
|
+}
|
|
|
+:deep(.total-row) {
|
|
|
+ background-color: yellow !important;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.plan-usage-low div) {
|
|
|
+ color: red !important;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: normal;
|
|
|
+}
|
|
|
+/* tree组件背景高亮 */
|
|
|
+:deep(.el-tree-node:focus > .el-tree-node__content){
|
|
|
+ background: #ff80ff !important;
|
|
|
+}
|
|
|
+/*!* 流程单查询按钮颜色控制未完成*/
|
|
|
+:deep(.custom-buttons.el-button--info) {
|
|
|
+ background-color: palegreen !important;
|
|
|
+ color: #155724;
|
|
|
+ font-size: 20px;
|
|
|
+ border-color: #c3e6cb;
|
|
|
+}
|
|
|
+/* 已完成 */
|
|
|
+:deep(.custom-buttons.el-button--danger) {
|
|
|
+ background-color: rgb(236, 135, 135) !important;
|
|
|
+ color: #721c24;
|
|
|
+ font-size: 20px;
|
|
|
+ border-color: #f5c6cb;
|
|
|
+}
|
|
|
+</style>
|