Browse Source

2026-11-13

调整产品尺寸测量报告
master
fengyuan_yang 7 days ago
parent
commit
d4ba6cdd6c
  1. 180
      src/views/modules/report/dimension_report.vue

180
src/views/modules/report/dimension_report.vue

@ -16,17 +16,18 @@
<col class="c-ok" /><col class="c-ng" /> <col class="c-ok" /><col class="c-ng" />
</colgroup> </colgroup>
<tr class="head-row"> <tr class="head-row">
<td colspan="7" class="logo-cell">
<img :src="logo" class="logo" alt="" />
<td colspan="5" class="logo-cell seq-cell">
<button type="button" class="customer-pick no-print" @click="openCustomerDialog">客户</button>
<img v-if="logoUrl" :src="logoUrl" class="logo" alt="" />
</td> </td>
<td colspan="13" class="title-cell">Products Dimension Inspection Report</td>
<td colspan="15" class="title-cell">Products Dimension Inspection Report</td>
</tr> </tr>
<tr> <tr>
<td colspan="5" class="label">Part Type</td> <td colspan="5" class="label">Part Type</td>
<td colspan="3" class="value"> <td colspan="3" class="value">
<span class="opt" @click="partType = 'New'">{{ partType === 'New' ? '■' : '□' }} New</span>
<span class="opt" @click="partType = 'Production'">{{ partType === 'Production' ? '■' : '□' }} Production</span>
<span class="opt" @click="partType = 'Stock'">{{ partType === 'Stock' ? '■' : '□' }} Stock</span>
<span class="opt" @click="partType = partType === 'New' ? '' : 'New'"><i class="tick">{{ partType === 'New' ? '✓' : '' }}</i>New</span>
<span class="opt" @click="partType = partType === 'Production' ? '' : 'Production'"><i class="tick">{{ partType === 'Production' ? '✓' : '' }}</i>Production</span>
<span class="opt" @click="partType = partType === 'Stock' ? '' : 'Stock'"><i class="tick">{{ partType === 'Stock' ? '✓' : '' }}</i>Stock</span>
</td> </td>
<td colspan="2" class="label">Part Name</td> <td colspan="2" class="label">Part Name</td>
<td colspan="2" class="value">{{ reportData.partDesc || '' }}</td> <td colspan="2" class="value">{{ reportData.partDesc || '' }}</td>
@ -145,8 +146,8 @@
</td> </td>
<td colspan="2" class="label">Measure Machine</td> <td colspan="2" class="label">Measure Machine</td>
<td colspan="3" class="value"> <td colspan="3" class="value">
<span class="opt" @click="toggleMachine('Callipers')">{{ machines.indexOf('Callipers') >= 0 ? '■' : '□' }} Callipers</span>
<span class="opt" @click="toggleMachine('VMS2030')">{{ machines.indexOf('VMS2030') >= 0 ? '■' : '□' }} VMS2030</span>
<span class="opt" @click="toggleMachine('Callipers')"><i class="tick">{{ machines.indexOf('Callipers') >= 0 ? '✓' : '' }}</i>Callipers</span>
<span class="opt" @click="toggleMachine('VMS2030')"><i class="tick">{{ machines.indexOf('VMS2030') >= 0 ? '✓' : '' }}</i>VMS2030</span>
</td> </td>
</tr> </tr>
</table> </table>
@ -265,13 +266,42 @@
<el-button type="primary" :disabled="!selectedItemRow" @click="confirmItem">确定</el-button> <el-button type="primary" :disabled="!selectedItemRow" @click="confirmItem">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="选择客户" :visible.sync="customerDialogVisible" width="640px" top="8vh" :modal-append-to-body="false" :destroy-on-close="true">
<el-form :inline="true" :model="customerSearch" size="small">
<el-form-item label="工厂" v-if="siteList.length > 1">
<el-select v-model="customerSearch.site" filterable style="width: 140px" @change="searchCustomerList">
<el-option v-for="item in siteList" :key="item.siteID" :label="item.shortSiteName || item.siteID" :value="item.siteID"></el-option>
</el-select>
</el-form-item>
<el-form-item label="客户编码">
<el-input v-model="customerSearch.customerID" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item label="客户名称">
<el-input v-model="customerSearch.customerName" clearable style="width: 140px"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="searchCustomerList">查询</el-button>
</el-form-item>
</el-form>
<el-table :data="customerList" border stripe highlight-current-row height="360" @current-change="row => selectedCustomerRow = row" @row-dblclick="handleCustomerDblClick">
<el-table-column type="index" label="序号" width="60" align="center"></el-table-column>
<el-table-column prop="customerID" label="客户编码" min-width="120"></el-table-column>
<el-table-column prop="customerName" label="客户名称" min-width="180"></el-table-column>
</el-table>
<div slot="footer">
<el-button @click="customerDialogVisible = false">取消</el-button>
<el-button type="primary" :disabled="!selectedCustomerRow" @click="confirmCustomer">确定</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import logo from '@/assets/img/dimension-report-logo.png'
import { getIQCRecordList, getPropertiesModelList, getPropertiesModelDetail, getIQCDetailedRecordList } from '@/api/qc/qc_report.js' import { getIQCRecordList, getPropertiesModelList, getPropertiesModelDetail, getIQCDetailedRecordList } from '@/api/qc/qc_report.js'
import { selectIQCSubDetailedRecord } from '@/api/qc/qc.js'
import { selectIQCSubDetailedRecord, getCustomerList } from '@/api/qc/qc.js'
import { getSiteData } from '@/api/board.js'
import { buildPrintImageUrl } from '@/utils/runtimeSiteConfig.js'
const HEADER_LABELS = [ const HEADER_LABELS = [
'Raw Material', 'Durometer', 'Vulcanize Temp.', 'Curing Pressure', 'Curing Time', 'Raw Material', 'Durometer', 'Vulcanize Temp.', 'Curing Pressure', 'Curing Time',
@ -292,7 +322,7 @@ export default {
name: '产品尺寸测量报告', name: '产品尺寸测量报告',
data () { data () {
return { return {
logo,
logoUrl: '',
partType: '', partType: '',
machines: [], machines: [],
inspector: '', inspector: '',
@ -328,11 +358,17 @@ export default {
selectedItemRow: null, selectedItemRow: null,
itemList: [], itemList: [],
itemTotalPage: 0, itemTotalPage: 0,
itemSearchData: { itemDesc: '', page: 1, limit: 10 }
itemSearchData: { itemDesc: '', page: 1, limit: 10 },
siteList: [],
customerDialogVisible: false,
customerList: [],
selectedCustomerRow: null,
customerSearch: { site: '', customerID: '', customerName: '' }
} }
}, },
mounted () { mounted () {
this.measureDate = this.today() this.measureDate = this.today()
this.loadSiteList()
}, },
methods: { methods: {
today () { today () {
@ -341,6 +377,70 @@ export default {
const d = String(now.getDate()).padStart(2, '0') const d = String(now.getDate()).padStart(2, '0')
return now.getFullYear() + '/' + m + '/' + d return now.getFullYear() + '/' + m + '/' + d
}, },
loadSiteList () {
getSiteData({ userID: this.$store.state.user.name }).then(({data}) => {
this.siteList = (data && data.rows) ? data.rows : []
if (!this.customerSearch.site && this.siteList.length) {
this.customerSearch.site = this.siteList[0].siteID
}
})
},
openCustomerDialog () {
const open = () => {
if (!this.customerSearch.site && this.siteList.length) {
this.customerSearch.site = this.siteList[0].siteID
}
if (!this.customerSearch.site) {
this.$message.warning('未获取到工厂,无法选择客户')
return
}
this.selectedCustomerRow = null
this.customerDialogVisible = true
this.searchCustomerList()
}
if (this.siteList.length) {
open()
return
}
getSiteData({ userID: this.$store.state.user.name }).then(({data}) => {
this.siteList = (data && data.rows) ? data.rows : []
open()
})
},
searchCustomerList () {
if (!this.customerSearch.site) {
this.$message.warning('请先选择工厂')
return
}
getCustomerList({
site: this.customerSearch.site,
customerID: this.customerSearch.customerID || '',
customerName: this.customerSearch.customerName || ''
}).then(({data}) => {
if (data && data.code === 0) {
this.customerList = data.rows || []
} else {
this.customerList = []
this.$message.error((data && data.msg) || '客户查询失败')
}
})
},
handleCustomerDblClick (row) {
this.selectedCustomerRow = row
this.confirmCustomer()
},
confirmCustomer () {
const row = this.selectedCustomerRow
if (!row) return
const fileName = row.logoFileName == null ? '' : String(row.logoFileName).trim()
this.customerDialogVisible = false
if (!fileName) {
this.logoUrl = ''
this.$message.warning('该客户未维护商标')
return
}
this.logoUrl = buildPrintImageUrl(fileName)
},
normName (value) { normName (value) {
return normName(value) return normName(value)
}, },
@ -429,6 +529,7 @@ export default {
this.detailMap = {} this.detailMap = {}
this.templateRows = [] this.templateRows = []
this.measureRows = this.blankRows() this.measureRows = this.blankRows()
this.logoUrl = ''
this.loadTemplateDetail() this.loadTemplateDetail()
}, },
loadTemplateDetail () { loadTemplateDetail () {
@ -650,10 +751,11 @@ export default {
body { margin: 0; font-family: 'Times New Roman', '宋体', sans-serif; } body { margin: 0; font-family: 'Times New Roman', '宋体', sans-serif; }
.dim-table { width: 100%; border-collapse: collapse; table-layout: fixed; } .dim-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.dim-table td { border: 1px solid #000; text-align: center; vertical-align: middle; font-size: 10px; padding: 2px; word-break: break-all; } .dim-table td { border: 1px solid #000; text-align: center; vertical-align: middle; font-size: 10px; padding: 2px; word-break: break-all; }
.head-row td { height: 36px; padding: 0 2px; }
.logo { height: 32px; width: auto; }
.logo-cell { border: none; text-align: left; }
.title-cell { border: none; font-family: 'Arial Black', sans-serif; font-size: 18px; font-weight: 700; line-height: 1.1; height: 36px; }
.head-row td { height: 34px; padding: 0 2px; border: none; vertical-align: middle; text-align: center; }
.logo-cell { border: none; text-align: center; }
.logo { height: 30px; max-height: 30px; max-width: 100%; width: auto; object-fit: contain; }
.dim-table td.title-cell { border: none; text-align: center; font-family: 'Arial Black', sans-serif; font-size: 22px; font-weight: 700; line-height: 1.1; height: 36px; }
.tick { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 12px; height: 12px; margin-right: 3px; border: 1px solid #000; font-style: normal; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: middle; overflow: hidden; }
.label { font-family: 'STSong', '华文宋体', serif; font-weight: 700; } .label { font-family: 'STSong', '华文宋体', serif; font-weight: 700; }
.value, .left { text-align: center; } .value, .left { text-align: center; }
.left { text-align: left; padding-left: 4px; } .left { text-align: left; padding-left: 4px; }
@ -712,7 +814,7 @@ export default {
} }
.report-content { .report-content {
background: #fff; background: #fff;
padding: 12px 12px 12px 36px;
padding: 12px 12px 12px 64px;
overflow: auto; overflow: auto;
} }
.dim-table { .dim-table {
@ -742,17 +844,41 @@ export default {
.c-ng { width: 52px; } .c-ng { width: 52px; }
.logo-cell, .title-cell { .logo-cell, .title-cell {
border: none; border: none;
text-align: center;
} }
.head-row td { .head-row td {
height: 48px;
height: 46px;
} }
.logo { .logo {
height: 42px; height: 42px;
max-height: 42px;
max-width: 100%;
width: auto;
object-fit: contain;
display: block;
margin: 0 auto;
} }
.title-cell {
.customer-pick {
position: absolute;
right: calc(100% + 8px);
top: 50%;
height: 18px;
margin-top: -9px;
padding: 0 4px;
border: 1px solid #409eff;
border-radius: 2px;
background: #fff;
color: #409eff;
font-size: 12px;
line-height: 16px;
cursor: pointer;
white-space: nowrap;
}
.dim-table td.title-cell {
font-family: 'Arial Black', 'Microsoft YaHei', sans-serif; font-family: 'Arial Black', 'Microsoft YaHei', sans-serif;
font-size: 22px; font-size: 22px;
font-weight: 700; font-weight: 700;
text-align: center;
} }
.label { .label {
font-family: 'STSong', '华文宋体', 'SimSun', serif; font-family: 'STSong', '华文宋体', 'SimSun', serif;
@ -775,6 +901,22 @@ export default {
cursor: pointer; cursor: pointer;
white-space: nowrap; white-space: nowrap;
} }
.tick {
display: inline-flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 13px;
height: 13px;
margin-right: 3px;
border: 1px solid #000;
font-style: normal;
font-size: 12px;
font-weight: 700;
line-height: 1;
vertical-align: middle;
overflow: hidden;
}
.mode-select { .mode-select {
width: 68px; width: 68px;
height: 22px; height: 22px;

Loading…
Cancel
Save