| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288 |
- <template>
- <div>
- <layout>
- <layout-content >
- <div class="gva-table-box">
- <h1 style="margin: 0%;margin-bottom: 10px;">车缝完工报工</h1>
- <el-row :gutter="24">
- <el-input v-model="add_searchInfo" placeholder="请扫描子订单编号" @keyup.enter="add_onSubmit"id="searchInput"
- style="width: 220px;height: 50px;margin-left: 10px;"></el-input>
- <el-button type="primary" icon="search" @click="add_onSubmit" style="height: 50px;width: 80px;">查询</el-button>
- <el-form-item label="机台号:" prop="jitaihao" class="mab" style="font-size: 30px;margin: 10px;" label-width="116px">
- <el-input v-model="add_formData['机台号']" readonly style="width: 80px; height: 40px;" id="jitaihao" />
- </el-form-item>
- <el-form-item label="工序:" prop="gongxu" class="mab" style="font-size: 30px; margin: 10px;" label-width="81px">
- <el-input v-model="add_formData['工序']" readonly style="width: 100px; height: 40px;" id="gongxu" />
- </el-form-item>
- <el-form-item label="组别:" prop="zubie" class="mab" style="font-size: 30px; margin: 10px;" label-width="81px">
- <el-input v-model="add_formData['组别']" readonly style="width: 100px; height: 40px;" id="zubie" />
- </el-form-item>
- <el-form-item label="人员:" prop="renyuan" class="mab" style="font-size: 30px; margin: 10px;" label-width="81px">
- <el-input v-model="add_formData['人员']" readonly style="width: 100px; height: 40px;" id="renyuan" />
- </el-form-item>
- <el-form-item label="是否尾包:" prop="joinDate" style="font-size: 30px;margin-top: 15px;" label-width="150">
- <el-button :type="activeButton === 'yes' ? 'info' : 'primary'" @click="setActiveButton('yes')"
- :style="activeButton === 'yes' ? activeButtonStyle : defaultButtonStyle"
- style="margin-top:-20px;height: 50px;width: 70px;">
- <span class="custom-button-text">是</span>
- </el-button>
- <el-button :type="activeButton === 'no' ? 'info' : 'primary'" @click="setActiveButton('no')"
- :style="activeButton === 'no' ? activeButtonStyle : defaultButtonStyle"
- style="margin-top:-20px;height: 50px;width: 70px;">
- <span class="custom-button-text">否</span>
- </el-button>
- </el-form-item>
- </el-row>
-
- <el-row :gutter="24">
- <el-form-item label="尺码" class="mab" prop="keyOrder" label-width="140" style="font-size: 30px;">
- <el-input v-model="cmformdata.cm1" id="cm1" readonly style="width: 65px;height: 40px;"/>
- <el-input v-model="cmformdata.cm2" id="cm2" readonly style="width: 65px;height: 40px;"/>
- <el-input v-model="cmformdata.cm3" id="cm3" readonly style="width: 65px;height: 40px;"/>
- <el-input v-model="cmformdata.cm4" id="cm4" readonly style="width: 65px;height: 40px;"/>
- <el-input v-model="cmformdata.cm5" id="cm5" readonly style="width: 65px;height: 40px;"/>
- <el-input v-model="cmformdata.cm6" id="cm6" readonly style="width: 65px;height: 40px;"/>
- <el-input v-model="cmformdata.cm7" id="cm7" readonly style="width: 65px;height: 40px;"/>
- <el-input v-model="cmformdata.cm8" id="cm8" readonly style="width: 65px;height: 40px;"/>
- <el-input v-model="cmformdata.cm9" id="cm9" readonly style="width: 65px;height: 40px;"/>
- <el-input v-model="cmformdata.cm10" id="cm10" readonly style="width: 65px;height: 40px;"/>
- <el-input v-model="cmformdata.cm11" id="cm11" readonly style="width: 65px;height: 40px;"/>
- </el-form-item>
- </el-row>
- <el-row :gutter="24">
- <el-form-item label="制单数" class="mab" prop="keyOrder" label-width="140" style="font-size: 30px;margin-top: -5px;">
- <el-input v-model="zdslformdata.cmsl1" readonly style="width: 65px;height: 40px;" id="zdsc1"/>
- <el-input v-model="zdslformdata.cmsl2" readonly style="width: 65px;height: 40px;" id="zdsc2"/>
- <el-input v-model="zdslformdata.cmsl3" readonly style="width: 65px;height: 40px;" id="zdsc3"/>
- <el-input v-model="zdslformdata.cmsl4" readonly style="width: 65px;height: 40px;" id="zdsc4"/>
- <el-input v-model="zdslformdata.cmsl5" readonly style="width: 65px;height: 40px;" id="zdsc5"/>
- <el-input v-model="zdslformdata.cmsl6" readonly style="width: 65px;height: 40px;" id="zdsc6"/>
- <el-input v-model="zdslformdata.cmsl7" readonly style="width: 65px;height: 40px;" id="zdsc7"/>
- <el-input v-model="zdslformdata.cmsl8" readonly style="width: 65px;height: 40px;" id="zdsc8"/>
- <el-input v-model="zdslformdata.cmsl9" readonly style="width: 65px;height: 40px;" id="zdsc9"/>
- <el-input v-model="zdslformdata.cmsl10" readonly style="width: 65px;height: 40px;" id="zdsc10"/>
- <el-input v-model="zdslformdata.zdtotal" readonly style="width: 65px;height: 40px;" id="zdtotal"/>
- </el-form-item>
- </el-row>
- <el-row :gutter="24">
- <el-form-item label="实裁数" class="mab" prop="keyOrder" label-width="140" style="font-size: 30px;margin-top: -10px;">
- <el-input v-model="scslformdata.scsl1" readonly style="width: 65px;height: 40px;" id="scsl1"/>
- <el-input v-model="scslformdata.scsl2" readonly style="width: 65px;height: 40px;" id="scsl2"/>
- <el-input v-model="scslformdata.scsl3" readonly style="width: 65px;height: 40px;" id="scsl3"/>
- <el-input v-model="scslformdata.scsl4" readonly style="width: 65px;height: 40px;" id="scsl4"/>
- <el-input v-model="scslformdata.scsl5" readonly style="width: 65px;height: 40px;" id="scsl5"/>
- <el-input v-model="scslformdata.scsl6" readonly style="width: 65px;height: 40px;" id="scsl6"/>
- <el-input v-model="scslformdata.scsl7" readonly style="width: 65px;height: 40px;" id="scsl7"/>
- <el-input v-model="scslformdata.scsl8" readonly style="width: 65px;height: 40px;" id="scsl8"/>
- <el-input v-model="scslformdata.scsl9" readonly style="width: 65px;height: 40px;" id="scsl9"/>
- <el-input v-model="scslformdata.scsl10" readonly style="width: 65px;height: 40px;" id="scsl10"/>
- <el-input v-model="scslformdata.sctotal" readonly style="width: 65px;height: 40px;" id="sctotal"/>
- </el-form-item>
- </el-row>
- <el-row :gutter="24">
- <el-form-item label="上报数量" class="mab" prop="keyOrder" label-width="140" style="font-size: 30px;margin-top: -10px;">
- <el-input v-model="slformdata.sl1" :readonly="!zdslformdata.cmsl1" @input="updateTotal" style="width: 65px;height: 40px;" id="sl1" @keydown="handleKeyDown($event, 'sl10', 'sl1', 'sl2')"/>
- <el-input v-model="slformdata.sl2" :readonly="!zdslformdata.cmsl2" @input="updateTotal" style="width: 65px;height: 40px;" id="sl2" @keydown="handleKeyDown($event, 'sl1', 'sl2', 'sl3')"/>
- <el-input v-model="slformdata.sl3" :readonly="!zdslformdata.cmsl3" @input="updateTotal" style="width: 65px;height: 40px;" id="sl3"@keydown="handleKeyDown($event, 'sl2', 'sl3', 'sl4')"/>
- <el-input v-model="slformdata.sl4" :readonly="!zdslformdata.cmsl4" @input="updateTotal" style="width: 65px;height: 40px;" id="sl4"@keydown="handleKeyDown($event, 'sl3', 'sl4', 'sl5')"/>
- <el-input v-model="slformdata.sl5" :readonly="!zdslformdata.cmsl5 "@input="updateTotal" style="width: 65px;height: 40px;" id="sl5"@keydown="handleKeyDown($event, 'sl4', 'sl5', 'sl6')"/>
- <el-input v-model="slformdata.sl6" :readonly="!zdslformdata.cmsl6" @input="updateTotal" style="width: 65px;height: 40px;" id="sl6"@keydown="handleKeyDown($event, 'sl5', 'sl6', 'sl7')"/>
- <el-input v-model="slformdata.sl7" :readonly="!zdslformdata.cmsl7" @input="updateTotal" style="width: 65px;height: 40px;" id="sl7"@keydown="handleKeyDown($event, 'sl6', 'sl7', 'sl8')"/>
- <el-input v-model="slformdata.sl8" :readonly="!zdslformdata.cmsl8" @input="updateTotal" style="width: 65px;height: 40px;" id="sl8"@keydown="handleKeyDown($event, 'sl7', 'sl8', 'sl9')"/>
- <el-input v-model="slformdata.sl9" :readonly="!zdslformdata.cmsl9" @input="updateTotal" style="width: 65px;height: 40px;" id="sl9"@keydown="handleKeyDown($event, 'sl8', 'sl9', 'sl10')"/>
- <el-input v-model="slformdata.sl10" :readonly="!zdslformdata.cmsl10" @input="updateTotal" style="width: 65px;height: 40px;" id="sl10"@keydown="handleKeyDown($event, 'sl9', 'sl10', 'sl1')"/>
- <el-input v-model="slformdata.sctotal" readonly style="width: 65px;height: 40px;" id="sctotal"/>
- <el-button type="primary" @click="add_Dialog" style="width: 100px;height: 60px;font-size: 20px;margin: -20px 0 0 10px">确认上报</el-button>
- <el-button type="primary" @click="add_printxp" style="width: 100px;height: 60px;font-size: 20px;margin: -20px 0 0 10px">打印预览</el-button>
- </el-form-item>
- </el-row>
- <hr>
- <el-row :gutter="24" style="margin-bottom: 15px;margin-left: 0px;">
- <el-main>
- <div @contextmenu.prevent>
- <el-table
- ref="multipleTableRef"
- style="width:100%; height: 40vh"
- tooltip-effect="dark"
- :row-style="{ height: '40px' }"
- :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"
- @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="50" /> -->
- <el-table-column v-slot="scope" align="left" label="操作" width="150">
- <el-button type="primary" @click="add_bdprintxp(scope.row)" style="width: 110px; height: 40px; font-size: 20px;">补打小票</el-button>
- </el-table-column>
- <el-table-column v-slot="scope" align="left" label="报工时间" width="150">
- <div style="margin-left: -9px">{{ scope.row.sys_rq }}</div>
- </el-table-column>
- <el-table-column v-slot="scope" align="left" label="子订单编号" width="110">
- <div style="margin-left: -9px">{{ scope.row.子订单编号 }}</div>
- </el-table-column>
- <el-table-column v-slot="scope" align="left" label="组别" width="80">
- <div style="margin-left: -9px">{{ scope.row.组别 }}</div>
- </el-table-column>
- <el-table-column v-for="item in sizeDatas" :key="item" align="center" :label="item"
- :prop="item" width="100" :cell-style="cellStyle">
- <template v-slot="scope">
- <div :class="{ 'highlight-cell': isCellHighlighted(scope.$index, item) }" style="margin-left: -5px;width: 80px;"
- @click="handleSizeClick(scope.$index, item, scope.row)">
- {{ scope.row[item] }}
- </div>
- </template>
- </el-table-column>
- <el-table-column v-slot="scope" align="left" label="数量" width="70">
- <div style="margin-left: -9px">{{ scope.row.数量 }}</div>
- </el-table-column>
- <el-table-column v-slot="scope" align="left" label="流水号" width="150">
- <div>{{ scope.row.serial }}</div>
- </el-table-column>
- </el-table>
- </div>
- </el-main>
- </el-row>
- </div>
- <!-- 是否订单尾包确认弹窗 -->
- <el-dialog v-model="DialogVisible" title="是否订单尾包" destroy-on-close width="30%" style="top: 20%;">
- <h3>请再次确认是否该订单产品已全部报工,该批为订单尾包?</h3>
- <div class="dialog-footer" style="text-align: right;">
- <el-button @click="confirmDialogVisible">取消</el-button>
- <el-button type="primary" @click="handleConfirm">确认</el-button>
- </div>
- </el-dialog>
- </layout-content>
- </layout>
- </div>
- </template>
- <script>
- export default {
- methods: {
- handleKeyDown(event, prevId, currentId, nextId) {
- const currentElement = document.getElementById(currentId);
- const isEmpty = currentElement.value === '';
- const atStart = currentElement.selectionStart === 0;
- const atEnd = currentElement.selectionStart === currentElement.value.length;
- switch (event.keyCode) {
- case 13: // Enter
- case 40: // 向下箭头
- if (nextId) {
- document.getElementById(nextId).focus();
- }
- break;
- case 38: // 向上箭头
- if (prevId) {
- document.getElementById(prevId).focus();
- }
- break;
- case 8: // 删除键
- if (prevId && (isEmpty || atStart)) {
- document.getElementById(prevId).focus();
- }
- break;
- case 37: // 向左箭头
- if (prevId && atStart) {
- document.getElementById(prevId).focus();
- }
- break;
- case 39: // 向右箭头
- if (nextId && atEnd) {
- document.getElementById(nextId).focus();
-
- }
- break;
- default:
- break;
- }
- },
- },
- };
- </script>
- <script setup>
- // 全量引入格式化工具 请按需保留
- 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 {getMachineMac} from '@/api/jixiaoguanli/jitairibaobiao'
- import {getMac} from '@/api/jixiaoguanli/baogong'
- import {ElMessage} from "element-plus";
- import { get } from 'scriptjs';
- defineOptions({name: 'Company'})
-
- // =========== 全局获取当前日期 ===========
- // currentDate 年月日 时分秒
- // currentDates 年月日
- 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}`;
- //全局获取code,接口接收code
- const _code = '车缝'
- //全局接口接受的物理地址
- const Machine = ref('')
- //全局获取UniqId
- const UniqId = ref('')
- //物理地址获取机台编号
- const getMachineMacdata = async () => {
- console.log("本页面获取物理地址",Machine.value)
- try {
- const data = await getMachineMac({sys_sbID:'68-ED-A4-26-60-84'});
- if(data.data===null){
- ElMessage({
- type: 'error',
- message: '未获取到机台编号请确认MAC地址或与管理员联系'
- })
- }else{
- add_formData['机台号'] = data.data['机台号']
- add_formData['工序'] = data.data['生产工序']
- add_formData['组别'] = data.data['组别']
- add_formData['人员'] = data.data['组长']
- setTimeout(() => {
- const inputElement = document.getElementById('searchInput');
- if (inputElement) {
- inputElement.focus();
- }
- }, 100); // 延迟100毫秒
- }
- } catch (error) {
- console.error(error)
- }
- }
- //自动获取物理地址
- const GetAddr = () => {
- var xmlhttp = null;
- var res;
- if (window.XMLHttpRequest) {
- xmlhttp = new XMLHttpRequest();
- } else if (window.ActiveXObject) {
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- }
- // 2. 设置回调函数
- xmlhttp.onreadystatechange = function() {
- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
- res = eval('('+xmlhttp.response+')');
- let result = ''
- for (let i = 0; i < res.macAddress.length; i++) {
- if (i % 2 === 0 && i !== 0) {
- result += '-' // 根据实际需求修改分隔符
- }
- result += res.macAddress[i]
- }
- Machine.value = result
- getMachineMacdata(Machine.value)
- }
- }
- // 3. 打开一个连接
- xmlhttp.open("get", "http://127.0.0.1:8090/init")
- // 5. 发送
- xmlhttp.send();
- }
- getMachineMacdata();
- // GetAddr()
- // 尺码
- const cmformdata = reactive({
- cm1:'',
- cm2:'',
- cm3:'',
- cm4:'',
- cm5:'',
- cm6:'',
- cm7:'',
- cm8:'',
- cm9:'',
- cm10:'',
- cm11:'合计',
- });
- // 制单数
- const zdslformdata = reactive({
- cmsl1:'',
- cmsl2:'',
- cmsl3:'',
- cmsl4:'',
- cmsl5:'',
- cmsl6:'',
- cmsl7:'',
- cmsl8:'',
- cmsl9:'',
- cmsl10:'',
- zdtotal:'',
- });
- // 实裁量
- const scslformdata = reactive({
- scsl1:'',
- scsl2:'',
- scsl3:'',
- scsl4:'',
- scsl5:'',
- scsl6:'',
- scsl7:'',
- scsl8:'',
- scsl9:'',
- scsl10:'',
- sctotal:'',
- });
- // 数量
- const slformdata = reactive({
- sl1:'',
- sl2:'',
- sl3:'',
- sl4:'',
- sl5:'',
- sl6:'',
- sl7:'',
- sl8:'',
- sl9:'',
- sl10:'',
- sctotal:'',
- });
- //实裁相加
- function updateTotal() {
- // 直接指定要累加的属性名
- const relevantKeys = ['sl1', 'sl2', 'sl3', 'sl4', 'sl5', 'sl6', 'sl7', 'sl8', 'sl9', 'sl10'];
- const values = relevantKeys.map(key => parseInt(slformdata[key], 10) || 0); // 使用 || 0 来处理可能的 NaN 或 undefined/null
- slformdata.sctotal = values.reduce((sum, value) => sum + value, 0);
- }
- //历史记录表格
- const add_tableData = reactive([]);
- //全局获取颜色款式款号
- const _yskskh= ref('')
- //全局获取新增流水号
- const _serial = ref('')
- //全局获取序号
- const _serial_num = ref('')
- //流水号补零
- function padNumber(num, length) {
- let str = '' + num;
- while (str.length < length) {
- str = '0' + str;
- }
- return str;
- }
- // 代表扫描两次自动保存
- const searcs = ref('')
- //尺寸列表
- const sizeDatas = reactive([])
- //搜索
- const add_searchInfo = ref('')
- //查询事件
- const add_onSubmit = async ()=>{
- sizeDatas.length = 0;
- add_tableData.length = 0;
- if(add_searchInfo.value === '' || add_searchInfo.value === undefined){
- const WorkListdata = [];
- add_tableData.splice(0,add_tableData.length,...WorkListdata);
- ElMessage({type: 'warning',message: '请扫描小票二维码' })
- }else{
- //获取下面报工历史记录
- const getSpotLists = await getSpotList({order:add_searchInfo.value,code:_code,sys_sbID:add_formData['机台号']});
- console.log(getSpotLists)
- if (!add_searchInfo.value.includes('-') && getSpotLists.data.records.length === 0) {
- ElMessage({type: 'warning',message: '未查询到报工历史数据' })
- return false;
- }
- _yskskh.value = getSpotLists.data.list[0] //颜色、款式、款号
- _serial.value = getSpotLists.data.serial //流水号
- _serial_num.value = getSpotLists.data.serial_num //序号
- let number = parseInt(getSpotLists.data.serial_num, 10);
- _serial_num.value = number+1,
- console.log(_serial_num.value)
- //获取尺码、制单数/实裁量上面信息
- const keys1 = ['cm1', 'cm2', 'cm3', 'cm4','cm5','cm6','cm7','cm8','cm9','cm10',];
- const keys2 = ['cmsl1', 'cmsl2', 'cmsl3', 'cmsl4','cmsl5','cmsl6','cmsl7','cmsl8','cmsl9','cmsl10','zdtotal',];
- const keys3 = ['scsl1', 'scsl2', 'scsl3', 'scsl4','scsl5','scsl6','scsl7','scsl8','scsl9','scsl10','sctotal',];
- //如果搜索是子订单编号
- if(add_searchInfo.value.includes('-')){
- for (let key of keys1) {
- if (getSpotLists.data.list[0].hasOwnProperty(key)) { // 确保键存在于对象中
- cmformdata[key] = getSpotLists.data.list[0][key];
- }
- }
- for (let key of keys2) {
- if (getSpotLists.data.list[0].hasOwnProperty(key)) { // 确保键存在于对象中
- zdslformdata[key] = getSpotLists.data.list[0][key];
- }
- }
- for (let key of keys3) {
- if (getSpotLists.data.list[0].hasOwnProperty(key)) { // 确保键存在于对象中
- scslformdata[key] = getSpotLists.data.list[0][key];
- }
- }
- setTimeout(() => {
- const inputElement = document.getElementById('sl1');
- if (inputElement) {
- inputElement.focus();
- }
- }, 100); // 延迟100毫秒
- }else{
- for (let key of keys1) {
- cmformdata[key] = '';
- }
- for (let key of keys2) {
- zdslformdata[key] = '';
- }
- }
- //历史记录
- if(getSpotLists.data.headers){
- sizeDatas.splice(0,getSpotLists.data.headers.length,...getSpotLists.data.headers);//型号数据
- add_tableData.splice(0,add_tableData.length,...getSpotLists.data.records);//表格数据
- }
- }
- }
-
- const AttendanceVisible=ref(false)
-
- //清空对象的属性值
- const gd_clearFormData = () => {
- Object.keys(add_formData).forEach(key => {
- add_formData[key] = '';
- });
- };
- const add_formData = reactive({
- 机台号: '',
- 工序: '',
- 组别: '',
- 人员: '',
- 尺码: '',
- 数量: '',
- 是否订单尾包: '',
- });
- const currentSlValue = ref('')
- //车缝确认上报按钮
- const add_Dialog = async ()=>{
- sizeDatas.length = 0;
- add_tableData.length = 0;
- console.log(_serial.value)
- if(_serial.value === NaN){
- ElMessage({type: 'warning',message: '网络异常.请检查'})
- return fasle;
- }
- if(add_searchInfo.value === ''){
- ElMessage({type: 'warning',message: '请扫描子订单编号输入数量后,再进行上报'})
- return fasle;
- }
- let cmArray = [cmformdata.cm1, cmformdata.cm2,cmformdata.cm3,cmformdata.cm4,cmformdata.cm5,cmformdata.cm6,cmformdata.cm7,cmformdata.cm8,cmformdata.cm9,cmformdata.cm10];
- let zdsl1Array = [zdslformdata.zdsl1, zdslformdata.zdsl12,zdslformdata.zdsl13,zdslformdata.zdsl14,zdslformdata.zdsl15,zdslformdata.zdsl16,zdslformdata.zdsl17,zdslformdata.zdsl18,zdslformdata.zdsl19,zdslformdata.zdsl110];
- let slArray = [slformdata.sl1, slformdata.sl2,slformdata.sl3,slformdata.sl4,slformdata.sl5,slformdata.sl6,slformdata.sl7,slformdata.sl8,slformdata.sl9,slformdata.sl10];
- let resultArrays = [];
- for (let i = 0; i < slArray.length; i++) {
- // 创建一个新数组来存储当前索引下的所有值
- let currentValues = [add_formData['机台号'],cmArray[i], zdsl1Array[i], slArray[i]];
- // 添加到结果数组中
- resultArrays.push(currentValues);
- }
- let paramsList = []; // 用于存储每个元素的 cm 和 sl
- let serialNumber = parseInt(_serial.value, 10);
- for (let i = 0; i < resultArrays.length; i++) {
- if (slArray[i]) {
- let params = {};
- params.order_id =add_searchInfo.value;
- params.sczl_jtbh = add_formData['机台号'];
- params.gxmc = add_formData['工序'];
- params.sys_id = add_formData['人员'];
- params.wb = add_formData['是否订单尾包'];
- params.cm = resultArrays[i][1];
- params.sl = resultArrays[i][3];
- params.sys_rq =currentDates;
- params.code = '车缝';
- serialNumber++;
- params.serial = padNumber(serialNumber, 3);
- params.sczl_bh = add_formData['组别'];
- params.serial_num = _serial_num.value;
- paramsList.push(params);
- }
- }
- if (paramsList.length === 0) {
- ElMessage({ type: 'info', message: '请填写报工尺码数量' });
- return;
- }
- console.log(paramsList)
- let allSuccess = true;
- for (let i = 0; i < paramsList.length; i++) {
- const cf_gettab = await search(paramsList[i]);
- if (cf_gettab.code !== 0) {
- // ElMessage({ type: 'error', message: '报工失败' });
- allSuccess = false;
- break; // 如果某个报工失败,则中断循环
- }
- }
- if (allSuccess) {
- const lsjltable = await getTab({order_id:add_searchInfo.value,sczl_jtbh:add_formData['机台号']});
- const getSpotLists = await getSpotList({order:add_searchInfo.value,code:_code,sys_sbID:add_formData['机台号']});
- sizeDatas.splice(0,getSpotLists.data.headers.length,...getSpotLists.data.headers);//型号数据
- add_tableData.splice(0,add_tableData.length,...getSpotLists.data.records);//表格数据
- add_printxp();
- searcs.value = '';
- add_searchInfo.value = ''; // 清除选择
- ElMessage({ type: 'success', message: '报工成功' });
- }
- }
- // 新增取消
- const add_closeDialog = () => {
- AttendanceVisible.value = false
- };
- //是否订单尾包选择是否按钮
- const activeButton = ref('no')
- add_formData['是否订单尾包']='0'
- const DialogVisible = ref(false)
- // 定义按钮的默认样式和激活样式
- const defaultButtonStyle = {
- backgroundColor: '#808080',//用于默认状态
- color: 'white',
- };
- const activeButtonStyle = {
- backgroundColor: 'red',//用于选中状态
- color: 'white',
- };
- const setActiveButton = (button) => {
- activeButton.value = button;
- if (button === 'yes') {
- add_formData['是否订单尾包'] = '1';
- DialogVisible.value = true;
- } else if (button === 'no') {
- add_formData['是否订单尾包'] = '0';
- DialogVisible.value = false;
- }
- };
- // 确定
- const handleConfirm = () => {
- add_formData['是否订单尾包'] = '1'
- DialogVisible.value = false
- };
- // 取消
- const confirmDialogVisible = () => {
- add_formData['是否订单尾包'] = '0'
- DialogVisible.value = false
- };
-
- // =========== 新增打印小票 ===========
- const jsondata ={"panels":[{"index":0,"name":1,"height":296.6,"width":210,"paperHeader":19.5,"paperFooter":832.5,"printElements":[{"options":{"left":226.5,"top":25.5,"height":61.5,"width":349.5,"title":"这是更新后的元素","right":418.9921875,"bottom":397.2421875,"vCenter":313.2421875,"hCenter":366.4921875,"field":"zddbh","coordinateSync":false,"widthHeightSync":false,"hideTitle":true,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":0,"top":25.5,"height":60,"width":220.5,"title":"子订单编号:","coordinateSync":false,"widthHeightSync":false,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"right":187.74375915527344,"bottom":392.25,"vCenter":84.24375915527344,"hCenter":360.75},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":100.5,"top":325.5,"height":60,"width":478.5,"title":"这是更新后的元素","right":372.75,"bottom":386.25,"vCenter":241.5,"hCenter":356.25,"field":"kh","coordinateSync":false,"widthHeightSync":false,"hideTitle":true,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"qid":"zddbh_1","textContentWrap":"clip"},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":0,"top":325.5,"height":60,"width":100,"title":"款号:","coordinateSync":false,"widthHeightSync":false,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"right":97,"bottom":361.5,"vCenter":47,"hCenter":331.5},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":421.5,"top":93,"height":159,"width":159,"title":"二维码","qrcodeType":"qrcode","testData":"qrcode","right":577.5,"bottom":251.25,"vCenter":498,"hCenter":171.75,"field":"emm","qrCodeLevel":0,"coordinateSync":false,"widthHeightSync":false,"hideTitle":true},"printElementType":{"title":"二维码","type":"qrcode"}},{"options":{"left":100.5,"top":85.5,"height":60,"width":262.5,"title":"这是更新后的元素","right":374.25,"bottom":143.25,"vCenter":243,"hCenter":113.25,"field":"pm","coordinateSync":false,"widthHeightSync":false,"hideTitle":true,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"qid":"kh_1"},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":0,"top":85.5,"height":60,"width":100,"title":"品名:","coordinateSync":false,"widthHeightSync":false,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"right":68.5,"bottom":263.25,"vCenter":18.5,"hCenter":233.25},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":100.5,"top":145.5,"height":60,"width":261,"title":"这是更新后的元素","right":324,"bottom":205.5,"vCenter":218.25,"hCenter":175.5,"field":"ys","coordinateSync":false,"widthHeightSync":false,"hideTitle":true,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"qid":"kh_2"},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":0,"top":144,"height":60,"width":100,"title":"颜色:","coordinateSync":false,"widthHeightSync":false,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"right":80.5,"bottom":386.25,"vCenter":30.5,"hCenter":356.25},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":100.5,"top":205.5,"height":60,"width":264,"title":"这是更新后的元素","right":324,"bottom":264.75,"vCenter":218.25,"hCenter":234.75,"field":"cm","coordinateSync":false,"widthHeightSync":false,"hideTitle":true,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"qid":"kh_3"},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":0,"top":204,"height":60,"width":100,"title":"尺码","coordinateSync":false,"widthHeightSync":false,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"right":100,"bottom":349.5,"vCenter":50,"hCenter":319.5},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":102,"top":385.5,"height":60,"width":246,"title":"这是更新后的元素","right":385.5,"bottom":388.5,"vCenter":247.5,"hCenter":357.75,"field":"zb","coordinateSync":false,"widthHeightSync":false,"hideTitle":true,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"qid":"kh_5"},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":0,"top":264,"height":60,"width":100,"title":"数量:","coordinateSync":false,"widthHeightSync":false,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"right":96.25,"bottom":322.5,"vCenter":46.25,"hCenter":292.5},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":453,"top":385.5,"height":61.5,"width":120,"title":"这是更新后的元素","right":573.75,"bottom":445.5,"vCenter":513.75,"hCenter":414.75,"field":"wb","coordinateSync":false,"widthHeightSync":false,"hideTitle":true,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"qid":"kh_7"},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":100.5,"top":265.5,"height":61.5,"width":262.5,"title":"这是更新后的元素","right":324.75,"bottom":324.75,"vCenter":219,"hCenter":294,"field":"sl","coordinateSync":false,"widthHeightSync":false,"hideTitle":true,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"qid":"kh_4"},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":354,"top":385.5,"height":60,"width":100,"title":"尾包:","coordinateSync":false,"widthHeightSync":false,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"right":440.25,"bottom":445.5,"vCenter":396.75,"hCenter":415.5},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":0,"top":385.5,"height":60,"width":100,"title":"组别:","coordinateSync":false,"widthHeightSync":false,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"right":100,"bottom":448.5,"vCenter":50,"hCenter":418.5},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":181.5,"top":445.5,"height":61.5,"width":259.5,"title":"这是更新后的元素","right":603,"bottom":505.5,"vCenter":393,"hCenter":474.75,"field":"dyrq","coordinateSync":false,"widthHeightSync":false,"hideTitle":true,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"qid":"kh_6"},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":0,"top":445.5,"height":60,"width":180,"title":"打印日期:","coordinateSync":false,"widthHeightSync":false,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0,"right":168,"bottom":505.5,"vCenter":84,"hCenter":475.5},"printElementType":{"title":"这是更新后的元素","type":"text"}},{"options":{"left":421.5,"top":261,"height":52.5,"width":40.5,"title":"第","right":459,"bottom":313.5,"vCenter":438.75,"hCenter":287.25,"coordinateSync":false,"widthHeightSync":false,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0},"printElementType":{"title":"文本","type":"text"}},{"options":{"left":540,"top":261,"height":52.5,"width":40.5,"title":"包","right":577.5,"bottom":312,"vCenter":557.25,"hCenter":285.75,"coordinateSync":false,"widthHeightSync":false,"fontSize":40,"textContentVerticalAlign":"middle","qrCodeLevel":0},"printElementType":{"title":"文本","type":"text"}},{"options":{"left":460.5,"top":261,"height":52.5,"width":79.5,"title":"1000","right":538.5,"bottom":313.5,"vCenter":498.75,"hCenter":287.25,"field":"lsh","coordinateSync":false,"widthHeightSync":false,"hideTitle":true,"fontSize":40,"textAlign":"center","textContentVerticalAlign":"middle","qrCodeLevel":0},"printElementType":{"title":"文本","type":"text"}}],"paperNumberLeft":568.5,"paperNumberTop":330,"paperNumberContinue":true,"watermarkOptions":{"content":"vue-plugin-hiprint","rotate":25,"timestamp":true,"format":"YYYY-MM-DD HH:mm"},"panelLayoutOptions":{}}]}
- // 右键点击行时触发
- const roww = ref(null)
- const selectedRows = ref([]);
- const allPrintData = ref([]);
- const printdata = ref({});
-
- //单机
- const add_tableRowClick = async (row) => {
- roww.value = row
- }
- //双击
- const add_updateCompanyFunc = async (row) => {
-
- }
- //右键
- const handleRightClick = async (row) => {
-
- }
- //复选框
- const add_xpSelectionChange = async (selection) => {
- console.log(selection.length)
- selectedRows.value = selection;
- if (selection.length === 0) {
- ElMessage({type: 'warning', message: '请勾选打印的数据' });
- return false;
- }else if(selection.length>0){
- allPrintData.value = selection.map((row) => {
- console.log(111,row)
- let weibao = row['是否尾包'] === '是' ? 1 : 0;
- const ewm = `${row['订单子编号']},01,${row['尺码']},${row['数量']},${weibao}`;
- return {
- emm: ewm,
- zddbh: row['子订单编号'],
- kh: row['款号'],
- pm: row['款式'],
- ys: row['颜色'],
- cm: row['尺码'],
- sl: row['数量'],
- zb: row['组别'],
- dyrq: currentDates,
- wb: row['尾包'],
- lsh: row['serial']
- };
- });
- }else{
- allPrintData.value = [];
- }
- console.log(allPrintData.value)
- }
-
- const selectedSizes = ref([]);
- // 存储所有高亮单元格的信息
- const highlightedCells = ref([]);
- let table_serial = ref('');
- let table_order_id = ref('');
- let table_kh = ref('');
- let table_sczl_jtbh = ref('');
- let table_gx = ref('');
- let table_wb = ref('');
- let table_ks = ref('');
- let table_color = ref('');
- function handleSizeClick(rowIndex, item, row) {
- table_serial = row['serial']
- table_order_id = row['子订单编号']
- table_sczl_jtbh = row['机台号']
- table_gx = row['工序名称']
- table_ks = row['款式']
- table_wb = row['尾包']
- table_color = row['颜色']
- table_kh = row['款号']
- // 查找当前单元格是否已高亮
- const index = highlightedCells.value.findIndex(hc => hc.rowIndex === rowIndex && hc.item === item);
- if (index !== -1) {
- // 如果已高亮,则移除
- highlightedCells.value.splice(index, 1);
- } else {
- // 否则,添加新的高亮信息
- highlightedCells.value.push({ rowIndex, item });
- }
- let newSizeItem = { size: item };
- const quantityWithParentheses = row[item];
- const match = quantityWithParentheses.match(/^([^()]+)\(([^()]+)\)$/);
- if (match) {
- newSizeItem.serial = match[1];
- newSizeItem.sl = parseInt(match[2], 10);
- const existingIndex = selectedSizes.value.findIndex(s => s.size === item);
- if (existingIndex !== -1) {
- selectedSizes.value.splice(existingIndex, 1);
- }
- selectedSizes.value.push(newSizeItem);
- } else {
- console.error('Invalid match format:', quantityWithParentheses);
- }
- }
- function isCellHighlighted(rowIndex, item) {
- return highlightedCells.value.some(hc => hc.rowIndex === rowIndex && hc.item === item);
- }
- //补打小票
- let _table_print = ref([]);
- let allParams = [];
- const add_bdprintxp = () => {
- console.log(selectedSizes.value)
- if(selectedSizes.value.length === 0){
- ElMessage({type: 'warning', message: '请选择要补打的数量'});
- return false;
- }
- allParams = [];
- for (let i = 0; i < selectedSizes.value.length; i++) {
- if (selectedSizes.value[i]) {
- let params = {};
- params.order_id = table_order_id ;
- params.kh = table_kh;
- params.ks = table_ks;
- params.color = table_color;
- params.cm = selectedSizes.value[i].size;
- params.sl = selectedSizes.value[i].sl;
- params.sczl_jtbh = table_sczl_jtbh;
- params.sys_rq =currentDate;
- params.sys_rq =currentDate;
- params.serial = selectedSizes.value[i].serial;
- params.wb = table_wb;
- allParams.push(params);
- _table_print.value = allParams.map((row) => {
- let weibao = table_wb === '是' ? '1': '0';
- const ewm = `${row['order_id']},${add_formData['机台号']},3,${row['cm']},${row['sl']},${weibao}`;
- return {
- emm: ewm,
- zddbh: row['order_id'],
- kh: row['kh'],
- pm: row['ks'],
- ys: row['color'],
- cm: row['cm'],
- sl: row['sl'],
- zb: row['sczl_jtbh'],
- dyrq: currentDates,
- wb: table_wb,
- lsh:row['serial']
- };
- });
- console.log(_table_print.value)
- const hiprintTemplate = new hiprint.PrintTemplate({ template: jsondata });
- hiprintTemplate.print(_table_print.value)
- }
- }
- };
-
- const _print = ref('')
- // 打印预览
- const add_printxp = () => {
- let cmArray = [cmformdata.cm1, cmformdata.cm2,cmformdata.cm3,cmformdata.cm4,cmformdata.cm5,cmformdata.cm6,cmformdata.cm7,cmformdata.cm8,cmformdata.cm9,cmformdata.cm10];
- let slArray = [slformdata.sl1, slformdata.sl2,slformdata.sl3,slformdata.sl4,slformdata.sl5,slformdata.sl6,slformdata.sl7,slformdata.sl8,slformdata.sl9,slformdata.sl10];
- let allParams = []; // 用于存储所有要打印的参数对象
- let allParamss = ref([]); // 用于存储所有要打印的参数对象
- if (!slArray.some(item => item !== "" && item !== null && item !== undefined)) {
- ElMessage({type: 'warning', message: '请填写上报数量后再使用打印功能'});
- return;
- }else{
- let serialNumber = parseInt(_serial.value, 10);
- for (let i = 0; i < slArray.length; i++) {
- if (slArray[i]) {
- let params = {};
- serialNumber++
- params.serial = padNumber(serialNumber, 3)
- params.order_id = add_searchInfo.value ;
- params.sczl_jtbh = add_formData['组别'];
- params.gx = add_formData['工序'];
- params.sys_id = add_formData['人员'];
- params.wb = add_formData['是否订单尾包'];
- params.cm = cmArray[i];
- params.sl = slArray[i];
- params.sys_rq =currentDate;
- allParams.push(params);
- allParamss.value = allParams.map((row) => {
- let weibao = add_formData['是否订单尾包'] === '1' ? '是': '否';
- //二维码数据:订单子编号,组别,工序(固定),尺码,数量,是否尾包(1代表是0代表否)如2408001-1,CF01,3,10,20,0
- const ewm = `${row['order_id']},${add_formData['机台号']},3,${row['cm']},${row['sl']},${add_formData['是否订单尾包']}`;
- return {
- emm: ewm,
- zddbh: row['order_id'],
- kh: _yskskh.value['款号'],
- pm: _yskskh.value['款式'],
- ys: _yskskh.value['颜色'],
- cm: row['cm'],
- sl: row['sl'],
- zb: row['sczl_jtbh'],
- dyrq: currentDates,
- wb: weibao,
- lsh:row['serial']
- };
-
- });
- // const hiprintTemplate = new hiprint.PrintTemplate({ template: jsondata });
- // hiprintTemplate.print2(allParamss.value);
- const hiprintTemplate = new hiprint.PrintTemplate({ template: jsondata });
- hiprintTemplate.print(allParamss.value)
- }
- }
- // console.log(allParamss.value)
- }
- };
- // =========== 删除按钮 ===========
- //记录复选框的值
- const bgSelection = ref(null)
- const baogong_del = () => {
- if(bgSelection.value === null || bgSelection.value === ''){
- ElMessage({type: 'warning',message: '请选择删除的数据' })
- }else{
- console.log(bgSelection.value)
- }
- }
-
- // 保存当前选中的行数据
- const table_selectrows = ref([]);
-
- // 表格复选框选中变化时触发
- const table_SelectionChange = (val) => {
- table_selectrows.value = val; // 将选中的行数据保存到 table_selectrows
- }
-
- // =========== 批量打印小票 ===========
- const onxiaopiaoclick = async () => {
- if (table_selectrows.value.length === 0) {
- ElMessage({type: 'warning', message: '请勾选打印的数据' });
- return false;
- }
- const allPrintData = table_selectrows.value.map((row) => {
- let weibao = row['是否尾包'] === '是' ? 1 : 0;
- const ewm = `${row['订单子编号']},01,${row['尺码']},${row['数量']},${weibao}`;
- return {
- emm: ewm,
- zddbh: row['订单子编号'],
- kh: row['生产款号'],
- pm: row['款式'],
- ys: row['颜色'],
- cm: row['尺码'],
- sl: row['报工数量'],
- zb: row['组别'],
- dyrq: currentDate,
- wb: row['是否尾包'],
- };
- });
- // 将所有数据一次性传递给打印模板
- const hiprintTemplate = new hiprint.PrintTemplate({ template: jsondata });
- hiprintTemplate.print(allPrintData);
-
- }
-
- // // 表格复选框
- // const handleSelectionChange = (selection, type) => {
- // const ids = selection.map(item => {
- // return item.订单子编号
- // })
- // bgSelection.value = ids.join(',')
- // }
-
- // // 表格复选框
- // const table_SelectionChange = (val, type) => {
- // console.log(val)
- // }
- // // =========== 补打小票 ===========
- // const onxiaopiaoclick = async () => {
- // if(row_onclick.value === '' || row_onclick.value === null || row_onclick.value === undefined){
- // ElMessage({type: 'warning',message: '请选择一条数据' })
- // return false;
- // }
- // let weibao;
- // if (row_onclick.value['是否尾包'] === '是') {
- // weibao = 1;
- // } else {
- // weibao = 0;
- // }
- // const ewm = `${row_onclick.value['订单子编号']},01,${row_onclick.value['尺码']},${row_onclick.value['数量']},${weibao}`;
- // printdata.value = {
- // emm: ewm,
- // zddbh: row_onclick.value['订单子编号'],
- // kh: row_onclick.value['生产款号'],
- // pm: row_onclick.value['款式'],
- // ys: row_onclick.value['颜色'],
- // cm: row_onclick.value['尺码'],
- // sl: row_onclick.value['报工数量'],
- // zb: row_onclick.value['组别'],
- // dyrq: currentDate,
- // wb: row_onclick.value['是否尾包'],
- // };
- // hiprint.init();
- // const hiprintTemplate = new hiprint.PrintTemplate({ template: jsondata });
- // hiprintTemplate.print(printdata.value);
- // }
-
- // =========== 修改 ===========
- const dialogFormVisible = ref(false)
- const edit_formData = ref({})
- // 双击修改
- const updateCompanyFunc = async (row) => {
- console.log(row)
- dialogFormVisible.value = true;
- Object.assign(edit_formData.value,row);
- edit_formData.value['是否订单尾包'] = row['是否尾包'];
- // let code = row['员工编号'];
- // const getStaffInfo_data = await getStaffInfo({code:code});
- // formDataTest.value = getStaffInfo_data.data;
- };
-
- // 弹窗修改确定
- const edit_Dialog = async () => {
- _ygjbzledit();
- }
-
- // 弹窗修改关闭
- const edit_closeDialog = () => {
- dialogFormVisible.value = false
- }
-
- const _ygjbzledit = async ()=>{
- // const formattedData = {
- // '订单子编号': edit_formData.value['订单子编号'],
- // '订单号': edit_formData.value['订单号'],
- // '生产款号': edit_formData.value['生产款号'],
- // '款式': edit_formData.value['款式'],
- // '颜色': edit_formData.value['颜色'],
- // '制单总数': edit_formData.value['制单总数'],
- // '组别': edit_formData.value['组别'],
- // '排产单数': edit_formData.value['排产单数'],
- // '尺码': edit_formData.value['尺码'],
- // '报工数量': edit_formData.value['报工数量'],
- // '是否为尾包': edit_formData.value['是否为尾包'],
- // '工序': edit_formData.value['工序'],
- // '验片人': edit_formData.value['验片人'],
- // '日期': edit_formData.value['日期'],
- // };
- // try {
- // const edid_edit_formData = await 修改接口(formattedData);
- // if (edid_edit_formData .code === 0) {
- // dialogFormVisible.value = false;
- // ElMessage({type: 'success',message: '更新成功'})
- // } else {
- // ElMessage({ type: 'error',message: '更新失败'})
- // }
- // } catch (error) {
- // console.error(error);
- // }
- }
-
- // =========== 分页 ===========
- // 分页相关的响应式变量
- const page = ref(1)
- const total = ref(0)
- const pageSize = ref(10)
- // 分页
- const handleCurrentChange = (val) => {
- page.value = val;
- _getStaffList();
- };
-
- // 修改页面容量 点击多少条/页
- const handleSizeChange = (val) => {
- page.value = 10;//默认显示
- pageSize.value = val;
- _getStaffList();
- };
- </script>
- <style scoped>
- .form-container {
- display: flex;
- flex-wrap: wrap;
- }
-
- .form-column {
- /*flex: 1;*/
- margin-right: 15px; /* 调整列之间的间距 */
- }
- /* 左侧输入框宽度调整 */
- .form-column .el-form-item .el-input {
- width: 150px; /* 调整左侧输入框的宽度 */
- }
-
- /* 媒体查询,根据需要调整断点 */
- @media screen and (max-width: 768px) {
- .form-column {
- flex: 1 0 100%; /* 在小屏幕下变成单列布局 */
- margin-right: 0;
- }
- }
- /* 表格复选框大小调整 */
- :deep(.el-checkbox.el-checkbox--small .el-checkbox__inner) {
- width: 30px; /* 复选框宽度 */
- height: 20px; /* 复选框高度 */
- }
-
- :deep(.el-checkbox.el-checkbox--small.is-checked .el-checkbox__inner::after) {
- transform: scale(1.2) rotate(45deg); /* 调整选中后的对勾大小 */
- top: 5%; /* 调整对勾位置 */
- left: 40%; /* 调整对勾位置 */
- width: 5px; /* 调整对勾宽度 */
- height: 9px; /* 调整对勾高度 */
- }
-
- /*:deep(.el-table td .cell) {*/
- /* line-height: 30px !important;*/
- /*}*/
- .JKWTree-container {
- display: flex;
- }
- .JKWTree-tree {
- /*width: 300px;*/
- background-color: #fff;
- padding: 10px;
- margin-right: 20px;
- }
- .JKWTree-tree h3 {
- font-size: 15px;
- font-weight: 700;
- margin: 10px 0;
- }
- .JKWTree-content {
- flex: 1;
- }
- /* 图片上传 */
- .upload-box {
- width: 200px;
- height: 200px;
- border: 2px dashed #e2e2e2;
- display: flex;
- justify-content: center;
- align-items: center;
- position: relative;
- cursor: pointer;
- }
- .uploaded-image {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- .upload-icon {
- font-size: 40px;
- color: #c0c4cc;
- }
- .file-input {
- display: none;
- }
- .el-table .warning-row {
- background: oldlace;
- }
- :deep(.el-input .is-disabled .cm_input){
- color: red;
- }
- /* 选中某行时的背景色 */
- :deep(.el-table__body tr.current-row) > td {
- background: #ff80ff !important;
- }
- </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{
- max-width: 1400px;
- padding: 0px !important;
- margin-left: -10px !important;
- }
- .mab{
- margin-bottom: 5px;
- }
- /* 点击按钮改变颜色 */
- .active-button {
- background-color: #ff0000;
- }
- .default-button {
- background-color: #808080;
- }
- ::v-deep .el-input_inner {
- font-size: 20px; /* 更改为你想要的字体大小 */
- }
- /* 搜索样式 */
- ::v-deep .el-input__wrapper #searchInput {
- font-size: 16px;
- }
- ::v-deep .el-input__wrapper #jitaihao {
- font-size: 18px;
- }
- ::v-deep .el-input__wrapper #gongxu {
- font-size: 18px;
- }
- ::v-deep .el-input__wrapper #zubie {
- font-size: 18px;
- }
- ::v-deep .el-input__wrapper #renyuan {
- font-size: 18px;
- }
- ::v-deep .el-input__wrapper #shuliang {
- font-size: 18px;
- color: red;
- }
- ::v-deep .el-input__wrapper #chima {
- font-size: 18px;
- }
- /* 尺码 */
- ::v-deep .el-input__wrapper #cm1{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #cm2{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #cm3{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #cm4{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #cm5{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #cm6{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #cm7{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #cm8{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #cm9{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #cm10{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #cm11{
- font-size: 20px;
- }
- /* 制单数 */
- ::v-deep .el-input__wrapper #zdsc1{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #zdsc2{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #zdsc3{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #zdsc4{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #zdsc5{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #zdsc6{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #zdsc7{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #zdsc8{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #zdsc9{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #zdsc10{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #zdtotal{
- font-size: 20px;
- }
- /* 实裁数 */
- ::v-deep .el-input__wrapper #scsl1{
- font-size: 20px;
- color: red !important;
- }
- ::v-deep .el-input__wrapper #scsl2{
- font-size: 20px;
- color: red !important;
- }
- ::v-deep .el-input__wrapper #scsl3{
- font-size: 20px;
- color: red !important;
- }
- ::v-deep .el-input__wrapper #scsl4{
- font-size: 20px;
- color: red !important;
- }
- ::v-deep .el-input__wrapper #scsl5{
- font-size: 20px;
- color: red !important;
- }
- ::v-deep .el-input__wrapper #scsl6{
- font-size: 20px;
- color: red !important;
- }
- ::v-deep .el-input__wrapper #scsl7{
- font-size: 20px;
- color: red !important;
- }
- ::v-deep .el-input__wrapper #scsl8{
- font-size: 20px;
- color: red !important;
- }
- ::v-deep .el-input__wrapper #scsl9{
- font-size: 20px;
- color: red !important;
- }
- ::v-deep .el-input__wrapper #scsl10{
- font-size: 20px;
- color: red !important;
- }
- ::v-deep .el-input__wrapper #sctotal{
- font-size: 20px;
- color: red !important;
- }
- /* 数量 */
- ::v-deep .el-input__wrapper #sl1{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #sl2{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #sl3{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #sl4{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #sl5{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #sl6{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #sl7{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #sl8{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #sl9{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #sl10{
- font-size: 20px;
- }
- ::v-deep .el-input__wrapper #sctotal{
- font-size: 20px;
- }
- /* 选择历史记录改变颜色 */
- .highlight-cell{
- height: 40px;
- /* 背景 */
- background-color: rgba(190, 79, 79, 0.7) !important;
- /* 使用 Flexbox 布局 */
- display: flex;
- /* 垂直居中 */
- align-items: center;
- /* 水平居中 */
- justify-content: center;
- /* 可选,确保 div 宽度填满单元格 */
- width: 100%;
- /* 可选,确保 padding 和 border 不会增加 div 的宽度 */
- box-sizing: border-box;
- }
- /* :deep(.el-table__body tr.current-row) > td {
- background: #ff80ff !important;
- } */
- .custom-button-text {
- font-size: 25px; /* 或者你想要的任何大小 */
- }
- </style>
-
|