@@ -711,6 +924,14 @@
getAllResourceList, // 查询机台列表
getSiteAndBuByUserName,
searchPartInfo, // 查询物料信息
+ partAttrDetailedSearch,
+ getPartAttrItemList,
+ getPartAttrItem,
+ addPartAttrItemDetails,
+ delPartAttrItemDetails,
+ savePartAttrDetailed,
+ goUpPartAttrItem,
+ goDownPartAttrItem
} from "@/api/qc/qc.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam'
@@ -776,7 +997,14 @@
createTime: '',
createBy: this.$store.state.user.name,
attributeType: 'A',
- exemptInspection: ''
+ exemptInspection: 'N',
+ iqcExempt: 'N',
+ faiExempt: 'N',
+ ipqcExempt: 'N',
+ pqcExempt: 'N',
+ fqcExempt: 'N',
+ oqcExempt: 'N',
+ sqcExempt: 'N'
},
detailData: {
site: '',
@@ -792,6 +1020,60 @@
templateName: '',
createBy: this.$store.state.user.name
},
+ standardDetailModelFlag: false,
+ standardFastAddFlag: false,
+ standardDetailList: [],
+ standardItemList1: [],
+ standardItemList2: [],
+ standardItemSelections1: [],
+ standardItemSelections2: [],
+ standardCurrentRow: {},
+ standardDetailData: {
+ site: '',
+ buNo: '',
+ partNo: '',
+ partDesc: '',
+ attributeNo: '',
+ attributeType: 'A',
+ itemType: 'D',
+ itemNo: '',
+ itemDesc: '',
+ inspectionTypeNo: '',
+ inspectionTypeName: '',
+ createBy: this.$store.state.user.name
+ },
+ standardColumnDetailList: [
+ {
+ columnProp: 'itemNo',
+ headerAlign: 'center',
+ align: 'center',
+ columnLabel: '检验项目编码',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ columnWidth: 80
+ },
+ {
+ columnProp: 'itemDesc',
+ headerAlign: 'center',
+ align: 'left',
+ columnLabel: '检验项目名称',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ columnWidth: 250
+ },
+ {
+ columnProp: 'valueType',
+ headerAlign: 'center',
+ align: 'center',
+ columnLabel: '检测值类型',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ columnWidth: 90
+ }
+ ],
columnList: [
{
userId: this.$store.state.user.name,
@@ -1528,6 +1810,7 @@
},
searchPartInfo () {
+
this.partDetailData.site = this.modalData.site
if (!this.partDetailData.partNo && !this.partDetailData.partDesc && !this.partDetailData.sku && !this.partDetailData.cinvSourceCode) {
this.partInfoList = []
@@ -1672,7 +1955,14 @@
firstIPQCPatrolTime: '',
lastIPQCPatrolTime: '',
cycleIPQCPatrolTime: '',
- exemptInspection: ''
+ exemptInspection: 'N',
+ iqcExempt: 'N',
+ faiExempt: 'N',
+ ipqcExempt: 'N',
+ pqcExempt: 'N',
+ fqcExempt: 'N',
+ oqcExempt: 'N',
+ sqcExempt: 'N'
}
this.modalDisableFlag = false
this.modalFlag = true
@@ -1701,7 +1991,14 @@
firstIPQCPatrolTime: row.firstIPQCPatrolTime,
lastIPQCPatrolTime: row.lastIPQCPatrolTime,
cycleIPQCPatrolTime: row.cycleIPQCPatrolTime,
- exemptInspection: row.exemptInspection
+ exemptInspection: row.exemptInspection || 'N',
+ iqcExempt: row.iqcExempt || 'N',
+ faiExempt: row.faiExempt || 'N',
+ ipqcExempt: row.ipqcExempt || 'N',
+ pqcExempt: row.pqcExempt || 'N',
+ fqcExempt: row.fqcExempt || 'N',
+ oqcExempt: row.oqcExempt || 'N',
+ sqcExempt: row.sqcExempt || 'N'
}
this.modalDisableFlag = true
this.modalFlag = true
@@ -1967,6 +2264,261 @@
})
},
+ syncStandardInspectionTypeName () {
+ const o = this.options.find(i => i.inspectionTypeNo === this.standardDetailData.inspectionTypeNo)
+ if (o) {
+ this.standardDetailData.inspectionTypeName = o.inspectionTypeName
+ }
+ },
+
+ standardDetailModal (row) {
+ this.standardDetailData.site = row.site
+ this.standardDetailData.buNo = row.buNo
+ this.standardDetailData.partNo = row.partNo
+ this.standardDetailData.partDesc = row.partDesc
+ this.standardDetailData.attributeNo = row.partNo
+ this.standardDetailData.attributeType = 'A'
+ this.standardDetailData.itemType = 'D'
+ if (this.options && this.options.length > 0) {
+ this.standardDetailData.inspectionTypeNo = this.options[0].inspectionTypeNo
+ this.standardDetailData.inspectionTypeName = this.options[0].inspectionTypeName
+ }
+ partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
+ if (data.code === 0) {
+ this.standardDetailList = data.rows || []
+ }
+ })
+ this.standardDetailModelFlag = true
+ },
+
+ closeStandardDialog () {
+ this.standardDetailList = []
+ this.standardItemList1 = []
+ this.standardItemList2 = []
+ },
+
+ standardAddFastModal () {
+ this.syncStandardInspectionTypeName()
+ this.standardItemSelections1 = null
+ this.standardItemSelections2 = null
+ getPartAttrItemList(this.standardDetailData).then(({data}) => {
+ if (data.code === 0) {
+ this.standardItemList1 = data.row1 || []
+ this.standardItemList2 = data.row2 || []
+ }
+ })
+ this.standardFastAddFlag = true
+ },
+
+ standardGetItem () {
+ this.syncStandardInspectionTypeName()
+ getPartAttrItem(this.standardDetailData).then(({data}) => {
+ if (data.code === 0) {
+ this.standardItemList1 = data.rows || []
+ }
+ })
+ },
+
+ standardItemClickRow (row) {
+ this.standardCurrentRow = JSON.parse(JSON.stringify(row))
+ },
+
+ standardItemClickRow1 (row) {
+ this.$refs.standardItemTable1.toggleRowSelection(row)
+ },
+
+ standardItemClickRow2 (row) {
+ this.$refs.standardItemTable2.toggleRowSelection(row)
+ },
+
+ standardSelectionItem1 (val) {
+ this.standardItemSelections1 = val
+ },
+
+ standardSelectionItem2 (val) {
+ this.standardItemSelections2 = val
+ },
+
+ standardAddItem () {
+ if (this.standardItemSelections1 == null || this.standardItemSelections1.length === 0) {
+ this.$message.warning('请选择可选项目!')
+ return
+ }
+ if (!this.standardDetailData.inspectionTypeName) {
+ this.syncStandardInspectionTypeName()
+ }
+ let inData = {
+ site: this.standardDetailData.site,
+ buNo: this.standardDetailData.buNo,
+ attributeNo: this.standardDetailData.attributeNo,
+ attributeType: 'A',
+ inspectionTypeNo: this.standardDetailData.inspectionTypeNo,
+ itemType: this.standardDetailData.itemType,
+ updateBy: this.$store.state.user.name,
+ itemList: this.standardItemSelections1
+ }
+ addPartAttrItemDetails(inData).then(({data}) => {
+ if (data && data.code === 0) {
+ getPartAttrItemList(this.standardDetailData).then(({data}) => {
+ if (data.code === 0) {
+ this.standardItemList1 = data.row1 || []
+ this.standardItemList2 = data.row2 || []
+ }
+ })
+ this.standardItemSelections1 = []
+ this.$message.success('操作成功')
+ } else {
+ this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
+ }
+ })
+ },
+
+ standardDeleteItem () {
+ if (this.standardItemSelections2 == null || this.standardItemSelections2.length === 0) {
+ this.$message.warning('请选择已有项目!')
+ return
+ }
+ let inData = {
+ site: this.standardDetailData.site,
+ buNo: this.standardDetailData.buNo,
+ attributeNo: this.standardDetailData.attributeNo,
+ attributeType: 'A',
+ updateBy: this.$store.state.user.name,
+ itemList: this.standardItemSelections2
+ }
+ delPartAttrItemDetails(inData).then(({data}) => {
+ if (data && data.code === 0) {
+ getPartAttrItemList(this.standardDetailData).then(({data}) => {
+ if (data.code === 0) {
+ this.standardItemList1 = data.row1 || []
+ this.standardItemList2 = data.row2 || []
+ }
+ })
+ this.standardItemSelections2 = []
+ this.$message.success('操作成功')
+ } else {
+ this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
+ }
+ })
+ },
+
+ standardRefreshDetailList () {
+ partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
+ if (data.code === 0) {
+ this.standardDetailList = data.rows || []
+ }
+ })
+ },
+
+ saveStandardDetail () {
+ let tempData = {
+ site: this.standardDetailData.site,
+ buNo: this.standardDetailData.buNo,
+ attributeNo: this.standardDetailData.attributeNo,
+ attributeType: 'A',
+ inspectionTypeNo: this.standardDetailData.inspectionTypeNo,
+ updateBy: this.$store.state.user.name,
+ itemList: this.standardDetailList
+ }
+ savePartAttrDetailed(tempData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.getDataList()
+ this.standardDetailModelFlag = false
+ this.$message.success('操作成功')
+ } else {
+ this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
+ }
+ })
+ },
+
+ standardDelItemDetails (row) {
+ this.$confirm('是否删除该检验项目?', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() => {
+ delPartAttrItemDetails({
+ site: this.standardDetailData.site,
+ buNo: this.standardDetailData.buNo,
+ attributeNo: this.standardDetailData.attributeNo,
+ attributeType: 'A',
+ updateBy: this.$store.state.user.name,
+ itemList: [row]
+ }).then(({data}) => {
+ if (data && data.code === 0) {
+ partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
+ if (data.code === 0) {
+ this.standardDetailList = data.rows || []
+ }
+ })
+ this.$message.success('操作成功')
+ } else {
+ this.$alert((data && data.msg) || '操作失败', '错误', { confirmButtonText: '确定' })
+ }
+ })
+ }).catch(() => {})
+ },
+
+ standardGoUp () {
+ if (!this.standardCurrentRow || !this.standardCurrentRow.itemNo) {
+ this.$message.warning('请先点击表格选择一行')
+ return
+ }
+ const row = {
+ ...this.standardCurrentRow,
+ site: this.standardDetailData.site,
+ buNo: this.standardDetailData.buNo,
+ attributeNo: this.standardDetailData.attributeNo
+ }
+ goUpPartAttrItem(row).then(({data}) => {
+ if (data && data.code === 0) {
+ partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
+ if (data.code === 0) {
+ this.standardDetailList = data.rows || []
+ for (let i = 0; i < this.standardDetailList.length; i++) {
+ if (this.standardDetailList[i].itemNo === row.itemNo) {
+ this.$refs.standardDetailTable.setCurrentRow(this.standardDetailList[i])
+ this.standardCurrentRow = JSON.parse(JSON.stringify(this.standardDetailList[i]))
+ break
+ }
+ }
+ this.$message.success('操作成功')
+ }
+ })
+ }
+ })
+ },
+
+ standardGoDown () {
+ if (!this.standardCurrentRow || !this.standardCurrentRow.itemNo) {
+ this.$message.warning('请先点击表格选择一行')
+ return
+ }
+ const row = {
+ ...this.standardCurrentRow,
+ site: this.standardDetailData.site,
+ buNo: this.standardDetailData.buNo,
+ attributeNo: this.standardDetailData.attributeNo
+ }
+ goDownPartAttrItem(row).then(({data}) => {
+ if (data && data.code === 0) {
+ partAttrDetailedSearch(this.standardDetailData).then(({data}) => {
+ if (data.code === 0) {
+ this.standardDetailList = data.rows || []
+ for (let i = 0; i < this.standardDetailList.length; i++) {
+ if (this.standardDetailList[i].itemNo === row.itemNo) {
+ this.$refs.standardDetailTable.setCurrentRow(this.standardDetailList[i])
+ this.standardCurrentRow = JSON.parse(JSON.stringify(this.standardDetailList[i]))
+ break
+ }
+ }
+ this.$message.success('操作成功')
+ }
+ })
+ }
+ })
+ },
+
// 删除物料属性中的模板
deletePartAttributeDetails (row) {
this.$confirm(`是否删除这个检验模板?`, '提示', {