|
|
@@ -111,12 +111,33 @@
|
|
|
<el-table-column type="selection" width="60" />
|
|
|
<el-table-column align="left" label="报工时间" prop="sys_rq" width="150"/>
|
|
|
<el-table-column align="left" label="子订单编号" prop="子订单编号" width="130"/>
|
|
|
- <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="80"/>
|
|
|
- <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
|
|
|
+ v-for="item in sizeDatas"
|
|
|
+ :key="item"
|
|
|
+ align="center"
|
|
|
+ :label="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 align="left" label="数量" prop="数量" width="100"/>
|
|
|
<el-table-column align="left" label="剩余数量" prop="剩余数量" width="85"/>
|
|
|
<el-table-column align="left" label="尾包" prop="尾包" width="60"/>
|
|
|
<el-table-column align="left" label="流水号" prop="serial" width="100"/>
|
|
|
@@ -389,6 +410,8 @@ const showPdf = async (row) => {
|
|
|
const add_searchInfo = ref('')
|
|
|
//表格
|
|
|
const add_tableData = reactive([]);
|
|
|
+//尺码
|
|
|
+const sizeDatas = reactive([])
|
|
|
//尾包选中值
|
|
|
const activeButtonValue = ref('')
|
|
|
const _order = ref('')
|
|
|
@@ -403,6 +426,8 @@ const add_onSubmit = async ()=>{
|
|
|
ElMessage({type: 'warning',message: '未获取到机台'})
|
|
|
return false;
|
|
|
}
|
|
|
+ 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);
|
|
|
@@ -421,7 +446,8 @@ const add_onSubmit = async ()=>{
|
|
|
_order.value = add_searchInfo.value;
|
|
|
//获取下面报工历史记录
|
|
|
const getSpotLists = await getSpotList({order:add_searchInfo.value,code:_code,sys_sbID:add_formData['机台号']});
|
|
|
- console.log("getSpotLists.data.result.ci_num::",getSpotLists.data.result.ci_num)
|
|
|
+ //获取尺码
|
|
|
+ sizeDatas.splice(0, getSpotLists.data.headers.length, ...getSpotLists.data.headers); //型号数据
|
|
|
if(getSpotLists.data.result.ci_num === 0 || getSpotLists.data.result.ci_num === '0'){
|
|
|
ElMessage({type: 'error',message: '已上报,无需再次报工' })
|
|
|
add_searchInfo.value = ''
|
|
|
@@ -446,6 +472,7 @@ const add_onSubmit = async ()=>{
|
|
|
add_formData['总数量'] = getSpotLists.data.result.sl
|
|
|
add_formData['剩余数量'] = getSpotLists.data.result.ci_num
|
|
|
add_tableData.splice(0,add_tableData.length,...getSpotLists.data.records);
|
|
|
+ console.log(add_tableData)
|
|
|
|
|
|
//xlsx附件
|
|
|
const searchValue = add_searchInfo.value.split('-')[0];
|
|
|
@@ -456,6 +483,57 @@ const add_onSubmit = async ()=>{
|
|
|
|
|
|
}
|
|
|
|
|
|
+//点击显示表格高亮
|
|
|
+function isCellHighlighted(rowIndex, item) {
|
|
|
+ return highlightedCells.value.some(hc => hc.rowIndex === rowIndex && hc.item === item);
|
|
|
+ console.log(highlightedCells.value)
|
|
|
+}
|
|
|
+
|
|
|
+const highlightedCells = ref([]);
|
|
|
+const selectedSizes = ref([]);
|
|
|
+let _table_row = ref('');
|
|
|
+//点击表格行事件
|
|
|
+function handleSizeClick(rowIndex, item, row) {
|
|
|
+ _table_row = row
|
|
|
+ // 查找当前单元格是否已高亮
|
|
|
+ const index = highlightedCells.value.findIndex(hc => hc.rowIndex === rowIndex && hc.item === item);
|
|
|
+ if (index !== -1) {
|
|
|
+ // 如果已高亮,则移除
|
|
|
+ highlightedCells.value.splice(index, 1);
|
|
|
+ } else {
|
|
|
+ // 如果已经有一个高亮条目,移除第一个高亮条目
|
|
|
+ if (highlightedCells.value.length > 0) {
|
|
|
+ highlightedCells.value.splice(0, 1);
|
|
|
+ }
|
|
|
+ // 添加新的高亮信息
|
|
|
+ highlightedCells.value.push({
|
|
|
+ rowIndex,
|
|
|
+ item
|
|
|
+ });
|
|
|
+ }
|
|
|
+ let newSizeItem = {
|
|
|
+ size: item
|
|
|
+ };
|
|
|
+ const quantityWithParentheses = row[item];
|
|
|
+ const match = quantityWithParentheses.match(/^([^()]+)\(([^()]+)\)$/);
|
|
|
+ if (match) {
|
|
|
+ // console.log("点击尺码包数据",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 数组
|
|
|
+ selectedSizes.value = [];
|
|
|
+ selectedSizes.value.push(newSizeItem);
|
|
|
+ } else {
|
|
|
+ console.error('Invalid match format:', quantityWithParentheses);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const AttendanceVisible=ref(false)
|
|
|
//清空对象的属性值
|
|
|
const gd_clearFormData = () => {
|