소스 검색

feat: 商用工程信息单

zh 2 년 전
부모
커밋
a1dcc8118d
2개의 변경된 파일189개의 추가작업 그리고 23개의 파일을 삭제
  1. 9 0
      src/api/supply/engin.js
  2. 180 23
      src/views/supply/engin/components/engin_form.vue

+ 9 - 0
src/api/supply/engin.js

@@ -569,3 +569,12 @@ export function getEnginCountList(params) {
     params
   })
 }
+
+// 商用工程登录单-引用
+export function getLoginOrderList(params) {
+  return request({
+    url: '/trade/login/order/ref',
+    method: 'post',
+    params
+  })
+}

+ 180 - 23
src/views/supply/engin/components/engin_form.vue

@@ -124,7 +124,10 @@
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
           <el-form-item label="工程编号" prop="enginNum">
-            <el-input v-model="mainForm.enginNum" placeholder="请输入工程编号" />
+            <div style="display: flex">
+              <el-input v-model="mainForm.enginNum" placeholder="请输入工程编号" />
+              <el-button style="margin-left: 10px" @click="visible = true;getLoginOrderList()">引用</el-button>
+            </div>
           </el-form-item>
         </el-col>
         <el-col :xs="24" :sm="12" :lg="8">
@@ -330,7 +333,6 @@
         </el-popconfirm>
       </div>
     </div>
-
     <el-dialog
       title="添加产品"
       :modal-append-to-body="true"
@@ -454,11 +456,73 @@
         <el-button type="primary" @click="submitAddGoods">确 定</el-button>
       </span>
     </el-dialog>
+
+    <el-dialog
+      title="商用工程登录项目"
+      :visible.sync="visible"
+      width="60%"
+      :modal-append-to-body="true"
+      :append-to-body="true"
+      :close-on-click-modal="false"
+      @close="onClose"
+    >
+      <div>
+        <el-row :gutter="20">
+          <el-form ref="formData" :model="formData" label-width="0" :inline="false" size="small">
+            <el-col :span="6">
+              <el-form-item prop="projectNo">
+                <el-input v-model="formData.projectNo" placeholder="请输入项目编号" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item prop="projectName">
+                <el-input v-model="formData.projectName" placeholder="请输入项目名称" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item prop="address">
+                <el-input v-model="formData.address" placeholder="请输入项目地址" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6" style="text-align: right;">
+              <el-button size="small" @click="currentPage2 = 1; getLoginOrderList()">查询</el-button>
+              <el-button size="small" type="primary" @click="resetGoodsScreenForm2">重置</el-button></el-col>
+          </el-form>
+        </el-row>
+        <div>
+          <zj-table
+            ref="tableEl"
+            style="margin-bottom: 20px"
+            :is-drop="true"
+            :columns="columns"
+            :table-data="tableData"
+            :table-attributes="{
+              border: true
+            }"
+          />
+          <div class="fr">
+            <el-pagination
+              :current-page="currentPage2"
+              :page-sizes="[10, 20, 30, 50]"
+              :page-size="10"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="listTotal2"
+              @size-change="handleSizeChange"
+              @current-change="handleCurrentChange"
+            />
+          </div>
+        </div>
+      </div>
+      <span slot="footer">
+        <el-button @click="onClose">取 消</el-button>
+        <el-button type="primary" @click="submitAddOrder">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-import { getEnginDetail, getRetailProductList, addEngin, editEngin, submitEngin, delItem } from '@/api/supply/engin'
+import { getEnginDetail, getRetailProductList, addEngin, editEngin, submitEngin, delItem, getLoginOrderList } from '@/api/supply/engin'
 import { getDictList, getTypeList, getSalesmanList, getDealerList } from '@/api/common'
 
 export default {
@@ -546,13 +610,59 @@ export default {
 
       leftSelection: [],
       rightSelection: [],
-      examineStatus: ''
+      examineStatus: '',
+      visible: false,
+      currentPage2: 1,
+      pageSize2: 10,
+      listTotal2: 0,
+      formData: {
+        address: '',
+        projectName: '',
+        projectNo: ''
+      },
+      tableData: [],
+      current: ''
     }
   },
 
   computed: {
     isDealer() {
       return JSON.parse(localStorage.getItem('supply_user')).isCustomer
+    },
+    columns() {
+      return [
+        {
+          columnAttributes: {
+            label: '',
+            prop: '操作'
+          },
+          render: (h, { row, column, index }) => {
+            return (
+              <div>
+                <el-radio value={this.current} label={row.id}></el-radio>
+              </div>
+            )
+          }
+        },
+        {
+          columnAttributes: {
+            label: '项目编号',
+            prop: 'projectNo'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '项目名称',
+            prop: 'projectName'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '项目地址',
+            prop: 'address'
+          }
+        }
+      ]
     }
   },
   watch: {
@@ -589,7 +699,16 @@ export default {
     goBack() {
       this.$emit('backListFormDetail')
     },
-
+    getLoginOrderList() {
+      getLoginOrderList({
+        pageNum: this.currentPage2,
+        pageSize: this.pageSize2,
+        ...this.formData
+      }).then(res => {
+        this.tableData = res.data.records
+        this.listTotal2 = res.data.total
+      })
+    },
     getDate(addYear) {
       var date = new Date()
       var seperator1 = '-'
@@ -962,22 +1081,26 @@ export default {
           if (type === 1) {
             if (this.listItem) {
               params.enginInfoId = this.listItem.enginInfoId
-              editEngin(params).then(res => {
-                this.$successMsg('编辑成功')
-                this.goBack()
-              }).finally(() => {
-                this.btnLoading = false
-              })
+              editEngin(params)
+                .then(res => {
+                  this.$successMsg('编辑成功')
+                  this.goBack()
+                })
+                .finally(() => {
+                  this.btnLoading = false
+                })
             } else {
               params.customerNumber = this.mainForm.jxsNum
               params.customerName = this.mainForm.jxsName
               params.customerId = this.mainForm.jxsId
-              addEngin(params).then(res => {
-                this.$successMsg('保存成功')
-                this.goBack()
-              }).finally(() => {
-                this.btnLoading = false
-              })
+              addEngin(params)
+                .then(res => {
+                  this.$successMsg('保存成功')
+                  this.goBack()
+                })
+                .finally(() => {
+                  this.btnLoading = false
+                })
             }
           } else {
             if (this.listItem) {
@@ -987,15 +1110,49 @@ export default {
               params.customerName = this.mainForm.jxsName
               params.customerId = this.mainForm.jxsId
             }
-            submitEngin(params).then(res => {
-              this.$successMsg('提交审核成功')
-              this.goBack()
-            }).finally(() => {
-              this.btnLoading = false
-            })
+            submitEngin(params)
+              .then(res => {
+                this.$successMsg('提交审核成功')
+                this.goBack()
+              })
+              .finally(() => {
+                this.btnLoading = false
+              })
           }
         }
       })
+    },
+    handleSizeChange(val) {
+      this.pageSize2 = val
+      this.currentPage2 = 1
+      this.getLoginOrderList()
+    },
+    handleCurrentChange(val) {
+      this.currentPage2 = val
+      this.getLoginOrderList()
+    },
+    // 重置筛选表单
+    resetGoodsScreenForm2() {
+      this.$refs.formData.resetFields()
+      this.currentPage2 = 1
+      this.getLoginOrderList()
+    },
+    submitAddOrder() {
+      const item = this.tableData.find(k => k.id === this.current)
+      this.mainForm.enginNum = item.projectNo
+      this.mainForm.enginName = item.projectName
+      this.mainForm.linkman = item.enginLinkName
+      this.mainForm.phone = item.enginLinkMobile
+      this.mainForm.address = item.address
+
+      this.onClose()
+    },
+    onClose() {
+      this.$nextTick(() => {
+        this.current = ''
+        this.$refs.formData.resetFields()
+        this.visible = false
+      })
     }
   }
 }