@dongkboy hai 2 meses
pai
achega
2b24a183b3
Modificáronse 1 ficheiros con 9 adicións e 4 borrados
  1. 9 4
      src/views/receivable/documentary/ticket.vue

+ 9 - 4
src/views/receivable/documentary/ticket.vue

@@ -42,7 +42,7 @@
       <el-table-column prop="receivablePremium" label="应收总额"></el-table-column>
       <el-table-column prop="reconciliationAmount" label="对账金额">
         <template #default="scope">
-          <div class="flex items-center cursor-pointer" @click="handleEdit(scope.row)"
+          <div class="flex items-center cursor-pointer" @click="handleEdit(scope.row,scope.$index)"
             @mouseenter="scope.row.showEdit = true" @mouseleave="scope.row.showEdit = false">
             ¥{{ scope.row.reconciliationAmount || 0 }}
             <el-icon class="m-l-4px " v-if="scope.row.showEdit">
@@ -153,7 +153,7 @@
       </el-form>
       <template #footer>
         <el-button class="border-[#0083FF] color-[#0083FF]" plain @click="editShow = false">取消</el-button>
-        <el-button type="primary" @click="editShow = false">确定</el-button>
+        <el-button type="primary" @click="handelComfirmEdit" >确定</el-button>
       </template>
     </el-dialog>
   <el-image-viewer v-if="imageShow" :url-list="[bigImageUrl]" @close="imageShow = false" />
@@ -179,9 +179,11 @@ const countForm = ref({
 })
 const editShow = ref(false)
 const editForm = ref({})
-const handleEdit = (row) => {
+const rowIndex = ref(0)
+const handleEdit = (row: any, index: number) => {
   editShow.value = true
   editForm.value = {...row}
+  rowIndex.value = index
 }
 const companyIdprops = {
   expandTrigger: 'hover' as const,
@@ -407,7 +409,10 @@ const initCompany = () => {
     }
   })
 }
-
+const handelComfirmEdit = () => {
+  tableData.value[rowIndex.value].reconciliationAmount = editForm.value.reconciliationAmount
+  editShow.value = false
+}
 onMounted(() => {
   initData()
   initCompany()