@@ -647,53 +701,64 @@
-
- scope.row.defectThreshold= value.match(/^[1-9]\d*$/) ? value.match(/^[1-9]\d*$/)[0] : ''"
- style="height: 11px; width: 98%;">
-
-
-
- {{scope.row[scope.column.property]}}
-
+
+
+ {{scope.row.defectThreshold}}
-
- scope.row.recoveryBatchCount = value.match(/^[1-9]\d*$/) ? value.match(/^[1-9]\d*$/)[0] : ''"
- style="height: 11px; width: 98%;">
-
-
-
- {{scope.row[scope.column.property]}}
-
+
+
+ {{scope.row.recoveryBatchCount}}
- {{scope.row[scope.column.property]}}
+
+
+ {{scope.row.currentDefectCount}}
@@ -703,11 +768,20 @@
- {{scope.row.remainingTrackingBatches}}
+
+
+ {{scope.row.remainingTrackingBatches}}
({
+ site: row.site,
+ buNo: row.buNo,
+ buDesc: row.buDesc,
+ partNo: row.partNo,
+ partDesc: row.partDesc,
+ defectThreshold: row.defectThreshold == null ? 0 : Number(row.defectThreshold),
+ recoveryBatchCount: row.recoveryBatchCount == null ? 0 : Number(row.recoveryBatchCount),
+ currentDefectCount: row.currentDefectCount == null ? 0 : Number(row.currentDefectCount),
+ remainingTrackingBatches: row.remainingTrackingBatches == null ? 0 : Number(row.remainingTrackingBatches),
+ lastUpdateBy: this.$store.state.user.name
+ }))
+ this.batchDefectEditFlag = true
+ },
+
+ saveBatchDefectEdit () {
+ if (!this.batchDefectEditList || this.batchDefectEditList.length === 0) {
+ this.$message.warning('没有可保存的数据!')
+ return
+ }
+ for (let i = 0; i < this.batchDefectEditList.length; i++) {
+ const row = this.batchDefectEditList[i]
+ const remaining = Number(row.remainingTrackingBatches || 0)
+ const recovery = Number(row.recoveryBatchCount || 0)
+ if (remaining > recovery) {
+ this.$message.warning(`物料【${row.partNo}】剩余跟踪批次不能大于连续跟踪批次`)
+ return
+ }
+ }
+ this.batchDefectEditLoading = true
+ batchQcPartDefectTrackingEdit(this.batchDefectEditList).then(({data}) => {
+ if (data && data.code === 0) {
+ this.$message.success('操作成功')
+ this.batchDefectEditFlag = false
+ if (this.$refs.partTable) {
+ this.$refs.partTable.clearSelection()
+ }
+ this.partSelections = []
+ this.getDataList()
+ } else {
+ this.$message.error(data.msg || '批量保存失败')
+ }
+ }).catch((error) => {
+ this.$message.error((error && error.message) || '批量保存失败')
+ }).finally(() => {
+ this.batchDefectEditLoading = false
+ })
+ },
+
// 获取数据列表
getDataList () {
this.searchData.limit = this.pageSize
@@ -3480,8 +3621,17 @@
// 批量保存
batchDefectTrackingModel () {
- let params = []
- params = this.defectTrackingList
+ const params = this.defectTrackingList || []
+ for (let i = 0; i < params.length; i++) {
+ const row = params[i]
+ const remaining = Number(row.remainingTrackingBatches || 0)
+ const recovery = Number(row.recoveryBatchCount || 0)
+ if (remaining > recovery) {
+ const supplier = row.supplierName || row.supplierId || ''
+ this.$message.warning(`供应商【${supplier}】剩余跟踪批次不能大于连续跟踪批次`)
+ return
+ }
+ }
this.batchLoading = true
updateDefectTracking(params).then(({data}) => {
if (data && data.code === 0) {
@@ -4355,6 +4505,22 @@
line-height: 32px;
}
+.part-edit-dialog .batch-defect-edit-table /deep/ .el-table__cell .cell {
+ height: auto !important;
+ line-height: 28px !important;
+ overflow: visible !important;
+ white-space: normal !important;
+}
+
+.part-edit-dialog .batch-defect-edit-table /deep/ .el-input-number {
+ width: 100%;
+}
+
+.part-edit-dialog .batch-defect-edit-table /deep/ .el-input-number .el-input__inner,
+.num-right /deep/ .el-input__inner {
+ text-align: right;
+}
+
/* 检验模板弹出框样式 - 超紧凑版 */