gaoluyang
2025-05-20 c334c2d76c1b51d0fbe1531bf524e1b90f921a7c
Merge remote-tracking branch 'origin/dev' into dev
已修改1个文件
85 ■■■■■ 文件已修改
src/views/salesManagement/invoiceRegistration/index.vue 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/invoiceRegistration/index.vue
@@ -43,10 +43,10 @@
              <el-table-column label="含税单价(元)" prop="taxInclusiveUnitPrice" />
              <el-table-column label="含税总价(元)" prop="taxInclusiveTotalPrice" />
              <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" />
              <el-table-column label="本次开票数" prop="invoiceNum" />
              <el-table-column label="本次开票金额(元)" prop="invoiceAmount" />
              <el-table-column label="未开票数(元)" prop="noInvoiceNum" />
              <el-table-column label="未开票金额(元)" prop="noInvoiceAmount" />
              <el-table-column label="开票数" prop="invoiceNum" />
              <el-table-column label="开票金额(元)" prop="invoiceAmount" />
              <el-table-column label="未开票数" prop="noInvoiceNum" />
              <el-table-column label="未开票金额(元)" prop="noInvoiceAmount"/>
            </el-table>
          </template>
        </el-table-column>
@@ -57,11 +57,7 @@
        <el-table-column label="业务员" prop="salesman" show-overflow-tooltip/>
        <el-table-column label="项目名称" prop="projectName" show-overflow-tooltip/>
        <el-table-column label="合同金额(元)" prop="contractAmount" show-overflow-tooltip/>
        <el-table-column fixed="right" label="操作" min-width="60" align="center">
          <template #default="scope">
            <el-button link type="primary" size="small" @click="openForm('edit', scope.row);">编辑</el-button>
          </template>
        </el-table-column>
        <el-table-column label="未开票金额(元)" prop="noInvoiceAmountTotal" show-overflow-tooltip/>
      </el-table>
      <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" :page="page.current"
                  :limit="page.size" @pagination="paginationChange" />
@@ -98,7 +94,7 @@
          <el-form-item label="产品信息:" prop="entryDate">
          </el-form-item>
        </el-row>
        <el-table :data="productData" border>
        <el-table :data="productData" border show-summary :summary-method="summarizeChildrenTable">
          <el-table-column align="center" label="序号" type="index" width="60" />
          <el-table-column label="产品大类" prop="productCategory" />
          <el-table-column label="规格型号" prop="specificationModel" />
@@ -110,28 +106,22 @@
          <el-table-column label="不含税总价(元)" prop="taxExclusiveTotalPrice" />
          <el-table-column label="本次开票数" prop="invoiceNum">
            <template #default="scope">
              <el-input :disabled="!scope.row.editFlag" v-model="scope.row.invoiceNum"></el-input>
              <el-input type="number" :step="1" min="0" v-model="scope.row.invoiceNum" @blur="invoiceNumBlur(scope.row)"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="本次开票金额(元)" prop="invoiceAmount" >
            <template #default="scope">
              <el-input :disabled="!scope.row.editFlag" v-model="scope.row.invoiceAmount"></el-input>
              <el-input type="number" :step="0.01" min="0" v-model="scope.row.invoiceAmount" @blur="invoiceAmountBlur(scope.row)"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="未开票数(元)" prop="noInvoiceNum" >
          <el-table-column label="未开票数" prop="noInvoiceNum" >
            <template #default="scope">
              <el-input :disabled="!scope.row.editFlag" v-model="scope.row.noInvoiceNum"></el-input>
              <el-input type="number" min="0" disabled v-model="scope.row.noInvoiceNum"></el-input>
            </template>
          </el-table-column>
          <el-table-column label="未开票金额(元)" prop="noInvoiceAmount" >
            <template #default="scope">
              <el-input :disabled="!scope.row.editFlag" v-model="scope.row.noInvoiceAmount"></el-input>
            </template>
          </el-table-column>
          <el-table-column fixed="right" label="操作" min-width="60" align="center">
            <template #default="scope">
              <el-button v-if="!scope.row.editFlag" link type="primary" size="small" @click="openProductEdit(scope.row);">编辑</el-button>
              <el-button v-else link type="primary" size="small" @click="openProductEdit(scope.row);">保存</el-button>
              <el-input  type="number" min="0"  disabled v-model="scope.row.noInvoiceAmount"></el-input>
            </template>
          </el-table-column>
        </el-table>
@@ -193,21 +183,6 @@
  }
})
const { searchForm, form, rules } = toRefs(data)
// 产品表单弹框数据
const productFormData = reactive({
  productForm: {
    productCategory: '',
    specificationModel: '',
    unit: '',
    quantity: '',
    taxInclusiveUnitPrice: '',
    taxRate: '',
    taxInclusiveTotalPrice: '',
    taxExclusiveTotalPrice: '',
    invoiceType: '',
  },
})
const { productForm } = toRefs(productFormData)
// 查询列表
/** 搜索按钮操作 */
@@ -229,6 +204,7 @@
      item.children = []
    })
    total.value = res.data.total
    expandedRowKeys.value = []
  })
}
// 表格选择数据
@@ -324,9 +300,6 @@
  proxy.$refs["formRef"].validate(valid => {
    if (valid) {
      form.value.productDtoList = proxy.HaveJson(productData.value)
      form.value.productDtoList.forEach(item => {
        item.id = ''
      })
      delete form.value.productData
      invoiceRegistrationSaveOrUpdate(form.value).then(res => {
        proxy.$modal.msgSuccess("提交成功")
@@ -340,13 +313,6 @@
const closeDia = () => {
  proxy.resetForm("formRef")
  dialogFormVisible.value = false
}
// 打开产品弹框
const openProductEdit = (row) => {
   const index =  productData.value.findIndex(item => item.id === row.id);
   if (index > -1) {
     productData.value[index].editFlag = !productData.value[index].editFlag
   }
}
// 导出
const handleOut = () => {
@@ -402,15 +368,40 @@
        customerId: res.customerId,
      }
      productData.value = form.value.productData.map(item => {
        item.editFlag = false
        item.noInvoiceNum = item.futureTickets
        item.noInvoiceAmount = item.futureTicketsAmount
        return item
      })
      console.log('productData.value ',productData.value )
    })
  }else {
    proxy.resetForm("formRef")
    productData.value = []
  }
}
//本次开票失焦操作
const invoiceNumBlur = (row) => {
  if(!row.invoiceNum){
    row.invoiceNum = 0
  }
  if(row.invoiceNum > row.noInvoiceNum){
    proxy.$modal.msgWarning('本次开票数不得大于未开票数')
    row.invoiceNum = 0
  }
  row.noInvoiceNum = row.futureTickets - row.invoiceNum
}
// 本次开票金额失焦操作
const invoiceAmountBlur = (row) => {
  if(!row.invoiceAmount){
    row.invoiceAmount = 0
  }
  if(row.invoiceAmount > row.noInvoiceAmount){
    proxy.$modal.msgWarning('本次开票金额不得大于未开票金额')
    row.invoiceAmount = 0
  }
  row.noInvoiceAmount = row.futureTicketsAmount - row.invoiceAmount
}
getList()
</script>