Browse Source

材料计量单

ZaiZai 1 year ago
parent
commit
e863f0caa9

+ 4 - 0
src/components/index.js

@@ -2,6 +2,8 @@ import HcTooltip from './hc-tooltip/index.vue'
 import HcTipItem from './hc-tooltip/item.vue'
 import HcTipItem from './hc-tooltip/item.vue'
 import HcChoiceUser from './choice-user/choice-user.vue'
 import HcChoiceUser from './choice-user/choice-user.vue'
 import HcReportDialog from './hc-report/hc-report.vue'
 import HcReportDialog from './hc-report/hc-report.vue'
+import HcInfoTable from './info-table/info-table.vue'
+import HcInfoTableTd from './info-table/info-table-td.vue'
 
 
 //注册全局组件
 //注册全局组件
 export const setupComponents = (App) => {
 export const setupComponents = (App) => {
@@ -9,4 +11,6 @@ export const setupComponents = (App) => {
     App.component('HcTipItem', HcTipItem)
     App.component('HcTipItem', HcTipItem)
     App.component('HcChoiceUser', HcChoiceUser)
     App.component('HcChoiceUser', HcChoiceUser)
     App.component('HcReportDialog', HcReportDialog)
     App.component('HcReportDialog', HcReportDialog)
+    App.component('HcInfoTable', HcInfoTable)
+    App.component('HcInfoTableTd', HcInfoTableTd)
 }
 }

+ 51 - 0
src/components/info-table/info-table-td.vue

@@ -0,0 +1,51 @@
+<template>
+    <td
+        class="hc-info-table-td p-2"
+        :class="[center ? 'text-center' : '', isTitle ? 'title-name' : '', ui]"
+        :style="width ? `width: ${width};` : ''"
+        hc-border="1 solid #ddd"
+        :colspan="colspan"
+    >
+        <slot />
+    </td>
+</template>
+
+<script setup>
+defineProps({
+    ui: {
+        type: String,
+        default: '',
+    },
+    center: {
+        type: Boolean,
+        default: false,
+    },
+    isTitle: {
+        type: Boolean,
+        default: false,
+    },
+    width: {
+        type: [String, Number],
+        default: '180px',
+    },
+    colspan: {
+        type: [String, Number],
+        default: '1',
+    },
+})
+
+defineOptions({
+    name: 'HcInfoTableTd',
+})
+</script>
+
+<style scoped lang="scss">
+.hc-info-table-td {
+    position: relative;
+    color: #333333;
+    background-color: white;
+    &.title-name {
+        background: #f9f9f9;
+    }
+}
+</style>

+ 20 - 0
src/components/info-table/info-table.vue

@@ -0,0 +1,20 @@
+<template>
+    <table class="hc-info-table relative w-full text-[13px]">
+        <tbody>
+            <slot />
+        </tbody>
+    </table>
+</template>
+
+<script setup>
+defineOptions({
+    name: 'HcInfoTable',
+})
+</script>
+
+<style scoped lang="scss">
+.hc-info-table {
+    border-collapse: collapse;
+    border-spacing: 0;
+}
+</style>

+ 1 - 0
src/views/debit-pay/admin/apply.vue

@@ -197,6 +197,7 @@ const detailsModalClick = () => {
     detailsModalShow.value = true
     detailsModalShow.value = true
 }
 }
 
 
+
 //是否上报
 //是否上报
 const isReport = ref(false)
 const isReport = ref(false)
 const reportClick = () => {
 const reportClick = () => {

+ 190 - 0
src/views/debit-pay/material/components/order/dataModal.vue

@@ -0,0 +1,190 @@
+<template>
+    <hc-dialog is-to-body is-table widths="1200px" :show="isShow" title="材料计量单新增" @save="modalSave" @close="modalClose">
+        <div class="relative h-full flex">
+            <div id="hc_modal_tree">
+                <hc-card-item scrollbar>
+                    <hc-lazy-tree :h-props="treeProps" @load="treeLoadNode" />
+                </hc-card-item>
+            </div>
+            <div id="hc_modal_form">
+                <hc-card-item>
+                    <el-form ref="baseFormRef" :model="baseForm" :rules="baseFormRules" label-position="top" label-width="auto">
+                        <el-row :gutter="20">
+                            <el-col :span="8">
+                                <el-form-item label="材料到场编号:">
+                                    <el-input v-model="baseForm.key1" />
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="合同材料:">
+                                    <el-input v-model="baseForm.key1" disabled />
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="计量期:">
+                                    <el-input v-model="baseForm.key1" disabled />
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="单价:">
+                                    <el-input v-model="baseForm.key1" />
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="数量:">
+                                    <el-input v-model="baseForm.key1" />
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="计量金额:">
+                                    <el-input v-model="baseForm.key1" disabled />
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="业务日期:">
+                                    <el-date-picker v-model="baseForm.key3" class="block" format="YYYY-MM-DD" type="date" value-format="YYYY-MM-DD" disabled />
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="材料来源:">
+                                    <el-input v-model="baseForm.key1" />
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="材料是否符合要求:">
+                                    <el-select v-model="baseForm.key2" block>
+                                        <el-option label="是" value="1" />
+                                        <el-option label="否" value="2" />
+                                    </el-select>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="备料堆放地点:">
+                                    <el-input v-model="baseForm.key1" />
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="存储情况:">
+                                    <el-input v-model="baseForm.key1" />
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="存储方法是否符合要求:">
+                                    <el-select v-model="baseForm.key2" block>
+                                        <el-option label="是" value="1" />
+                                        <el-option label="否" value="2" />
+                                    </el-select>
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="8">
+                                <el-form-item label="合格证号:">
+                                    <el-input v-model="baseForm.key1" />
+                                </el-form-item>
+                            </el-col>
+                            <el-col :span="16">
+                                <el-form-item label="备注:">
+                                    <el-input v-model="baseForm.key1" />
+                                </el-form-item>
+                            </el-col>
+                        </el-row>
+                    </el-form>
+                    <!-- 附件列表 -->
+                    <div class="hc-flex my-5">
+                        <div class="flex-1 text-[16px] text-blue">附件列表</div>
+                        <div class="font-400 text-orange">可上传 图片(png、jpg、jpeg)、Excel(xls、xlsx)、PDF、Word(doc、docx)文件</div>
+                    </div>
+                    <el-form :model="baseForm" label-position="top">
+                        <el-form-item label="">
+                            <hc-form-upload type="list" :src="baseForm.key11" />
+                        </el-form-item>
+                    </el-form>
+                </hc-card-item>
+            </div>
+        </div>
+    </hc-dialog>
+</template>
+
+<script setup>
+import { nextTick, ref, watch } from 'vue'
+
+const props = defineProps({
+    ids: {
+        type: [String, Number],
+        default: '',
+    },
+})
+
+//事件
+const emit = defineEmits(['close'])
+
+//双向绑定
+// eslint-disable-next-line no-undef
+const isShow = defineModel('modelValue', {
+    default: false,
+})
+
+//监听
+watch(() => [
+    props.ids,
+], ([ids]) => {
+    console.log('ids', ids)
+}, { immediate: true })
+
+//监听
+watch(isShow, (val) => {
+    if (val) {
+        detailsModalShow()
+    }
+})
+
+const detailsModalShow = () => {
+    nextTick(() => {
+        window.$split(['#hc_modal_tree', '#hc_modal_form'], {
+            sizes: [30, 70],
+            snapOffset: 0,
+            minSize: [170, 500],
+        })
+    })
+}
+
+//数据格式
+const treeProps = {
+    label: 'name',
+    children: 'children',
+    isLeaf: 'leaf',
+}
+
+//懒加载的数据
+const treeLoadNode = ({ level }, resolve) => {
+    if (level === 0) {
+        return resolve([{ name: 'region' }])
+    }
+    if (level > 3) {
+        return resolve([])
+    }
+    setTimeout(() => {
+        resolve([
+            { name: 'leaf', leaf: true },
+            { name: 'zone' },
+        ])
+    }, 500)
+}
+
+//基础表单
+const baseFormRef = ref(null)
+const baseForm = ref({})
+const baseFormRules = {}
+
+const modalSave = () => {
+    modalClose()
+}
+
+const modalClose = () => {
+    isShow.value = false
+    emit('close')
+}
+</script>
+
+<style scoped lang="scss">
+
+</style>

+ 159 - 2
src/views/debit-pay/material/order.vue

@@ -1,13 +1,170 @@
 <template>
 <template>
-    <hc-card title="材料计量单">
-        开发中...
+    <hc-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>
+            </div>
+        </template>
+        <template #extra>
+            <el-button hc-btn type="primary" @click="addModalClick">
+                <HcIcon name="add" />
+                <span>新增</span>
+            </el-button>
+            <el-button hc-btn type="primary" @click="reportClick">
+                <HcIcon name="send-plane-2" />
+                <span>上报</span>
+            </el-button>
+        </template>
+        <div class="relative h-full flex">
+            <div class="flex-1">
+                <hc-card-item>
+                    <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" is-check @selection-change="tableCheckChange">
+                        <template #action="{ row }">
+                            <el-link type="success" @click="rowEditClick(row)">修改</el-link>
+                            <el-link type="danger">删除</el-link>
+                        </template>
+                    </hc-table>
+                    <template #action>
+                        <hc-pages :pages="searchForm" @change="pageChange" />
+                    </template>
+                </hc-card-item>
+            </div>
+            <div class="ml-3 w-[600px]">
+                <hc-card-item title="详情信息" scrollbar>
+                    <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 center is-title>材料到场编号:</hc-info-table-td>
+                            <hc-info-table-td width="120px">1</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 center is-title>业务日期:</hc-info-table-td>
+                            <hc-info-table-td width="120px">2020-09-10</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 center is-title>计量数量:</hc-info-table-td>
+                            <hc-info-table-td width="120px">555</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 center is-title>备料堆放地点:</hc-info-table-td>
+                            <hc-info-table-td width="120px">-</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>
+                        </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>
+                        </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>
+                        </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>
+                        </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 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>
+                    </div>
+                </hc-card-item>
+            </div>
+        </div>
+        <!-- 新增/修改 -->
+        <HcDataModal v-model="isDataModal" />
+
+        <!-- 上报弹窗 -->
+        <hc-report-dialog v-model="isReport" />
     </hc-card>
     </hc-card>
 </template>
 </template>
 
 
 <script setup>
 <script setup>
+import { onMounted, ref } from 'vue'
+import HcDataModal from './components/order/dataModal.vue'
+
 defineOptions({
 defineOptions({
     name: 'DebitPayMaterialOrder',
     name: 'DebitPayMaterialOrder',
 })
 })
+
+//渲染完成
+onMounted(() => {
+
+})
+
+//搜索表单
+const searchForm = ref({
+    key1: null, current: 1, size: 10, total: 0,
+})
+
+//计量期
+const key1Data = ref([
+    { id: 1, name: '计量期1' },
+    { id: 2, name: '计量期2' },
+])
+const searchKey1Click = () => {
+
+}
+
+//分页
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+}
+
+//表格数据
+const tableLoading = ref(false)
+const tableColumn = ref([
+    { key: 'key1', name: '合同材料' },
+    { key: 'key2', name: '材料到场编号' },
+    { key: 'key3', name: '业务日期' },
+    { key: 'key4', name: '计量金额' },
+    { key: 'key5', name: '审核状态' },
+    { key: 'action', name: '操作', width: 94 },
+])
+const tableData = ref([
+    { key1: '1111' },
+])
+
+//表格选择
+const tableCheckChange = () => {
+
+}
+
+//新增
+const isDataModal = ref(false)
+const addModalClick = () => {
+    isDataModal.value = true
+}
+
+//修改
+const rowEditClick = (row) => {
+    isDataModal.value = true
+}
+
+//是否上报
+const isReport = ref(false)
+const reportClick = () => {
+    isReport.value = true
+}
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">