liuhairui 1 year ago
parent
commit
999d9a8425

+ 12 - 3
src/view/performance/06-packingDocuments/index.vue

@@ -86,6 +86,7 @@
 								<!-- 表格列表input -->
 								<!-- 表格列表input -->
 								<el-table :data="detailData.table" border tooltip-effect="dark"
 								<el-table :data="detailData.table" border tooltip-effect="dark"
 									:row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }"
 									:row-style="{ height: '20px' }" :cell-style="{ padding: '0px' }"
+									:cell-class-name="sxzhscsCellClass"
 									:header-row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }">
 									:header-row-style="{ height: '20px' }" :header-cell-style="{ padding: '0px' }">
 
 
 									<el-table-column label="工单编号" width="120">
 									<el-table-column label="工单编号" width="120">
@@ -1782,13 +1783,21 @@ const ent1 = (event,index,row,title) => {
   }
   }
 };
 };
 
 
+//新增、修改表格文字顔色
+const sxzhscsCellClass = ({row, column, rowIndex, columnIndex}) =>{
+  if (column.label === '印件工序' || column.label === '工序名称' || column.label === '印件名称') {
+    return 'plan-usage-low';
+  }
+}
+
 </script>
 </script>
 
 
 <style scoped>
 <style scoped>
-	:deep(.plan-usage-low div) {
-		color: red !important;
+	/* 新增、修改文字背景顔色 */
+	:deep(.plan-usage-low .el-input__inner) {
+	  color: red !important;
 	}
 	}
-
+	
 	.JKWTree-container {
 	.JKWTree-container {
 		display: flex;
 		display: flex;
 	}
 	}

+ 25 - 40
src/view/performance/Manualdocuments.vue

@@ -55,7 +55,7 @@
 						</div>
 						</div>
 					</div>
 					</div>
 					<!-- 弹出框 -->
 					<!-- 弹出框 -->
-					<el-dialog v-model="dialogFormVisible" :before-close="closeDialog"
+					<el-dialog v-model="dialogFormVisible"
 						:title="type === 'create' ? '添加' : '修改'" destroy-on-close width="1000px">
 						:title="type === 'create' ? '添加' : '修改'" destroy-on-close width="1000px">
 						<el-form :model="formData"  label-position="right" ref="elFormRef" :rules="rule"
 						<el-form :model="formData"  label-position="right" ref="elFormRef" :rules="rule"
 							label-width="70px" @keyup="moveFocus">
 							label-width="70px" @keyup="moveFocus">
@@ -217,7 +217,7 @@
 								</div>
 								</div>
 								<div style="width: 450px;">
 								<div style="width: 450px;">
 									<div v-for="index in 6" :key="index + 6">
 									<div v-for="index in 6" :key="index + 6">
-										<el-input style="width: 100px; margin-right: 5px;"
+										<el-input style="width: 100px; margin-right: 5px;" placeholder="Enter回车"
 											v-model="formData['sczl_bh' + (index + 6)]" :id="'bh' + (index + 6)"
 											v-model="formData['sczl_bh' + (index + 6)]" :id="'bh' + (index + 6)"
 											@keydown="ent($event, (index + 6).toString())" />
 											@keydown="ent($event, (index + 6).toString())" />
 										<el-input style="width: 100px; margin-right: 5px; color: red;" :readonly="true"
 										<el-input style="width: 100px; margin-right: 5px; color: red;" :readonly="true"
@@ -560,19 +560,6 @@
 	}
 	}
 
 
 	const getTableData = async () => {
 	const getTableData = async () => {
-		// const response = await getDateList(params);
-		// console.log(response)
-		// if (response.code === 0) {
-		//   const processedData = response.data.data.map(item => {
-		//     return {
-		//       ...item,
-		//       combinedProp: item.sczl_gdbh + '--'+item.yj_yjmc,
-		// combinedProp2: item.sczl_yjgx + '-'+item.sczl_gxmc
-		//     };
-		//   });
-		//   tableData.splice(0, tableData.length, ...processedData);
-		// }
-
 		const response = await getDateList({
 		const response = await getDateList({
 			date: params.date,
 			date: params.date,
 			sys_id: params.sys_id,
 			sys_id: params.sys_id,
@@ -916,15 +903,6 @@
 			})
 			})
 	}
 	}
    }else if (event.keyCode === 13 || event.keyCode === 40) { 
    }else if (event.keyCode === 13 || event.keyCode === 40) { 
-		if (event.target.id == '其他备注') {
-			ElMessageBox.confirm('数据存盘?', '提示', {
-				confirmButtonText: '确定',
-				cancelButtonText: '取消',
-				type: 'warning'
-			}).then(() => {
-				enterDialog()
-			})
-		}
 		for (let i = currentIndex + 1; i < inputs.length; i++) {
 		for (let i = currentIndex + 1; i < inputs.length; i++) {
 			if (!inputs[i].readOnly) {
 			if (!inputs[i].readOnly) {
 				nextTick(() => {
 				nextTick(() => {
@@ -966,15 +944,15 @@
 			}
 			}
 		}
 		}
 	} else if (event.keyCode === 39) { // 向右箭头
 	} else if (event.keyCode === 39) { // 向右箭头
-		if (event.target.id == '其他备注') {
-			ElMessageBox.confirm('数据存盘?', '提示', {
-				confirmButtonText: '确定',
-				cancelButtonText: '取消',
-				type: 'warning'
-			}).then(() => {
-				enterDialog()
-			})
-		}
+		// if (event.target.id == '其他备注') {
+		// 	ElMessageBox.confirm('数据存盘?', '提示', {
+		// 		confirmButtonText: '确定',
+		// 		cancelButtonText: '取消',
+		// 		type: 'warning'
+		// 	}).then(() => {
+		// 		enterDialog()
+		// 	})
+		// }
 		if (event.target.selectionStart === event.target.value.length) {
 		if (event.target.selectionStart === event.target.value.length) {
 			for (let i = currentIndex + 1; i < inputs.length; i++) {
 			for (let i = currentIndex + 1; i < inputs.length; i++) {
 				if (!inputs[i].readOnly) {
 				if (!inputs[i].readOnly) {
@@ -1917,9 +1895,7 @@ const entdedh = (event) => {
 		if (ADD.value == '新增') {
 		if (ADD.value == '新增') {
 			console.log(restoredData)
 			console.log(restoredData)
 			const response = await inspectadd(restoredData);
 			const response = await inspectadd(restoredData);
-			// ADD.value='1'
-			// console.log(ADD.value)
-			ADD.value = '0'
+			// ADD.value = '0'
 			console.log(response)
 			console.log(response)
 			if (response.code == 0) {
 			if (response.code == 0) {
 				ElMessage({
 				ElMessage({
@@ -1932,9 +1908,10 @@ const entdedh = (event) => {
 					//刷新页面
 					//刷新页面
 					getTableData()
 					getTableData()
 				}
 				}
+				
 			}
 			}
 
 
-		} else {
+		} else if (ADD.value == '修改'){
 			const response = await shougongedit(restoredData);
 			const response = await shougongedit(restoredData);
 			if (response.code == 0) {
 			if (response.code == 0) {
 				ElMessage({
 				ElMessage({
@@ -2019,7 +1996,6 @@ const entdedh = (event) => {
 			treeData.splice(0, treeData.length, ...transformedData);
 			treeData.splice(0, treeData.length, ...transformedData);
 
 
 		}
 		}
-		// getTableData()
 	}
 	}
 	// ============== 表格控制部分结束 ===============
 	// ============== 表格控制部分结束 ===============
 
 
@@ -2118,12 +2094,16 @@ const entdedh = (event) => {
 	}
 	}
 	// 弹窗确定
 	// 弹窗确定
 	const enterDialog = async () => {
 	const enterDialog = async () => {
+		
 		ElMessageBox.confirm('数据存盘?', '提示', {
 		ElMessageBox.confirm('数据存盘?', '提示', {
 			confirmButtonText: '确定',
 			confirmButtonText: '确定',
 			cancelButtonText: '取消',
 			cancelButtonText: '取消',
 			type: 'warning'
 			type: 'warning'
 		}).then(() => {
 		}).then(() => {
-
+			
+			// console.log(1)
+			// return; 
+			
 			if (formData.value.sczl_rq == '') {
 			if (formData.value.sczl_rq == '') {
 				ElMessage({
 				ElMessage({
 					type: 'error',
 					type: 'error',
@@ -2167,13 +2147,14 @@ const entdedh = (event) => {
 			for (let i = 0; i < 13; i++) {
 			for (let i = 0; i < 13; i++) {
 				formData.value[`sczl_cl${i}`] = 0;
 				formData.value[`sczl_cl${i}`] = 0;
 				formData.value[`sczl_fp${i}`] = 0;
 				formData.value[`sczl_fp${i}`] = 0;
-				}
+			}
 		});
 		});
 	}
 	}
 	let tables = ref(5);
 	let tables = ref(5);
 	let lastCellValue = ref()
 	let lastCellValue = ref()
 	// 双击表格操作
 	// 双击表格操作
 	function doubleClick(row, column, event) {
 	function doubleClick(row, column, event) {
+		ADD.value = '修改'
 		type.value = 'update';
 		type.value = 'update';
 		lastCellValue = row['UniqId'];
 		lastCellValue = row['UniqId'];
 		tables.value = lastCellValue
 		tables.value = lastCellValue
@@ -2260,4 +2241,8 @@ const entdedh = (event) => {
 	.mab {
 	.mab {
 		margin-bottom: 5px;
 		margin-bottom: 5px;
 	}
 	}
+	/* tree组件背景高亮 */
+	:deep(.el-tree-node:focus > .el-tree-node__content){
+			background: #ff80ff !important;
+		}
 </style>
 </style>