|
@@ -2,8 +2,8 @@
|
|
|
<hc-new-card>
|
|
|
<template #header>
|
|
|
<div class="w-40">
|
|
|
- <el-select v-model="searchForm.key1" filterable block placeholder="选择计量期" @change="searchKey1Click">
|
|
|
- <el-option v-for="item in key1Data" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
+ <el-select v-model="searchForm.meterPeriodId" placeholder="选择计量期" filterable clearable block @change="searchKey1Click">
|
|
|
+ <el-option v-for="item in key1Data" :key="item.id" :label="item.periodName" :value="item.id" />
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -21,9 +21,11 @@
|
|
|
<div class="flex-1">
|
|
|
<hc-card-item>
|
|
|
<hc-table
|
|
|
+ is-current-row
|
|
|
:column="tableColumn" :datas="tableData" :loading="tableLoading"
|
|
|
is-new is-check :check-style="{ width: 29 }" :index-style="{ width: 60 }"
|
|
|
@selection-change="tableCheckChange"
|
|
|
+ @row-click="hanleRow"
|
|
|
>
|
|
|
<template #action="{ row }">
|
|
|
<el-link type="success" @click="rowEditClick(row)">修改</el-link>
|
|
@@ -40,52 +42,52 @@
|
|
|
<hc-info-table>
|
|
|
<tr>
|
|
|
<hc-info-table-td center is-title>合同材料:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="120px">水泥</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">{{ infoData?.contractMaterialName }}</hc-info-table-td>
|
|
|
<hc-info-table-td center is-title>材料到场编号:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="120px">1</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">{{ infoData?.materialArriveNumber }}</hc-info-table-td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<hc-info-table-td center is-title>计量期:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="120px">第1期</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">{{ infoData?.meterPeriodId }}</hc-info-table-td>
|
|
|
<hc-info-table-td center is-title>业务日期:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="120px">2020-09-10</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">{{ infoData?.businessDate }}</hc-info-table-td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<hc-info-table-td center is-title>单价:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="120px">5000</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">{{ infoData?.price }}</hc-info-table-td>
|
|
|
<hc-info-table-td center is-title>计量数量:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="120px">555</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">{{ infoData?.meterAmount }}</hc-info-table-td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<hc-info-table-td center is-title>计量金额:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="120px">2775000</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">{{ infoData?.meterMoney }}</hc-info-table-td>
|
|
|
<hc-info-table-td center is-title>备料堆放地点:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="120px">-</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">{{ infoData?.storagePlace }}</hc-info-table-td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<hc-info-table-td center is-title>存储情况:</hc-info-table-td>
|
|
|
<hc-info-table-td width="120px">-</hc-info-table-td>
|
|
|
<hc-info-table-td center is-title>材料来源:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="120px">-</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">{{ infoData?.storageStatus }}</hc-info-table-td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<hc-info-table-td center is-title>材料是否符合要求:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="120px">否</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">{{ infoData?.materialConformName }}</hc-info-table-td>
|
|
|
<hc-info-table-td center is-title>存储方法是否符合要求:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="120px">否</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="120px">{{ infoData?.storageConformName }}</hc-info-table-td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<hc-info-table-td center is-title>合格证号:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="auto" colspan="3">-</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="auto" colspan="3">{{ infoData?.certificate }}</hc-info-table-td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<hc-info-table-td center is-title>备注:</hc-info-table-td>
|
|
|
- <hc-info-table-td width="auto" colspan="3">-</hc-info-table-td>
|
|
|
+ <hc-info-table-td width="auto" colspan="3">{{ infoData?.remark }}</hc-info-table-td>
|
|
|
</tr>
|
|
|
</hc-info-table>
|
|
|
<div class="mt-5">附件列表</div>
|
|
|
<div class="mt-3">
|
|
|
- <el-check-tag checked class="mr-2">文件名称1.jpg</el-check-tag>
|
|
|
+ <el-check-tag v-for="item in infoData?.fileList" checked class="mr-2">{{ item.fileName }}</el-check-tag>
|
|
|
<el-check-tag checked class="mr-2">文件名称2.jpg</el-check-tag>
|
|
|
<el-check-tag checked class="mr-2">文件名称3.jpg</el-check-tag>
|
|
|
<el-check-tag checked class="mr-2">文件名称4.jpg</el-check-tag>
|
|
@@ -102,30 +104,48 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onMounted, ref } from 'vue'
|
|
|
+import { onActivated, onMounted, ref } from 'vue'
|
|
|
import HcDataModal from './components/order/dataModal.vue'
|
|
|
+import mainApi from '~api/debit-pay/material/order.js'
|
|
|
+import periodApi from '~api/debit-pay/material/periods.js'
|
|
|
+import { getArrValue, getObjValue, getYearList } from 'js-fast-way'
|
|
|
+import { useAppStore } from '~src/store'
|
|
|
+const useAppState = useAppStore()
|
|
|
+const contractId = ref(useAppState.getContractId)
|
|
|
+const projectId = ref(useAppState.getProjectId)
|
|
|
|
|
|
defineOptions({
|
|
|
name: 'DebitPayMaterialOrder',
|
|
|
})
|
|
|
|
|
|
//渲染完成
|
|
|
+onActivated(() => {
|
|
|
+ getKey1Data()
|
|
|
+})
|
|
|
onMounted(() => {
|
|
|
-
|
|
|
+ getTableData()
|
|
|
})
|
|
|
-
|
|
|
//搜索表单
|
|
|
const searchForm = ref({
|
|
|
- key1: null, current: 1, size: 10, total: 0,
|
|
|
+ meterPeriodId: null, current: 1, size: 10, total: 0,
|
|
|
})
|
|
|
|
|
|
//计量期
|
|
|
-const key1Data = ref([
|
|
|
- { id: 1, name: '计量期1' },
|
|
|
- { id: 2, name: '计量期2' },
|
|
|
-])
|
|
|
+const key1Data = ref([])
|
|
|
+const getKey1Data = async ()=>{
|
|
|
+ const { error, code, data } = await periodApi.allPeriod({
|
|
|
+ contractId:contractId.value,
|
|
|
+ type:1,
|
|
|
+ })
|
|
|
+ tableLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ key1Data.value = getArrValue(data)
|
|
|
+ } else {
|
|
|
+ key1Data.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
const searchKey1Click = () => {
|
|
|
-
|
|
|
+ getTableData()
|
|
|
}
|
|
|
|
|
|
//分页
|
|
@@ -137,17 +157,51 @@ const pageChange = ({ current, size }) => {
|
|
|
//表格数据
|
|
|
const tableLoading = ref(false)
|
|
|
const tableColumn = ref([
|
|
|
- { key: 'key1', name: '合同材料' },
|
|
|
- { key: 'key2', name: '材料到场编号' },
|
|
|
+ { key: 'contractMaterialId', name: '合同材料' },
|
|
|
+ { key: 'materialArriveNumber', name: '材料到场编号' },
|
|
|
{ key: 'key3', name: '业务日期' },
|
|
|
- { key: 'key4', name: '计量金额' },
|
|
|
- { key: 'key5', name: '审核状态' },
|
|
|
+ { key: 'meterMoney', name: '计量金额' },
|
|
|
+ { key: 'approveStatusName', name: '审核状态' },
|
|
|
{ key: 'action', name: '操作', width: 94 },
|
|
|
])
|
|
|
const tableData = ref([
|
|
|
- { key1: '1111' },
|
|
|
])
|
|
|
-
|
|
|
+const getTableData = async () => {
|
|
|
+ tableLoading.value = true
|
|
|
+ console.log(searchForm.value, 'searchForm.value')
|
|
|
+ const { error, code, data } = await mainApi.getPage({
|
|
|
+ ...searchForm.value,
|
|
|
+ contractId:contractId.value,
|
|
|
+ // meterPeriodId:searchForm.value.key1,
|
|
|
+ })
|
|
|
+ tableLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ tableData.value = getArrValue(data['records'])
|
|
|
+ if (tableData.value.length > 0) {
|
|
|
+ getDetail(tableData.value[0].id)
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ tableData.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
+const hanleRow = ({ row })=>{
|
|
|
+ getDetail(id)
|
|
|
+}
|
|
|
+//获取详情
|
|
|
+const infoData = ref({})
|
|
|
+const getDetail = async (id)=>{
|
|
|
+ const { error, code, data } = await mainApi.detail({
|
|
|
+ id,
|
|
|
+ })
|
|
|
+ if (!error && code === 200) {
|
|
|
+ infoData.value = getObjValue(data)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ infoData.value = {}
|
|
|
+ }
|
|
|
+}
|
|
|
//表格选择
|
|
|
const tableCheckChange = () => {
|
|
|
|