2545307760@qq.com 1 год назад
Родитель
Сommit
6ff1bd3657

+ 2 - 2
web/.env.development

@@ -4,12 +4,12 @@ VITE_CLI_PORT = 8080
 VITE_SERVER_PORT = 8220
 VITE_BASE_API = /api
 VITE_FILE_API = /api
-//VITE_BASE_PATH = http://192.168.110.116
+VITE_BASE_PATH = http://192.168.110.218
 VITE_POSITION = closef
 VITE_EDITOR = webstorm
 
 
 // VITE_EDITOR = webstorm 如果使用webstorm开发且要使用dom定位到代码行功能 请先自定添加 webstorm到环境变量 再将VITE_EDITOR值修改为webstorm
 // 如果使用docker-compose开发模式,设置为下面的地址或本机主机IP
-VITE_BASE_PATH = http://110.40.223.170
+//VITE_BASE_PATH = http://110.40.223.170
 

+ 8 - 0
web/src/api/file.js

@@ -74,3 +74,11 @@ export const downloadProjectFile = (data) => {
     data: data
   })
 }
+
+// 查询所有必要文件
+export const queryAllFileType = () => {
+  return service({
+    url: '/file/queryNecessaryDocuments',
+    method: 'get',
+  })
+}

+ 0 - 1
web/src/view/projectManage/projectApproval/projectApproval.vue

@@ -218,7 +218,6 @@ import { createProject } from '@/api/project'
 import { getAllUsers } from '@/api/user'
 import { ElMessage } from 'element-plus'
 import { useRouter } from 'vue-router'
-
 const router = useRouter()
 
 defineOptions({

+ 4 - 4
web/src/view/projectManage/projectList/projectList.vue

@@ -202,12 +202,12 @@
               align="center"
             />
             <el-table-column
-              prop="principal"
-              label="项目负责人"
+              prop="firstPrincipal"
+              label="甲方负责人"
               align="center"
             />
             <el-table-column
-              prop="price"
+              prop="projectPrice"
               label="项目金额"
               align="center"
             />
@@ -270,7 +270,6 @@ import { useRoute, useRouter } from 'vue-router'
 const router = useRouter()
 // eslint-disable-next-line no-unused-vars
 const route = useRoute()
-
 defineOptions({
   name: 'ProjectList'
 })
@@ -374,6 +373,7 @@ const listData = (condition) => {
   getProjectList(condition).then(res => {
     if (res.code === 0 && res.data.total > 0) {
       const list = res.data.list
+      console.log(list)
       list.forEach(item => {
         item.CreatedAt = formatDate(item.CreatedAt)
       })

+ 278 - 38
web/src/view/projectManage/projectTest/projectTest.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div
-      style="height: 400px"
+      style="height: 370px"
       class="bg-white"
     >
       <div class="basicInformation">
@@ -42,6 +42,27 @@
             />
           </el-steps>
         </el-col>
+        <el-col :span="4">
+          <el-form :inline="true">
+            <el-form-item>
+              <el-button
+                size="large"
+                :disabled="infoSteps === 0"
+                @click="previousPage"
+              >
+                上一页
+              </el-button>
+            </el-form-item>
+            <el-form-item>
+              <el-button
+                :disabled="infoSteps === 2"
+                type="primary"
+                size="large"
+                @click="nextPage"
+              >下一页</el-button>
+            </el-form-item>
+          </el-form>
+        </el-col>
       </el-row>
       <el-row style="margin-top: 30px">
         <el-col
@@ -58,7 +79,10 @@
                     label="项目名称"
                     size="large"
                   >
-                    <el-input placeholder="请输入项目名称" />
+                    <el-input
+                      v-model="condition.name"
+                      placeholder="请输入项目名称"
+                    />
                   </el-form-item>
                 </el-col>
                 <el-col
@@ -69,7 +93,10 @@
                     label="项目地址:"
                     size="large"
                   >
-                    <el-input placeholder="请输入项目地址" />
+                    <el-input
+                      v-model="condition.address"
+                      placeholder="请输入项目地址"
+                    />
                   </el-form-item>
                 </el-col>
               </el-row>
@@ -79,7 +106,10 @@
                     label="甲方电话"
                     size="large"
                   >
-                    <el-input placeholder="请输入甲方负责人电话" />
+                    <el-input
+                      v-model="condition.firstPhone"
+                      placeholder="请输入甲方负责人电话"
+                    />
                   </el-form-item>
                 </el-col>
                 <el-col
@@ -90,7 +120,10 @@
                     label="甲方负责人"
                     size="large"
                   >
-                    <el-input placeholder="请输入甲方负责人名称" />
+                    <el-input
+                      v-model="condition.firstPrincipal"
+                      placeholder="请输入甲方负责人名称"
+                    />
                   </el-form-item>
                 </el-col>
               </el-row>
@@ -102,7 +135,10 @@
                     label="乙方负责人"
                     size="large"
                   >
-                    <el-input placeholder="请输入乙方负责人名称" />
+                    <el-input
+                      v-model="condition.secondPrincipal"
+                      placeholder="请输入乙方负责人名称"
+                    />
                   </el-form-item>
                 </el-col>
                 <el-col
@@ -116,7 +152,10 @@
                     <el-input-number v-model="condition.projectPrice" />
                   </el-form-item>
                 </el-col>
-                <el-col :span="5" :offset="1">
+                <el-col
+                  :span="5"
+                  :offset="1"
+                >
                   <el-form-item
                     label="合同签订时间"
                     size="large"
@@ -150,7 +189,10 @@
                     />
                   </el-form-item>
                 </el-col>
-                <el-col :span="5" :offset="1">
+                <el-col
+                  :span="5"
+                  :offset="1"
+                >
                   <el-form-item
                     label="竣工时间"
                     size="large"
@@ -166,59 +208,257 @@
                     />
                   </el-form-item>
                 </el-col>
+                <el-col
+                  :span="8"
+                  :offset="1"
+                >
+                  <el-form-item label="说明">
+                    <el-input
+                      v-model="condition.illustrate"
+                      :rows="5"
+                      type="textarea"
+                      placeholder="请输入项目说明"
+                    />
+                  </el-form-item>
+                </el-col>
               </el-row>
             </div>
-            <el-row style="margin-top: 20px">
-              <el-col :offset="11">
-                <el-form :inline="true">
-                  <el-form-item>
-                    <el-button size="large">
-                      上一页
-                    </el-button>
+            <div v-show="infoSteps === 2">
+              <el-row>
+                <el-col :span="5">
+                  <el-form-item
+                    label="监理单位"
+                    size="large"
+                  >
+                    <el-input
+                      v-model="condition.supervisorUint"
+                      placeholder="请输入监理单位"
+                    />
                   </el-form-item>
-                  <el-form-item>
-                    <el-button
-                      type="primary"
-                      size="large"
-                    >下一页</el-button>
+                </el-col>
+                <el-col
+                  :span="5"
+                  :offset="1"
+                >
+                  <el-form-item
+                    label="监理姓名"
+                    size="large"
+                  >
+                    <el-input
+                      v-model="condition.supervisorName"
+                      placeholder="请输入监理姓名"
+                    />
                   </el-form-item>
-                </el-form>
-              </el-col>
-            </el-row>
+                </el-col>
+                <el-col
+                  :span="5"
+                  :offset="1"
+                >
+                  <el-form-item
+                    label="监理电话"
+                    size="large"
+                  >
+                    <el-input
+                      v-model="condition.supervisorPhone"
+                      placeholder="请输入监理电话"
+                    />
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </div>
           </el-form>
         </el-col>
       </el-row>
     </div>
+    <div
+      style="height: 400px;margin-top: 20px;overflow: auto"
+      class="bg-white"
+    >
+      <div class="basicInformation">
+        <div style="padding-top: 10px;margin-left: 90px">
+          <el-image :src="sign" />
+        </div>
+        <div style="display: flex;align-items: center">
+          <el-text
+            style="margin-left: 10px"
+            size="large"
+            tag="b"
+          >项目附属文件</el-text>
+        </div>
+      </div>
+      <el-row style="margin-top: 15px">
+        <el-col
+          :span="12"
+          style="margin-left: 90px"
+        >
+          <el-alert
+            title="请注意立项时上传的文件应包含报价单、施工图、合同、项目立项书、工程清单、财评中心审计后清单表"
+            type="info"
+            show-icon
+          />
+        </el-col>
+      </el-row>
+      <el-row style="margin:20px 0 0 90px;">
+        <el-col :span="15">
+          <el-upload
+            class="upload-demo"
+            drag
+            multiple
+            :auto-upload="false"
+            :file-list="fileListData"
+            :on-change="changeFileData"
+            :on-remove="removeFileData"
+          >
+            <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+            <div class="el-upload__text">
+              请选择需要上传的文件
+            </div>
+            <template #tip>
+              <div class="el-upload__tip">
+                选择的文件不要超过500MB
+              </div>
+            </template>
+          </el-upload>
+        </el-col>
+        <el-col
+          :span="4"
+          :offset="1"
+        >
+          <el-button
+            icon="Collection"
+            size="large"
+            type="primary"
+            @click="approval"
+          >项目立项</el-button>
+        </el-col>
+      </el-row>
+    </div>
   </div>
 </template>
 
 <script setup>
 import { reactive, ref } from 'vue'
 import { Document } from '@element-plus/icons-vue'
+import { ElMessage } from 'element-plus'
 import sign from '@/assets/sign.png'
+import { createProject } from '@/api/project'
+import moment from 'moment/moment'
+import { useRouter } from 'vue-router'
+const router = useRouter()
+
 defineOptions({
   name: 'ProjectTest'
 })
+
 // 数据
 const condition = reactive({
   code: '', // 项目编号
-  name: '', // 项目名称
-  address: '', // 项目地址
-  firstPrincipal: '', // 甲方负责人
-  firstPhone: '', // 甲方电话
-  projectPrice: 0, // 合同金额
-  secondPrincipal: '', // 乙方负责人
-  signTime: '', // 合同签订日期
-  intoConstructionTime: '', // 进场施工时间
-  completedTime: '', // 竣工时间
-  supervisorUint: '', // 监理单位
-  supervisorName: '', // 监理姓名
-  supervisorPhone: '', // 监理电话
-  illustrate: '', // 说明
-  state: '' // 状态
+  name: '水质监测', // 项目名称
+  address: '湖南省', // 项目地址
+  firstPrincipal: '刘总', // 甲方负责人
+  firstPhone: '18373925841', // 甲方电话
+  projectPrice: 200000, // 合同金额
+  secondPrincipal: '苏道民', // 乙方负责人
+  signTime: '2024-08-20', // 合同签订日期
+  intoConstructionTime: '2024-09-10', // 进场施工时间
+  completedTime: '2024-10-10', // 竣工时间
+  supervisorUint: '法律事务所', // 监理单位
+  supervisorName: '罗翔', // 监理姓名
+  supervisorPhone: '18373925841', // 监理电话
+  illustrate: '1122222222', // 说明
+  state: 1 // 状态
 })
+// 基本信息页数
+const infoSteps = ref(0)
+const previousPage = () => {
+  infoSteps.value -= 1
+}
+const nextPage = () => {
+  if (infoSteps.value === 0) {
+    const home = {
+      name: condition.name,
+      address: condition.address,
+      firstPrincipal: condition.firstPrincipal,
+      firstPhone: condition.firstPhone
+    }
+    for (const item in home) {
+      if (home[item] === '') {
+        ElMessage.error('请将甲方信息填写完整')
+        return
+      }
+    }
+    infoSteps.value += 1
+  } else if (infoSteps.value === 1) {
+    const second = {
+      projectPrice: condition.projectPrice,
+      secondPrincipal: condition.secondPrincipal,
+      signTime: condition.signTime,
+      intoConstructionTime: condition.intoConstructionTime,
+      completedTime: condition.completedTime,
+      illustrate: condition.illustrate
+    }
+    for (const item in second) {
+      if (second[item] === '' || second[item] === 0) {
+        ElMessage.error('请将乙方信息填写完整')
+        return
+      }
+    }
+    infoSteps.value += 1
+  }
+}
+
+// 附属文件
+const fileListData = ref([])
+
+const changeFileData = (file, fileList) => {
+  fileListData.value = fileList
+}
 
-const infoSteps = ref(1)
+const removeFileData = (file, fileList) => {
+  fileListData.value = fileList
+}
+
+// 项目立项
+const approval = () => {
+  const basic = condition
+  basic.code = 'LCZM' + createCode()
+  for (const item in basic) {
+    if (basic[item] === '' || basic[item] === 0) {
+      ElMessage.error('请将三方信息填写完整')
+    }
+  }
+  const formData = new FormData()
+  const json = JSON.stringify(basic)
+  if (fileListData.value.length !== 0) {
+    fileListData.value.forEach(item => {
+      formData.append('file', item.raw)
+    })
+  } else {
+    formData.append('file', [])
+  }
+  formData.append('project', json)
+  createProject(formData).then(res => {
+    if (res.code === 0) {
+      ElMessage({
+        message: '立项成功',
+        type: 'success',
+      })
+      const { href } = router.resolve({
+        path: '/layout/projectManage/projectList', // 路径
+      })
+      location.href = (href)
+    } else {
+      ElMessage({
+        message: '立项失败',
+        type: 'error',
+      })
+    }
+  })
+}
+
+const createCode = () => {
+  return moment().format('YYYYMMDDHHmm')
+}
 </script>
 
 <style scoped lang="less">