Browse Source

绩效下新增

Lexie 1 year ago
parent
commit
140d064ada

+ 9 - 0
src/api/mes_api_gty/otherDocuments.js

@@ -46,3 +46,12 @@ export const updateData = (data) => {
     data
   })
 }
+
+// 新增
+export const add = (data) => {
+  return service({
+    url: '/mes_server/other_count_document/add',
+    method: 'post',
+    data
+  })
+}

+ 2 - 0
src/api/mes_api_gty/overTimePayVerification.js

@@ -49,3 +49,5 @@ export const getLocal = (params) => {
   })
 }
 
+
+

+ 60 - 17
src/view/performance/07-otherDocuments/index.vue

@@ -42,7 +42,7 @@
               <el-button
                 type="primary"
                 :icon="Search"
-                @click="onSearch"
+                @click="handleShowAdd"
               >新增</el-button>
 
               <div style="margin-left: auto;">
@@ -192,12 +192,12 @@
                 label="工价代号"
               >
                 <el-input
-                  v-model="detailData.Sczl_dedh"
+                  v-model="detailData.sys_bh"
                   style="width: 200px"
                   @keyup.enter="handleGjdhEnter"
                 />
                 <el-input
-                  v-model="detailData.aaaa"
+                  v-model="detailData.sys_mc"
                   style="width: 300px; margin-left: 5px"
                   readonly
                 />
@@ -247,7 +247,7 @@ import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDow
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { Search, Refresh, Download } from '@element-plus/icons-vue'
 import { ref, reactive, onMounted, onBeforeMount } from 'vue'
-import { getSide, getTable, getInfo, getOtherInfo, updateData } from '@/api/mes_api_gty/otherDocuments'
+import { getSide, getTable, getInfo, getOtherInfo, updateData,add } from '@/api/mes_api_gty/otherDocuments'
 
 defineOptions({
   name: '07OtherDocuments'
@@ -362,11 +362,18 @@ const detailData = reactive({})
 
 // 弹窗控制标记
 const dialogFormVisible = ref(false)
-
+// 新增数据
+const handleShowAdd = () => {
+    type.value = '新增'
+	Object.assign(detailData, currentRow.value)
+	dialogFormVisible.value = true
+}
 // 查改
 const handleShowDetail = () => {
   type.value = '查改'
   Object.assign(detailData, currentRow.value)
+  console.log(detailData)
+  console.log(currentRow.value)
   dialogFormVisible.value = true
 }
 const handleYgbhEnter = async() => {
@@ -392,31 +399,67 @@ const handleGjdhEnter = async() => {
 
 // 弹窗确定
 const enterDialog = async() => {
-  const params = {
-    UniqId: detailData.UniqId,
+	
+	if (type.value === '查改') {
+	  updateDetailData()
+	} else if (type.value === '新增') {
+	  addDetailData()
+	}
+}
+//新增
+const addDetailData = async() => {
+	
+  const restoredData = {
+    Sys_id: '[1009/李美芬]',
     Sczl_bh1: detailData.Sczl_bh1,
     sczl_Type: detailData.sczl_Type,
+    // name: detailData.name,
     Sczl_rq: detailData.Sczl_rq,
     Sczl_gdbh: detailData.sczl_gdbh,
-    Sczl_gxmc: '',
+    Sczl_gxmc: detailData.Sczl_gxmc,
     sczl_gxh: detailData.sczl_gxh,
-    Sczl_cl: detailData.Sczl_cl,
-    Sczl_dedh: '',
-    Sczl_desc: detailData.Sczl_desc,
+	Sczl_cl: detailData.Sczl_cl,
+	Sczl_dedh: detailData.sys_bh,
+	Sczl_desc: detailData.Sczl_desc,
   }
-  const res = await updateData(params)
+  console.log(restoredData)
+  const res = await add(restoredData)
+  console.log(restoredData)
+  console.log(res)
   if (res.code === 0) {
     ElMessage({
       type: 'success',
-      message: '新成功',
+      message: '新成功',
     })
     dialogFormVisible.value = false
-    params.order = ''
-    // page.value = 1
-    handleCurrentChange()
   }
 }
-
+//修改
+const updateDetailData = async() => {
+	const params = {
+	  UniqId: detailData.UniqId,
+	  Sczl_bh1: detailData.Sczl_bh1,
+	  sczl_Type: detailData.sczl_Type,
+	  Sczl_rq: detailData.Sczl_rq,
+	  Sczl_gdbh: detailData.sczl_gdbh,
+	  Sczl_gxmc: '',
+	  sczl_gxh: detailData.sczl_gxh,
+	  Sczl_cl: detailData.Sczl_cl,
+	  Sczl_dedh: '',
+	  Sczl_desc: detailData.Sczl_desc,
+	}
+	const res = await updateData(params)
+	if (res.code === 0) {
+	  ElMessage({
+	    type: 'success',
+	    message: '更新成功',
+	  })
+	  dialogFormVisible.value = false
+	  params.order = ''
+	  // page.value = 1
+	  handleCurrentChange()
+	}
+}
 // 获取需要的字典 可能为空 按需保留
 const setOptions = async() => {
 }

+ 102 - 17
src/view/performance/08-timesheet/index.vue

@@ -33,6 +33,11 @@
                 :icon="Search"
                 @click="onSearch"
               >搜索</el-button>
+			  <el-button
+			    type="primary"
+			    :icon="Search"
+			    @click="handleShowAdd"
+			  >新增</el-button>
               <el-button
                 type="primary"
                 :icon="Refresh"
@@ -61,6 +66,7 @@
               :header-cell-style="{ padding: '0px' }"
               @selection-change="handleSelectionChange"
               @row-dblclick="doubleClick"
+			  @row-click="Click"
             >
               <el-table-column
                 type="selection"
@@ -395,7 +401,7 @@ import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDow
 import { ElMessage, ElMessageBox } from 'element-plus'
 import { Search, Refresh, Download } from '@element-plus/icons-vue'
 import { ref, reactive, onMounted, onBeforeMount } from 'vue'
-import { getSide, getTable, getDetail, updateData, getLocate } from '@/api/mes_api_gty/timesheet'
+import { getSide, getTable, getDetail, updateData, getLocate ,createData} from '@/api/mes_api_gty/timesheet'
 
 defineOptions({
   name: '08Timesheet'
@@ -523,7 +529,15 @@ const handleNodeClick = (node, check) => {
     handleCurrentChange()
   }
 }
-
+// 新增数据
+const handleShowAdd = async () => {
+  const res = await getDetail({ wgjs_rq: value1.value, wgjs_bh1: value2.value });
+  if (res.code === 0) {
+	type.value='add'
+    Object.assign(detailData, res.data);
+	dialogFormVisible.value = true
+  }
+};
 // 搜索
 function onSearch() {
   params.search = searchInfo.value
@@ -550,24 +564,95 @@ async function doubleClick(row, column, event) {
     dialogFormVisible.value = true
   }
 }
-
+const value1=ref()
+const value2=ref()
+// 单击表格操作
+async function Click(row, column, event) {
+  const { wgjs_rq, wgjs_bh1 } = row
+  value1.value=wgjs_rq
+  value2.value=wgjs_bh1
+  // console.log(wgjs_rq)
+  // console.log(wgjs_bh1)
+  // const res = await getDetail({ wgjs_rq, wgjs_bh1 })
+  // if (res.code === 0) {
+  //   Object.assign(detailData, res.data)
+  //   dialogFormVisible.value = true
+  // }
+}
 // 更新数据
 const enterDialog = async() => {
-  const obj = detailData
-  for (let i = 1; i <= 6; i++) {
-    delete obj[`name${i}`]
-  }
-  const res = await updateData(obj)
-  if (res.code === 0) {
-    ElMessage({
-      type: 'success',
-      message: '更新成功'
-    })
-    params.type = 'getTableData'
-    // page.value = 1
-    handleCurrentChange()
-    dialogFormVisible.value = false
+	
+	if (type.value === 'update') {
+	  updateDetailData()
+	} else if (type.value === 'add') {
+	  addDetailData()
+	}
+	
+  
+}
+//新增
+const addDetailData = async() => {
+  const restoredData = {
+    wgjs_rq: detailData.wgjs_rq,
+	wgjs_bh1:detailData.wgjs_bh1,
+	wgjs_js1:detailData.wgjs_js1,
+	wgjs_yy1:detailData.wgjs_yy1,
+	wgjs_冲定额1:detailData.wgjs_冲定额1,
+	
+	wgjs_bh2:detailData.wgjs_bh2,
+	wgjs_js2:detailData.wgjs_js2,
+	wgjs_yy2:detailData.wgjs_yy2,
+	wgjs_冲定额2:detailData.wgjs_冲定额2,
+	
+	wgjs_bh3:detailData.wgjs_bh3,
+	wgjs_js3:detailData.wgjs_js3,
+	wgjs_yy3:detailData.wgjs_yy3,
+	wgjs_冲定额3:detailData.wgjs_冲定额3,
+	
+	wgjs_bh4:detailData.wgjs_bh4,
+	wgjs_js4:detailData.wgjs_js4,
+	wgjs_yy4:detailData.wgjs_yy4,
+	wgjs_冲定额4:detailData.wgjs_冲定额4,
+	
+	wgjs_bh5:detailData.wgjs_bh5,
+	wgjs_js5:detailData.wgjs_js5,
+	wgjs_yy5:detailData.wgjs_yy5,
+	wgjs_冲定额5:detailData.wgjs_冲定额5,
+	
+	wgjs_bh6:detailData.wgjs_bh6,
+	wgjs_js6:detailData.wgjs_js6,
+	wgjs_yy6:detailData.wgjs_yy6,
+	wgjs_冲定额6:detailData.wgjs_冲定额6,
   }
+  console.log(restoredData)
+  const res = await createData(restoredData)
+  console.log(res)
+  // console.log(res)
+  // if (res.code === 0) {
+  //   ElMessage({
+  //     type: 'success',
+  //     message: '新增成功',
+  //   })
+  //   dialogFormVisible.value = false
+  // }
+}
+//修改
+const updateDetailData = async() => {
+	const obj = detailData
+	for (let i = 1; i <= 6; i++) {
+	  delete obj[`name${i}`]
+	}
+	const res = await updateData(obj)
+	if (res.code === 0) {
+	  ElMessage({
+	    type: 'success',
+	    message: '更新成功'
+	  })
+	  params.type = 'getTableData'
+	  // page.value = 1
+	  handleCurrentChange()
+	  dialogFormVisible.value = false
+	}
 }
 
 // 获取需要的字典 可能为空 按需保留