Browse Source

2025-11-27

master
fengyuan_yang 2 months ago
parent
commit
67bc71ab83
  1. 1
      src/api/qc/qc.js
  2. 38
      src/views/modules/qc/qcPartAttribute.vue
  3. 20
      src/views/modules/qc/qcTemplate.vue

1
src/api/qc/qc.js

@ -21,6 +21,7 @@ export const templateSearch = data => createAPI(`/pms/qc/templateSearch`,'post',
export const templateSave = data => createAPI(`/pms/qc/templateSave`,'post',data) export const templateSave = data => createAPI(`/pms/qc/templateSave`,'post',data)
export const templateUpdate = data => createAPI(`/pms/qc/templateUpdate`,'post',data) export const templateUpdate = data => createAPI(`/pms/qc/templateUpdate`,'post',data)
export const templateDelete = data => createAPI(`/pms/qc/templateDelete`,'post',data) export const templateDelete = data => createAPI(`/pms/qc/templateDelete`,'post',data)
export const checkTemplateReference = data => createAPI(`/pms/qc/checkTemplateReference`,'post',data) // 检查模板是否被物料引用
export const inspectionTypeSearch = data => createAPI(`/pms/qc/inspectionTypeSearch`,'post',data) export const inspectionTypeSearch = data => createAPI(`/pms/qc/inspectionTypeSearch`,'post',data)
export const objectSearch = data => createAPI(`/pms/qc/objectSearch`,'post',data) export const objectSearch = data => createAPI(`/pms/qc/objectSearch`,'post',data)
export const templateDetailsSearch = data => createAPI(`/pms/qc/templateDetailsSearch`,'post',data) export const templateDetailsSearch = data => createAPI(`/pms/qc/templateDetailsSearch`,'post',data)

38
src/views/modules/qc/qcPartAttribute.vue

@ -352,8 +352,8 @@
</el-form> </el-form>
<el-table <el-table
ref="templateTable" ref="templateTable"
:data="detailList"
:height="secondHeight - 68"
:data="detailListPaged"
:height="secondHeight - 100"
border border
@selection-change="handleTemplateSelectionChange" @selection-change="handleTemplateSelectionChange"
style="width: 100%;"> style="width: 100%;">
@ -498,6 +498,17 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 -->
<el-pagination
@size-change="templateSizeChangeHandle"
@current-change="templateCurrentChangeHandle"
:current-page="templatePageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="templatePageSize"
:total="detailList.length"
layout="total, sizes, prev, pager, next, jumper"
style="margin-top: 0px;">
</el-pagination>
</el-tab-pane> </el-tab-pane>
<!-- 物料缺陷跟踪 --> <!-- 物料缺陷跟踪 -->
<el-tab-pane label="物料缺陷跟踪" name="defectTracking"> <el-tab-pane label="物料缺陷跟踪" name="defectTracking">
@ -1363,6 +1374,8 @@
selectedTemplates: [], // selectedTemplates: [], //
dataListLoading: false, dataListLoading: false,
templateDeleteLoading: false, // loading templateDeleteLoading: false, // loading
templatePageIndex: 1, //
templatePageSize: 20, //
// //
columnList: [ columnList: [
{ {
@ -2028,6 +2041,15 @@
} }
}, },
computed: {
//
detailListPaged () {
const start = (this.templatePageIndex - 1) * this.templatePageSize
const end = start + this.templatePageSize
return this.detailList.slice(start, end)
}
},
methods: { methods: {
// bu // bu
getSiteAndBuByUserName () { getSiteAndBuByUserName () {
@ -2268,6 +2290,7 @@
this.detailData.partDesc = this.partCurrentRow.partDesc this.detailData.partDesc = this.partCurrentRow.partDesc
searchPartAttributeDetails(this.detailData).then(({data}) => { searchPartAttributeDetails(this.detailData).then(({data}) => {
this.detailList = data.rows this.detailList = data.rows
this.templatePageIndex = 1 //
}) })
}, },
@ -2521,6 +2544,17 @@
}) })
}, },
//
templateSizeChangeHandle (val) {
this.templatePageSize = val
this.templatePageIndex = 1
},
//
templateCurrentChangeHandle (val) {
this.templatePageIndex = val
},
// ==================== ==================== // ==================== ====================
// //

20
src/views/modules/qc/qcTemplate.vue

@ -461,6 +461,7 @@
templateSave, // templateSave, //
templateUpdate, // templateUpdate, //
templateDelete, // templateDelete, //
checkTemplateReference, //
inspectionTypeSearch, // inspectionTypeSearch, //
objectSearch, // objectSearch, //
templateDetailsSearch, // templateDetailsSearch, //
@ -1293,6 +1294,18 @@
// //
deleteModel (row) { deleteModel (row) {
//
checkTemplateReference({
site: row.site,
buNo: row.buNo,
templateId: row.templateId
}).then(({data}) => {
if (data && data.code === 0) {
if (data.isReferenced) {
//
this.$message.warning(`该模板已被 ${data.referenceCount} 个物料引用,无法删除!`)
} else {
//
this.$confirm(`是否删除这个检验模板?`, '提示', { this.$confirm(`是否删除这个检验模板?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -1307,6 +1320,13 @@
} }
}) })
}) })
}
} else {
this.$message.error(data.msg || '检查模板引用失败')
}
}).catch(() => {
this.$message.error('检查模板引用失败')
})
}, },
saveData () { saveData () {

Loading…
Cancel
Save