|
|
@@ -64,7 +64,7 @@
|
|
|
<el-text style="font-size: 30px;">上报数量</el-text>
|
|
|
</el-col>
|
|
|
<!--上报数量输入框 -->
|
|
|
- <el-col :span="2"><el-input v-model="add_formData['上报数量']" readonly style="width: 100%; height: 40px;"/></el-col>
|
|
|
+ <el-col :span="2"><el-input v-model="add_formData['上报数量']" @input="baogongslpd" style="width: 100%; height: 40px;"/></el-col>
|
|
|
|
|
|
|
|
|
<!-- 是否尾包文本 -->
|
|
|
@@ -96,45 +96,79 @@
|
|
|
|
|
|
<layout-content >
|
|
|
<el-main>
|
|
|
- <el-row :gutter="24" style="margin-bottom: 15px;margin-left: 0px;">
|
|
|
- <div @contextmenu.prevent>
|
|
|
- <el-table ref="multipleTableRef" style="width: 100%;height: 53vh"
|
|
|
- :row-style="{ height: '50px' }" :header-cell-style="{ padding: '5px', fontSize: '20px' }"
|
|
|
- :cell-style="{ padding: '10px', fontSize: '20px' }" :header-row-style="{ height: '20px' }"
|
|
|
- :data="add_tableData" border row-key="ID" size="small"
|
|
|
- highlight-current-row="true" tooltip-effect="dark"
|
|
|
- @row-dblclick="add_updateCompanyFunc" @row-click="add_tableRowClick" @row-contextmenu="handleRightClick"
|
|
|
- :show-overflow-tooltip="true" @selection-change="add_xpSelectionChange">
|
|
|
- <!-- <el-table-column type="selection" width="70" /> -->
|
|
|
- <el-table-column sortable align="left" label="流水号" prop="serial" width="100"/>
|
|
|
- <el-table-column sortable align="left" label="报工时间" prop="sys_rq" width="160"/>
|
|
|
- <el-table-column sortable align="left" label="订单编号" prop="订单编号" width="130"/>
|
|
|
- <el-table-column sortable align="left" label="订单子编号" prop="子订单编号" width="140"/>
|
|
|
- <!-- <el-table-column sortable align="left" label="款式" prop="款式" width="140"/> -->
|
|
|
- <el-table-column sortable align="left" label="色系名称" prop="颜色" width="130"/>
|
|
|
- <el-table-column sortable align="left" label="尺码" prop="尺码" width="110"/>
|
|
|
- <el-table-column sortable align="left" label="数量" prop="数量" width="110"/>
|
|
|
- <el-table-column sortable align="left" label="上报数量" prop="上报数量" width="110"/>
|
|
|
- <el-table-column sortable align="left" label="是否尾包" prop="尾包" width="130"/>
|
|
|
- <el-table-column sortable align="left" label="组别" prop="组别" width="130"/>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
+ <el-row :gutter="24" style="margin-bottom: 15px;margin-left: 8px;">
|
|
|
+ <!-- 表格数据 -->
|
|
|
+ <el-tabs v-model="activeName">
|
|
|
+ <el-tab-pane label="报工历史记录" @click="showTable('报工历史记录')" name="first">
|
|
|
+ <el-table ref="multipleTableRef" style="width: 100%;height: 53vh"
|
|
|
+ :row-style="{ height: '50px' }" :header-cell-style="{ padding: '5px', fontSize: '20px' }"
|
|
|
+ :cell-style="{ padding: '10px', fontSize: '20px' }" :header-row-style="{ height: '20px' }"
|
|
|
+ :data="add_tableData" border row-key="ID" size="small"
|
|
|
+ highlight-current-row="true" tooltip-effect="dark"
|
|
|
+ @row-dblclick="add_updateCompanyFunc" @row-click="add_tableRowClick" @row-contextmenu="handleRightClick"
|
|
|
+ :show-overflow-tooltip="true" @selection-change="add_xpSelectionChange">
|
|
|
+ <!-- <el-table-column type="selection" width="70" /> -->
|
|
|
+ <el-table-column sortable align="left" label="流水号" prop="serial" width="100"/>
|
|
|
+ <el-table-column sortable align="left" label="报工时间" prop="sys_rq" width="160"/>
|
|
|
+ <el-table-column sortable align="left" label="订单编号" prop="订单编号" width="130"/>
|
|
|
+ <el-table-column sortable align="left" label="订单子编号" prop="子订单编号" width="140"/>
|
|
|
+ <!-- <el-table-column sortable align="left" label="款式" prop="款式" width="140"/> -->
|
|
|
+ <el-table-column sortable align="left" label="色系名称" prop="颜色" width="130"/>
|
|
|
+ <el-table-column sortable align="left" label="尺码" prop="尺码" width="110"/>
|
|
|
+ <el-table-column sortable align="left" label="数量" prop="数量" width="110"/>
|
|
|
+ <el-table-column sortable align="left" label="上报数量" prop="上报数量" width="110"/>
|
|
|
+ <el-table-column sortable align="left" label="是否尾包" prop="尾包" width="130"/>
|
|
|
+ <el-table-column sortable align="left" label="组别" prop="组别" width="130"/>
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
+ <el-tab-pane label="技术附件" @click="showTable('技术附件')" name="fourth">
|
|
|
+ <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"
|
|
|
+ :cell-class-name="planUsageCellClass"
|
|
|
+ highlight-current-row="true"
|
|
|
+ @row-dblclick="ExcelShow"
|
|
|
+ style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
|
|
|
+ <!-- <el-table-column type="selection" width="55" /> -->
|
|
|
+ <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="120"/>
|
|
|
+ <el-table-column align="left" label="建档用户" prop="sys_id" width="120"/>
|
|
|
+ <el-table-column align="left" label="建档时间" prop="sys_rq" width="160"/>
|
|
|
+ <el-table-column align="left" label="更新时间" prop="mod_rq" width="120"/>
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
</el-row>
|
|
|
</el-main>
|
|
|
</layout-content>
|
|
|
<div class="dialog-footer" style="text-align: left;margin-right: 60px;">
|
|
|
- <el-button type="primary" @click="add_Dialog" id="add_Dialog" :disabled="add_Dialogonclick === false" style="width: 110px;height: 60px;font-size: 20px;margin-left: 20px;">确认</el-button>
|
|
|
+ <el-button type="primary" @click="add_Dialog" id="add_Dialog" :disabled="add_Dialogonclick === false" style="width: 110px;height: 60px;font-size: 20px;margin-left: 20px;">报工</el-button>
|
|
|
<el-button type="primary" @click="gd_yulan" style="width: 100px;height: 60px;font-size: 20px;">工单预览</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- </el-main> -->
|
|
|
</layout-content>
|
|
|
</layout>
|
|
|
+ <!-- 技术附件预览弹窗 -->
|
|
|
+ <el-dialog v-model="luckyexcelVisible" :before-close="luckyexcelCloseDialog" width="100%" top="0vh">
|
|
|
+ <div id="luckyexcel" style="width: 100%;height: 100vh;"></div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<PrintPage ref="printPageRef" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ currentTable: '', // 当前展示的表格
|
|
|
+ activeName: 'first',
|
|
|
+ };
|
|
|
+ },
|
|
|
methods: {
|
|
|
handleKeyDown(event, prevId, currentId, nextId) {
|
|
|
const currentElement = document.getElementById(currentId);
|
|
|
@@ -178,10 +212,13 @@ export default {
|
|
|
</script>
|
|
|
<script setup>
|
|
|
// 全量引入格式化工具 请按需保留
|
|
|
+import $script from 'scriptjs'
|
|
|
+import $ from 'jquery';
|
|
|
+import LuckyExcel from 'luckyexcel';
|
|
|
import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
|
|
|
import {hiprint} from "vue-plugin-hiprint";
|
|
|
import {ref, reactive,nextTick,watch, setBlockTracking } from 'vue'
|
|
|
-import {getSpotList,search,getTab} from '@/api/mes/job'
|
|
|
+import {getSpotList,search,getTab,OrderAttachments} from '@/api/mes/job'
|
|
|
import {getMachineMac} from '@/api/jixiaoguanli/jitairibaobiao'
|
|
|
import {getMac} from '@/api/jixiaoguanli/baogong'
|
|
|
import PrintPage from '../yunyin/shengchanguanli/components/print.vue';
|
|
|
@@ -202,7 +239,6 @@ const seconds = String(today.getSeconds()).padStart(2, '0');
|
|
|
const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
|
const currentDates = `${year}-${month}-${day}`;
|
|
|
|
|
|
-
|
|
|
//全局获取code,接口接收code
|
|
|
const _code = '总检'
|
|
|
//全局接口接受的物理地址
|
|
|
@@ -213,9 +249,11 @@ const UniqId = ref('')
|
|
|
const _gx = '6'
|
|
|
//全局获取工序名称
|
|
|
const _gxmc = '总检'
|
|
|
+
|
|
|
+
|
|
|
//物理地址获取机台编号
|
|
|
const getMachineMacdata = async () => {
|
|
|
- console.log("总检机台获取物理地址",Machine.value)
|
|
|
+ console.log(_code,"机台获取物理地址",Machine.value)
|
|
|
try {
|
|
|
const data = await getMachineMac({sys_sbID:Machine.value});
|
|
|
add_formData['机台号'] = data.data['机台号']
|
|
|
@@ -272,17 +310,30 @@ const activeButtonValue = ref('')
|
|
|
//代表扫描两次自动保存
|
|
|
const searcs = ref('')
|
|
|
const _order = ref('')
|
|
|
-//查询询钮
|
|
|
+//技术附件
|
|
|
+const jstableData = reactive([])
|
|
|
+
|
|
|
+//查询按钮
|
|
|
const add_onSubmit = async ()=>{
|
|
|
+
|
|
|
+ if(add_formData['机台号'] === ''){
|
|
|
+ ElMessage({type: 'warning',message: '未获取到机台'})
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
if(add_searchInfo.value === '' || add_searchInfo.value === undefined){
|
|
|
const WorkListdata = [];
|
|
|
add_tableData.splice(0,add_tableData.length,...WorkListdata);
|
|
|
ElMessage({type: 'warning',message: '请扫描小票二维码' })
|
|
|
}else{
|
|
|
- add_formData['尺码'] = ''
|
|
|
- add_formData['总数量'] = ''
|
|
|
- add_formData['剩余数量'] = ''
|
|
|
- add_formData['上报数量'] = ''
|
|
|
+ //技术附件
|
|
|
+ const searchValue = add_searchInfo.value.split('-')[0];
|
|
|
+ const jsOrderAttachments = await OrderAttachments({order:searchValue,desc:'技术附件'})
|
|
|
+ jstableData.splice(0,jsOrderAttachments.data.length,...jsOrderAttachments.data);
|
|
|
+
|
|
|
+ add_formData['尺码'] = ''
|
|
|
+ add_formData['总数量'] = ''
|
|
|
+ add_formData['剩余数量'] = ''
|
|
|
// if(searcs.value === ''){
|
|
|
_order.value = add_searchInfo.value;
|
|
|
const sys_sbID = add_formData['机台号']
|
|
|
@@ -297,17 +348,78 @@ const add_onSubmit = async ()=>{
|
|
|
// searcs.value = 1;
|
|
|
add_searchInfo.value = ''
|
|
|
setTimeout(() => {
|
|
|
- const inputElement = document.getElementById('sbsl');
|
|
|
- if (inputElement) {
|
|
|
- inputElement.focus();
|
|
|
- }
|
|
|
- }, 100); // 延迟100毫秒
|
|
|
+ const inputElement = document.getElementById('sbsl');
|
|
|
+ if (add_formData['剩余数量']) {
|
|
|
+ inputElement.focus();
|
|
|
+ }
|
|
|
+ }, 100); // 延迟100毫秒
|
|
|
|
|
|
- // }else{
|
|
|
- // add_Dialog();
|
|
|
- // }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+//技术资料excel展示
|
|
|
+const ExcelShow = (row) =>{
|
|
|
+ console.log("技术资料excel展示")
|
|
|
+ console.log(row)
|
|
|
+ if(!row.附件内容) return
|
|
|
+ $.getScript('/luckysheet/plugins/js/plugin.js', () => {
|
|
|
+ $script('/luckysheet/luckysheet.umd.js', () => {
|
|
|
+ function dataURLtoBlob(dataUrl) {
|
|
|
+ const byteString = atob(dataUrl.split(',')[1]);
|
|
|
+ const ab = new ArrayBuffer(byteString.length);
|
|
|
+ const ia = new Uint8Array(ab);
|
|
|
+
|
|
|
+ for (let i = 0; i < byteString.length; i++) {
|
|
|
+ ia[i] = byteString.charCodeAt(i);
|
|
|
+ }
|
|
|
+
|
|
|
+ return new Blob([ab], { type: 'application/octet-stream' });
|
|
|
+ }
|
|
|
+
|
|
|
+ const blob = dataURLtoBlob(row.附件内容);
|
|
|
+ luckyexcelVisible.value = true
|
|
|
+ LuckyExcel.transformExcelToLucky(blob, function(exportJson, luckysheetfile){
|
|
|
+ if(exportJson.sheets==null || exportJson.sheets.length==0){
|
|
|
+ alert("Failed to read the content of the excel file, currently does not support xls files!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(luckyExcel) luckyExcel.destroy();
|
|
|
+ luckysheet.create({
|
|
|
+ container: 'luckyexcel', //容器的ID
|
|
|
+ data: exportJson.sheets,
|
|
|
+ title: exportJson.info.name, // 工作簿名称
|
|
|
+ lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
|
|
|
+ showtoolbar: false, // 是否显示工具栏
|
|
|
+ showinfobar: false, // 是否显示顶部信息栏
|
|
|
+ allowEdit: false, // 是否允许前台编辑
|
|
|
+ enableAddRow: false, // 允许增加行
|
|
|
+ enableAddCol: false, // 允许增加列
|
|
|
+ userInfo: false, // 右上角的用户信息展示样式
|
|
|
+ showRowBar: false, // 是否显示行号区域
|
|
|
+ showColumnBar: false, // 是否显示列号区域
|
|
|
+ sheetFormulaBar: false, // 是否显示公式栏
|
|
|
+ enableAddBackTop: false,//返回头部按钮
|
|
|
+ });
|
|
|
+ luckyExcel = luckysheet;
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
|
|
|
+ $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+let luckyExcel = null
|
|
|
+
|
|
|
+const luckyexcelVisible = ref(false)
|
|
|
+const luckyexcelCloseDialog = () => {
|
|
|
+ luckyexcelVisible.value = false
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
const AttendanceVisible=ref(false)
|
|
|
//清空对象的属性值
|
|
|
const gd_clearFormData = () => {
|
|
|
@@ -328,26 +440,35 @@ const add_formData = reactive({
|
|
|
|
|
|
});
|
|
|
const add_Dialogonclick = ref(false)
|
|
|
+
|
|
|
+//获取input事件
|
|
|
function baogongslpd() {
|
|
|
// 将字符串转换为数字
|
|
|
- const reportedQuantity = parseInt(add_formData['上报数量'], 10) || 0; // 使用10作为基数表示十进制,如果转换失败则返回0
|
|
|
- const totalQuantity = parseInt(add_formData['剩余数量'], 10) || 0; // 同样处理
|
|
|
+ const reportedQuantity = parseInt(add_formData['上报数量'], 10) || 0;
|
|
|
+ const totalQuantity = parseInt(add_formData['剩余数量'], 10) || 0;
|
|
|
+
|
|
|
if (reportedQuantity > totalQuantity) {
|
|
|
ElMessage({ type: 'warning', message: '上报数量不能大于剩余数量' });
|
|
|
add_Dialogonclick.value = false;
|
|
|
- }else if(reportedQuantity === 0){
|
|
|
+ }else if(reportedQuantity === ''){
|
|
|
add_Dialogonclick.value = false;
|
|
|
} else {
|
|
|
add_Dialogonclick.value = true;
|
|
|
}
|
|
|
}
|
|
|
const currentSlValue=ref('')
|
|
|
-//后道确认按钮
|
|
|
+//报工
|
|
|
const add_Dialog = async ()=>{
|
|
|
+
|
|
|
+ if(add_formData['上报数量'] === ''){
|
|
|
+ ElMessage({type: 'warning',message: '上报数量为空,请填写上报数量'})
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if(_order.value === ''){
|
|
|
ElMessage({type: 'warning',message: '请重新扫描小票二维码'})
|
|
|
+ return;
|
|
|
}else{
|
|
|
- console.log(_order.value.split(',')[0])
|
|
|
let params ={}
|
|
|
params.code = _code
|
|
|
params.order = _order.value.split(',')[0].split('-')[0]
|
|
|
@@ -403,7 +524,6 @@ const gd_yulan = () => {
|
|
|
printPageRef.value.open(order)
|
|
|
}
|
|
|
}
|
|
|
-//单机
|
|
|
//单击
|
|
|
const add_tableRowClick = async (row) => {
|
|
|
const orderString = `${row['子订单编号']},${row['组别']},3,${row['尺码']},${row['数量']},${row['尾包']}`;
|