Browse Source

变更令

ZaiZai 1 năm trước cách đây
mục cha
commit
5139083d30

+ 1 - 1
src/config/index.json

@@ -1,6 +1,6 @@
 {
     "version": "20230607160059",
-    "target": "http://192.168.0.113:8090",
+    "target": "http://192.168.0.125:8090",
     "smsPhone": "",
     "vite": {
         "port": 5180,

+ 0 - 1
src/store/modules/user.js

@@ -17,7 +17,6 @@ const store = useAppStore(pinia)
 //登录
 export const useAppLogin = async (form) => {
     const { error, code, res } = await userLogin(form)
-    console.log(error, code, res)
     if (!error && code === 200) {
         store.setTokenVal(res['access_token'])
         store.setRefreshTokenVal(res['refresh_token'])

+ 1 - 1
src/views/alter/admin/components/order/addModal.vue

@@ -110,7 +110,7 @@
                         <template #extra>
                             <el-link type="primary" @click="changeShowClick">添加</el-link>
                         </template>
-                        <div class="hc-table-ref-box no-border">
+                        <div v-if="tableData[tableIndex]?.formList.length > 0" class="hc-table-ref-box no-border">
                             <el-table class="w-full" :data="tableData[tableIndex]?.formList" row-key="id" height="100%" highlight-current-row border>
                                 <el-table-column type="index" label="序号" />
                                 <el-table-column prop="formNumber" label="清单编号" />

+ 82 - 47
src/views/alter/admin/order.vue

@@ -23,10 +23,20 @@
         <div class="relative h-full flex">
             <div :id="`hc_table_card_${uuid}`" class="flex-1">
                 <hc-card-item>
-                    <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" is-new :index-style="{ width: 60 }">
+                    <hc-table ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" is-current-row is-new :index-style="{ width: 60 }" @row-click="tableRowClick">
                         <template #action="{ row }">
-                            <el-link type="success" @click="rowEditClick(row)">修改</el-link>
-                            <el-link type="danger">删除</el-link>
+                            <template v-if="row.approveStatus === 2">
+                                <el-link v-if="row.commandStatus === 0" type="success">下达</el-link>
+                                <el-link v-if="row.commandStatus === 0" type="danger">删除</el-link>
+                                <el-link v-if="row.commandStatus === 1 && row.citeStatus === 0" type="success">撤销下达</el-link>
+                            </template>
+                            <template v-if="row.approveStatus === 0">
+                                <el-link type="success" @click="rowEditClick(row)">修改</el-link>
+                                <el-link type="danger">删除</el-link>
+                            </template>
+                            <template v-if="row.approveStatus === 3">
+                                <el-link type="danger">删除</el-link>
+                            </template>
                         </template>
                     </hc-table>
                     <template #action>
@@ -40,35 +50,35 @@
                         <hc-info-table>
                             <tr>
                                 <hc-info-table-td center is-title>变更方案编号:</hc-info-table-td>
-                                <hc-info-table-td width="120px">33</hc-info-table-td>
+                                <hc-info-table-td width="120px">{{ tableInfo.changeNumber ?? '-' }}</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">{{ tableInfo.changeName ?? '-' }}</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">{{ tableInfo.changeUnit ?? '-' }}</hc-info-table-td>
                             </tr>
                             <tr>
                                 <hc-info-table-td center is-title>业务日期:</hc-info-table-td>
-                                <hc-info-table-td width="160px">2022-02-15</hc-info-table-td>
+                                <hc-info-table-td width="160px">{{ tableInfo.businessDate ?? '-' }}</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">{{ tableInfo.changeTypeName ?? '-' }}</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">{{ tableInfo.lengthenDays ?? '-' }}</hc-info-table-td>
                             </tr>
                             <tr>
                                 <hc-info-table-td center is-title>变更申请金额:</hc-info-table-td>
-                                <hc-info-table-td width="120px">116</hc-info-table-td>
+                                <hc-info-table-td width="120px">{{ tableInfo.changeMoney ?? '-' }}</hc-info-table-td>
                                 <hc-info-table-td center is-title>设计图完成时间:</hc-info-table-td>
-                                <hc-info-table-td width="120px">2022-02-15</hc-info-table-td>
+                                <hc-info-table-td width="120px">{{ tableInfo.designDate ?? '-' }}</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">{{ tableInfo.realityChangeNumber ?? '-' }}</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">{{ tableInfo.changeClassifyName ?? '-' }}</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">{{ tableInfo.changeApprovalNumber ?? '-' }}</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">{{ tableInfo.changeApprovalDate ?? '-' }}</hc-info-table-td>
                             </tr>
                             <tr>
                                 <hc-info-table-td center is-title>引用预变更:</hc-info-table-td>
@@ -76,35 +86,36 @@
                             </tr>
                             <tr>
                                 <hc-info-table-td center is-title>变更原因:</hc-info-table-td>
-                                <hc-info-table-td width="auto" colspan="5">-</hc-info-table-td>
+                                <hc-info-table-td width="auto" colspan="5">{{ tableInfo.changeCause ?? '-' }}</hc-info-table-td>
                             </tr>
                         </hc-info-table>
                     </hc-card-item>
                     <hc-card-item class="mt-3" title="变更申请部位">
-                        <hc-table :column="tableColumn1" :datas="tableData1" is-new :index-style="{ width: 60 }" />
+                        <hc-table :column="tableColumn1" :datas="tableInfo.nodeList" is-new :index-style="{ width: 60 }" is-current-row @row-click="tableNodeRowClick" />
                     </hc-card-item>
-                    <hc-card-item class="mt-3" title="变更申请清单">
+                    <hc-card-item v-if="tableChangeData.length > 0" class="mt-3" title="变更申请清单">
                         <div class="hc-table-ref-box no-border">
-                            <el-table class="w-full" :data="tableData" row-key="id" height="100%" highlight-current-row border>
+                            <el-table class="w-full" :data="tableChangeData" row-key="id" height="100%" highlight-current-row border>
                                 <el-table-column type="index" label="序号" />
-                                <el-table-column prop="key1" label="清单编号" />
-                                <el-table-column prop="key2" label="清单名称" />
-                                <el-table-column prop="key3" label="单价" />
+                                <el-table-column prop="formNumber" label="清单编号" />
+                                <el-table-column prop="formName" label="清单名称" />
+                                <el-table-column prop="currentPrice" label="单价" />
                                 <el-table-column label="数量" align="center">
-                                    <el-table-column prop="key5" label="变更前" />
-                                    <el-table-column prop="key6" label="变更增减" />
-                                    <el-table-column prop="key7" label="变更后" />
+                                    <el-table-column prop="contractTotal" label="变更前" />
+                                    <el-table-column prop="currentChangeTotal" label="变更增减" />
+                                    <el-table-column prop="changeTotal" label="变更后" />
                                 </el-table-column>
                                 <el-table-column label="金额" align="center">
-                                    <el-table-column prop="key8" label="变更前" />
-                                    <el-table-column prop="key9" label="变更增减" />
-                                    <el-table-column prop="key10" label="变更后" />
+                                    <el-table-column prop="contractMoney" label="变更前" />
+                                    <el-table-column prop="currentChangeMoney" label="变更增减" />
+                                    <el-table-column prop="changeMoney" label="变更后" />
                                 </el-table-column>
                             </el-table>
                         </div>
                     </hc-card-item>
+                    <!-- 附件列表 -->
                     <hc-card-item class="mt-3" title="附件列表">
-                        <hc-table :column="tableColumn2" :datas="tableData2" is-new :index-style="{ width: 60 }" />
+                        <hc-form-upload type="list" :src="tableInfo.fileList" :h-props="uploadFormProps" />
                     </hc-card-item>
                 </el-scrollbar>
             </div>
@@ -121,7 +132,7 @@
 <script setup>
 import { nextTick, onMounted, ref } from 'vue'
 import { useAppStore } from '~src/store'
-import { getArrValue, getRandom } from 'js-fast-way'
+import { getArrValue, getObjValue, getRandom } from 'js-fast-way'
 import mainApi from '~api/alter/admin/order'
 import addModal from './components/order/addModal.vue'
 
@@ -176,7 +187,7 @@ const pageChange = ({ current, size }) => {
 }
 
 //表格数据
-const tableLoading = ref(false)
+const tableRef = ref(null)
 const tableColumn = ref([
     { key: 'changeNumber', name: '变更编号' },
     { key: 'changeName', name: '变更名称' },
@@ -187,6 +198,9 @@ const tableColumn = ref([
     { key: 'action', name: '操作', width: 94 },
 ])
 const tableData = ref([])
+
+//获取表格数据
+const tableLoading = ref(false)
 const getTableData = async () => {
     tableData.value = []
     tableLoading.value = true
@@ -198,6 +212,28 @@ const getTableData = async () => {
     tableData.value = getArrValue(data['records'])
     searchForm.value.total = data.total || 0
     tableLoading.value = false
+    //默认选中第一行
+    let info = {}
+    if (tableData.value.length > 0) {
+        info = tableData.value[0]
+    }
+    tableRef.value?.tableRef?.setCurrentRow(info)
+    getTableDetail(info).then()
+}
+
+//表格行被点击
+const tableRowClick = ({ row }) => {
+    getTableDetail(row)
+}
+
+//获取详情
+const tableInfo = ref({})
+const getTableDetail = async (row) => {
+    const { data } = await mainApi.getDetail({ id: row.id })
+    const info = getObjValue(data)
+    info.nodeList = getArrValue(info.nodeList)
+    tableInfo.value = info
+    console.log(info)
 }
 
 
@@ -213,25 +249,24 @@ const addModalClick = () => {
 
 //申请部位
 const tableColumn1 = ref([
-    { key: 'key1', name: '工程名称' },
-    { key: 'key2', name: '节点路径' },
-    { key: 'key3', name: '合同图号' },
-    { key: 'key4', name: '变更金额(元)' },
-    { key: 'key5', name: '是否增补' },
-])
-const tableData1 = ref([
-    { key1: '1111' },
+    { key: 'nodeName', name: '工程名称' },
+    { key: 'nodeUrl', name: '节点路径' },
+    { key: 'contractPicture', name: '合同图号' },
+    { key: 'changeMoney', name: '变更后金额(元)' },
+    { key: 'isSupplementName', name: '是否增补' },
 ])
 
+//申请部位被点击
+const tableChangeData = ref([])
+const tableNodeRowClick = ({ row }) => {
+    tableChangeData.value = getArrValue(row.formList)
+}
+
 //附件列表
-const tableColumn2 = ref([
-    { key: 'key1', name: '文件名称' },
-    { key: 'key2', name: '必须上传' },
-    { key: 'key3', name: '附件列表' },
-])
-const tableData2 = ref([
-    { key1: '工程设计变更申请单', key2: '是', key3: '文件名称' },
-])
+const uploadFormProps = {
+    url: 'fileUrl',
+    name: 'fileName',
+}
 
 //是否上报
 const isReport = ref(false)