Bladeren bron

合同材料

ZaiZai 10 maanden geleden
bovenliggende
commit
11bb58a94f

+ 43 - 0
src/api/modules/debit-pay/material/material.js

@@ -0,0 +1,43 @@
+import { HcApi } from '../../../request/index'
+export default {
+    //列表
+    async getAllMaterial(form) {
+        return HcApi({
+            url: '/api/blade-meter/contractMaterial/get-all-material2',
+            method: 'post',
+            data: form,
+        }, false)
+    },
+    //获取清单树
+    async getAdjustFormTree(form) {
+        return HcApi({
+            url: '/api/blade-meter/contractMaterial/get-adjust-form-tree',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+    //确定绑定
+    async linkFormMaterial(form) {
+        return HcApi({
+            url: '/api/blade-meter/contractMaterial/material-link-form',
+            method: 'post',
+            data: form,
+        }, false)
+    },
+     //获取清单列表
+    async linkAllForm(form) {
+        return HcApi({
+            url: '/api/blade-meter/contractMaterial/get-link-all-form',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+    //解除绑定关系
+    async removeLinkForm(id) {
+        return HcApi({
+            url: '/api/blade-meter/contractMaterial/remove-link-form',
+            method: 'get',
+            params: { id },
+        }, false)
+    },
+}

+ 1 - 1
src/views/debit-pay/material/contract.vue

@@ -77,7 +77,7 @@
             </template>
             <hc-card-item v-if="isTablePrice">
                 <template #header>
-                    <div class="text-14px text-red">*加个有效期</div>
+                    <div class="text-14px text-red">*价格有效期</div>
                     <div class="ml-3 w-64">
                         <hc-date-picker :dates="betweenTime" @change="betweenTimeUpdate" />
                     </div>

+ 83 - 3
src/views/debit-pay/material/material.vue

@@ -1,11 +1,91 @@
 <template>
-    <div>
-        材料调差
-    </div>
+    <hc-card title="材料调差" class="hc-debit-pay-material-material">
+        <template #extra>
+            <el-button hc-btn type="primary">
+                <hc-icon name="add" />
+                <span>新增</span>
+            </el-button>
+        </template>
+        <hc-table :column="tableColumn" :datas="tableData" :index-style="{ width: 60 }" :loading="tableLoading">
+            <template #key3="{ row }">
+                <el-link type="primary" @click="rowTop(row)">{{ row.key3 }}</el-link>
+            </template>
+            <template #key8="{ row }">
+                <span class="text-green">已完结</span>
+                <span class="text-gray">未完结</span>
+            </template>
+            <template #action="{ row }">
+                <el-link type="primary" @click="rowEditClick(row)">编辑</el-link>
+                <el-link type="danger" @click="rowDelClick(row)">删除</el-link>
+            </template>
+        </hc-table>
+    </hc-card>
 </template>
 
 <script setup>
+import { onActivated, ref } from 'vue'
+import { useAppStore } from '~src/store'
+import { HcDelMsg } from 'hc-vue3-ui'
+import { getArrValue } from 'js-fast-way'
+import mainApi from '~api/debit-pay/material/material'
 
+//初始化
+const store = useAppStore()
+const projectId = ref(store.getProjectId)
+const contractId = ref(store.getContractId)
+
+//渲染完成
+onActivated(() => {
+    //getTableData()
+})
+
+//表格
+const tableColumn = [
+    { key: 'key1', name: '调差期', width: 100, align: 'center' },
+    { key: 'key2', name: '调差月份', width: 120, align: 'center' },
+    { key: 'key3', name: '材料名称' },
+    { key: 'key4', name: '基准价格(元)', width: 140, align: 'center' },
+    { key: 'key5', name: '施工期价格(元)', width: 140, align: 'center' },
+    { key: 'key6', name: '调差数量', width: 140, align: 'center' },
+    { key: 'key7', name: '调差金额', width: 140, align: 'center' },
+    { key: 'key8', name: '状态', width: 120, align: 'center' },
+    { key: 'action', name: '操作', width: 100, align: 'center' },
+]
+const tableData = ref([
+    {},
+])
+
+//获取表格数据
+const tableLoading = ref(false)
+const getTableData = async () => {
+    tableLoading.value = true
+    const { error, code, data } = await mainApi.getAllMaterial({
+        //...searchForm.value,
+        projectId: projectId.value,
+        contractId: contractId.value,
+    })
+    tableLoading.value = false
+    if (!error && code === 200) {
+        tableData.value = getArrValue(data)
+    } else {
+        tableData.value = []
+    }
+}
+
+//材料名称被点击
+const rowTop = (row) => {
+
+}
+
+//编辑
+const rowEditClick = (row) => {
+
+}
+
+//删除
+const rowDelClick = (row) => {
+
+}
 </script>
 
 <style scoped lang="scss">