Просмотр исходного кода

提交采购申请以及销售出库

caojunjie 4 лет назад
Родитель
Сommit
b36c1a9865

+ 2 - 1
src/combination/formComponent.vue

@@ -2,7 +2,7 @@
   <div>
     <el-form :model="form" ref="form" style="display:flex;flex-wrap: wrap">
       <el-form-item
-        v-for="(item,index) in formOption" :key="item.index" v-if="(index+1) <= inDex"
+        v-for="(item,index) in formOption" :key="item.index?item.index:index" v-if="(index+1) <= inDex"
         :prop="item.label"
         :label="item.name"
         :label-width="item.labelSize + 'px'"
@@ -84,6 +84,7 @@ export default {
           if (form === 'submit'){
             this.$emit('submitAndSave')
           }else {
+            console.log('1111')
             this.$emit('submitForm')
           }
         } else {

+ 20 - 20
src/views/index.vue

@@ -4,16 +4,16 @@
       <div style="display: flex; margin-bottom: 40px">
         <div style="width: 70%">
           <ul class="block">
-            <li @click="jump('/business/inStock')">
+            <li @click="jump('/purchaseRequest')">
               <div>
                 <i
-                  class="el-icon-download"
+                  class="el-icon-s-custom"
                   style="font-size: 50px; text-align: center"
                 ></i>
                 <p>采购申请</p>
               </div>
             </li>
-            <li @click="jump('/business/outStock')">
+            <li @click="jump('/purchaseIssue')">
               <div>
                 <i
                   class="el-icon-upload2"
@@ -22,76 +22,76 @@
                 <p>销售出库</p>
               </div>
             </li>
-            <li @click="jump('/basicdata/corps')">
+            <li @click="jump('/inStock')">
               <div>
                 <i
-                  class="el-icon-s-custom"
+                  class="el-icon-download"
                   style="font-size: 50px; text-align: center"
                 ></i>
                 <p>入库</p>
               </div>
             </li>
-            <li @click="jump('/basicdata/goods')">
+            <li @click="jump('/outStock')">
               <div>
                 <i
-                  class="el-icon-s-cooperation"
+                  class="el-icon-upload2"
                   style="font-size: 50px; text-align: center"
                 ></i>
-                <p>新增商品</p>
+                <p>出库</p>
               </div>
             </li>
-            <li @click="jump('/business/stockTransfer')">
+            <li @click="jump('/basicdata/fees')">
               <div>
                 <i
                   class="el-icon-connection"
                   style="font-size: 50px; text-align: center"
                 ></i>
-                <p>调拨</p>
+                <p>新增物资</p>
               </div>
             </li>
-            <li @click="jump('/finance/charge')">
+            <li @click="jump('/finance/chargeInvoice')">
               <div>
                 <i
                   class="el-icon-wallet"
                   style="font-size: 50px; text-align: center"
                 ></i>
-                <p>收款</p>
+                <p>发票申请</p>
               </div>
             </li>
-            <li @click="jump('/finance/payment')">
+            <li @click="jump('/finance/salesInvoice')">
               <div>
                 <i
                   class="el-icon-money"
                   style="font-size: 50px; text-align: center"
                 ></i>
-                <p>付款</p>
+                <p>销项发票</p>
               </div>
             </li>
-            <li @click="jump('/finance/contrast')">
+            <li @click="jump('')">
               <div>
                 <i
                   class="el-icon-s-management"
                   style="font-size: 50px; text-align: center"
                 ></i>
-                <p>对账</p>
+                <p>进项发票</p>
               </div>
             </li>
-            <li @click="jump('/business/goodsTransfer')">
+            <li @click="jump('/finance/charge')">
               <div>
                 <i
                   class="el-icon-takeaway-box"
                   style="font-size: 50px; text-align: center"
                 ></i>
-                <p>货转</p>
+                <p>收款</p>
               </div>
             </li>
-            <li @click="jump('/agreement/agreementStorage')">
+            <li @click="jump('/finance/payment')">
               <div>
                 <i
                   class="el-icon-s-order"
                   style="font-size: 50px; text-align: center"
                 ></i>
-                <p>协议</p>
+                <p>付款</p>
               </div>
             </li>
           </ul>

+ 1087 - 0
src/views/purchaseIssue/index.vue

@@ -0,0 +1,1087 @@
+<template>
+  <div>
+    <div v-if="pageDisplay" class="app-container">
+      <formComponent
+        v-if="searchWhether"
+        :formOption="formOption"
+        :dataList="dataList"
+        :inDex="inDex"
+        ref="avatar"
+        @submitForm="submitForm"
+        @returnToForm="returnToForm"
+      />
+      <listComponent
+        :tableData="tableData"
+        @selectionbox="selectionbox"
+        @see="viewMethod"
+        @modify="modification"
+        @deletion="deletion"
+        @buttonList="buttonList"
+        @showSearch="showSearch"
+        @feedback="feedback"
+        @getList="getList"
+        :isItHidden="isItHidden"
+        :customButton="customButton"
+        :listStyle="listStyle"
+        :queryList="queryList"
+        :setRowList="setRowList"
+      />
+      <el-pagination
+        style="float: right;margin-top: 10px"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :page-sizes="[10, 20, 30, 50]"
+        :page-size="this.formDataList.pageSize"
+        background
+        layout="sizes, prev, pager, next"
+        :total="total">
+      </el-pagination>
+    </div>
+    <div v-else class="app-container">
+      <formComponent
+        v-if="searchWhether"
+        :formOption="contentOption"
+        :dataList="dataList"
+        :inDex="inDex"
+        ref="avatar"
+        @submitForm="submitForm"
+        @returnToForm="returnToForm"
+        @submitAndSave="submitAndSave"
+        @selectTrigger="selectTrigger"
+      />
+      <listComponent
+        ref="listComponent"
+        :tableData="contentList"
+        @selectionbox="selectionbox"
+        @see="viewMethod"
+        @modify="modification"
+        @deletion="deletion"
+        @buttonList="buttonList"
+        @showSearch="showSearch"
+        @feedback="feedback"
+        @getList="getList"
+        @deletRows="deletRows"
+        @totalAmount="totalAmount"
+        :tatolLabel="tatolLabel"
+        :isItHidden="isItHidden"
+        :customButton="contentButton"
+        :listStyle="listStyle"
+        :queryList="purchaseList"
+        :setRowList="setRowList"
+        :listData="listData"
+      />
+    </div>
+    <el-dialog
+      title="打印采购"
+      :visible.sync="dialogVisible"
+      :fullscreen="true"
+      style="padding: 0;margin:0"
+      width="70%">
+      <div ref="print">
+        <table class="table table-striped table-bordered" align="center" valign="center">
+          <tr>
+            <td style="font-size: 24px;font-weight:bold" class="column" colspan="6">采购表</td>
+          </tr>
+          <tr>
+            <td class="column" style="width: 10%;">项目</td>
+            <td class="column" style="width: 25%;">{{formList.projectName}}</td>
+            <td class="column" style="width: 10%;">供应商</td>
+            <td class="column" style="width: 25%;">{{ formList.corpName }}</td>
+            <td class="column" style="width: 25%;" colspan="2">日期:{{formList.fBsdate}}</td>
+          </tr>
+        </table>
+        <table class="table table-striped table-bordered" align="center" valign="center">
+          <tr>
+            <td class="column" style="width: 15%;border-top: none;">品名</td>
+            <td class="column" style="width: 15%;border-top: none;">单价</td>
+            <td class="column" style="width: 15%;border-top: none;">采购计划(斤)</td>
+            <td class="column" style="width: 15%;border-top: none;">实际重量(斤)</td>
+            <td class="column" style="width: 15%;border-top: none;">金额</td>
+            <td class="column" style="width: 20%;border-top: none;">备注</td>
+          </tr>
+          <tr v-for="(item,index) in this.contentList" :key="index">
+            <td class="column">{{item.feeName}}</td>
+            <td class="column">{{item.fUnitprice}}</td>
+            <td class="column">{{item.fPurchase}}</td>
+            <td class="column">{{item.fQty}}</td>
+            <td class="column">{{item.fAmount}}</td>
+            <td class="column">{{item.remark}}</td>
+          </tr>
+        </table>
+        <table class="table table-striped table-bordered" align="center" valign="center">
+          <tr>
+            <td colspan="6" style="border-top: none;" class="column"></td>
+          </tr>
+          <tr>
+            <td class="column" style="width: 25%;">采购人签字</td>
+            <td class="column" style="width: 25%;">厨房主管签字</td>
+            <td class="column" style="width: 25%;">验收人签字</td>
+            <td class="column" style="width: 25%;">主管签字</td>
+          </tr>
+          <tr>
+            <td class="column" style="width: 25%;height: 37px;"></td>
+            <td class="column" style="width: 25%;"></td>
+            <td class="column" style="width: 25%;"></td>
+            <td class="column" style="width: 25%;"></td>
+          </tr>
+          <tr>
+            <td colspan="4" style="border-top: none;font-weight:bold;text-align: right;padding-right: 10%;font-size: 16px;" class="column">{{ formList.fsbuName }}</td>
+          </tr>
+        </table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+    <el-button @click="dialogVisible = false">取 消</el-button>
+    <el-button type="primary" @click="Printing">打印</el-button>
+  </span>
+    </el-dialog>
+  </div>
+</template>
+
+
+<script>
+import { select } from '@/api/system/set'
+import {
+  listQuery,
+  submit,
+  viewSingle,
+  deleteQuery,
+  productName,
+  queryItem,
+  company,
+  warehouse,
+  listDelete,
+  tableDeleteQuery,
+  confirmDeletion
+} from '@/api/purchaseRequest/index'
+import Cookies from 'js-cookie'
+
+export default {
+  name: 'index',
+  data() {
+    return {
+      total:0,
+      formDataList:{
+        fBilltype: 'SQ',
+        pageSize:10,
+        pageNum:1,
+      },
+      formList:{},
+      tatolLabel:['金额'],
+      dialogVisible: false,
+      listData: {
+        fFeeid: [],
+        fFeeunitid: [],
+        fStltypeid: []
+      },
+      searchWhether: true,
+      pageDisplay: true,
+      dataList: {
+        fGoodsid: [],
+        fSbu: [],
+        fWarehouseid: [],
+        fCorpid: []
+      },
+      contentList: [],
+      inDex: 4,
+      tableData: [],
+      tableList: [],
+      isItHidden: true,
+      listStyle: [
+        {
+          surface: '1',
+          label: 'serialNumber',
+          name: '序号',
+          checked: 0,
+          width: 100,
+          onabort: ''
+        }, {
+          surface: '2',
+          label: 'fBillno',
+          name: '申请编号',
+          checked: 0,
+          width: 100,
+          onabort: ''
+        }, {
+          surface: '3',
+          label: 'projectName',
+          name: '项目名称',
+          checked: 0,
+          width: 100,
+          onabort: ''
+        }, {
+          surface: '4',
+          label: 'corpName',
+          name: '客户名称',
+          checked: 0,
+          width: 100,
+          onabort: ''
+        }, {
+          surface: '5',
+          label: 'fMoney',
+          name: '金额',
+          checked: 0,
+          width: 100,
+          onabort: ''
+        }, {
+          surface: '6',
+          label: 'createTime',
+          name: '申请日期',
+          checked: 0,
+          width: 100,
+          onabort: ''
+        },{
+          surface: '7',
+          label: 'createBy',
+          name: '申请人',
+          checked: 0,
+          width: 100,
+          onabort: ''
+        }, {
+          surface: '8',
+          label: 'fReviewDate',
+          name: '审核日期',
+          checked: 0,
+          width: 100,
+          onabort: ''
+        },{
+          surface: '9',
+          label: 'remark',
+          name: '备注',
+          checked: 0,
+          width: 100,
+          onabort: ''
+        },{
+          surface: '11',
+          label: 'operation',
+          name: '操作',
+          checked: 0,
+          width: 160,
+          operation: '1',
+          onabort: ''
+        }
+      ],
+      contentStyle: [
+        {
+          surface: '1',
+          label: 'serialNumber',
+          name: '序号',
+          checked: 0,
+          width: 100,
+          disabled: false,
+          onabort: ''
+        }, {
+          surface: '2',
+          label: 'fFeeid',
+          name: '品名',
+          checked: 0,
+          width: 100,
+          onabort: '',
+          disabled: false,
+          changeable: 1
+        }, {
+          surface: '3',
+          label: 'fUnitprice',
+          name: '单价',
+          checked: 0,
+          width: 100,
+          disabled: false,
+          onabort: 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
+          changeable: 2
+        },
+        {
+          surface: '4',
+          label: 'fPurchase',
+          name: '重量',
+          checked: 0,
+          width: 100,
+          onabort: '',
+          disabled: false,
+          changeable: 2
+        },
+        {
+          surface: '5',
+          label: 'fQty',
+          name: '实际重量',
+          checked: 0,
+          width: 100,
+          onabort: 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
+          disabled: false,
+          changeable: 2
+        }, {
+          surface: '6',
+          label: 'fFeeunitid',
+          name: '计量单位',
+          checked: 0,
+          width: 100,
+          onabort: '',
+          disabled: false,
+          changeable: 1
+        }, {
+          surface: '7',
+          label: 'fAmount',
+          name: '金额',
+          checked: 0,
+          width: 100,
+          onabort: 'this.value=this.value.replace(/[^\\-?\\d.]/g,"").replace(/^(\\-)*(\\d+)\\.(\\d\\d).*$/, "$1$2.$3")',
+          disabled: false,
+          changeable: 2
+        },
+        // {
+        //   surface: '8',
+        //   label: 'fStltypeid',
+        //   name: '付费方式',
+        //   checked: 0,
+        //   width: 100,
+        //   onabort: '',
+        //   disabled: false,
+        //   changeable: 1
+        // },
+        {
+          surface: '9',
+          label: 'remark',
+          name: '备注',
+          checked: 0,
+          width: 100,
+          onabort: '',
+          disabled: false,
+          changeable: 2
+        },
+        // {
+        //   surface: '10',
+        //   label: 'createTime',
+        //   name: '申请日期',
+        //   checked: 0,
+        //   disabled: false,
+        //   width: 100,
+        //   onabort: ''
+        // }, {
+        //   surface: '11',
+        //   label: 'createBy',
+        //   name: '申请人',
+        //   disabled: false,
+        //   checked: 0,
+        //   width: 100,
+        //   onabort: ''
+        // },
+        // {
+        //   surface: '12',
+        //   label: 'fReviewDate',
+        //   name: '审核日期',
+        //   checked: 0,
+        //   disabled: false,
+        //   width: 100,
+        //   onabort: ''
+        // },
+        {
+          surface: '13',
+          label: 'operation',
+          name: '操作',
+          checked: 0,
+          disabled: false,
+          width: 160,
+          operation: '2',
+          onabort: ''
+        }
+      ],
+      queryList: {
+        tableName: '采购申请',
+        columnList: []
+      },
+      purchaseList: {
+        tableName: '采购申请详情',
+        columnList: []
+      },
+      setRowList: [],
+      customButton: [
+        {
+          type: 'primary',
+          size: 'mini',
+          icon: 'el-icon-edit',
+          name: '新增',
+          disabled: false
+        },
+        // {
+        //   type:'warning',
+        //   size:'mini',
+        //   icon:'el-icon-edit',
+        //   name:'立即修改',
+        //   disabled:false,
+        // },
+        {
+          type: 'warning',
+          size: 'mini',
+          icon: 'el-icon-upload2',
+          name: '导出',
+          disabled: false
+        }, {
+          type: 'success',
+          size: 'mini',
+          icon: 'el-icon-c-scale-to-original',
+          name: '复制新增',
+          disabled: false
+        }
+      ],
+      contentButton: [
+        {
+          type: 'danger',
+          size: 'mini',
+          icon: 'el-icon-arrow-left',
+          name: '返回列表',
+          disabled: false
+        }, {
+          type: 'primary',
+          size: 'mini',
+          icon: 'el-icon-plus',
+          name: '录入',
+          disabled: false
+        }, {
+          type: 'primary',
+          size: 'mini',
+          icon: 'el-icon-plus',
+          name: '保存',
+          plain: true,
+          disabled: false
+        }, {
+          type: 'success',
+          size: 'mini',
+          icon: 'el-icon-edit',
+          name: '修改',
+          disabled: false
+        }, {
+          type: 'warning',
+          size: 'mini',
+          icon: 'el-icon-download',
+          name: '导出',
+          disabled: false
+        },
+        // {
+        //   type: 'info',
+        //   size: 'mini',
+        //   icon: 'el-icon-edit-outline',
+        //   name: '打印',
+        //   disabled: false
+        // },
+        {
+          type: 'primary',
+          size: 'mini',
+          icon: 'el-icon-edit-outline',
+          name: '请核',
+          disabled: false
+        },
+        {
+          type: 'info',
+          size: 'mini',
+          icon: 'el-icon-edit-outline',
+          name: '申请发票',
+          disabled: false
+        },
+        //{
+        //   type: 'info',
+        //   size: 'mini',
+        //   icon: 'el-icon-edit-outline',
+        //   name: '生成销售单',
+        //   disabled: false
+        // }
+      ],
+      formOption: [
+        {
+          span: 6,
+          label: 'fBillno',
+          name: '申请编号',
+          inputType: 2,
+          width: 200,
+          labelSize: '80',
+          rules: [{ required: false, message: ' ' }]
+        }, {
+          span: 6,
+          label: 'fGoodsid',
+          name: '项目名称',
+          inputType: 1,
+          width: 200,
+          labelSize: '80',
+          rules: [{ required: false, message: ' ' }]
+        }, {
+          span: 6,
+          label: 'fCorpid',
+          name: '供应商',
+          inputType: 2,
+          width: 200,
+          labelSize: '80',
+          rules: [{ required: false, message: ' ' }]
+        }, {
+          span: 6,
+          label: 'createBy',
+          name: '申请人',
+          inputType: 2,
+          width: 200,
+          labelSize: '80',
+          rules: [{ required: false, message: ' ' }]
+        }, {
+          span: 6,
+          label: 'moneys',
+          name: '金额',
+          inputType: 5,
+          width: 200,
+          labelSize: '80',
+          rules: [{ required: false, message: ' ' }]
+        }, {
+          span: 6,
+          label: 'cLoadDate',
+          name: '申请日期',
+          inputType: 3,
+          width: 200,
+          labelSize: '80',
+          rules: [{ required: false, message: ' ' }]
+        }
+      ],
+      contentOption: [
+        {
+          index:'1',
+          span: 6,
+          label: 'fBillno',
+          name: '系统编号',
+          inputType: 2,
+          width: 200,
+          labelSize: '80',
+          disabled: true,
+          rules: [{ required: false, message: ' ' }]
+        }, {
+          index:'2',
+          span: 6,
+          label: 'fGoodsid',
+          name: '项目名称',
+          inputType: 1,
+          width: 200,
+          labelSize: '80',
+          disabled: true,
+          rules: [{ required: true, message: ' ' }]
+        }, {
+          index:'3',
+          span: 6,
+          label: 'personNaem',
+          name: '项目主管',
+          inputType: 2,
+          width: 200,
+          labelSize: '80',
+          disabled: true,
+          rules: [{ required: false, message: ' ' }]
+        }, {
+          index:'4',
+          span: 6,
+          label: 'corpsName',
+          name: '客户',
+          inputType: 2,
+          width: 200,
+          labelSize: '80',
+          disabled: true,
+          rules: [{ required: false, message: ' ' }]
+        }, {
+          index:'5',
+          span: 6,
+          label: 'fCorpid',
+          name: '供应商',
+          inputType: 1,
+          width: 200,
+          labelSize: '80',
+          disabled: true,
+          rules: [{ required: true, message: ' ' }]
+        }, {
+          index:'6',
+          span: 6,
+          label: 'fWarehouseid',
+          name: '仓库',
+          inputType: 1,
+          width: 200,
+          disabled: true,
+          labelSize: '80',
+          rules: [{ required: true, message: ' ' }]
+        }, {
+          index:'7',
+          span: 6,
+          label: 'fBsdate',
+          name: '提货日期',
+          inputType: 6,
+          width: 200,
+          disabled: true,
+          labelSize: '80',
+          rules: [{ required: true, message: ' ' }]
+        }, {
+          index:'8',
+          span: 6,
+          label: 'createBy',
+          name: '申请人',
+          inputType: 2,
+          width: 200,
+          disabled: true,
+          labelSize: '80',
+          rules: [{ required: false, message: ' ' }]
+        },
+        {
+          index:'9',
+          span: 6,
+          label: 'fStudentsWeight',
+          name: '学生人数',
+          inputType: 2,
+          onabort: 'this.value=this.value.replace(/[^0-9]/g,\'\')',
+          width: 200,
+          disabled: true,
+          labelSize: '80',
+          rules: [{ required: true, message: ' ' }]
+        }, {
+          index:'10',
+          span: 6,
+          label: 'fTeachersWeight',
+          name: '教师人数',
+          onabort: 'this.value=this.value.replace(/[^0-9]/g,\'\')',
+          inputType: 2,
+          width: 200,
+          disabled: true,
+          labelSize: '80',
+          rules: [{ required: true, message: ' ' }]
+        },
+        {
+          index:'11',
+          span: 6,
+          label: 'fSbu',
+          name: '开票公司',
+          inputType: 1,
+          width: 200,
+          disabled: true,
+          labelSize: '80',
+          rules: [{ required: true, message: ' ' }]
+        }, {
+          index:'12',
+          span: 6,
+          label: 'remark',
+          name: '备注',
+          inputType: 4,
+          disabled: true,
+          width: 200,
+          labelSize: '80',
+          rules: [{ required: false, message: ' ' }]
+        }
+      ]
+    }
+  },
+  created() {
+    let data = {
+      tableName: this.queryList.tableName,
+      userId: Cookies.get('userName')
+    }
+    this.getRow(data)
+    this.query(this.formDataList)
+    productName().then(res => {
+      console.log(res)
+      if (res.code === 200) {
+        for (let item in res.rows) {
+          this.listData.fFeeid.push({
+            label: res.rows[item].fName,
+            value: res.rows[item].fId
+          })
+        }
+        console.log(this.listData)
+      }
+    })
+    this.getDicts('data_unitfees').then(res => {
+      console.log(res.data)
+      for (let item in res.data) {
+        this.listData.fFeeunitid.push({
+          label: res.data[item].dictLabel,
+          value: JSON.parse(res.data[item].dictValue)
+        })
+      }
+    })
+    this.getDicts('f_paymode').then(res => {
+      console.log(res)
+      for (let item in res.data) {
+        this.listData.fStltypeid.push({
+          label: res.data[item].dictLabel,
+          value: JSON.parse(res.data[item].dictValue)
+        })
+      }
+    })
+    queryItem().then(res => {
+      console.log(res)
+      for (let item in res.data) {
+        this.dataList.fGoodsid.push({
+          label: res.data[item].projectName,
+          value: res.data[item].fId,
+          personNaem: res.data[item].personNaem,
+          corpsName: res.data[item].corpsName,
+          fCorpid: res.data[item].fCorpid
+        })
+      }
+    })
+    //查询仓库
+    warehouse().then(res => {
+      console.log(res)
+      for (let item in res.rows) {
+        this.dataList.fWarehouseid.push({
+          label: res.rows[item].fName,
+          value: res.rows[item].fId
+        })
+      }
+    })
+    this.fCompany(1)
+    this.fCompany(2)
+  },
+  methods: {
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.formDataList.pageSize = val
+      this.query(this.formDataList)
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.formDataList.pageNum = val
+      this.query(this.formDataList)
+    },
+    //计算金额
+    totalAmount(scope) {
+      console.log(scope)
+      if (scope.row.fUnitprice && scope.row.fQty) {
+        scope.row.fAmount = (scope.row.fUnitprice * scope.row.fQty).toFixed(2)
+      }
+    },
+    //查询公司
+    fCompany(name) {
+      company(name).then(res => {
+        console.log(res)
+        if (name == 1) {
+          this.dataList.fCorpid = []
+          for (let item in res.data) {
+            this.dataList.fCorpid.push({
+              label: res.data[item].fName,
+              value: res.data[item].fId
+            })
+          }
+        } else if (name == 2) {
+          this.dataList.fSbu = []
+          for (let item in res.data) {
+            this.dataList.fSbu.push({
+              label: res.data[item].fName,
+              value: res.data[item].fId
+            })
+          }
+        }
+      })
+    },
+    //查询主页列数据
+    query(data) {
+      listQuery(data).then(res => {
+        this.tableData = res.rows
+        this.total = res.total
+      })
+    },
+    //查询列数据
+    getRow(data) {
+      console.log(data.tableName)
+      select(data).then((res) => {
+        console.log(res)
+        if (data.tableName === '采购申请详情') {
+          if (res.data.length != 0) {
+            this.purchaseList.columnList = res.data.filter((e) => e.checked == 0)
+            this.purchaseList.columnList = res.data
+            this.setRowList = res.data
+            this.purchaseList.columnList = this.purchaseList.columnList.filter((e) => e.checked == 0)
+            // this.waitFor = true
+          } else {
+            // this.waitFor = true
+            this.purchaseList.columnList = this.contentStyle
+            this.setRowList = this.contentStyle
+          }
+          this.pageDisplay = false
+          this.isItHidden = false
+          this.inDex = this.contentOption.length
+        } else {
+          if (res.data.length != 0) {
+            this.queryList.columnList = res.data.filter((e) => e.checked == 0)
+            this.queryList.columnList = res.data
+            this.setRowList = res.data
+            this.queryList.columnList = this.queryList.columnList.filter((e) => e.checked == 0)
+            // this.waitFor = true
+          } else {
+            // this.waitFor = true
+            this.queryList.columnList = this.listStyle
+            console.log(this.queryList.columnList.fFeeid)
+            this.setRowList = this.listStyle
+          }
+          this.pageDisplay = true
+          this.isItHidden = true
+          this.inDex = 4
+        }
+      })
+    },
+    returnToForm(row) {
+      console.log(row, 111)
+    },
+    //查看
+    viewMethod(scope) {
+      console.log(scope)
+      this.contentOption.forEach(item => item.disabled = true)
+      this.contentStyle.forEach(item => item.disabled = true)
+      viewSingle(scope.row.fId).then(res => {
+        if (res.code === 200) {
+          let data = {
+            tableName: this.purchaseList.tableName,
+            userId: Cookies.get('userName')
+          }
+          this.$refs.avatar.form = {}
+          this.getRow(data)
+          this.$refs.avatar.form = res.data.warehouseBills
+          this.contentList = res.data.tWarehousebillsfees
+        }
+      })
+    },
+    //修改
+    modification(scope) {
+      console.log(scope)
+    },
+    //删除
+    deletion(scope) {
+      console.log(scope.row.fId)
+      tableDeleteQuery(scope.row.fId).then(res => {
+        console.log(res)
+        this.$confirm(res.msg == 1 ? '主表数据为空' : (res.msg == 2 ? '主表有数据' : '未知状态') + '是否永久删除该条数据?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          confirmDeletion(scope.row.fId).then(data => {
+            this.$message({
+              type: 'success',
+              message: '删除成功!'
+            })
+            let list = {
+              fBilltype: 'SQ'
+            }
+            this.query(list)
+          })
+        }).catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          })
+        })
+      })
+    },
+    //选择框
+    selectionbox(selection) {
+      console.log(selection)
+    },
+    //详情内容保存
+    submitAndSave(item) {
+      let formData = new window.FormData()
+      formData.append('tWarehousebills', JSON.stringify(this.$refs.avatar.form))
+      formData.append('tWarehousebillsfees', JSON.stringify(this.contentList))
+      formData.append('fBilltype', 'SQ')
+      submit(formData).then(res => {
+        if (res.code == 200) {
+          this.$message.success('保存成功')
+          this.$refs.avatar.form = res.data.warehouseBills
+          this.contentList = res.data.tWarehousebillsCntrs
+          console.log(this.dataList, this.contentList)
+          if (item == 1){
+            this.dialogVisible = true
+          }
+        }
+      })
+    },
+    //表单选中后触发
+    selectTrigger(name, list, id) {
+      console.log(list, id)
+      if (name == 'fGoodsid') {
+        for (let item in list) {
+          if (list[item].value == id) {
+            this.$refs.avatar.form.personNaem = list[item].personNaem
+            this.$refs.avatar.form.corpsName = list[item].corpsName
+          }
+        }
+      }
+    },
+    //确认打印
+    Printing(){
+      this.$print(this.$refs.print)
+    },
+    //所以按钮
+    buttonList(row) {
+      console.log(row)
+      let data
+      switch (row.name) {
+        case '新增':
+          this.contentList = []
+          data = {
+            tableName: this.purchaseList.tableName,
+            userId: Cookies.get('userName')
+          }
+          this.$refs.avatar.form = {}
+          this.getRow(data)
+
+          this.contentOption.forEach(item => {
+            if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy') {
+              item.disabled = true
+            } else {
+              item.disabled = false
+            }
+          })
+          this.$refs.avatar.form.createBy = Cookies.get('userName')
+          break
+        case '保存':
+          this.$refs.avatar.submitForm('submit')
+          break
+        case '打印':
+          if (!this.$refs.avatar.form.fId){
+            this.$message.error('未保存,不允许打印');
+          }else {
+            this.formList = this.$refs.avatar.form
+            this.submitAndSave(1)
+          }
+          break
+        case '修改':
+          this.contentOption.forEach(item => {
+            if (item.label == 'personNaem' || item.label == 'corpsName' || item.label == 'createBy') {
+              item.disabled = true
+            } else {
+              item.disabled = false
+            }
+          })
+          this.contentStyle.forEach(item => item.disabled = false)
+          break
+        case '录入':
+          this.contentList.push({
+            fFeeid: '',
+            fUnitprice: '',
+            fPurchase: '',
+            fQty: '',
+            fFeeunitid: '',
+            fAmount: '',
+            fStltypeid: '',
+            remark: '',
+            createTime: '',
+            createBy: Cookies.get('userName'),
+            fReviewDate: '',
+            operation: '',
+          })
+          break
+        case '返回列表':
+          if (!this.$refs.avatar.form || this.contentList !== 0) {
+            data = {
+              tableName: this.queryList.tableName,
+              userId: Cookies.get('userName')
+            }
+            this.$refs.avatar.form = {}
+            this.getRow(data)
+            let list = {
+              fBilltype: 'SQ'
+            }
+            this.query(list)
+          } else {
+            this.$confirm('当前数据未保存是否保存?', '提示', {
+              confirmButtonText: '保存',
+              cancelButtonText: '取消',
+              type: 'warning'
+            }).then(() => {
+              this.submitAndSave()
+              console.log('111112')
+            }).catch(() => {
+              data = {
+                tableName: this.queryList.tableName,
+                userId: Cookies.get('userName')
+              }
+              this.$refs.avatar.form = {}
+              this.getRow(data)
+              let list = {
+                fBilltype: 'SQ'
+              }
+              this.query(list)
+              console.log('333')
+            })
+          }
+          break
+        default:
+          this.$message.error('该按钮暂无功能')
+      }
+    },
+    // 显示搜索条件、点击后会调用此方法
+    showSearch() {
+      console.log('到我了')
+      this.searchWhether = !this.searchWhether
+    },
+    //搜索、重置、展开
+    feedback(res) {
+      console.log(res)
+      if (res == '展开') {
+        if (this.inDex == 4) {
+          this.inDex = this.formOption.length
+        } else {
+          this.inDex = 4
+        }
+      } else if (res == '搜索') {
+        this.$refs.avatar.submitForm()
+      } else if (res == '重置') {
+        this.$refs.avatar.form = {}
+      }
+    },
+    //表单验证通过执行搜索
+    submitForm() {
+      console.log('111')
+      let list = this.formDataList
+      console.log(this.$refs.avatar.form)
+      this.formDataList = this.$refs.avatar.form
+      this.formDataList.fBilltype = list.fBilltype
+      this.formDataList.pageSize = list.pageSize
+      this.formDataList.pageNum = list.pageNum
+      this.query(this.formDataList)
+    },
+    //点击刷新会调用此方法
+    getList() {
+      this.feedback('重置')
+      this.submitForm()
+      console.log('到我了2')
+    },
+    //详情表内容移出
+    deletRows(index, rows) {
+      console.log(index, rows)
+      if (rows[index].fId) {
+        deleteQuery(this.$refs.avatar.form.fId, this.$refs.avatar.form.fDateChanged).then(res => {
+          if (res.code === 200) {
+            listDelete(rows[index].fId).then(data => {
+              rows.splice(index, 1)
+            })
+          }
+        })
+      } else {
+        rows.splice(index, 1)
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+
+.table {
+  border-collapse: collapse;
+  border-spacing: 0;
+  background-color: transparent;
+  display: table;
+  width: 100%;
+  max-width: 100%;
+  margin: 0 auto;
+}
+
+.table td {
+  text-align: center;
+  vertical-align: middle;
+  font-size: 14px;
+  color: #333333;
+  padding: 8px 12px;
+}
+
+.column {
+  border: 1px solid #000;
+}
+.app-container >>> .el-form-item{
+  margin-bottom: 0;
+}
+</style>

+ 60 - 14
src/views/purchaseRequest/index.vue

@@ -26,6 +26,16 @@
         :queryList="queryList"
         :setRowList="setRowList"
       />
+      <el-pagination
+        style="float: right;margin-top: 10px"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :page-sizes="[10, 20, 30, 50]"
+        :page-size="this.formDataList.pageSize"
+        background
+        layout="sizes, prev, pager, next"
+        :total="total">
+      </el-pagination>
     </div>
     <div v-else class="app-container">
       <formComponent
@@ -149,6 +159,12 @@ export default {
   name: 'index',
   data() {
     return {
+      total:0,
+      formDataList:{
+        fBilltype: 'SQ',
+        pageSize:10,
+        pageNum:1,
+      },
       formList:{},
       tatolLabel:['金额'],
       dialogVisible: false,
@@ -213,7 +229,7 @@ export default {
           checked: 0,
           width: 100,
           onabort: ''
-        }, {
+        },{
           surface: '7',
           label: 'createBy',
           name: '申请人',
@@ -227,15 +243,15 @@ export default {
           checked: 0,
           width: 100,
           onabort: ''
-        }, {
+        },{
           surface: '9',
           label: 'remark',
           name: '备注',
           checked: 0,
           width: 100,
           onabort: ''
-        }, {
-          surface: '10',
+        },{
+          surface: '11',
           label: 'operation',
           name: '操作',
           checked: 0,
@@ -430,12 +446,30 @@ export default {
           icon: 'el-icon-download',
           name: '导出',
           disabled: false
-        }, {
+        },{
           type: 'info',
           size: 'mini',
           icon: 'el-icon-edit-outline',
           name: '打印',
           disabled: false
+        },{
+          type: 'primary',
+          size: 'mini',
+          icon: 'el-icon-edit-outline',
+          name: '请核',
+          disabled: false
+        },{
+          type: 'info',
+          size: 'mini',
+          icon: 'el-icon-edit-outline',
+          name: '生成入库单',
+          disabled: false
+        },{
+          type: 'info',
+          size: 'mini',
+          icon: 'el-icon-edit-outline',
+          name: '生成销售单',
+          disabled: false
         }
       ],
       formOption: [
@@ -624,10 +658,7 @@ export default {
       userId: Cookies.get('userName')
     }
     this.getRow(data)
-    let list = {
-      fBilltype: 'SQ'
-    }
-    this.query(list)
+    this.query(this.formDataList)
     productName().then(res => {
       console.log(res)
       if (res.code === 200) {
@@ -684,6 +715,16 @@ export default {
     this.fCompany(2)
   },
   methods: {
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.formDataList.pageSize = val
+      this.query(this.formDataList)
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.formDataList.pageNum = val
+      this.query(this.formDataList)
+    },
     //计算金额
     totalAmount(scope) {
       console.log(scope)
@@ -718,6 +759,7 @@ export default {
     query(data) {
       listQuery(data).then(res => {
         this.tableData = res.rows
+        this.total = res.total
       })
     },
     //查询列数据
@@ -946,7 +988,7 @@ export default {
           }
           break
         default:
-          this.$message.error('按钮未知错误')
+          this.$message.error('该按钮暂无功能')
       }
     },
     // 显示搜索条件、点击后会调用此方法
@@ -971,10 +1013,14 @@ export default {
     },
     //表单验证通过执行搜索
     submitForm() {
-      console.log('执行搜索')
-      let list = this.$refs.avatar.form
-      list.fBilltype = 'SQ'
-      this.query(list)
+      console.log('111')
+      let list = this.formDataList
+      console.log(this.$refs.avatar.form)
+      this.formDataList = this.$refs.avatar.form
+      this.formDataList.fBilltype = list.fBilltype
+      this.formDataList.pageSize = list.pageSize
+      this.formDataList.pageNum = list.pageNum
+      this.query(this.formDataList)
     },
     //点击刷新会调用此方法
     getList() {

+ 2 - 1
vue.config.js

@@ -34,8 +34,9 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://192.168.1.143:9020`,
+        // target: `http://192.168.1.143:9020`,
         // target: `http://localhost:8080`,
+        target: `https://ap.tubaosoft.com/prod-api/`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''