YangJian0701 1 년 전
부모
커밋
54924dafcb
2개의 변경된 파일34개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 0
      src/api/ValidationTemplate.js
  2. 25 1
      src/views/ValidationTemplate/index.vue

+ 9 - 0
src/api/ValidationTemplate.js

@@ -26,6 +26,15 @@ const VT = {
 	Time_Add: '/VerifyTemplate/Time_Add',
 	Time_Up: '/VerifyTemplate/Time_Up',
 	Time_Del: '/VerifyTemplate/Time_Del',
+
+	TempCopy:'VerifyTemplate/Copy',//复制
+}
+export function TempCopy(data) {
+	return axios({
+		url: VT.TempCopy,
+		method: 'post',
+		data:data
+	})
 }
 export function TempClassDel(data) {
 	return axios({

+ 25 - 1
src/views/ValidationTemplate/index.vue

@@ -58,6 +58,8 @@
 								</el-button>
 								<el-button size="small" @click="handleDelete(scope.row)">删除
 								</el-button>
+								<el-button size="small" @click="handleCopy(scope.row)">复制
+								</el-button>
 							</div>
 						</template>
 					</el-table-column>
@@ -245,7 +247,7 @@
 		Map_Del,
 		Map_Add,
 		Map_Up,
-		TempUp
+		TempUp,TempCopy
 	} from '@/api/ValidationTemplate'
 	import {
 		PDFToken
@@ -339,6 +341,28 @@
 			this.getTempApi()
 		},
 		methods: {
+			handleCopy(e){
+				console.log('复制',e)
+				this.$prompt('请输入模板名称', '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					inputPattern: /\S/,
+					inputErrorMessage: '模板名称不能为空'
+					}).then(({ value }) => {
+						TempCopy({
+							T_VerifyTemplate_id:e.T_VerifyTemplate_id,
+							T_name:value
+						}).then(res=>{
+							console.log('1111',res)
+							if(res.data.Code==200) this.GetTempListApi()
+						})
+					}).catch(() => {
+					this.$message({
+						type: 'info',
+						message: '取消复制'
+					});       
+				});
+			},
 			showImg(){
 				this.dialogVisible = true
 				this.imgUrl = this.form.T_text