achao 3 vuotta sitten
vanhempi
commit
1c43037d50

+ 2 - 2
unimall-admin/config/dep.env.js

@@ -1,6 +1,6 @@
 module.exports = {
 	NODE_ENV: '"production"',
   ENV_CONFIG: '"dep"',
-  HOST: '"http://localhost:8091"',
-  BASE_API: '"http://localhost:8091/m.api"'
+  HOST: 'http://192.168.1.113:8091',
+  BASE_API: '"http://192.168.1.113/m.api"'
 }

+ 2 - 2
unimall-admin/config/dev.env.js

@@ -2,8 +2,8 @@ module.exports = {
 	NODE_ENV: '"development"',
   ENV_CONFIG: '"dev"',
 
-  HOST: '"http://localhost:8091"',
-  BASE_API: '"http://localhost:8091/m.api"'
+  HOST: '"http://192.168.1.113:8091"',
+  BASE_API: '"http://192.168.1.113:8091/m.api"'
   // HOST: '"http://192.168.1.115:8080"',
   // BASE_API: '"http://192.168.1.115:8080/m.api"'
   // HOST: '"http://192.168.1.113:8080"',

+ 1 - 1
unimall-admin/config/index.js

@@ -15,7 +15,7 @@ module.exports = {
 
     // can be overwritten by process.env.HOST
     // if you want dev by ip, please set host: '0.0.0.0'
-    host: 'localhost',
+    host: '192.168.1.116',
     port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: true,
     errorOverlay: true,

+ 4 - 6
unimall-admin/src/api/collectionPayment.js

@@ -21,12 +21,11 @@ export function listCollectionPayment(query) {
       _mt: 'list',
       page: query.page,
       limit: query.limit,
-      CollectionPaymentDTO: JSON.stringify(query.type),
+      CollectionPaymentDTO: JSON.stringify(query.type)
     })
   })
 }
 
-
 export function createCollectionPayment(data) {
   return request({
     method: 'post',
@@ -49,7 +48,6 @@ export function updateCollectionPayment(data) {
   })
 }
 
-
 export function importWord(data) {
   return request({
     method: 'post',
@@ -61,16 +59,16 @@ export function importWord(data) {
   })
 }
 
-export function exportXlsx(data) {debugger
+export function exportXlsx(data) {
   return request({
     method: 'post',
     data: Qs.stringify({
       _gp: 'admin.collectionpayment',
       _mt: 'export',
       CollectionPaymentDTO: JSON.stringify(data),
-      response: 'blob',
+      response: 'blob'
     })
   })
 }
 
-// export const exportXlsx ='/contractCostInfo/payment'
+// export const exportXlsx ='/contractCostInfo/payment'

+ 3 - 3
unimall-admin/src/api/customerBillingDetail.js

@@ -4,9 +4,9 @@ import Qs from 'qs'
 export function listCustomerBillingDetail(query) {
   return request({
     method: 'post',
-    params:{
-      _gp: 'admin.customerbillingdetail',
-      _mt: 'list',
+    params: {
+      _gp: 'admin.customerbilling',
+      _mt: 'getInfo',
       page: query.page,
       limit: query.limit,
       ...query

+ 43 - 2
unimall-admin/src/api/customerBillingInfo.js

@@ -4,16 +4,35 @@ import Qs from 'qs'
 export function listCustomerBillingInfo(query) {
   return request({
     method: 'post',
-    params:{
+    params: {
       _gp: 'admin.customerbilling',
       _mt: 'list',
       page: query.page,
       limit: query.limit,
-      ...query
+      CustomerBillingInfoDTO: JSON.stringify(query.type)
     }
   })
 }
+export function getCusDate(query) {
+  return request({
+    method: 'post',
+    params: {
+      _gp: 'admin.customerbilling',
+      _mt: 'cusDate',
+      ...query
 
+    }
+  })
+}
+export function listCustomer() {
+  return request({
+    method: 'post',
+    params: {
+      _gp: 'admin.customerbilling',
+      _mt: 'customerList'
+    }
+  })
+}
 export function createCustomerBillingInfo(data) {
   return request({
     method: 'post',
@@ -24,6 +43,16 @@ export function createCustomerBillingInfo(data) {
     })
   })
 }
+export function editCustomerBillingInfo(data) {
+  return request({
+    method: 'post',
+    data: Qs.stringify({
+      _gp: 'admin.customerbilling',
+      _mt: 'edit',
+      CustomerBillingInfoDTO: JSON.stringify(data)
+    })
+  })
+}
 
 export function updateCustomerBillingInfo(data) {
   return request({
@@ -46,3 +75,15 @@ export function deleteCustomerBillingInfo(id) {
     }
   })
 }
+
+export function exportXlsx(data) {
+  return request({
+    method: 'post',
+    data: Qs.stringify({
+      _gp: 'admin.customerbilling',
+      _mt: 'export',
+      CustomerBillingInfoDTO: JSON.stringify(data),
+      response: 'blob'
+    })
+  })
+}

+ 0 - 48
unimall-admin/src/api/customerInfo.js

@@ -1,48 +0,0 @@
-import request from '@/utils/request'
-import Qs from 'qs'
-
-export function listCustomerInfo(query) {
-  return request({
-    method: 'post',
-    params:{
-      _gp: 'admin.customerinfo',
-      _mt: 'list',
-      page: query.page,
-      limit: query.limit,
-      ...query
-    }
-  })
-}
-
-export function createCustomerInfo(data) {
-  return request({
-    method: 'post',
-    data: Qs.stringify({
-      _gp: 'admin.customerinfo',
-      _mt: 'create',
-      CustomerInfoDTO: JSON.stringify(data)
-    })
-  })
-}
-
-export function updateCustomerInfo(data) {
-  return request({
-    method: 'post',
-    data: Qs.stringify({
-      _gp: 'admin.customerinfo',
-      _mt: 'edit',
-      CustomerInfoDTO: JSON.stringify(data)
-    })
-  })
-}
-
-export function deleteCustomerInfo(id) {
-  return request({
-    method: 'post',
-    params: {
-      _gp: 'admin.customerinfo',
-      _mt: 'delete',
-      id: id
-    }
-  })
-}

+ 37 - 1
unimall-admin/src/router/route.json

@@ -1,4 +1,27 @@
-[
+[{
+	"redirect":"noredirect",
+	"path":"/tools1",
+	"children":[
+		{
+			"path":"generator",
+			"meta":{
+				"noCache":true,
+				"perms":[
+					""
+				],
+				"title":"代码生成器"
+			},
+			"name":"tools",
+			"page":"/tools/generator"
+		}
+	],
+	"meta":{
+		"icon":"tools",
+		"title":"实用工具"
+	},
+	"name":"toolsManage",
+	"alwaysShow":true
+},
 	{
 		"redirect":"noredirect",
 		"path":"/tools",
@@ -76,6 +99,19 @@
 				"page":"/customerBilling/customerBillingInfoadd",
 				"hidden":true
 			},
+			{
+				"path":"customerBillingInfolook",
+				"meta":{
+					"noCache":true,
+					"perms":[
+						""
+					],
+					"title":"客户账单查看"
+				},
+				"name":"customerBillingInfolook",
+				"page":"/customerBilling/customerBillingInfolook",
+				"hidden":true
+			},
 			{
 				"path":"customerBillingInfoedit",
 				"meta":{

+ 613 - 558
unimall-admin/src/views/collectionPayment/collectionPayment.vue

@@ -1,150 +1,217 @@
 <template>
-    <div class="app-container">
-        <!-- 查询和其他操作 -->
-        <div class="filter-container">
-            <el-input v-model="listQuery.type.receivingWithdrawingPeople" clearable class="filter-item" size="small"
-                style="width: 200px;" placeholder="请输入收款人姓名" />
-            <!-- <el-input v-model="listQuery.type.receivingWithdrawingRegion" clearable class="filter-item" size="small"
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.type.receivingWithdrawingPeople"
+        clearable
+        class="filter-item"
+        size="small"
+        style="width: 200px;"
+        placeholder="请输入收款人姓名" />
+      <!-- <el-input v-model="listQuery.type.receivingWithdrawingRegion" clearable class="filter-item" size="small"
                 style="width: 200px;" placeholder="请输入收款地" /> -->
 
-            <!-- <el-input v-model="listQuery.receiptPaymentDate" clearable class="filter-item" size="small"
+      <!-- <el-input v-model="listQuery.receiptPaymentDate" clearable class="filter-item" size="small"
                 style="width: 200px;" placeholder="请输入收款日期" /> -->
-            <el-select v-model="listQuery.type.receivingWithdrawingRegion" placeholder="请选择收款地" style="margin:0 20px;"
-                size="small">
-                <el-option :label="item.country" :value="item.country" v-for="(item, index) in placeList" :key="index">
-                </el-option>
-            </el-select>
-            <el-date-picker style="margin-right:20px" size="small" v-model="selectDate" type="daterange" value-format="yyyy-MM-dd"
-                range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
-            </el-date-picker>
+      <el-select
+        v-model="listQuery.type.receivingWithdrawingRegion"
+        placeholder="请选择收款地"
+        style="margin:0 20px;"
+        size="small">
+        <el-option v-for="(item, index) in placeList" :label="item.country" :value="item.country" :key="index"/>
+      </el-select>
+      <el-date-picker
+        v-model="selectDate"
+        style="margin-right:20px"
+        size="small"
+        type="daterange"
+        value-format="yyyy-MM-dd"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"/>
 
-            <el-button v-permission="['collectionPayment:collectionpayment:list']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-search" @click="handleFilter">查找</el-button>
-            <el-button v-permission="['collectionPayment:collectionpayment:create']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-edit" @click="handleCreate">添加</el-button>
-            <el-button v-permission="['collectionPayment:collectionpayment:create']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-edit" @click="exportlist">导出</el-button>
+      <el-button
+        v-permission="['collectionPayment:collectionpayment:list']"
+        class="filter-item"
+        type="primary"
+        size="mini"
+        icon="el-icon-search"
+        @click="handleFilter">查找</el-button>
+      <el-button
+        v-permission="['collectionPayment:collectionpayment:create']"
+        class="filter-item"
+        type="primary"
+        size="mini"
+        icon="el-icon-edit"
+        @click="handleCreate">添加</el-button>
+      <el-button
+        v-permission="['collectionPayment:collectionpayment:create']"
+        class="filter-item"
+        type="primary"
+        size="mini"
+        icon="el-icon-edit"
+        @click="exportlist">导出</el-button>
 
-            <el-upload style="margin-left: 8px;margin-bottom:0" class="filter-item" action="" :on-change="importClick"
-                :show-file-list="false"
-                accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
-                :auto-upload="false">
-                <el-button v-permission="['collectionPayment:collectionpayment:create']" class="filter-item"
-                    type="primary" size="mini" icon="el-icon-edit">导入</el-button>
-            </el-upload>
+      <el-upload
+        :on-change="importClick"
+        :show-file-list="false"
+        :auto-upload="false"
+        style="margin-left: 8px;margin-bottom:0"
+        class="filter-item"
+        action=""
+        accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
+        <el-button
+          v-permission="['collectionPayment:collectionpayment:create']"
+          class="filter-item"
+          type="primary"
+          size="mini"
+          icon="el-icon-edit">导入</el-button>
+      </el-upload>
 
-        </div>
+    </div>
 
-        <!-- 查询结果 -->
-        <el-table v-loading="listLoading" :data="list" size="small" element-loading-text="正在查询中。。。" border fit
-            highlight-current-row show-summary :summary-method="getSummaries" @selection-change="handleSelectionChange">
-            <el-table-column :selectable="selectInit" type="selection"></el-table-column>
-            <el-table-column type="index" label="序号">
-                <template scope="scope">
-                    <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
-                    <span v-else>{{ scope.$index + 1 }}</span>
-                </template>
-            </el-table-column>
+    <!-- 查询结果 -->
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      :summary-method="getSummaries"
+      size="small"
+      element-loading-text="正在查询中。。。"
+      border
+      fit
+      highlight-current-row
+      show-summary
+      @selection-change="handleSelectionChange">
+      <el-table-column :selectable="selectInit" type="selection"/>
+      <el-table-column type="index" label="序号">
+        <template scope="scope">
+          <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
+          <span v-else>{{ scope.$index + 1 }}</span>
+        </template>
+      </el-table-column>
 
-            <el-table-column align="center" label="收款日期" prop="receiptPaymentDate">
-                <template slot-scope="scope">
-                    {{ scope.row.receiptPaymentDate }}</template>
-            </el-table-column>
-            <el-table-column align="center" label="收款地" prop="receivingWithdrawingRegion" />
-            <el-table-column align="center" label="付款人" prop="receivingWithdrawingPeople" />
-            <el-table-column align="center" label="金额(欧元)" prop="deductionEuro" />
-            <el-table-column align="center" label="金额(人民币)" prop="deductionRmb" />
-            <el-table-column align="center" label="备注1" prop="remarks" />
-            <el-table-column align="center" label="备注2" prop="remark" />
-            <el-table-column align="center" label="状态" prop="status">
-                <template slot-scope="scope">
-                    {{ scope.row.status == 1 ? '已作废' : '' }}</template>
-            </el-table-column>
-            <el-table-column align="center" label="操作人" prop="updatePeople" />
-            <!-- <el-form-item label="操作人" prop="updatePeople">
+      <el-table-column align="center" label="收款日期" prop="receiptPaymentDate">
+        <template slot-scope="scope">
+          {{ scope.row.receiptPaymentDate }}</template>
+      </el-table-column>
+      <el-table-column align="center" label="收款地" prop="receivingWithdrawingRegion" />
+      <el-table-column align="center" label="付款人" prop="receivingWithdrawingPeople" />
+      <el-table-column align="center" label="金额(欧元)" prop="deductionEuro" />
+      <el-table-column align="center" label="金额(人民币)" prop="deductionRmb" />
+      <el-table-column align="center" label="备注1" prop="remarks" />
+      <el-table-column align="center" label="备注2" prop="remark" />
+      <el-table-column align="center" label="状态" prop="status">
+        <template slot-scope="scope">
+          {{ scope.row.status == 1 ? '已作废' : '' }}</template>
+      </el-table-column>
+      <el-table-column align="center" label="操作人" prop="updatePeople" />
+      <!-- <el-form-item label="操作人" prop="updatePeople">
                     <el-input v-model="dataForm.updatePeople" />
                 </el-form-item> -->
-            <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
-                <template slot-scope="scope">
-                    <el-button v-permission="['collectionPayment:collectionpayment:edit']" type="primary" size="mini"
-                        @click="handleUpdate(scope.row)">编辑</el-button>
-                    <el-button v-permission="['collectionPayment:collectionpayment:edit']" type="primary" size="mini"
-                        @click="updateData1(scope.row)">作废</el-button>
-                    <!-- <el-button v-permission="['collectionPayment:collectionpayment:delete']" type="danger" size="mini"
+      <el-table-column align="center" label="操作" class-name="small-padding" width="250px">
+        <template slot-scope="scope">
+          <el-button
+            v-permission="['collectionPayment:collectionpayment:edit']"
+            type="primary"
+            size="mini"
+            @click="handleUpdate(scope.row)">编辑</el-button>
+          <el-button
+            v-permission="['collectionPayment:collectionpayment:edit']"
+            type="primary"
+            size="mini"
+            @click="updateData1(scope.row)">作废</el-button>
+            <!-- <el-button v-permission="['collectionPayment:collectionpayment:delete']" type="danger" size="mini"
                         @click="handleDelete(scope.row)">删除</el-button> -->
-                </template>
-            </el-table-column>
-        </el-table>
+        </template>
+      </el-table-column>
+    </el-table>
 
-        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-            :page-sizes="[100, 200, 300, 400,1000,1500,2000]" :page-size="100" layout="total, sizes, prev, pager, next, jumper"
-            :total="total">
-        </el-pagination>
+    <el-pagination
+      :current-page="currentPage"
+      :page-sizes="[100, 200, 300, 400,1000,1500,2000]"
+      :page-size="100"
+      :total="total"
+      layout="total, sizes, prev, pager, next, jumper"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"/>
 
-        <!-- 添加或修改对话框 -->
-        <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
-            <el-form ref="dataForm" :rules="rules" :model="dataForm" status-icon label-position="left"
-                label-width="150px" style="width: 400px; margin-left:50px;">
-                <el-form-item label="id" prop="id" hidden>
-                    <el-input v-model="dataForm.id" />
-                </el-form-item>
-                <el-form-item label="付款人" prop="receivingWithdrawingPeople">
-                    <el-input v-model="dataForm.receivingWithdrawingPeople" />
-                </el-form-item>
-                <el-form-item label="收款地" prop="receivingWithdrawingRegion">
-                    <!-- <el-input v-model="dataForm.receivingWithdrawingRegion" /> -->
-                    <el-select v-model="dataForm.receivingWithdrawingRegion" placeholder="请选择收款地点" style="width:100%">
-                        <el-option :label="item.country" :value="item.country" v-for="(item, index) in placeList"
-                            :key="index"></el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item label="收款日期" prop="receiptPaymentDate">
-                    <!-- <el-input v-model="dataForm.receiptPaymentDate" /> -->
-                    <el-date-picker v-model="dataForm.receiptPaymentDate" type="date" class="tkdate" value-format="yyyy-MM-dd"
-                        style="width: 100%;">
-                    </el-date-picker>
-                </el-form-item>
-                <el-form-item label="金额(欧元)" prop="deductionEuro">
-                    <el-input v-model="dataForm.deductionEuro" />
-                </el-form-item>
-                <el-form-item label="金额(人民币)" prop="deductionRmb">
-                    <el-input v-model="dataForm.deductionRmb" />
-                </el-form-item>
-                <el-form-item label="备注1" prop="remarks">
-                    <el-input v-model="dataForm.remarks" />
-                </el-form-item>
-                <el-form-item label="备注2" prop="remark">
-                    <el-input v-model="dataForm.remark" />
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click="dialogFormVisible = false">取消</el-button>
-                <el-button v-if="dialogStatus == 'create'" :loading="submiting" type="primary" @click="createData">确定
-                </el-button>
-                <el-button v-else type="primary" :loading="submiting" @click="updateData">确定</el-button>
-            </div>
-        </el-dialog>
-    </div>
+    <!-- 添加或修改对话框 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
+      <el-form
+        ref="dataForm"
+        :rules="rules"
+        :model="dataForm"
+        status-icon
+        label-position="left"
+        label-width="150px"
+        style="width: 400px; margin-left:50px;">
+        <el-form-item label="id" prop="id" hidden>
+          <el-input v-model="dataForm.id" />
+        </el-form-item>
+        <el-form-item label="付款人" prop="receivingWithdrawingPeople">
+          <el-input v-model="dataForm.receivingWithdrawingPeople" />
+        </el-form-item>
+        <el-form-item label="收款地" prop="receivingWithdrawingRegion">
+          <!-- <el-input v-model="dataForm.receivingWithdrawingRegion" /> -->
+          <el-select v-model="dataForm.receivingWithdrawingRegion" placeholder="请选择收款地点" style="width:100%">
+            <el-option
+              v-for="(item, index) in placeList"
+              :label="item.country"
+              :value="item.country"
+              :key="index"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="收款日期" prop="receiptPaymentDate">
+          <!-- <el-input v-model="dataForm.receiptPaymentDate" /> -->
+          <el-date-picker
+            v-model="dataForm.receiptPaymentDate"
+            type="date"
+            class="tkdate"
+            value-format="yyyy-MM-dd"
+            style="width: 100%;"/>
+        </el-form-item>
+        <el-form-item label="金额(欧元)" prop="deductionEuro">
+          <el-input v-model="dataForm.deductionEuro" />
+        </el-form-item>
+        <el-form-item label="金额(人民币)" prop="deductionRmb">
+          <el-input v-model="dataForm.deductionRmb" />
+        </el-form-item>
+        <el-form-item label="备注1" prop="remarks">
+          <el-input v-model="dataForm.remarks" />
+        </el-form-item>
+        <el-form-item label="备注2" prop="remark">
+          <el-input v-model="dataForm.remark" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">取消</el-button>
+        <el-button v-if="dialogStatus == 'create'" :loading="submiting" type="primary" @click="createData">确定
+        </el-button>
+        <el-button v-else :loading="submiting" type="primary" @click="updateData">确定</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
 import {
-    dayjs,
-    EventBus
+  dayjs,
+  EventBus
 } from 'base-core-lib'
 import {
-    listCountry
+  listCountry
 } from '@/api/country'
 import {
-    downloadFile
+  downloadFile
 } from '@/utils/batchDown'
 import {
-    importWord,
-    listCollectionPayment,
-    createCollectionPayment,
-    updateCollectionPayment,
-    deleteCollectionPayment,
-    exportXlsx
+  importWord,
+  listCollectionPayment,
+  createCollectionPayment,
+  updateCollectionPayment,
+  deleteCollectionPayment,
+  exportXlsx
 } from '@/api/collectionPayment'
 // import {
 //     exportXlsx
@@ -153,461 +220,449 @@ import {
 import Pagination from '@/components/Pagination'
 import store from '@/store'
 export default {
-    name: 'CollectionPayment',
-    components: { Pagination },
-    data() {
-        return {
-            isAllowExport: true,
-            countryList: [],
-            modification: [],
-            selectDate: '',
-            date: {
-                year: dayjs().format('YYYY'),
-                month: dayjs().format('MM'),
-            },
-            accessoryTFs: false,
-            fileList: [],
-            appendixIdsAdd: '',
-            excelFreightspace: [],
-            fileTemp: null,
-            placeList: [],
-            list: null,
-            total: 0,
-            listLoading: true,
-            listQuery: {
-                page: 1,
-                limit: 100,
-                type: {
-                    businessType: 1,
-                    receivingWithdrawingPeople: '',
-                    receivingWithdrawingRegion: '',
-                    startDate: '',
-                    endDate: '',
-                },
-            },
-            listPlace: {
-                page: 1,
-                limit: 2000,
-                type: {
-                    country: ''
-                }
-            },
-            dataForm: {
-                id: undefined,
-                updatePeople: store.getters.name
-            },
-            dialogFormVisible: false,
-            submiting: false,
-            dialogStatus: '',
-            textMap: {
-                update: '编辑',
-                create: '创建'
-            },
-            rules: {
-            }
+  name: 'CollectionPayment',
+  components: { Pagination },
+  data() {
+    return {
+      isAllowExport: true,
+      countryList: [],
+      modification: [],
+      selectDate: '',
+      date: {
+        year: dayjs().format('YYYY'),
+        month: dayjs().format('MM')
+      },
+      accessoryTFs: false,
+      fileList: [],
+      appendixIdsAdd: '',
+      excelFreightspace: [],
+      fileTemp: null,
+      placeList: [],
+      list: null,
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        limit: 100,
+        type: {
+          businessType: 1,
+          receivingWithdrawingPeople: '',
+          receivingWithdrawingRegion: '',
+          startDate: '',
+          endDate: ''
+        }
+      },
+      listPlace: {
+        page: 1,
+        limit: 2000,
+        type: {
+          country: ''
         }
+      },
+      dataForm: {
+        id: undefined,
+        updatePeople: store.getters.name
+      },
+      dialogFormVisible: false,
+      submiting: false,
+      dialogStatus: '',
+      textMap: {
+        update: '编辑',
+        create: '创建'
+      },
+      rules: {
+      }
+    }
+  },
+  created() {
+    this.getList()
+    // let a = store.getters.name
+    this.currentPage = 1
+  },
+  methods: {
+    handleSizeChange(val) {
+      debugger
+      console.log(`每页 ${val} 条`)
+      this.listQuery.limit = val
+      this.getList()
     },
-    created() {
-        this.getList()
-        // let a = store.getters.name
-        this.currentPage = 1
+    handleCurrentChange(val) {
+      this.listQuery.page = val
+      console.log(`当前页: ${val}`)
+      this.getList()
     },
-    methods: {
-        handleSizeChange(val) {
-            debugger
-            console.log(`每页 ${val} 条`)
-            this.listQuery.limit = val
-            this.getList()
-        },
-        handleCurrentChange(val) {
-            this.listQuery.page = val
-            console.log(`当前页: ${val}`)
-            this.getList()
-        },
-        handleSelectionChange(val) {
-            this.modification = val
-        },
-        selectInit(row) {
-            return true
-        },
-        async exportlist() {
-            if (this.modification.length == 0) {
-                this.$message.warning('请选择要导出的条目!')
-            } else {
-                console.log('导出数据', this.modification)
-                let _data = {
-                    collectionPaymentDTOList: this.modification,
-                }
-                const {
-                    data
-                } = await exportXlsx(_data).then((response) => {
-                    this.download(response.data.data)
-                    //   downloadFile({
-                    //     res: data,
-                    //     fileName: `${
-                    //     this.date.year + (this.date.month ? `-${this.date.month}` : '')
-                    //     }付款信息`,
-                    //     type: 'xls',
-                    //     })
-                    if (response.status == '200') {
-
-                    }
-                })
+    handleSelectionChange(val) {
+      this.modification = val
+    },
+    selectInit(row) {
+      return true
+    },
+    async exportlist() {
+      if (this.modification.length == 0) {
+        this.$message.warning('请选择要导出的条目!')
+      } else {
+        console.log('导出数据', this.modification)
+        const _data = {
+          collectionPaymentDTOList: this.modification
+        }
+        const {
+          data
+        } = await exportXlsx(_data).then((response) => {
+          this.download(response.data.data)
+          //   downloadFile({
+          //     res: data,
+          //     fileName: `${
+          //     this.date.year + (this.date.month ? `-${this.date.month}` : '')
+          //     }付款信息`,
+          //     type: 'xls',
+          //     })
+          if (response.status == '200') {
 
+          }
+        })
+      }
+    },
+    importClick(file, fileList) {
+      this.fileTemp = file.raw
+      const fileName = file.raw.name
+      const fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
+      // 判断上传文件格式
+      if (this.fileTemp) {
+        if (fileType == 'xlsx' || fileType == 'xls') {
+          this.importf(this.fileTemp)
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '附件格式错误,请删除后重新上传!'
+          })
+        }
+      } else {
+        this.$message({
+          type: 'warning',
+          message: '请上传附件!'
+        })
+      }
+    },
+    importf(obj) {
+      this.countryList = []
+      this.excelFreightspace = []
+      // this.dialogVisible = true;
+      const _this = this
+      const inputDOM = this.$refs.inputer // 通过DOM取文件数据
+      this.file = event.currentTarget.files[0]
+      var rABS = false // 是否将文件读取为二进制字符串
+      var f = this.file
+      var reader = new FileReader()
+      // if (!FileReader.prototype.readAsBinaryString) {
+      FileReader.prototype.readAsBinaryString = function (f) {
+        var binary = ''
+        var rABS = false // 是否将文件读取为二进制字符串
+        var pt = this
+        var wb // 读取完成的数据
+        var outdata
+        var reader = new FileReader()
+        reader.onload = function (e) {
+          var bytes = new Uint8Array(reader.result)
+          var length = bytes.byteLength
+          for (var i = 0; i < length; i++) {
+            binary += String.fromCharCode(bytes[i])
+          }
+          var XLSX = require('xlsx')
+          if (rABS) {
+            wb = XLSX.read(btoa(fixdata(binary)), { // 手动转化
+              type: 'base64',
+              cellDates: true
+            })
+          } else {
+            wb = XLSX.read(binary, {
+              type: 'binary'
+            })
+          }
+          // outdata就是你想要的东西 excel导入的数据
+          outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]])
+          // excel 数据再处理
+          const arr = []
+          outdata.map(v => {
+            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+            const jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig, '')
+            v = JSON.parse(jsonString)
+            const obj = {}
+            debugger
+            // xxx代表列名
+            obj.receiptPaymentDate = v.收款日期
+            obj.receivingWithdrawingRegion = v.收款地
+            obj.receivingWithdrawingPeople = v.付款人
+            obj.deductionEuro = v.金额EUR
+            obj.deductionRmb = v.金额RMB
+            obj.businessType = 1
+            obj.remarks = v.备注1
+            obj.remark = v.备注2
+            obj.updatePeople = _this.$store.getters.name
+            if (!obj.deductionEuro) {
+              obj.deductionEuro = 0
             }
-        },
-        importClick(file, fileList) {
-            this.fileTemp = file.raw
-            let fileName = file.raw.name
-            let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
-            // 判断上传文件格式
-            if (this.fileTemp) {
-                if (fileType == 'xlsx' || fileType == 'xls') {
-                    this.importf(this.fileTemp)
-                } else {
-                    this.$message({
-                        type: 'warning',
-                        message: '附件格式错误,请删除后重新上传!',
-                    })
-                }
-            } else {
-                this.$message({
-                    type: 'warning',
-                    message: '请上传附件!',
-                })
+            if (!obj.deductionRmb) {
+              obj.deductionRmb = 0
             }
-        },
-        importf(obj) {
-            this.countryList = []
-            this.excelFreightspace = []
-            // this.dialogVisible = true;
-            let _this = this;
-            let inputDOM = this.$refs.inputer; // 通过DOM取文件数据
-            this.file = event.currentTarget.files[0];
-            var rABS = false; //是否将文件读取为二进制字符串
-            var f = this.file;
-            var reader = new FileReader();
-            //if (!FileReader.prototype.readAsBinaryString) {
-            FileReader.prototype.readAsBinaryString = function (f) {
-                var binary = '';
-                var rABS = false; //是否将文件读取为二进制字符串
-                var pt = this;
-                var wb; //读取完成的数据
-                var outdata;
-                var reader = new FileReader();
-                reader.onload = function (e) {
-                    var bytes = new Uint8Array(reader.result);
-                    var length = bytes.byteLength;
-                    for (var i = 0; i < length; i++) {
-                        binary += String.fromCharCode(bytes[i]);
-                    }
-                    var XLSX = require('xlsx');
-                    if (rABS) {
-                        wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
-                            type: 'base64',
-                            cellDates: true
-                        });
-                    } else {
-                        wb = XLSX.read(binary, {
-                            type: 'binary'
-                        });
-                    }
-                    // outdata就是你想要的东西 excel导入的数据
-                    outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
-                    // excel 数据再处理
-                    let arr = []
-                    outdata.map(v => {
-                        // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
-                        let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig, '');
-                        v = JSON.parse(jsonString);
-                        let obj = {}
-                        debugger
-                        //xxx代表列名
-                        obj.receiptPaymentDate = v.收款日期
-                        obj.receivingWithdrawingRegion = v.收款地
-                        obj.receivingWithdrawingPeople = v.付款人
-                        obj.deductionEuro = v.金额EUR
-                        obj.deductionRmb = v.金额RMB
-                        obj.businessType = 1
-                        obj.remarks = v.备注1
-                        obj.remark = v.备注2
-                        obj.updatePeople = _this.$store.getters.name
-                        if (!obj.deductionEuro) {
-                            obj.deductionEuro = 0
-                        }
-                        if (!obj.deductionRmb) {
-                            obj.deductionRmb = 0
-                        }
-                        for (let i = 0; i < _this.placeList.length; i++) {
-                            _this.countryList.push(_this.placeList[i].country)
-                        }
-                        if (!_this.countryList.includes(obj.receivingWithdrawingRegion)) {
-                            _this.isAllowExport = false
-                            _this.$notify({
-                                title: '失败',
-                                message: '导入失败,导入数据中收款地在系统中不存在,请重新编辑',
-                                type: 'error'
-                            });
-                            return
-                        } else {
-                            _this.excelFreightspace.push(obj)
-                            _this.isAllowExport = true
-                        }
-
-                    })
-                    if (_this.excelFreightspace && _this.isAllowExport) {
-                        importWord(_this.excelFreightspace).then((response) => {
-
-                            if (response.status == '200') {
-                                _this.$notify({
-                                    title: '成功',
-                                    message: '导入成功',
-                                    type: 'success'
-                                });
-                                _this.getList()
-                            }
-                        })
-
-                    }
-                }
-                reader.readAsArrayBuffer(f);
+            for (let i = 0; i < _this.placeList.length; i++) {
+              _this.countryList.push(_this.placeList[i].country)
             }
-            if (rABS) {
-                reader.readAsArrayBuffer(f);
+            if (!_this.countryList.includes(obj.receivingWithdrawingRegion)) {
+              _this.isAllowExport = false
+              _this.$notify({
+                title: '失败',
+                message: '导入失败,导入数据中收款地在系统中不存在,请重新编辑',
+                type: 'error'
+              })
+              return
             } else {
-                reader.readAsBinaryString(f);
+              _this.excelFreightspace.push(obj)
+              _this.isAllowExport = true
             }
-
-        },
-        formatDate(numb, format) {
-            const old = numb - 1;
-            const t = Math.round((old - Math.floor(old)) * 24 * 60 * 60);
-            const time = new Date(1900, 0, old, 0, 0, t)
-            const year = time.getFullYear();
-            const month = time.getMonth() + 1;
-            const date = time.getDate();
-            return year + format + (month < 10 ? '0' + month : month) + format + (date < 10 ? '0' + date : date) + ' 00:00:00'
-        },
-        getSummaries(param) {
-
-            const { columns, data } = param;
-            const sums = [];
-            columns.forEach((column, index) => {
-                if (index === 0) {
-                    sums[index] = "合计";
-                    return;
-                } else if (index == 5 || index == 6) {
-                    const values = data.map((item) => Number(item[column.property]));
-                    if (!values.every((value) => isNaN(value))) {
-                        sums[index] = values.reduce((prev, curr) => {
-                            const value = Number(curr);
-                            if (!isNaN(value)) {
-                                return prev + curr;
-                            } else {
-                                return prev;
-                            }
-                        }, 0);
-                        sums[index] += "";
-                    } else {
-                        sums[index] = "--";
-                    }
-                } else {
-                    // sums[index] = "--";
-                }
-            });
-
-            return sums;
-
-        },
-        getList() {
-
-            console.log(this.selectDate)
-            listCountry(this.listPlace).then(response => {
-                this.placeList = response.data.data.items
-            })
-                .catch(() => {
-                    this.placeList = []
+          })
+          if (_this.excelFreightspace && _this.isAllowExport) {
+            importWord(_this.excelFreightspace).then((response) => {
+              if (response.status == '200') {
+                _this.$notify({
+                  title: '成功',
+                  message: '导入成功',
+                  type: 'success'
                 })
-            this.listLoading = true
-            console.log(this.selectDate)
-            if (this.selectDate&&this.selectDate.length > 0) {
+                _this.getList()
+              }
+            })
+          }
+        }
+        reader.readAsArrayBuffer(f)
+      }
+      if (rABS) {
+        reader.readAsArrayBuffer(f)
+      } else {
+        reader.readAsBinaryString(f)
+      }
+    },
+    formatDate(numb, format) {
+      const old = numb - 1
+      const t = Math.round((old - Math.floor(old)) * 24 * 60 * 60)
+      const time = new Date(1900, 0, old, 0, 0, t)
+      const year = time.getFullYear()
+      const month = time.getMonth() + 1
+      const date = time.getDate()
+      return year + format + (month < 10 ? '0' + month : month) + format + (date < 10 ? '0' + date : date) + ' 00:00:00'
+    },
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        } else if (index == 5 || index == 6) {
+          const values = data.map((item) => Number(item[column.property]))
+          if (!values.every((value) => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr)
+              if (!isNaN(value)) {
+                return prev + curr
+              } else {
+                return prev
+              }
+            }, 0)
+            sums[index] += ''
+          } else {
+            sums[index] = '--'
+          }
+        } else {
+          // sums[index] = "--";
+        }
+      })
 
-                this.listQuery.type.startDate = dayjs(this.selectDate[0]).format('YYYY-MM-DD')
-                this.listQuery.type.endDate = dayjs(this.selectDate[1]).format('YYYY-MM-DD')
-            }else{
-                 this.listQuery.type.startDate = ""
-                this.listQuery.type.endDate = ""
-            }
+      return sums
+    },
+    getList() {
+      console.log(this.selectDate)
+      listCountry(this.listPlace).then(response => {
+        this.placeList = response.data.data.items
+      })
+        .catch(() => {
+          this.placeList = []
+        })
+      this.listLoading = true
+      console.log(this.selectDate)
+      if (this.selectDate&&this.selectDate.length > 0) {
+        this.listQuery.type.startDate = dayjs(this.selectDate[0]).format('YYYY-MM-DD')
+        this.listQuery.type.endDate = dayjs(this.selectDate[1]).format('YYYY-MM-DD')
+      } else {
+        this.listQuery.type.startDate = ''
+        this.listQuery.type.endDate = ''
+      }
 
-            listCollectionPayment(this.listQuery).then(response => {
-                this.list = response.data.data.items
-                this.total = response.data.data.total
-                this.listLoading = false
-            })
-                .catch(() => {
-                    this.list = []
-                    this.total = 0
-                    this.listLoading = false
-                })
-        },
-        handleFilter() {
-            this.listQuery.page = 1
-            this.getList()
-        },
-        resetForm() {
-            this.dataForm = {
-                id: undefined
-            }
-        },
-        handleCreate() {
-            this.resetForm()
-            this.dialogStatus = 'create'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
-            })
-        },
-        createData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    this.dataForm.businessType = 1
-                    this.dataForm.updatePeople = this.$store.getters.name
-                    if (!this.dataForm.deductionEuro) {
-                        this.dataForm.deductionEuro = 0
-                    }
-                    if (!this.dataForm.deductionRmb) {
-                        this.dataForm.deductionRmb = 0
-                    }
+      listCollectionPayment(this.listQuery).then(response => {
+        this.list = response.data.data.items
+        this.total = response.data.data.total
+        this.listLoading = false
+      })
+        .catch(() => {
+          this.list = []
+          this.total = 0
+          this.listLoading = false
+        })
+    },
+    handleFilter() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    resetForm() {
+      this.dataForm = {
+        id: undefined
+      }
+    },
+    handleCreate() {
+      this.resetForm()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    createData() {
+      this.$refs['dataForm'].validate(valid => {
+        if (valid) {
+          this.submiting = true
+          this.dataForm.businessType = 1
+          this.dataForm.updatePeople = this.$store.getters.name
+          if (!this.dataForm.deductionEuro) {
+            this.dataForm.deductionEuro = 0
+          }
+          if (!this.dataForm.deductionRmb) {
+            this.dataForm.deductionRmb = 0
+          }
 
-                    createCollectionPayment(this.dataForm).then(response => {
-                        this.list.unshift(response.data.data)
-                        this.dialogFormVisible = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '添加成功'
-                        })
-                        this.submiting = false
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
+          createCollectionPayment(this.dataForm).then(response => {
+            this.list.unshift(response.data.data)
+            this.dialogFormVisible = false
+            this.$notify.success({
+              title: '成功',
+              message: '添加成功'
             })
-        },
-        handleUpdate(row) {
-            this.dataForm = Object.assign({}, row)
-            this.dialogStatus = 'update'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
-            })
-        },
-        handleUpdate1(row) {
-            this.$confirm('此操作将永久作废该记录---' + row.id + '---, 是否继续?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                deleteCollectionPayment(row.id).then(response => {
-                    this.$notify.success({
-                        title: '成功',
-                        message: '删除成功'
-                    })
-                    const index = this.list.indexOf(row)
-                    this.list.splice(index, 1)
-                })
-                    .catch(response => {
-                        this.$notify.error({
-                            title: '失败',
-                            message: response.data.errmsg
-                        })
-                    })
-            }).catch(() => {
-                return false
+            this.submiting = false
+          })
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
             })
-
-        },
-        updateData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    this.dataForm.updatePeople = this.$store.getters.name
-                    updateCollectionPayment(this.dataForm).then(() => {
-                        for (const v of this.list) {
-                            if (v.id === this.dataForm.id) {
-                                const index = this.list.indexOf(v)
-                                this.list.splice(index, 1, this.dataForm)
-                                break
-                            }
-                        }
-                        this.dialogFormVisible = false
-                        this.submiting = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '更新成功'
-                        })
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
+        }
+      })
+    },
+    handleUpdate(row) {
+      this.dataForm = Object.assign({}, row)
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    handleUpdate1(row) {
+      this.$confirm('此操作将永久作废该记录---' + row.id + '---, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteCollectionPayment(row.id).then(response => {
+          this.$notify.success({
+            title: '成功',
+            message: '删除成功'
+          })
+          const index = this.list.indexOf(row)
+          this.list.splice(index, 1)
+        })
+          .catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
             })
-        },
-        updateData1(row) {
-            this.dataForm.flag = 1
-            this.dataForm.id = row.id
-            updateCollectionPayment(this.dataForm).then(() => {
-
-                this.submiting = false
-                this.$notify.success({
-                    title: '成功',
-                    message: '更新成功',
-                })
-                this.getList()
+          })
+      }).catch(() => {
+        return false
+      })
+    },
+    updateData() {
+      this.$refs['dataForm'].validate(valid => {
+        if (valid) {
+          this.submiting = true
+          this.dataForm.updatePeople = this.$store.getters.name
+          updateCollectionPayment(this.dataForm).then(() => {
+            for (const v of this.list) {
+              if (v.id === this.dataForm.id) {
+                const index = this.list.indexOf(v)
+                this.list.splice(index, 1, this.dataForm)
+                break
+              }
+            }
+            this.dialogFormVisible = false
+            this.submiting = false
+            this.$notify.success({
+              title: '成功',
+              message: '更新成功'
             })
-                .catch(response => {
-                    this.$notify.error({
-                        title: '失败',
-                        message: response.data.errmsg
-                    })
-                    this.submiting = false
-                })
-
-        },
-        handleDelete(row) {
-            this.$confirm('此操作将永久删除该记录---' + row.id + '---, 是否继续?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                deleteCollectionPayment(row.id).then(response => {
-                    this.$notify.success({
-                        title: '成功',
-                        message: '删除成功'
-                    })
-                    const index = this.list.indexOf(row)
-                    this.list.splice(index, 1)
-                })
-                    .catch(response => {
-                        this.$notify.error({
-                            title: '失败',
-                            message: response.data.errmsg
-                        })
-                    })
-            }).catch(() => {
-                return false
+          })
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
             })
         }
+      })
+    },
+    updateData1(row) {
+      this.dataForm.flag = 1
+      this.dataForm.id = row.id
+      updateCollectionPayment(this.dataForm).then(() => {
+        this.submiting = false
+        this.$notify.success({
+          title: '成功',
+          message: '更新成功'
+        })
+        this.getList()
+      })
+        .catch(response => {
+          this.$notify.error({
+            title: '失败',
+            message: response.data.errmsg
+          })
+          this.submiting = false
+        })
+    },
+    handleDelete(row) {
+      this.$confirm('此操作将永久删除该记录---' + row.id + '---, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteCollectionPayment(row.id).then(response => {
+          this.$notify.success({
+            title: '成功',
+            message: '删除成功'
+          })
+          const index = this.list.indexOf(row)
+          this.list.splice(index, 1)
+        })
+          .catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
+            })
+          })
+      }).catch(() => {
+        return false
+      })
     }
+  }
 }
 </script>
 <style>

+ 0 - 595
unimall-admin/src/views/collectionPayment/collectionPayment2.vue

@@ -1,595 +0,0 @@
-<template>
-    <div class="app-container">
-        <!-- 查询和其他操作 -->
-        <div class="filter-container">
-            <el-input v-model="listQuery.type.receivingWithdrawingPeople" clearable class="filter-item" size="small"
-                style="width: 200px;" placeholder="请输入提款人姓名" />
-            <!-- <el-input v-model="listQuery.type.receivingWithdrawingRegion" clearable class="filter-item" size="small"
-                style="width: 200px;" placeholder="请输入提款地" /> -->
-
-            <!-- <el-input v-model="listQuery.receiptPaymentDate" clearable class="filter-item" size="small"
-                style="width: 200px;" placeholder="请输入提款日期" /> -->
-            <el-select v-model="listQuery.type.receivingWithdrawingRegion" placeholder="请选择收款地" style="margin:0 20px;"
-                size="small">
-                <el-option :label="item.country" :value="item.country" v-for="(item, index) in placeList" :key="index">
-                </el-option>
-            </el-select>
-            <el-date-picker style="margin-right:20px" size="small" v-model="selectDate" type="daterange" value-format="yyyy-MM-dd"
-                range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
-            </el-date-picker>
-
-            <el-button v-permission="['collectionPayment:collectionpayment:list']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-search" @click="handleFilter">查找</el-button>
-            <el-button v-permission="['collectionPayment:collectionpayment:create']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-edit" @click="handleCreate">添加</el-button>
-            <el-button v-permission="['collectionPayment:collectionpayment:create']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-edit" @click="exportlist">导出</el-button>
-
-            <el-upload style="margin-left: 8px;margin-bottom:0" class="filter-item" action="" :on-change="importClick"
-                :show-file-list="false"
-                accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
-                :auto-upload="false">
-                <el-button v-permission="['collectionPayment:collectionpayment:create']" class="filter-item"
-                    type="primary" size="mini" icon="el-icon-edit">导入</el-button>
-            </el-upload>
-
-        </div>
-
-        <!-- 查询结果 -->
-        <el-table v-loading="listLoading" :data="list" size="small" element-loading-text="正在查询中。。。" border fit
-            highlight-current-row show-summary :summary-method="getSummaries" @selection-change="handleSelectionChange">
-            <el-table-column :selectable="selectInit" type="selection"></el-table-column>
-            <el-table-column type="index" label="序号">
-                <template scope="scope">
-                    <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
-                    <span v-else>{{ scope.$index + 1 }}</span>
-                </template>
-            </el-table-column>
-
-            <el-table-column align="center" label="提款日期" prop="receiptPaymentDate">
-                <template slot-scope="scope">
-                    {{ scope.row.receiptPaymentDate | formatDate }}</template>
-            </el-table-column>
-            <el-table-column align="center" label="提款地" prop="receivingWithdrawingRegion" />
-            <el-table-column align="center" label="提款人" prop="receivingWithdrawingPeople" />
-            <el-table-column align="center" label="金额(欧元)" prop="deductionEuro" />
-            <el-table-column align="center" label="金额(人民币)" prop="deductionRmb" />
-            <el-table-column align="center" label="备注1" prop="remarks" />
-            <el-table-column align="center" label="备注2" prop="remark" />
-            <el-table-column align="center" label="状态" prop="status">
-                <template slot-scope="scope">
-                    {{ scope.row.status == 1 ? '已作废' : '' }}</template>
-            </el-table-column>
-            <el-table-column align="center" label="操作人" prop="updatePeople" />
-            <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
-                <template slot-scope="scope">
-                    <el-button v-permission="['collectionPayment:collectionpayment:edit']" type="primary" size="mini"
-                        @click="handleUpdate(scope.row)">编辑</el-button>
-                            <el-button v-permission="['collectionPayment:collectionpayment:edit']" type="primary" size="mini"
-                        @click="updateData1(scope.row)">作废</el-button>
-                    <!-- <el-button v-permission="['collectionPayment:collectionpayment:delete']" type="danger" size="mini"
-                        @click="handleDelete(scope.row)">删除</el-button> -->
-                </template>
-            </el-table-column>
-        </el-table>
-
-        <!-- <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
-            @pagination="getList"/> -->
-    <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-size="[100,200,300,400,500,600]"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="total"
-      >
-      </el-pagination>
-        <!-- 添加或修改对话框 -->
-        <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
-            <el-form ref="dataForm" :rules="rules" :model="dataForm" status-icon label-position="left"
-                label-width="150px" style="width: 400px; margin-left:50px;">
-                <el-form-item label="id" prop="id" hidden>
-                    <el-input v-model="dataForm.id" />
-                </el-form-item>
-                <el-form-item label="提款人" prop="receivingWithdrawingPeople">
-                    <el-input v-model="dataForm.receivingWithdrawingPeople" />
-                </el-form-item>
-                <el-form-item label="提款地" prop="receivingWithdrawingRegion">
-                    <!-- <el-input v-model="dataForm.receivingWithdrawingRegion" /> -->
-                    <el-select v-model="dataForm.receivingWithdrawingRegion" placeholder="请选择提款地点" style="width:100%">
-                        <el-option :label="item.country" :value="item.country" v-for="(item, index) in placeList"
-                            :key="index"></el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item label="提款日期" prop="receiptPaymentDate">
-                    <!-- <el-input v-model="dataForm.receiptPaymentDate" /> -->
-                    <el-date-picker v-model="dataForm.receiptPaymentDate" type="date" class="tkdate" value-format="yyyy-MM-dd"
-                        style="width: 100%;">
-                    </el-date-picker>
-                </el-form-item>
-                <el-form-item label="金额(欧元)" prop="deductionEuro">
-                    <el-input v-model="dataForm.deductionEuro" />
-                </el-form-item>
-                <el-form-item label="金额(人民币)" prop="deductionRmb">
-                    <el-input v-model="dataForm.deductionRmb" />
-                </el-form-item>
-                <el-form-item label="备注1" prop="remarks">
-                    <el-input v-model="dataForm.remarks" />
-                </el-form-item>
-                <el-form-item label="备注2" prop="remark">
-                    <el-input v-model="dataForm.remark" />
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click="dialogFormVisible = false">取消</el-button>
-                <el-button v-if="dialogStatus == 'create'" :loading="submiting" type="primary" @click="createData">确定
-                </el-button>
-                <el-button v-else type="primary" :loading="submiting" @click="updateData">确定</el-button>
-            </div>
-        </el-dialog>
-    </div>
-</template>
-
-<script>
-import {
-    dayjs,
-    EventBus
-} from 'base-core-lib'
-import {
-    listCountry
-} from '@/api/country'
-import {
-    downloadFile
-} from '@/utils/batchDown'
-import {
-    importWord,
-    listCollectionPayment,
-    createCollectionPayment,
-    updateCollectionPayment,
-    deleteCollectionPayment,
-    exportXlsx
-} from '@/api/collectionPayment'
-// import {
-//     exportXlsx
-// } from '@/model/export'
-
-import Pagination from '@/components/Pagination'
-import store from '@/store'
-export default {
-    name: 'CollectionPayment',
-    components: { Pagination },
-    data() {
-        return {
-            isAllowExport: true,
-            countryList: [],
-            modification: [],
-            selectDate: '',
-            date: {
-                year: dayjs().format('YYYY'),
-                month: dayjs().format('MM'),
-            },
-            accessoryTFs: false,
-            fileList: [],
-            appendixIdsAdd: '',
-            excelFreightspace: [],
-            fileTemp: null,
-            placeList: [],
-            list: null,
-            total: 0,
-            listLoading: true,
-            listQuery: {
-                page: 1,
-                limit: 20,
-                type: {
-                    businessType: 2,
-                    receivingWithdrawingPeople: '',
-                    receivingWithdrawingRegion: '',
-                    startDate: '',
-                    endDate: '',
-                },
-
-
-
-            },
-            listPlace: {
-                page: 1,
-                limit: 2000,
-                type: {
-                    country: ''
-                }
-            },
-            dataForm: {
-                id: undefined
-            },
-            dialogFormVisible: false,
-            submiting: false,
-            dialogStatus: '',
-            textMap: {
-                update: '编辑',
-                create: '创建'
-            },
-            rules: {
-            }
-        }
-    },
-    created() {
-        this.getList()
-    },
-    methods: {
-         handleSizeChange(val) {
-      console.log(`每页 ${val} 条`)
-      this.pageSize = val
-      this.getList()
-    },
-    handleCurrentChange(val) {
-      this.currentPage = val
-      console.log(`当前页: ${val}`)
-      this.getList()
-    },
-        handleSelectionChange(val) {
-            this.modification = val
-        },
-        selectInit(row) {
-            return true
-        },
-        async exportlist() {
-            if (this.modification.length == 0) {
-                this.$message.warning('请选择要导出的条目!')
-            } else {
-                console.log('导出数据', this.modification)
-                let _data = {
-                    collectionPaymentTiDTOList: this.modification,
-                }
-                const {
-                    data
-                } = await exportXlsx(_data).then((response) => {
-                    this.download(response.data.data)
-                    //   downloadFile({
-                    //     res: data,
-                    //     fileName: `${
-                    //     this.date.year + (this.date.month ? `-${this.date.month}` : '')
-                    //     }提款信息`,
-                    //     type: 'xls',
-                    //     })
-
-                    if (response.status == '200') {
-
-                    }
-                })
-
-            }
-
-
-
-
-
-
-
-
-
-        },
-        importClick(file, fileList) {
-            this.fileTemp = file.raw
-            let fileName = file.raw.name
-            let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
-            // 判断上传文件格式
-            if (this.fileTemp) {
-                if (fileType == 'xlsx' || fileType == 'xls') {
-                    this.importf(this.fileTemp)
-                } else {
-                    this.$message({
-                        type: 'warning',
-                        message: '附件格式错误,请删除后重新上传!',
-                    })
-                }
-            } else {
-                this.$message({
-                    type: 'warning',
-                    message: '请上传附件!',
-                })
-            }
-        },
-        importf(obj) {
-            this.excelFreightspace = []
-            // this.dialogVisible = true;
-            let _this = this;
-            let inputDOM = this.$refs.inputer; // 通过DOM取文件数据
-            this.file = event.currentTarget.files[0];
-            var rABS = false; //是否将文件读取为二进制字符串
-            var f = this.file;
-            var reader = new FileReader();
-            //if (!FileReader.prototype.readAsBinaryString) {
-            FileReader.prototype.readAsBinaryString = function (f) {
-                var binary = '';
-                var rABS = false; //是否将文件读取为二进制字符串
-                var pt = this;
-                var wb; //读取完成的数据
-                var outdata;
-                var reader = new FileReader();
-                reader.onload = function (e) {
-                    var bytes = new Uint8Array(reader.result);
-                    var length = bytes.byteLength;
-                    for (var i = 0; i < length; i++) {
-                        binary += String.fromCharCode(bytes[i]);
-                    }
-                    var XLSX = require('xlsx');
-                    if (rABS) {
-                        wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
-                            type: 'base64',
-                            cellDates: true
-                        });
-                    } else {
-                        wb = XLSX.read(binary, {
-                            type: 'binary'
-                        });
-                    }
-                    // outdata就是你想要的东西 excel导入的数据
-                    outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
-                    // excel 数据再处理
-                    let arr = []
-                    outdata.map(v => {
-                        // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
-                        let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig, '');
-                        v = JSON.parse(jsonString);
-                        let obj = {}
-
-                        //xxx代表列名
-                        obj.receiptPaymentDate = v.提款日期
-                        obj.receivingWithdrawingRegion = v.提款地
-                        obj.receivingWithdrawingPeople = v.提款人
-                        obj.deductionEuro = v.金额EUR
-                        obj.deductionRmb = v.金额RMB
-                        obj.businessType = 2
-                        obj.remarks = v.备注1
-                        obj.remark = v.备注2
-                        obj.updatePeople = _this.$store.getters.name
-                        if (!obj.deductionEuro) {
-                            obj.deductionEuro = 0
-                        }
-                        if (!obj.deductionRmb) {
-                            obj.deductionRmb = 0
-                        }
-                        for (let i = 0; i < _this.placeList.length; i++) {
-                            _this.countryList.push(_this.placeList[i].country)
-                        }
-                        if (!_this.countryList.includes(obj.receivingWithdrawingRegion)) {
-                            _this.isAllowExport = false
-                            _this.$notify({
-                                title: '失败',
-                                message: '导入失败,导入数据中收款地在系统中不存在,请重新编辑',
-                                type: 'error'
-                            });
-                            return
-                        } else {
-                            _this.excelFreightspace.push(obj)
-                            _this.isAllowExport = true
-                        }
-                    })
-                    if (_this.excelFreightspace && _this.isAllowExport) {
-                        importWord(_this.excelFreightspace).then((response) => {
-
-                            if (response.status == '200') {
-                                _this.$notify({
-                                    title: '成功',
-                                    message: '导入成功',
-                                    type: 'success'
-                                });
-                                _this.getList()
-                            }
-                        })
-
-                    }
-                }
-                reader.readAsArrayBuffer(f);
-            }
-            if (rABS) {
-                reader.readAsArrayBuffer(f);
-            } else {
-                reader.readAsBinaryString(f);
-            }
-
-        },
-        formatDate(numb, format) {
-            const old = numb - 1;
-            const t = Math.round((old - Math.floor(old)) * 24 * 60 * 60);
-            const time = new Date(1900, 0, old, 0, 0, t)
-            const year = time.getFullYear();
-            const month = time.getMonth() + 1;
-            const date = time.getDate();
-            return year + format + (month < 10 ? '0' + month : month) + format + (date < 10 ? '0' + date : date) + ' 00:00:00'
-        },
-        getSummaries(param) {
-
-            const { columns, data } = param;
-            const sums = [];
-            columns.forEach((column, index) => {
-                if (index === 0) {
-                    sums[index] = "合计";
-                    return;
-                } else if (index == 5 || index == 6) {
-                    const values = data.map((item) => Number(item[column.property]));
-                    if (!values.every((value) => isNaN(value))) {
-                        sums[index] = values.reduce((prev, curr) => {
-                            const value = Number(curr);
-                            if (!isNaN(value)) {
-                                return prev + curr;
-                            } else {
-                                return prev;
-                            }
-                        }, 0);
-                        sums[index] += "";
-                    } else {
-                        sums[index] = "--";
-                    }
-                } else {
-                    // sums[index] = "--";
-                }
-            });
-
-            return sums;
-
-        },
-        getList() {
-
-            console.log(this.selectDate)
-            listCountry(this.listPlace).then(response => {
-                this.placeList = response.data.data.items
-            })
-                .catch(() => {
-                    this.placeList = []
-                })
-            this.listLoading = true
-            console.log(this.selectDate)
-            if (this.selectDate.length > 0) {
-
-                this.listQuery.type.startDate = dayjs(this.selectDate[0]).format('YYYY-MM-DD')
-                this.listQuery.type.endDate = dayjs(this.selectDate[1]).format('YYYY-MM-DD')
-            }
-
-            listCollectionPayment(this.listQuery).then(response => {
-                this.list = response.data.data.items
-                this.total = response.data.data.total
-                this.listLoading = false
-            })
-                .catch(() => {
-                    this.list = []
-                    this.total = 0
-                    this.listLoading = false
-                })
-        },
-        handleFilter() {
-            this.listQuery.page = 1
-            this.getList()
-        },
-        resetForm() {
-            this.dataForm = {
-                id: undefined
-            }
-        },
-        handleCreate() {
-            this.resetForm()
-            this.dialogStatus = 'create'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
-            })
-        },
-        createData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    this.dataForm.businessType = 2
-                    this.dataForm.updatePeople = this.$store.getters.name
-                    if (!this.dataForm.deductionEuro) {
-                        this.dataForm.deductionEuro = 0
-                    }
-                    if (!this.dataForm.deductionRmb) {
-                        this.dataForm.deductionRmb = 0
-                    }
-                    createCollectionPayment(this.dataForm).then(response => {
-                        this.list.unshift(response.data.data)
-                        this.dialogFormVisible = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '添加成功'
-                        })
-                        this.submiting = false
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
-            })
-        },
-        handleUpdate(row) {
-            this.dataForm = Object.assign({}, row)
-            this.dialogStatus = 'update'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
-            })
-        },
-        updateData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    this.dataForm.updatePeople = this.$store.getters.name
-                    updateCollectionPayment(this.dataForm).then(() => {
-                        for (const v of this.list) {
-                            if (v.id === this.dataForm.id) {
-                                const index = this.list.indexOf(v)
-                                this.list.splice(index, 1, this.dataForm)
-                                break
-                            }
-                        }
-                        this.dialogFormVisible = false
-                        this.submiting = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '更新成功'
-                        })
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
-            })
-        },
-        updateData1(row) {
-            this.dataForm.flag = 1
-            this.dataForm.id = row.id
-            updateCollectionPayment(this.dataForm).then(() => {
-
-                this.submiting = false
-                this.$notify.success({
-                    title: '成功',
-                    message: '更新成功',
-                })
-                this.getList()
-            })
-                .catch(response => {
-                    this.$notify.error({
-                        title: '失败',
-                        message: response.data.errmsg
-                    })
-                    this.submiting = false
-                })
-
-        },
-        handleDelete(row) {
-            this.$confirm('此操作将永久删除该记录---' + row.id + '---, 是否继续?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                deleteCollectionPayment(row.id).then(response => {
-                    this.$notify.success({
-                        title: '成功',
-                        message: '删除成功'
-                    })
-                    const index = this.list.indexOf(row)
-                    this.list.splice(index, 1)
-                })
-                    .catch(response => {
-                        this.$notify.error({
-                            title: '失败',
-                            message: response.data.errmsg
-                        })
-                    })
-            }).catch(() => {
-                return false
-            })
-        }
-    }
-}
-</script>
-<style>
-</style>

+ 0 - 577
unimall-admin/src/views/collectionPayment/collectionPayment3.vue

@@ -1,577 +0,0 @@
-<template>
-    <div class="app-container">
-        <!-- 查询和其他操作 -->
-        <div class="filter-container">
-            <el-input v-model="listQuery.type.receivingWithdrawingPeople" clearable class="filter-item" size="small"
-                style="width: 200px;" placeholder="请输入提款人姓名" />
-            <!-- <el-input v-model="listQuery.type.receivingWithdrawingRegion" clearable class="filter-item" size="small"
-                style="width: 200px;" placeholder="请输入提款地" /> -->
-
-            <!-- <el-input v-model="listQuery.receiptPaymentDate" clearable class="filter-item" size="small"
-                style="width: 200px;" placeholder="请输入提款日期" /> -->
-            <el-select v-model="listQuery.type.receivingWithdrawingRegion" placeholder="请选择收款地" style="margin:0 20px;"
-                size="small">
-                <el-option :label="item.country" :value="item.country" v-for="(item, index) in placeList" :key="index">
-                </el-option>
-            </el-select>
-            <el-date-picker style="margin-right:20px" size="small" v-model="selectDate" type="daterange" value-format="yyyy-MM-dd"
-                range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期">
-            </el-date-picker>
-
-            <el-button v-permission="['collectionPayment:collectionpayment:list']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-search" @click="handleFilter">查找</el-button>
-            <el-button v-permission="['collectionPayment:collectionpayment:create']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-edit" @click="handleCreate">添加</el-button>
-            <el-button v-permission="['collectionPayment:collectionpayment:create']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-edit" @click="exportlist">导出</el-button>
-
-            <el-upload style="margin-left: 8px;margin-bottom:0" class="filter-item" action="" :on-change="importClick"
-                :show-file-list="false"
-                accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
-                :auto-upload="false">
-                <el-button v-permission="['collectionPayment:collectionpayment:create']" class="filter-item"
-                    type="primary" size="mini" icon="el-icon-edit">导入</el-button>
-            </el-upload>
-
-        </div>
-
-        <!-- 查询结果 -->
-        <el-table v-loading="listLoading" :data="list" size="small" element-loading-text="正在查询中。。。" border fit
-            highlight-current-row show-summary :summary-method="getSummaries" @selection-change="handleSelectionChange">
-            <el-table-column :selectable="selectInit" type="selection"></el-table-column>
-            <el-table-column type="index" label="序号">
-                <template scope="scope">
-                    <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
-                    <span v-else>{{ scope.$index + 1 }}</span>
-                </template>
-            </el-table-column>
-
-            <el-table-column align="center" label="提款日期" prop="receiptPaymentDate">
-                <template slot-scope="scope">
-                    {{ scope.row.receiptPaymentDate | formatDate }}</template>
-            </el-table-column>
-            <el-table-column align="center" label="提款地" prop="receivingWithdrawingRegion" />
-            <el-table-column align="center" label="提款人" prop="receivingWithdrawingPeople" />
-            <el-table-column align="center" label="金额(欧元)" prop="deductionEuro" />
-            <el-table-column align="center" label="金额(人民币)" prop="deductionRmb" />
-            <el-table-column align="center" label="备注1" prop="remarks" />
-            <el-table-column align="center" label="备注2" prop="remark" />
-            <el-table-column align="center" label="状态" prop="status">
-                <template slot-scope="scope">
-                    {{ scope.row.status == 1 ? '已作废' : '' }}</template>
-            </el-table-column>
-            <el-table-column align="center" label="操作人" prop="updatePeople" />
-            <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
-                <template slot-scope="scope">
-                    <el-button v-permission="['collectionPayment:collectionpayment:edit']" type="primary" size="mini"
-                        @click="handleUpdate(scope.row)">编辑</el-button>
-                            <el-button v-permission="['collectionPayment:collectionpayment:edit']" type="primary" size="mini"
-                        @click="updateData1(scope.row)">作废</el-button>
-                    <!-- <el-button v-permission="['collectionPayment:collectionpayment:delete']" type="danger" size="mini"
-                        @click="handleDelete(scope.row)">删除</el-button> -->
-                </template>
-            </el-table-column>
-        </el-table>
-
-        <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
-            @pagination="getList" />
-
-        <!-- 添加或修改对话框 -->
-        <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
-            <el-form ref="dataForm" :rules="rules" :model="dataForm" status-icon label-position="left"
-                label-width="150px" style="width: 400px; margin-left:50px;">
-                <el-form-item label="id" prop="id" hidden>
-                    <el-input v-model="dataForm.id" />
-                </el-form-item>
-                <el-form-item label="提款人" prop="receivingWithdrawingPeople">
-                    <el-input v-model="dataForm.receivingWithdrawingPeople" />
-                </el-form-item>
-                <el-form-item label="提款地" prop="receivingWithdrawingRegion">
-                    <!-- <el-input v-model="dataForm.receivingWithdrawingRegion" /> -->
-                    <el-select v-model="dataForm.receivingWithdrawingRegion" placeholder="请选择提款地点" style="width:100%">
-                        <el-option :label="item.country" :value="item.country" v-for="(item, index) in placeList"
-                            :key="index"></el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item label="提款日期" prop="receiptPaymentDate">
-                    <!-- <el-input v-model="dataForm.receiptPaymentDate" /> -->
-                    <el-date-picker v-model="dataForm.receiptPaymentDate" type="date" class="tkdate" value-format="yyyy-MM-dd"
-                        style="width: 100%;">
-                    </el-date-picker>
-                </el-form-item>
-                <el-form-item label="金额(欧元)" prop="deductionEuro">
-                    <el-input v-model="dataForm.deductionEuro" />
-                </el-form-item>
-                <el-form-item label="金额(人民币)" prop="deductionRmb">
-                    <el-input v-model="dataForm.deductionRmb" />
-                </el-form-item>
-                <el-form-item label="备注1" prop="remarks">
-                    <el-input v-model="dataForm.remarks" />
-                </el-form-item>
-                <el-form-item label="备注2" prop="remark">
-                    <el-input v-model="dataForm.remark" />
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click="dialogFormVisible = false">取消</el-button>
-                <el-button v-if="dialogStatus == 'create'" :loading="submiting" type="primary" @click="createData">确定
-                </el-button>
-                <el-button v-else type="primary" :loading="submiting" @click="updateData">确定</el-button>
-            </div>
-        </el-dialog>
-    </div>
-</template>
-
-<script>
-import {
-    dayjs,
-    EventBus
-} from 'base-core-lib'
-import {
-    listCountry
-} from '@/api/country'
-import {
-    downloadFile
-} from '@/utils/batchDown'
-import {
-    importWord,
-    listCollectionPayment,
-    createCollectionPayment,
-    updateCollectionPayment,
-    deleteCollectionPayment,
-    exportXlsx
-} from '@/api/collectionPayment'
-// import {
-//     exportXlsx
-// } from '@/model/export'
-
-import Pagination from '@/components/Pagination'
-import store from '@/store'
-export default {
-    name: 'CollectionPayment',
-    components: { Pagination },
-    data() {
-        return {
-            isAllowExport: true,
-            countryList: [],
-            modification: [],
-            selectDate: '',
-            date: {
-                year: dayjs().format('YYYY'),
-                month: dayjs().format('MM'),
-            },
-            accessoryTFs: false,
-            fileList: [],
-            appendixIdsAdd: '',
-            excelFreightspace: [],
-            fileTemp: null,
-            placeList: [],
-            list: null,
-            total: 0,
-            listLoading: true,
-            listQuery: {
-                page: 1,
-                limit: 20,
-                type: {
-                    businessType: 2,
-                    receivingWithdrawingPeople: '',
-                    receivingWithdrawingRegion: '',
-                    startDate: '',
-                    endDate: '',
-                },
-
-
-
-            },
-            listPlace: {
-                page: 1,
-                limit: 2000,
-                type: {
-                    country: ''
-                }
-            },
-            dataForm: {
-                id: undefined
-            },
-            dialogFormVisible: false,
-            submiting: false,
-            dialogStatus: '',
-            textMap: {
-                update: '编辑',
-                create: '创建'
-            },
-            rules: {
-            }
-        }
-    },
-    created() {
-        this.getList()
-    },
-    methods: {
-        handleSelectionChange(val) {
-            this.modification = val
-        },
-        selectInit(row) {
-            return true
-        },
-        async exportlist() {
-            if (this.modification.length == 0) {
-                this.$message.warning('请选择要导出的条目!')
-            } else {
-                console.log('导出数据', this.modification)
-                let _data = {
-                    collectionPaymentTiDTOList: this.modification,
-                }
-                const {
-                    data
-                } = await exportXlsx(_data).then((response) => {
-                    this.download(response.data.data)
-                    //   downloadFile({
-                    //     res: data,
-                    //     fileName: `${
-                    //     this.date.year + (this.date.month ? `-${this.date.month}` : '')
-                    //     }提款信息`,
-                    //     type: 'xls',
-                    //     })
-
-                    if (response.status == '200') {
-
-                    }
-                })
-
-            }
-
-
-
-
-
-
-
-
-
-        },
-        importClick(file, fileList) {
-            this.fileTemp = file.raw
-            let fileName = file.raw.name
-            let fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
-            // 判断上传文件格式
-            if (this.fileTemp) {
-                if (fileType == 'xlsx' || fileType == 'xls') {
-                    this.importf(this.fileTemp)
-                } else {
-                    this.$message({
-                        type: 'warning',
-                        message: '附件格式错误,请删除后重新上传!',
-                    })
-                }
-            } else {
-                this.$message({
-                    type: 'warning',
-                    message: '请上传附件!',
-                })
-            }
-        },
-        importf(obj) {
-            this.excelFreightspace = []
-            // this.dialogVisible = true;
-            let _this = this;
-            let inputDOM = this.$refs.inputer; // 通过DOM取文件数据
-            this.file = event.currentTarget.files[0];
-            var rABS = false; //是否将文件读取为二进制字符串
-            var f = this.file;
-            var reader = new FileReader();
-            //if (!FileReader.prototype.readAsBinaryString) {
-            FileReader.prototype.readAsBinaryString = function (f) {
-                var binary = '';
-                var rABS = false; //是否将文件读取为二进制字符串
-                var pt = this;
-                var wb; //读取完成的数据
-                var outdata;
-                var reader = new FileReader();
-                reader.onload = function (e) {
-                    var bytes = new Uint8Array(reader.result);
-                    var length = bytes.byteLength;
-                    for (var i = 0; i < length; i++) {
-                        binary += String.fromCharCode(bytes[i]);
-                    }
-                    var XLSX = require('xlsx');
-                    if (rABS) {
-                        wb = XLSX.read(btoa(fixdata(binary)), { //手动转化
-                            type: 'base64',
-                            cellDates: true
-                        });
-                    } else {
-                        wb = XLSX.read(binary, {
-                            type: 'binary'
-                        });
-                    }
-                    // outdata就是你想要的东西 excel导入的数据
-                    outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
-                    // excel 数据再处理
-                    let arr = []
-                    outdata.map(v => {
-                        // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
-                        let jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig, '');
-                        v = JSON.parse(jsonString);
-                        let obj = {}
-
-                        //xxx代表列名
-                        obj.receiptPaymentDate = v.提款日期
-                        obj.receivingWithdrawingRegion = v.提款地
-                        obj.receivingWithdrawingPeople = v.提款人
-                        obj.deductionEuro = v.金额EUR
-                        obj.deductionRmb = v.金额RMB
-                        obj.businessType = 2
-                        obj.remarks = v.备注1
-                        obj.remark = v.备注2
-                        obj.updatePeople = _this.$store.getters.name
-                        if (!obj.deductionEuro) {
-                            obj.deductionEuro = 0
-                        }
-                        if (!obj.deductionRmb) {
-                            obj.deductionRmb = 0
-                        }
-                        for (let i = 0; i < _this.placeList.length; i++) {
-                            _this.countryList.push(_this.placeList[i].country)
-                        }
-                        if (!_this.countryList.includes(obj.receivingWithdrawingRegion)) {
-                            _this.isAllowExport = false
-                            _this.$notify({
-                                title: '失败',
-                                message: '导入失败,导入数据中收款地在系统中不存在,请重新编辑',
-                                type: 'error'
-                            });
-                            return
-                        } else {
-                            _this.excelFreightspace.push(obj)
-                            _this.isAllowExport = true
-                        }
-                    })
-                    if (_this.excelFreightspace && _this.isAllowExport) {
-                        importWord(_this.excelFreightspace).then((response) => {
-
-                            if (response.status == '200') {
-                                _this.$notify({
-                                    title: '成功',
-                                    message: '导入成功',
-                                    type: 'success'
-                                });
-                                _this.getList()
-                            }
-                        })
-
-                    }
-                }
-                reader.readAsArrayBuffer(f);
-            }
-            if (rABS) {
-                reader.readAsArrayBuffer(f);
-            } else {
-                reader.readAsBinaryString(f);
-            }
-
-        },
-        formatDate(numb, format) {
-            const old = numb - 1;
-            const t = Math.round((old - Math.floor(old)) * 24 * 60 * 60);
-            const time = new Date(1900, 0, old, 0, 0, t)
-            const year = time.getFullYear();
-            const month = time.getMonth() + 1;
-            const date = time.getDate();
-            return year + format + (month < 10 ? '0' + month : month) + format + (date < 10 ? '0' + date : date) + ' 00:00:00'
-        },
-        getSummaries(param) {
-
-            const { columns, data } = param;
-            const sums = [];
-            columns.forEach((column, index) => {
-                if (index === 0) {
-                    sums[index] = "合计";
-                    return;
-                } else if (index == 5 || index == 6) {
-                    const values = data.map((item) => Number(item[column.property]));
-                    if (!values.every((value) => isNaN(value))) {
-                        sums[index] = values.reduce((prev, curr) => {
-                            const value = Number(curr);
-                            if (!isNaN(value)) {
-                                return prev + curr;
-                            } else {
-                                return prev;
-                            }
-                        }, 0);
-                        sums[index] += "";
-                    } else {
-                        sums[index] = "--";
-                    }
-                } else {
-                    // sums[index] = "--";
-                }
-            });
-
-            return sums;
-
-        },
-        getList() {
-
-            console.log(this.selectDate)
-            listCountry(this.listPlace).then(response => {
-                this.placeList = response.data.data.items
-            })
-                .catch(() => {
-                    this.placeList = []
-                })
-            this.listLoading = true
-            console.log(this.selectDate)
-            if (this.selectDate.length > 0) {
-
-                this.listQuery.type.startDate = dayjs(this.selectDate[0]).format('YYYY-MM-DD')
-                this.listQuery.type.endDate = dayjs(this.selectDate[1]).format('YYYY-MM-DD')
-            }
-
-            listCollectionPayment(this.listQuery).then(response => {
-                this.list = response.data.data.items
-                this.total = response.data.data.total
-                this.listLoading = false
-            })
-                .catch(() => {
-                    this.list = []
-                    this.total = 0
-                    this.listLoading = false
-                })
-        },
-        handleFilter() {
-            this.listQuery.page = 1
-            this.getList()
-        },
-        resetForm() {
-            this.dataForm = {
-                id: undefined
-            }
-        },
-        handleCreate() {
-            this.resetForm()
-            this.dialogStatus = 'create'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
-            })
-        },
-        createData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    this.dataForm.businessType = 2
-                    this.dataForm.updatePeople = this.$store.getters.name
-                    if (!this.dataForm.deductionEuro) {
-                        this.dataForm.deductionEuro = 0
-                    }
-                    if (!this.dataForm.deductionRmb) {
-                        this.dataForm.deductionRmb = 0
-                    }
-                    createCollectionPayment(this.dataForm).then(response => {
-                        this.list.unshift(response.data.data)
-                        this.dialogFormVisible = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '添加成功'
-                        })
-                        this.submiting = false
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
-            })
-        },
-        handleUpdate(row) {
-            this.dataForm = Object.assign({}, row)
-            this.dialogStatus = 'update'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
-            })
-        },
-        updateData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    this.dataForm.updatePeople = this.$store.getters.name
-                    updateCollectionPayment(this.dataForm).then(() => {
-                        for (const v of this.list) {
-                            if (v.id === this.dataForm.id) {
-                                const index = this.list.indexOf(v)
-                                this.list.splice(index, 1, this.dataForm)
-                                break
-                            }
-                        }
-                        this.dialogFormVisible = false
-                        this.submiting = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '更新成功'
-                        })
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
-            })
-        },
-        updateData1(row) {
-            this.dataForm.flag = 1
-            this.dataForm.id = row.id
-            updateCollectionPayment(this.dataForm).then(() => {
-
-                this.submiting = false
-                this.$notify.success({
-                    title: '成功',
-                    message: '更新成功',
-                })
-                this.getList()
-            })
-                .catch(response => {
-                    this.$notify.error({
-                        title: '失败',
-                        message: response.data.errmsg
-                    })
-                    this.submiting = false
-                })
-
-        },
-        handleDelete(row) {
-            this.$confirm('此操作将永久删除该记录---' + row.id + '---, 是否继续?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                deleteCollectionPayment(row.id).then(response => {
-                    this.$notify.success({
-                        title: '成功',
-                        message: '删除成功'
-                    })
-                    const index = this.list.indexOf(row)
-                    this.list.splice(index, 1)
-                })
-                    .catch(response => {
-                        this.$notify.error({
-                            title: '失败',
-                            message: response.data.errmsg
-                        })
-                    })
-            }).catch(() => {
-                return false
-            })
-        }
-    }
-}
-</script>
-<style>
-</style>

+ 451 - 217
unimall-admin/src/views/customerBilling/customerBillingInfo.vue

@@ -1,239 +1,473 @@
 <template>
-    <div class="app-container">
-        <div class="filter-container">
-            <el-input v-model="listQuery.payNo" clearable class="filter-item" size="small" style="width: 200px;"
-                placeholder="请输入编号" />
-            <el-input v-model="listQuery.businessType" clearable class="filter-item" size="small" style="width: 200px;"
-                placeholder="请输入单据类型" />
-            <el-input v-model="listQuery.status" clearable class="filter-item" size="small" style="width: 200px;"
-                placeholder="请输入状态" />
-            <el-button v-permission="['customerBilling:customerbilling:list']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-search" @click="handleFilter">查找</el-button>
-            <el-button v-permission="['customerBilling:customerbilling:create']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-edit" @click="handleCreate">添加</el-button>
-        </div>
+  <div class="app-container">
+    <div class="filter-container">
+      <el-input
+        v-model="listQuery.type.payNo"
+        clearable
+        class="filter-item"
+        size="small"
+        style="width: 200px;"
+        placeholder="请输入编号" />
+      <el-select v-model="listQuery.type.status" size="small" placeholder="请选择收款状态">
+        <el-option
+          v-for="item in skList"
+          :label="item.label"
+          :value="item.value"
+          :key="item.value"
+        />
+      </el-select>
+      <el-select
+        v-model="listQuery.type.businessType"
+        placeholder="请选择单据类型"
+        style="margin:0 20px;"
+        size="small">
+        <el-option v-for="item in djList" :label="item.label" :value="item.value" :key="item.value"/>
+      </el-select>
+      <el-date-picker
+        v-model="selectDate"
+        style="margin-right:20px"
+        size="small"
+        type="daterange"
+        value-format="yyyy-MM-dd"
+        range-separator="至"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"/>
+      <el-button
+        v-permission="['customerBilling:customerbilling:list']"
+        class="filter-item"
+        type="primary"
+        size="mini"
+        icon="el-icon-search"
+        @click="handleFilter">查找</el-button>
+      <el-button
+        v-permission="['customerBilling:customerbilling:create']"
+        class="filter-item"
+        type="primary"
+        size="mini"
+        icon="el-icon-edit"
+        @click="handleCreate">添加</el-button>
+      <el-button
+        class="filter-item"
+        type="primary"
+        size="mini"
+        icon="el-icon-edit"
+        @click="exportlist">导出</el-button>
 
-        <el-table v-loading="listLoading" :data="list" size="small" element-loading-text="正在查询中。。。" border fit
-            highlight-current-row>
-            <el-table-column align="center" label="编号" prop="payNo" />
-            <el-table-column align="center" label="单据类型" prop="businessType" />
-            <el-table-column align="center" label="结账日期" prop="closingDate" />
-            <el-table-column align="center" label="已付金额" prop="amountPaid" />
-            <el-table-column align="center" label="未付金额" prop="unpaidAmount" />
-            <el-table-column align="center" label="备注1" prop="remarks" />
-            <el-table-column align="center" label="备注2" prop="remark" />
-            <el-table-column align="center" label="状态" prop="status" />
-            <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
-                <template slot-scope="scope">
-                    <el-button v-permission="['customerBilling:customerbilling:edit']" type="primary" size="mini"
-                        @click="handleUpdate(scope.row)">编辑</el-button>
-                    <el-button v-permission="['customerBilling:customerbilling:delete']" type="danger" size="mini"
-                        @click="handleDelete(scope.row)">删除</el-button>
-                </template>
-            </el-table-column>
-        </el-table>
+    </div>
 
-        <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
-            @pagination="getList" />
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      :summary-method="getSummaries"
+      size="small"
+      element-loading-text="正在查询中。。。"
+      border
+      fit
+      highlight-current-row
+      show-summary
+      @selection-change="handleSelectionChange">
+      <el-table-column :selectable="selectInit" type="selection"/>
+      <el-table-column type="index" label="序号">
+        <template scope="scope">
+          <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
+          <span v-else>{{ scope.$index + 1 }}</span>
+        </template>
+      </el-table-column>
 
-        <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
-            <el-form ref="dataForm" :rules="rules" :model="dataForm" status-icon label-position="left"
-                label-width="100px" style="width: 400px; margin-left:50px;">
-                <el-form-item label="id" prop="id" hidden>
-                    <el-input v-model="dataForm.id" />
-                </el-form-item>
-                <el-form-item label="编号" prop="payNo">
-                    <el-input v-model="dataForm.payNo" />
-                </el-form-item>
-                <el-form-item label="单据类型" prop="businessType">
-                    <el-input v-model="dataForm.businessType" />
-                </el-form-item>
-                <el-form-item label="结账日期" prop="closingDate">
-                    <el-input v-model="dataForm.closingDate" />
-                </el-form-item>
-                <el-form-item label="已付金额" prop="amountPaid">
-                    <el-input v-model="dataForm.amountPaid" />
-                </el-form-item>
-                <el-form-item label="未付金额" prop="unpaidAmount">
-                    <el-input v-model="dataForm.unpaidAmount" />
-                </el-form-item>
-                <el-form-item label="备注1" prop="remarks">
-                    <el-input v-model="dataForm.remarks" />
-                </el-form-item>
-                <el-form-item label="备注2" prop="remark">
-                    <el-input v-model="dataForm.remark" />
-                </el-form-item>
-                <el-form-item label="状态" prop="status">
-                    <el-input v-model="dataForm.status" />
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click="dialogFormVisible = false">取消</el-button>
-                <el-button v-if="dialogStatus == 'create'" :loading="submiting" type="primary" @click="createData">确定
-                </el-button>
-                <el-button v-else type="primary" :loading="submiting" @click="updateData">确定</el-button>
-            </div>
-        </el-dialog>
-    </div>
+      <el-table-column align="center" label="编号" prop="payNo" />
+      <el-table-column align="center" label="客户" prop="customer" />
+      <el-table-column align="center" label="单据类型" prop="businessType">\
+        <template slot-scope="scope">
+          {{ scope.row.businessType==1?'正常单据':'结转单据' }}
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="结账日期" prop="closingDate" />
+      <el-table-column align="center" label="已付金额" prop="amountIng" />
+      <el-table-column align="center" label="已付金额" prop="amountPaid" />
+      <el-table-column align="center" label="未付金额" prop="unpaidAmount" />
+      <el-table-column align="center" label="备注1" prop="remarks" />
+      <el-table-column align="center" label="备注2" prop="remark" />
+      <el-table-column align="center" label="状态" prop="status">
+        <template slot-scope="scope">
+          <span v-if="scope.row.status==1">
+            未收款
+          </span>
+          <span v-if="scope.row.status==2">
+            部分收款
+          </span>
+          <span v-if="scope.row.status==3">
+            已收款
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column align="center" label="操作" class-name="small-padding" width="250px">
+        <template slot-scope="scope">
+          <el-button
+            v-permission="['customerBilling:customerbilling:edit']"
+            type="primary"
+            size="mini"
+            @click="handleLook(scope.row)">查看</el-button>
+          <el-button
+            v-permission="['customerBilling:customerbilling:edit']"
+            type="primary"
+            size="mini"
+            @click="handleUpdate(scope.row)">编辑</el-button>
+          <el-button
+            v-permission="['customerBilling:customerbilling:delete']"
+            type="danger"
+            size="mini"
+            @click="handleDelete(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <el-pagination
+      :current-page="currentPage"
+      :page-sizes="[100, 200, 300, 400,1000,1500,2000]"
+      :page-size="100"
+      :total="total"
+      layout="total, sizes, prev, pager, next, jumper"
+      @size-change="handleSizeChange"
+      @current-change="handleCurrentChange"/>
+
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
+      <el-form
+        ref="dataForm"
+        :rules="rules"
+        :model="dataForm"
+        status-icon
+        label-position="left"
+        label-width="100px"
+        style="width: 400px; margin-left:50px;">
+        <el-form-item label="id" prop="id" hidden>
+          <el-input v-model="dataForm.id" />
+        </el-form-item>
+        <el-form-item label="编号" prop="payNo">
+          <el-input v-model="dataForm.payNo" />
+        </el-form-item>
+        <el-form-item label="单据类型" prop="businessType">
+          <el-input v-model="dataForm.businessType" />
+        </el-form-item>
+        <el-form-item label="结账日期" prop="closingDate">
+          <el-input v-model="dataForm.closingDate" />
+        </el-form-item>
+        <el-form-item label="已付金额" prop="amountPaid">
+          <el-input v-model="dataForm.amountPaid" />
+        </el-form-item>
+        <el-form-item label="未付金额" prop="unpaidAmount">
+          <el-input v-model="dataForm.unpaidAmount" />
+        </el-form-item>
+        <el-form-item label="备注1" prop="remarks">
+          <el-input v-model="dataForm.remarks" />
+        </el-form-item>
+        <el-form-item label="备注2" prop="remark">
+          <el-input v-model="dataForm.remark" />
+        </el-form-item>
+        <el-form-item label="状态" prop="status">
+          <el-input v-model="dataForm.status" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">取消</el-button>
+        <el-button v-if="dialogStatus == 'create'" :loading="submiting" type="primary" @click="createData">确定
+        </el-button>
+        <el-button v-else :loading="submiting" type="primary" @click="updateData">确定</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
 import {
-    listCustomerBillingInfo,
-    createCustomerBillingInfo,
-    updateCustomerBillingInfo,
-    deleteCustomerBillingInfo
+  listCustomerBillingInfo,
+  createCustomerBillingInfo,
+  updateCustomerBillingInfo,
+  deleteCustomerBillingInfo,
+  exportXlsx
 } from '@/api/customerBillingInfo'
 import Pagination from '@/components/Pagination'
 export default {
-    name: 'CustomerBillingInfo',
-    components: { Pagination },
-    data() {
-        return {
-            list: null,
-            total: 0,
-            listLoading: true,
-            listQuery: {
-                page: 1,
-                limit: 20
-            },
-            dataForm: {
-                id: undefined
-            },
-            dialogFormVisible: false,
-            submiting: false,
-            dialogStatus: '',
-            textMap: {
-                update: '编辑',
-                create: '创建'
-            },
-            rules: {
-            }
-        }
-    },
-    created() {
-        this.getList()
-    },
-    methods: {
-        getList() {
-            this.listLoading = true
-            listCustomerBillingInfo(this.listQuery).then(response => {
-                this.list = response.data.data.items
-                this.total = response.data.data.total
-                this.listLoading = false
-            })
-                .catch(() => {
-                    this.list = []
-                    this.total = 0
-                    this.listLoading = false
-                })
+  name: 'CustomerBillingInfo',
+  components: { Pagination },
+  data() {
+    return {
+      skList: [
+        {
+          value: 1,
+          label: '未收款'
         },
-        handleFilter() {
-            this.listQuery.page = 1
-            this.getList()
-        },
-        resetForm() {
-            this.dataForm = {
-                id: undefined
-            }
+        {
+          value: 2,
+          label: '部分收款'
         },
-        handleCreate() {
-            // this.resetForm()
-            // this.dialogStatus = 'create'
-            // this.dialogFormVisible = true
-            // this.$nextTick(() => {
-            //     this.$refs['dataForm'].clearValidate()
-            // })
-            this.$router.push({
-                path:'customerBillingInfoadd'
-            }
-                
-            )
+        {
+          value: 3,
+          label: '已收款'
+        }
+      ],
+      modification: [],
+      selectDate: '',
+      djList: [
+        {
+          value: '1',
+          label: '正常单据'
         },
-        createData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    createCustomerBillingInfo(this.dataForm).then(response => {
-                        this.list.unshift(response.data.data)
-                        this.dialogFormVisible = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '添加成功'
-                        })
-                        this.submiting = false
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
+        {
+          value: '2',
+          label: '结转单据'
+        }
+      ],
+      list: null,
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        limit: 100,
+        type: {}
+      },
+      dataForm: {
+        id: undefined
+      },
+      dialogFormVisible: false,
+      submiting: false,
+      dialogStatus: '',
+      textMap: {
+        update: '编辑',
+        create: '创建'
+      },
+      rules: {
+      }
+    }
+  },
+  created() {
+    this.getList()
+    this.currentPage = 1
+  },
+  methods: {
+    async exportlist() {
+      if (this.modification.length == 0) {
+        this.$message.warning('请选择要导出的条目!')
+      } else {
+        console.log('导出数据', this.modification)
+        const _data = {
+          customerBillingInfoDTOS: this.modification
+        }
+        const {
+          data
+        } = await exportXlsx(_data).then((response) => {
+          this.download(response.data.data)
+          if (response.status == '200') {
+
+          }
+        })
+      }
+    },
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`)
+      this.listQuery.limit = val
+      this.getList()
+    },
+    handleCurrentChange(val) {
+      this.listQuery.page = val
+      console.log(`当前页: ${val}`)
+      this.getList()
+    },
+    handleSelectionChange(val) {
+      this.modification = val
+    },
+    selectInit(row) {
+      return true
+    },
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        } else if (
+          index == 6 ||
+          index == 7 ||
+          index == 8
+        ) {
+          const values = data.map(item => Number(item[column.property]))
+          if (!values.every(value => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr)
+              if (!isNaN(value)) {
+                return prev + curr
+              } else {
+                return prev
+              }
+            }, 0)
+            sums[index] += ''
+          } else {
+            sums[index] = '--'
+          }
+        } else {
+          // sums[index] = "--";
+        }
+      })
+
+      return sums
+    },
+    async exportlist() {
+      if (this.modification.length == 0) {
+        this.$message.warning('请选择要导出的条目!')
+      } else {
+        console.log('导出数据', this.modification)
+        const _data = {
+          customerBillingInfoDTOS: this.modification
+        }
+        const {
+          data
+        } = await exportXlsx(_data).then((response) => {
+          this.download(response.data.data)
+          //   downloadFile({
+          //     res: data,
+          //     fileName: `${
+          //     this.date.year + (this.date.month ? `-${this.date.month}` : '')
+          //     }付款信息`,
+          //     type: 'xls',
+          //     })
+          if (response.status == '200') {
+
+          }
+        })
+      }
+    },
+    getList() {
+      this.listLoading = true
+      if (this.selectDate&&this.selectDate.length > 0) {
+        this.listQuery.type.startDate = dayjs(this.selectDate[0]).format('YYYY-MM-DD')
+        this.listQuery.type.endDate = dayjs(this.selectDate[1]).format('YYYY-MM-DD')
+      } else {
+        this.listQuery.type.startDate = ''
+        this.listQuery.type.endDate = ''
+      }
+      listCustomerBillingInfo(this.listQuery).then(response => {
+        this.list = response.data.data.items
+        this.total = response.data.data.total
+        this.listLoading = false
+      })
+        .catch(() => {
+          this.list = []
+          this.total = 0
+          this.listLoading = false
+        })
+    },
+    handleFilter() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    resetForm() {
+      this.dataForm = {
+        id: undefined
+      }
+    },
+    handleLook(row) { debugger
+      this.$router.push({
+        path: 'customerBillingInfolook',
+        query: {
+          id: row.id
+        }
+      })
+    },
+    handleCreate() {
+      this.$router.push({
+        path: 'customerBillingInfoadd'
+      })
+    },
+    createData() {
+      this.$refs['dataForm'].validate(valid => {
+        if (valid) {
+          this.submiting = true
+          createCustomerBillingInfo(this.dataForm).then(response => {
+            this.list.unshift(response.data.data)
+            this.dialogFormVisible = false
+            this.$notify.success({
+              title: '成功',
+              message: '添加成功'
             })
-        },
-        handleUpdate(row) {
-            this.dataForm = Object.assign({}, row)
-            this.dialogStatus = 'update'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
+            this.submiting = false
+          })
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
             })
-        },
-        updateData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    updateCustomerBillingInfo(this.dataForm).then(() => {
-                        for (const v of this.list) {
-                            if (v.id === this.dataForm.id) {
-                                const index = this.list.indexOf(v)
-                                this.list.splice(index, 1, this.dataForm)
-                                break
-                            }
-                        }
-                        this.dialogFormVisible = false
-                        this.submiting = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '更新成功'
-                        })
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
+        }
+      })
+    },
+    handleUpdate(row) {
+      this.$router.push({
+        path: 'customerBillingInfoedit',
+        query: {
+          id: row.id
+        }
+      })
+      // this.dataForm = Object.assign({}, row)
+      // this.dialogStatus = 'update'
+      // this.dialogFormVisible = true
+      // this.$nextTick(() => {
+      //     this.$refs['dataForm'].clearValidate()
+      // })
+    },
+    updateData() {
+      this.$refs['dataForm'].validate(valid => {
+        if (valid) {
+          this.submiting = true
+          updateCustomerBillingInfo(this.dataForm).then(() => {
+            for (const v of this.list) {
+              if (v.id === this.dataForm.id) {
+                const index = this.list.indexOf(v)
+                this.list.splice(index, 1, this.dataForm)
+                break
+              }
+            }
+            this.dialogFormVisible = false
+            this.submiting = false
+            this.$notify.success({
+              title: '成功',
+              message: '更新成功'
             })
-        },
-        handleDelete(row) {
-            this.$confirm('此操作将永久删除该记录---' + row.id + '---, 是否继续?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                deleteCustomerBillingInfo(row.id).then(response => {
-                    this.$notify.success({
-                        title: '成功',
-                        message: '删除成功'
-                    })
-                    const index = this.list.indexOf(row)
-                    this.list.splice(index, 1)
-                })
-                    .catch(response => {
-                        this.$notify.error({
-                            title: '失败',
-                            message: response.data.errmsg
-                        })
-                    })
-            }).catch(() => {
-                return false
+          })
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
             })
         }
+      })
+    },
+    handleDelete(row) {
+      this.$confirm('此操作将永久删除该记录---' + row.id + '---, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteCustomerBillingInfo(row.id).then(response => {
+          this.$notify.success({
+            title: '成功',
+            message: '删除成功'
+          })
+          const index = this.list.indexOf(row)
+          this.list.splice(index, 1)
+        })
+          .catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
+            })
+          })
+      }).catch(() => {
+        return false
+      })
     }
+  }
 }
 </script>

+ 686 - 211
unimall-admin/src/views/customerBilling/customerBillingInfoadd.vue

@@ -1,235 +1,710 @@
 <template>
-    <div class="app-container">
-        <!-- <div class="filter-container">
-            <el-input v-model="listQuery.payNo" clearable class="filter-item" size="small" style="width: 200px;"
-                placeholder="请输入编号" />
-            <el-input v-model="listQuery.businessType" clearable class="filter-item" size="small" style="width: 200px;"
-                placeholder="请输入单据类型" />
-            <el-input v-model="listQuery.status" clearable class="filter-item" size="small" style="width: 200px;"
-                placeholder="请输入状态" />
-            <el-button v-permission="['customerBilling:customerbilling:list']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-search" @click="handleFilter">查找</el-button>
-            <el-button v-permission="['customerBilling:customerbilling:create']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-edit" @click="handleCreate">添加</el-button>
-        </div> -->
+  <div class="app-container">
+    <el-row class="title-style">
+      <el-col :span="12">
+        <h2 class="bg-left title">客户账单</h2>
+      </el-col>
+      <el-col :span="12" class="bg-right">
+        <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">返回</el-button>
+        <el-button type="primary" size="small" @click="createData">提交</el-button>
+      </el-col>
+    </el-row>
+    <el-form
+      ref="dataForm"
+      :rules="rules"
+      :model="dataForm"
+      status-icon
+      label-position="left"
+      label-width="200px"
+      class="position"
+    >
+      <div class="small-title" style="font-size: 16px">基本信息</div>
+      <div class="ws-info-table">
+        <el-form-item label="id" prop="id" hidden>
+          <el-input v-model="dataForm.id" />
+        </el-form-item>
+        <el-form-item label="编号:" prop="payNo" style="margin-right:50px">
+          <el-input v-model="dataForm.payNo" class="input-width" />
+        </el-form-item>
+        <el-form-item label="客户:" prop="customer" style="margin-right:50px">
+          <el-input v-model="dataForm.customer" class="input-width" />
+        </el-form-item>
+        <el-form-item label="单据类型:" prop="businessType" style="margin-right:50px">
+          <el-select
+            v-model="dataForm.businessType"
+            placeholder="请选择单据类型"
+            class="input-width"
+            @change="changeBusinessType"
+          >
+            <el-option
+              v-for="item in djList"
+              :label="item.label"
+              :value="item.value"
+              :key="item.value"
+            />
+          </el-select>
+        </el-form-item>
 
-        <!-- <el-table v-loading="listLoading" :data="list" size="small" element-loading-text="正在查询中。。。" border fit
-            highlight-current-row>
-            <el-table-column align="center" label="编号" prop="payNo" />
-            <el-table-column align="center" label="单据类型" prop="businessType" />
-            <el-table-column align="center" label="结账日期" prop="closingDate" />
-            <el-table-column align="center" label="已付金额" prop="amountPaid" />
-            <el-table-column align="center" label="未付金额" prop="unpaidAmount" />
-            <el-table-column align="center" label="备注1" prop="remarks" />
-            <el-table-column align="center" label="备注2" prop="remark" />
-            <el-table-column align="center" label="状态" prop="status" />
-            <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
-                <template slot-scope="scope">
-                    <el-button v-permission="['customerBilling:customerbilling:edit']" type="primary" size="mini"
-                        @click="handleUpdate(scope.row)">编辑</el-button>
-                    <el-button v-permission="['customerBilling:customerbilling:delete']" type="danger" size="mini"
-                        @click="handleDelete(scope.row)">删除</el-button>
-                </template>
-            </el-table-column>
-        </el-table> -->
+        <el-form-item label="结账日期" prop="closingDate" style="margin-right:50px">
+          <el-date-picker
+            v-model="dataForm.closingDate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            style="width:200px"
+          />
+        </el-form-item>
+        <el-form-item label="应付金额:" prop="amountIng" style="margin-right:50px">
+          <el-input v-model="dataForm.amountIng" class="input-width" />
+        </el-form-item>
+        <el-form-item label="已付金额:" prop="amountPaid" style="margin-right:50px">
+          <el-input v-model="dataForm.amountPaid" class="input-width" />
+        </el-form-item>
+        <el-form-item label="未付金额:" prop="unpaidAmount" style="margin-right:50px">
+          <el-input v-model="dataForm.unpaidAmount" class="input-width" />
+        </el-form-item>
+        <el-form-item label="备注1:" prop="remarks" style="margin-right:50px">
+          <el-input v-model="dataForm.remarks" class="input-width" />
+        </el-form-item>
+        <el-form-item label="备注2:" prop="remark" style="margin-right:50px">
+          <el-input v-model="dataForm.remark" class="input-width" />
+        </el-form-item>
+        <el-form-item label="状态:" prop="status" style="margin-right:50px">
+          <el-select v-model="dataForm.status" placeholder="请选择收款状态" class="input-width">
+            <el-option
+              v-for="item in skList"
+              :label="item.label"
+              :value="item.value"
+              :key="item.value"
+            />
+          </el-select>
+        </el-form-item>
+      </div>
+      <div class="small-title" style="font-size: 16px">详情</div>
+      <div style="display:flex">
+        <el-button
+          v-if="!isJz"
+          size="mini"
+          class="filter-item"
+          type="primary"
+          icon="el-icon-edit"
+          style="margin-bottom:20px"
+          @click="addDetail"
+        >添加</el-button>
+        <el-upload
+          v-if="!isJz"
+          :on-change="importClick"
+          :show-file-list="false"
+          :auto-upload="false"
+          style="margin-left: 8px;margin-bottom:0"
+          class="filter-item"
+          action=""
+          accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
+          <el-button
+            class="filter-item"
+            type="primary"
+            size="mini"
+            icon="el-icon-edit">导入</el-button>
+        </el-upload>
 
-        <!-- <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
-            @pagination="getList" /> -->
+      </div>
 
-        <!-- <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible"> -->
-            <div class="base-title">基本信息</div>
-            <el-form ref="dataForm" :rules="rules" :model="dataForm" status-icon label-position="left"
-                label-width="100px" style="width: 400px; margin-left:50px;">
-                <el-form-item label="id" prop="id" hidden>
-                    <el-input v-model="dataForm.id" />
-                </el-form-item>
-                <el-form-item label="编号" prop="payNo">
-                    <el-input v-model="dataForm.payNo" />
-                </el-form-item>
-                <el-form-item label="单据类型" prop="businessType">
-                    <el-input v-model="dataForm.businessType" />
-                </el-form-item>
-                <el-form-item label="结账日期" prop="closingDate">
-                    <el-input v-model="dataForm.closingDate" />
-                </el-form-item>
-                <el-form-item label="已付金额" prop="amountPaid">
-                    <el-input v-model="dataForm.amountPaid" />
-                </el-form-item>
-                <el-form-item label="未付金额" prop="unpaidAmount">
-                    <el-input v-model="dataForm.unpaidAmount" />
-                </el-form-item>
-                <el-form-item label="备注1" prop="remarks">
-                    <el-input v-model="dataForm.remarks" />
-                </el-form-item>
-                <el-form-item label="备注2" prop="remark">
-                    <el-input v-model="dataForm.remark" />
-                </el-form-item>
-                <el-form-item label="状态" prop="status">
-                    <el-input v-model="dataForm.status" />
-                </el-form-item>
-            </el-form>
-            <!-- <div slot="footer" class="dialog-footer">
-                <el-button @click="dialogFormVisible = false">取消</el-button>
-                <el-button v-if="dialogStatus == 'create'" :loading="submiting" type="primary" @click="createData">确定
-                </el-button>
-                <el-button v-else type="primary" :loading="submiting" @click="updateData">确定</el-button>
-            </div> -->
-        <!-- </el-dialog> -->
-    </div>
+      <el-table
+        v-loading="listLoading"
+        :data="list"
+        :summary-method="getSummaries"
+        size="small"
+        element-loading-text="正在查询中。。。"
+        border
+        fit
+        highlight-current-row
+        show-summary
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column :selectable="selectInit" type="selection" style="width:30px" />
+        <el-table-column type="index" label="序号">
+          <template scope="scope">
+            <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
+            <span v-else>{{ scope.$index + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="柜号" prop="cabinetNo">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.cabinetNo" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="到港日期" prop="arrivalDate" width="170px">
+          <template slot-scope="scope">
+            <el-date-picker
+              v-model="scope.row.arrivalDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              style="width:140px"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="送货地点" prop="deliveryPlace">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.deliveryPlace" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="产品" prop="product">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.product" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="重量" prop="weight">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.weight" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="清关费" prop="clearanceFee">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.clearanceFee" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="清关成本" prop="clearanceCost">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.clearanceCost" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="卡车" prop="truck">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.truck" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="卡车成本" prop="truckCost">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.truckCost" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="其他费用" prop="otherExpenses">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.otherExpenses" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="其他成本" prop="otherCost">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.otherCost" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="应付金额" prop="pricePayable">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.pricePayable" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="成本价格" prop="cost">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.cost" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="备注1" prop="remarks">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remarks" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              v-if="!isJz"
+              type="danger"
+              size="mini"
+              @click.native.prevent="deleteRow(scope.$index, list)"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-form>
+    <!-- 结转单据 -->
+    <el-dialog :visible.sync="dialogFormVisible" title="结转单据">
+      <el-form
+        ref="jzDataForm"
+        :model="jzDataForm"
+        status-icon
+        label-position="left"
+        label-width="150px"
+        style="width: 400px; margin-left:50px;"
+      >
+        <el-form-item label="客户姓名" prop>
+          <el-select v-model="jzDataForm.customer" placeholder="请选择客户姓名" style="width:100%" clearable @change="getCusDateList">
+            <el-option
+              v-for="(item, index) in customerList"
+              :label="item"
+              :value="item"
+              :key="index"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="日期" prop>
+          <el-select v-model="jzDataForm.closingDate" placeholder="请选择日期" style="width:100%" clearable @change="getcabineNoList">
+            <el-option
+              v-for="(item, index) in cusDateList"
+              :label="item.closingDate"
+              :value="item.closingDate"
+              :key="index"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="柜号" prop>
+          <el-select v-model="jzDataForm.cabinetNo" placeholder="请选择柜号" style="width:100%" clearable>
+            <el-option
+              v-for="(item, index) in cabinetNoList"
+              :label="item.cabinetNo"
+              :value="item.cabinetNo"
+              :key="index"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">取消</el-button>
+        <el-button
+          v-if="dialogStatus == 'create'"
+          :loading="submiting"
+          type="primary"
+          @click="createData"
+        >确定</el-button>
+        <el-button v-else :loading="submiting" type="primary" @click="updateData">确定</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
 import {
-    listCustomerBillingInfo,
-    createCustomerBillingInfo,
-    updateCustomerBillingInfo,
-    deleteCustomerBillingInfo
+  getCusDate,
+  listCustomer,
+  createCustomerBillingInfo,
+  updateCustomerBillingInfo,
+  deleteCustomerBillingInfo
 } from '@/api/customerBillingInfo'
 import Pagination from '@/components/Pagination'
 export default {
-    name: 'CustomerBillingInfo',
-    components: { Pagination },
-    data() {
-        return {
-            list: null,
-            total: 0,
-            listLoading: true,
-            listQuery: {
-                page: 1,
-                limit: 20
-            },
-            dataForm: {
-                id: undefined
-            },
-            dialogFormVisible: false,
-            submiting: false,
-            dialogStatus: '',
-            textMap: {
-                update: '编辑',
-                create: '创建'
-            },
-            rules: {
-            }
-        }
-    },
-    created() {
-        this.getList()
-    },
-    methods: {
-        getList() {
-            this.listLoading = true
-            listCustomerBillingInfo(this.listQuery).then(response => {
-                this.list = response.data.data.items
-                this.total = response.data.data.total
-                this.listLoading = false
-            })
-                .catch(() => {
-                    this.list = []
-                    this.total = 0
-                    this.listLoading = false
-                })
+  name: 'CustomerBillingInfo',
+  components: { Pagination },
+  data() {
+    return {
+      fileList: [],
+      appendixIdsAdd: '',
+      excelFreightspace: [],
+      isJz: false,
+      cabinetNoList: [],
+      jzDataForm: {
+        cabinetNo: ''
+      },
+      customerList: [],
+      cusDateList: [],
+      djList: [
+        {
+          value: '1',
+          label: '正常单据'
         },
-        handleFilter() {
-            this.listQuery.page = 1
-            this.getList()
+        {
+          value: '2',
+          label: '结转单据'
+        }
+      ],
+      skList: [
+        {
+          value: 1,
+          label: '未收款'
         },
-        resetForm() {
-            this.dataForm = {
-                id: undefined
-            }
+        {
+          value: 2,
+          label: '部分收款'
         },
-        handleCreate() {
-            this.resetForm()
-            this.dialogStatus = 'create'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
+        {
+          value: 3,
+          label: '已收款'
+        }
+      ],
+      billDetailList: [
+        {
+          payNo: '11',
+          businessType: '1',
+          closingDate: '1',
+          amountPaid: '1',
+          unpaidAmount: '1',
+          remarks: '1',
+          remark: '1',
+          status: '1'
+        }
+      ],
+      list: null,
+      total: 0,
+      listLoading: false,
+      listQuery: {
+        page: 1,
+        limit: 100
+      },
+      dataForm: {
+        id: undefined
+      },
+      dialogFormVisible: false,
+      submiting: false,
+      dialogStatus: '',
+      textMap: {
+        update: '编辑',
+        create: '创建'
+      },
+      rules: {}
+    }
+  },
+  created() {
+    // this.getList()
+    this.list = []
+  },
+  methods: {
+    getCusDateList(val) {
+      this.jzDataForm.closingDate=''
+      this.jzDataForm.cabinetNo=''
+      console.log(val)
+      const _data = {
+        customer: val
+      }
+      getCusDate(_data)
+        .then(response => {
+          this.cusDateList = response.data.data
+        })
+        .catch(() => {
+          this.list = []
+          this.total = 0
+          this.listLoading = false
+        })
+    },
+    getcabineNoList(val) {
+      for (let i = 0; i<this.cusDateList.length; i++) {
+        if (this.cusDateList[i].closingDate==val) {
+          this.cabinetNoList = this.cusDateList[i].customerBillingDetailDOList
+        }
+      }
+    },
+    changeBusinessType(e) {
+      console.log(e)
+      // 结转单据
+
+      if (e == 2) {
+        debugger
+        this.isJz = true
+        this.getCustomerList()
+      }
+    },
+    returnsales() {
+      this.$router.push({
+        path: 'customerBilling'
+      })
+    },
+    handleSelectionChange(val) {
+      this.modification = val
+    },
+    selectInit(row) {
+      return true
+    },
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        } else if (
+          index == 7 ||
+          index == 8 ||
+          index == 10 ||
+          index == 11 ||
+          index == 12 ||
+          index == 13 ||
+          index == 14
+        ) {
+          const values = data.map(item => Number(item[column.property]))
+          if (!values.every(value => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr)
+              if (!isNaN(value)) {
+                return prev + curr
+              } else {
+                return prev
+              }
+            }, 0)
+            sums[index] += ''
+          } else {
+            sums[index] = '--'
+          }
+        } else {
+          // sums[index] = "--";
+        }
+      })
+
+      return sums
+    },
+    addDetail() {
+      console.log('add')
+      this.list.push({
+        cabinetNo: '',
+        arrivalDate: '',
+        deliveryPlace: '',
+        product: '',
+        weight: '',
+        clearanceFee: '',
+        clearanceCost: '',
+        truck: '',
+        truckCost: '',
+        otherExpenses: '',
+        otherCost: '',
+        pricePayable: '',
+        cost: '',
+        remarks: '',
+        remark: '',
+        status: ''
+      })
+    },
+    getCustomerList() {
+      listCustomer(this.listQuery)
+        .then(response => {
+          this.dialogFormVisible = true
+          this.customerList = response.data.data
+          if (response.data.data.length>0) {
+            this.getCusDateList(response.data.data[0])
+          }
+        })
+        .catch(() => {
+          this.list = []
+          this.total = 0
+          this.listLoading = false
+        })
+    },
+    // handleFilter() {
+    //   this.listQuery.page = 1
+    //   this.getList()
+    // },
+    resetForm() {
+      this.dataForm = {
+        id: undefined
+      }
+    },
+    handleCreate() {
+      this.resetForm()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    createData() {
+      this.$refs['dataForm'].validate(valid => {
+        if (valid) {
+          this.submiting = true
+          this.dataForm.customerBillingDetailDTOS = this.list
+          createCustomerBillingInfo(this.dataForm)
+            .then(response => {
+              //   this.list.unshift(response.data.data)
+              this.dialogFormVisible = false
+              this.$notify.success({
+                title: '成功',
+                message: '添加成功'
+              })
+              this.submiting = false
+              this.returnsales()
             })
-        },
-        createData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    createCustomerBillingInfo(this.dataForm).then(response => {
-                        this.list.unshift(response.data.data)
-                        this.dialogFormVisible = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '添加成功'
-                        })
-                        this.submiting = false
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
             })
-        },
-        handleUpdate(row) {
-            this.dataForm = Object.assign({}, row)
-            this.dialogStatus = 'update'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
+        }
+      })
+    },
+    handleUpdate(row) {
+      this.dataForm = Object.assign({}, row)
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    updateData() {
+      debugger
+      this.dataForm.customer = this.jzDataForm.customer
+      for (let i = 0; i<this.cabinetNoList.length; i++) {
+        if (this.cabinetNoList[i].cabinetNo==this.jzDataForm.cabinetNo) {
+          this.list =[this.cabinetNoList[i]]
+        }
+      }
+
+      this.dialogFormVisible = false
+      this.submiting = false
+    },
+    deleteRow(index, rows) {
+      rows.splice(index, 1)
+    },
+    importClick(file, fileList) {
+      this.fileTemp = file.raw
+      const fileName = file.raw.name
+      const fileType = fileName.substring(fileName.lastIndexOf('.') + 1)
+      // 判断上传文件格式
+      if (this.fileTemp) {
+        if (fileType == 'xlsx' || fileType == 'xls') {
+          this.importf(this.fileTemp)
+        } else {
+          this.$message({
+            type: 'warning',
+            message: '附件格式错误,请删除后重新上传!'
+          })
+        }
+      } else {
+        this.$message({
+          type: 'warning',
+          message: '请上传附件!'
+        })
+      }
+    },
+    importf(obj) {
+      this.excelFreightspace = []
+      // this.dialogVisible = true;
+      const _this = this
+      const inputDOM = this.$refs.inputer // 通过DOM取文件数据
+      this.file = event.currentTarget.files[0]
+      var rABS = false // 是否将文件读取为二进制字符串
+      var f = this.file
+      var reader = new FileReader()
+      // if (!FileReader.prototype.readAsBinaryString) {
+      FileReader.prototype.readAsBinaryString = function (f) {
+        var binary = ''
+        var rABS = false // 是否将文件读取为二进制字符串
+        var pt = this
+        var wb // 读取完成的数据
+        var outdata
+        var reader = new FileReader()
+        reader.onload = function (e) {
+          var bytes = new Uint8Array(reader.result)
+          var length = bytes.byteLength
+          for (var i = 0; i < length; i++) {
+            binary += String.fromCharCode(bytes[i])
+          }
+          var XLSX = require('xlsx')
+          if (rABS) {
+            wb = XLSX.read(btoa(fixdata(binary)), { // 手动转化
+              type: 'base64',
+              cellDates: true
             })
-        },
-        updateData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    updateCustomerBillingInfo(this.dataForm).then(() => {
-                        for (const v of this.list) {
-                            if (v.id === this.dataForm.id) {
-                                const index = this.list.indexOf(v)
-                                this.list.splice(index, 1, this.dataForm)
-                                break
-                            }
-                        }
-                        this.dialogFormVisible = false
-                        this.submiting = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '更新成功'
-                        })
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
+          } else {
+            wb = XLSX.read(binary, {
+              type: 'binary'
             })
-        },
-        handleDelete(row) {
-            this.$confirm('此操作将永久删除该记录---' + row.id + '---, 是否继续?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                deleteCustomerBillingInfo(row.id).then(response => {
-                    this.$notify.success({
-                        title: '成功',
-                        message: '删除成功'
-                    })
-                    const index = this.list.indexOf(row)
-                    this.list.splice(index, 1)
+          }
+          // outdata就是你想要的东西 excel导入的数据
+          outdata = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]])
+          // excel 数据再处理
+          const arr = []
+          outdata.map(v => {
+            // let jsonString = JSON.stringify(v).replace(/\*/g, '').replace(/\s/ig,'');
+            const jsonString = JSON.stringify(v).replace(/\//g, '').replace(/\s/ig, '')
+            v = JSON.parse(jsonString)
+            const obj = {}
+            debugger
+            // xxx代表列名
+            obj.cabinetNo = v.柜号
+            obj.arrivalDate = v.到港日期
+            obj.deliveryPlace = v.送货地点
+            obj.product = v.产品
+            obj.weight = v.重量
+            obj.clearanceFee = v.清关费
+            obj.clearanceCost = v.清关成本
+            obj.truck = v.卡车
+            obj.truckCost = v.卡车成本
+            obj.otherExpenses = v.其他费用
+            obj.pricePayable = v.应付金额
+            obj.cost = v.成本价格
+            obj.remarks = v.备注1
+            _this.excelFreightspace.push(obj)
+          })
+          if (_this.excelFreightspace) {
+            importWord(_this.excelFreightspace).then((response) => {
+              if (response.status == '200') {
+                _this.$notify({
+                  title: '成功',
+                  message: '导入成功',
+                  type: 'success'
                 })
-                    .catch(response => {
-                        this.$notify.error({
-                            title: '失败',
-                            message: response.data.errmsg
-                        })
-                    })
-            }).catch(() => {
-                return false
+                _this.getList()
+              }
             })
+          }
         }
+        reader.readAsArrayBuffer(f)
+      }
+      if (rABS) {
+        reader.readAsArrayBuffer(f)
+      } else {
+        reader.readAsBinaryString(f)
+      }
     }
+  }
 }
 </script>
+<style lang="scss">
+.bg-left {
+  padding-left: 30px;
+}
+.bg-right {
+  padding-right: 10px;
+  text-align: right;
+}
+.bg-bottom {
+  margin: 15px 0px;
+}
+.title-style {
+  background: #f6f7fc;
+  border-radius: 5px;
+}
+.app-container {
+  // background: ;
+}
+.title::before {
+  content: "";
+  display: inline-block;
+  width: 5px;
+  height: 30px;
+  background: #5473e8;
+  position: absolute;
+  left: 0;
+}
+.position {
+  position: relative;
+}
+.small-title {
+  position: relative;
+  padding: 10px;
+  font-weight: 600;
+  margin: 20px 0;
+}
+.small-title::before {
+  position: absolute;
+  content: "";
+  display: block;
+  background: #5473e8;
+  width: 4px;
+  height: 14px;
+  left: 0px;
+  top: 13px;
+}
+.el-form {
+  padding: 0 40px;
+}
+.ws-info-table {
+  display: -webkit-box;
+  display: -ms-flexbox;
+  display: flex;
+  -ms-flex-wrap: wrap;
+  flex-wrap: wrap;
+  border-left: 1px solid #ccc;
+  border-top: 1px solid #ccc;
+  position: relative;
+  border-left: 0;
+  border-top: 0;
+}
+.input-width {
+  width: 200px;
+}
+</style>

+ 484 - 212
unimall-admin/src/views/customerBilling/customerBillingInfoedit.vue

@@ -1,234 +1,506 @@
 <template>
-    <div class="app-container">
-        <div class="filter-container">
-            <el-input v-model="listQuery.payNo" clearable class="filter-item" size="small" style="width: 200px;"
-                placeholder="请输入编号" />
-            <el-input v-model="listQuery.businessType" clearable class="filter-item" size="small" style="width: 200px;"
-                placeholder="请输入单据类型" />
-            <el-input v-model="listQuery.status" clearable class="filter-item" size="small" style="width: 200px;"
-                placeholder="请输入状态" />
-            <el-button v-permission="['customerBilling:customerbilling:list']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-search" @click="handleFilter">查找</el-button>
-            <el-button v-permission="['customerBilling:customerbilling:create']" class="filter-item" type="primary"
-                size="mini" icon="el-icon-edit" @click="handleCreate">添加</el-button>
-        </div>
+  <div class="app-container">
+    <el-row class="title-style">
+      <el-col :span="12">
+        <h2 class="bg-left title">客户账单</h2>
+      </el-col>
+      <el-col :span="12" class="bg-right">
+        <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">返回</el-button>
+        <el-button type="primary" size="small" @click="editData">提交</el-button>
+      </el-col>
+    </el-row>
+    <el-form
+      ref="dataForm"
+      :rules="rules"
+      :model="dataForm"
+      status-icon
+      label-position="left"
+      label-width="200px"
+      class="position"
+    >
+      <div class="small-title" style="font-size: 16px">基本信息</div>
+      <div class="ws-info-table">
+        <el-form-item label="id" prop="id" hidden>
+          <el-input v-model="dataForm.id"/>
+        </el-form-item>
+        <el-form-item label="编号:" prop="payNo" style="margin-right:50px">
+          <el-input v-model="dataForm.payNo" class="input-width" disabled="true"/>
+        </el-form-item>
+        <el-form-item label="客户:" prop="customer" style="margin-right:50px">
+          <el-input v-model="dataForm.customer" class="input-width" disabled="true"/>
+        </el-form-item>
+        <el-form-item label="单据类型:" prop="businessType" style="margin-right:50px">
+          <el-select v-model="dataForm.businessType" placeholder="请选择单据类型" class="input-width" disabled="true">
+            <el-option
+              v-for="item in djList"
+              :label="item.label"
+              :value="item.value"
+              :key="item.value"
+            />
+          </el-select>
+        </el-form-item>
 
-        <el-table v-loading="listLoading" :data="list" size="small" element-loading-text="正在查询中。。。" border fit
-            highlight-current-row>
-            <el-table-column align="center" label="编号" prop="payNo" />
-            <el-table-column align="center" label="单据类型" prop="businessType" />
-            <el-table-column align="center" label="结账日期" prop="closingDate" />
-            <el-table-column align="center" label="已付金额" prop="amountPaid" />
-            <el-table-column align="center" label="未付金额" prop="unpaidAmount" />
-            <el-table-column align="center" label="备注1" prop="remarks" />
-            <el-table-column align="center" label="备注2" prop="remark" />
-            <el-table-column align="center" label="状态" prop="status" />
-            <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
-                <template slot-scope="scope">
-                    <el-button v-permission="['customerBilling:customerbilling:edit']" type="primary" size="mini"
-                        @click="handleUpdate(scope.row)">编辑</el-button>
-                    <el-button v-permission="['customerBilling:customerbilling:delete']" type="danger" size="mini"
-                        @click="handleDelete(scope.row)">删除</el-button>
-                </template>
-            </el-table-column>
-        </el-table>
+        <el-form-item label="结账日期" prop="closingDate" style="margin-right:50px">
+          <el-date-picker
+            v-model="dataForm.closingDate"
+            type="date"
+            value-format="yyyy-MM-dd"
+            style="width:200px"
+          />
+        </el-form-item>
+        <el-form-item label="应付金额:" prop="amountIng" style="margin-right:50px">
+          <el-input v-model="dataForm.amountIng" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="已付金额:" prop="amountPaid" style="margin-right:50px">
+          <el-input v-model="dataForm.amountPaid" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="未付金额:" prop="unpaidAmount" style="margin-right:50px">
+          <el-input v-model="dataForm.unpaidAmount" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="备注1:" prop="remarks" style="margin-right:50px">
+          <el-input v-model="dataForm.remarks" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="备注2:" prop="remark" style="margin-right:50px">
+          <el-input v-model="dataForm.remark" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="状态:" prop="status" style="margin-right:50px">
+          <el-select v-model="dataForm.status" placeholder="请选择收款状态" class="input-width">
+            <el-option
+              v-for="item in skList"
+              :label="item.label"
+              :value="item.value"
+              :key="item.value"
+            />
+          </el-select>
+        </el-form-item>
+      </div>
+      <div class="small-title" style="font-size: 16px">详情</div>
+      <el-button style="margin-bottom:20px" @click="addDetail">添加</el-button>
 
-        <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
-            @pagination="getList" />
-
-        <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
-            <el-form ref="dataForm" :rules="rules" :model="dataForm" status-icon label-position="left"
-                label-width="100px" style="width: 400px; margin-left:50px;">
-                <el-form-item label="id" prop="id" hidden>
-                    <el-input v-model="dataForm.id" />
-                </el-form-item>
-                <el-form-item label="编号" prop="payNo">
-                    <el-input v-model="dataForm.payNo" />
-                </el-form-item>
-                <el-form-item label="单据类型" prop="businessType">
-                    <el-input v-model="dataForm.businessType" />
-                </el-form-item>
-                <el-form-item label="结账日期" prop="closingDate">
-                    <el-input v-model="dataForm.closingDate" />
-                </el-form-item>
-                <el-form-item label="已付金额" prop="amountPaid">
-                    <el-input v-model="dataForm.amountPaid" />
-                </el-form-item>
-                <el-form-item label="未付金额" prop="unpaidAmount">
-                    <el-input v-model="dataForm.unpaidAmount" />
-                </el-form-item>
-                <el-form-item label="备注1" prop="remarks">
-                    <el-input v-model="dataForm.remarks" />
-                </el-form-item>
-                <el-form-item label="备注2" prop="remark">
-                    <el-input v-model="dataForm.remark" />
-                </el-form-item>
-                <el-form-item label="状态" prop="status">
-                    <el-input v-model="dataForm.status" />
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click="dialogFormVisible = false">取消</el-button>
-                <el-button v-if="dialogStatus == 'create'" :loading="submiting" type="primary" @click="createData">确定
-                </el-button>
-                <el-button v-else type="primary" :loading="submiting" @click="updateData">确定</el-button>
-            </div>
-        </el-dialog>
-    </div>
+      <el-table
+        v-loading="listLoading"
+        :data="list"
+        :summary-method="getSummaries"
+        size="small"
+        element-loading-text="正在查询中。。。"
+        border
+        fit
+        highlight-current-row
+        show-summary
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column :selectable="selectInit" type="selection" style="width:30px" />
+        <el-table-column type="index" label="序号">
+          <template scope="scope">
+            <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
+            <span v-else>{{ scope.$index + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="柜号" prop="cabinetNo">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.cabinetNo" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="到港日期" prop="arrivalDate" width="170px">
+          <template slot-scope="scope">
+            <el-date-picker
+              v-model="scope.row.arrivalDate"
+              type="date"
+              value-format="yyyy-MM-dd"
+              style="width:140px"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="送货地点" prop="deliveryPlace">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.deliveryPlace" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="产品" prop="product">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.product" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="重量" prop="weight">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.weight" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="清关费" prop="clearanceFee">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.clearanceFee" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="清关成本" prop="clearanceCost">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.clearanceCost" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="卡车" prop="truck">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.truck" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="卡车成本" prop="truckCost">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.truckCost" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="其他费用" prop="otherExpenses">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.otherExpenses" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="其他成本" prop="otherCost">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.otherCost" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="应付金额" prop="pricePayable">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.pricePayable" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="成本价格" prop="cost">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.cost" />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="备注1" prop="remarks">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remarks" />
+          </template>
+        </el-table-column>
+        <!-- <el-table-column align="center" label="备注2" prop="remark">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remark" />
+          </template>
+        </el-table-column>-->
+        <!-- <el-table-column align="center" label="状态" prop="status">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.status" />
+          </template>
+        </el-table-column>-->
+        <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button type="danger" size="mini" @click.native.prevent="deleteRow(scope.$index, list)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-form>
+  </div>
 </template>
 
 <script>
 import {
-    listCustomerBillingInfo,
-    createCustomerBillingInfo,
-    updateCustomerBillingInfo,
-    deleteCustomerBillingInfo
+  listCustomerBillingInfo,
+  createCustomerBillingInfo,
+  editCustomerBillingInfo,
+  updateCustomerBillingInfo,
+  deleteCustomerBillingInfo
 } from '@/api/customerBillingInfo'
+import { listCustomerBillingDetail } from '@/api/customerBillingDetail'
 import Pagination from '@/components/Pagination'
 export default {
-    name: 'CustomerBillingInfo',
-    components: { Pagination },
-    data() {
-        return {
-            list: null,
-            total: 0,
-            listLoading: true,
-            listQuery: {
-                page: 1,
-                limit: 20
-            },
-            dataForm: {
-                id: undefined
-            },
-            dialogFormVisible: false,
-            submiting: false,
-            dialogStatus: '',
-            textMap: {
-                update: '编辑',
-                create: '创建'
-            },
-            rules: {
-            }
-        }
-    },
-    created() {
-        this.getList()
-    },
-    methods: {
-        getList() {
-            this.listLoading = true
-            listCustomerBillingInfo(this.listQuery).then(response => {
-                this.list = response.data.data.items
-                this.total = response.data.data.total
-                this.listLoading = false
-            })
-                .catch(() => {
-                    this.list = []
-                    this.total = 0
-                    this.listLoading = false
-                })
-        },
-        handleFilter() {
-            this.listQuery.page = 1
-            this.getList()
+  name: 'CustomerBillingInfo',
+  components: { Pagination },
+  data() {
+    return {
+      djList: [
+        {
+          value: '1',
+          label: '正常单据'
         },
-        resetForm() {
-            this.dataForm = {
-                id: undefined
-            }
+        {
+          value: '2',
+          label: '结转单据'
+        }
+      ],
+      skList: [
+        {
+          value: 1,
+          label: '未收款'
         },
-        handleCreate() {
-            this.resetForm()
-            this.dialogStatus = 'create'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
-            })
+        {
+          value: 2,
+          label: '部分收款'
         },
-        createData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    createCustomerBillingInfo(this.dataForm).then(response => {
-                        this.list.unshift(response.data.data)
-                        this.dialogFormVisible = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '添加成功'
-                        })
-                        this.submiting = false
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
+        {
+          value: 3,
+          label: '已收款'
+        }
+      ],
+      billDetailList: [
+        {
+          payNo: '11',
+          businessType: '1',
+          closingDate: '1',
+          amountPaid: '1',
+          unpaidAmount: '1',
+          remarks: '1',
+          remark: '1',
+          status: '1'
+        }
+      ],
+      list: null,
+      total: 0,
+      listLoading: false,
+      listQuery: {
+        page: 1,
+        limit: 100
+      },
+      dataForm: {
+        id: undefined
+      },
+      dialogFormVisible: false,
+      submiting: false,
+      dialogStatus: '',
+      textMap: {
+        update: '编辑',
+        create: '创建'
+      },
+      rules: {}
+    }
+  },
+  created() { debugger
+    this.listQuery.id = this.$route.query.id
+    this.getList()
+  },
+  methods: {
+    getList() {
+      this.listLoading = true
+      listCustomerBillingDetail(this.listQuery)
+        .then(response => {
+          debugger
+          this.dataForm = response.data.data
+          this.list = response.data.data.customerBillingDetailDOList
+          this.total = response.data.data.total
+          this.listLoading = false
+        })
+        .catch(() => {
+          this.list = []
+          this.total = 0
+          this.listLoading = false
+        })
+    },
+    returnsales() {
+      this.$router.push({
+        path: 'customerBilling'
+      })
+    },
+    handleSelectionChange(val) {
+      this.modification = val
+    },
+    selectInit(row) {
+      return true
+    },
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        } else if (
+          index == 7 ||
+          index == 8 ||
+          index == 10 ||
+          index == 11 ||
+          index == 12||
+           index == 13||
+            index == 14
+        ) {
+          const values = data.map(item => Number(item[column.property]))
+          if (!values.every(value => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr)
+              if (!isNaN(value)) {
+                return prev + curr
+              } else {
+                return prev
+              }
+            }, 0)
+            sums[index] += ''
+          } else {
+            sums[index] = '--'
+          }
+        } else {
+          // sums[index] = "--";
+        }
+      })
+
+      return sums
+    },
+    addDetail() {
+      console.log('add')
+      this.list.push({
+        cabinetNo: '',
+        arrivalDate: '',
+        deliveryPlace: '',
+        product: '',
+        weight: '',
+        clearanceFee: '',
+        clearanceCost: '',
+        truck: '',
+        truckCost: '',
+        otherExpenses: '',
+        otherCost: '',
+        pricePayable: '',
+        cost: '',
+        remarks: '',
+        remark: '',
+        status: ''
+      })
+    },
+    handleFilter() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    resetForm() {
+      this.dataForm = {
+        id: undefined
+      }
+    },
+    handleCreate() {
+      this.resetForm()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    editData() {
+      this.$refs['dataForm'].validate(valid => {
+        if (valid) {
+          this.submiting = true
+          this.dataForm.customerBillingDetailDTOS = this.list
+          editCustomerBillingInfo(this.dataForm)
+            .then(response => {
+            //   this.list.unshift(response.data.data)
+              this.dialogFormVisible = false
+              this.$notify.success({
+                title: '成功',
+                message: '添加成功'
+              })
+              this.submiting = false
+              this.returnsales()
             })
-        },
-        handleUpdate(row) {
-            this.dataForm = Object.assign({}, row)
-            this.dialogStatus = 'update'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
             })
-        },
-        updateData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    updateCustomerBillingInfo(this.dataForm).then(() => {
-                        for (const v of this.list) {
-                            if (v.id === this.dataForm.id) {
-                                const index = this.list.indexOf(v)
-                                this.list.splice(index, 1, this.dataForm)
-                                break
-                            }
-                        }
-                        this.dialogFormVisible = false
-                        this.submiting = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '更新成功'
-                        })
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
+        }
+      })
+    },
+    handleUpdate(row) {
+      this.dataForm = Object.assign({}, row)
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    updateData() {
+      this.$refs['dataForm'].validate(valid => {
+        if (valid) {
+          this.submiting = true
+          updateCustomerBillingInfo(this.dataForm)
+            .then(() => {
+              for (const v of this.list) {
+                if (v.id === this.dataForm.id) {
+                  const index = this.list.indexOf(v)
+                  this.list.splice(index, 1, this.dataForm)
+                  break
                 }
+              }
+              this.dialogFormVisible = false
+              this.submiting = false
+              this.$notify.success({
+                title: '成功',
+                message: '更新成功'
+              })
             })
-        },
-        handleDelete(row) {
-            this.$confirm('此操作将永久删除该记录---' + row.id + '---, 是否继续?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                deleteCustomerBillingInfo(row.id).then(response => {
-                    this.$notify.success({
-                        title: '成功',
-                        message: '删除成功'
-                    })
-                    const index = this.list.indexOf(row)
-                    this.list.splice(index, 1)
-                })
-                    .catch(response => {
-                        this.$notify.error({
-                            title: '失败',
-                            message: response.data.errmsg
-                        })
-                    })
-            }).catch(() => {
-                return false
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
             })
         }
+      })
+    },
+    deleteRow(index, rows) {
+      rows.splice(index, 1)
     }
+  }
 }
 </script>
+<style lang="scss">
+.bg-left {
+  padding-left: 30px;
+}
+.bg-right {
+  padding-right: 10px;
+  text-align: right;
+}
+.bg-bottom {
+  margin: 15px 0px;
+}
+.title-style {
+  background: #f6f7fc;
+  border-radius: 5px;
+}
+.app-container {
+  // background: ;
+}
+.title::before {
+  content: "";
+  display: inline-block;
+  width: 5px;
+  height: 30px;
+  background: #5473e8;
+  position: absolute;
+  left: 0;
+}
+.position {
+  position: relative;
+}
+.small-title {
+  position: relative;
+  padding: 10px;
+  font-weight: 600;
+  margin: 20px 0;
+}
+.small-title::before {
+  position: absolute;
+  content: "";
+  display: block;
+  background: #5473e8;
+  width: 4px;
+  height: 14px;
+  left: 0px;
+  top: 13px;
+}
+.el-form {
+  padding: 0 40px;
+}
+.ws-info-table {
+  display: -webkit-box;
+  display: -ms-flexbox;
+  display: flex;
+  -ms-flex-wrap: wrap;
+  flex-wrap: wrap;
+  border-left: 1px solid #ccc;
+  border-top: 1px solid #ccc;
+  position: relative;
+  border-left: 0;
+  border-top: 0;
+}
+.input-width{
+    width: 200px;
+}
+</style>

+ 544 - 0
unimall-admin/src/views/customerBilling/customerBillingInfolook.vue

@@ -0,0 +1,544 @@
+<template>
+  <div class="app-container">
+    <el-row class="title-style">
+      <el-col :span="12">
+        <h2 class="bg-left title">客户账单</h2>
+      </el-col>
+      <el-col :span="12" class="bg-right">
+        <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">返回</el-button>
+        <!-- <el-button type="primary" size="small" @click="createData">提交</el-button> -->
+      </el-col>
+    </el-row>
+    <el-form
+      ref="dataForm"
+      :rules="rules"
+      :model="dataForm"
+      status-icon
+      label-position="left"
+      label-width="200px"
+      class="position"
+    >
+      <div class="small-title" style="font-size: 16px">基本信息</div>
+      <div class="ws-info-table">
+        <el-form-item label="id" prop="id" hidden>
+          <el-input v-model="dataForm.id" :disabled="true"/>
+        </el-form-item>
+        <el-form-item label="编号:" prop="payNo" style="margin-right:50px">
+          <el-input v-model="dataForm.payNo" :disabled="true" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="客户:" prop="customer" style="margin-right:50px">
+          <el-input v-model="dataForm.customer" :disabled="true" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="单据类型:" prop="businessType" style="margin-right:50px">
+          <el-select
+            v-model="dataForm.businessType"
+            :disabled="true"
+            placeholder="请选择单据类型"
+            class="input-width">
+            <el-option
+              v-for="item in djList"
+              :label="item.label"
+              :value="item.value"
+              :key="item.value"
+            />
+          </el-select>
+        </el-form-item>
+
+        <el-form-item :disabled="true" label="结账日期" prop="closingDate" style="margin-right:50px">
+          <el-date-picker
+            v-model="dataForm.closingDate"
+            :disabled="true"
+            type="date"
+            value-format="yyyy-MM-dd"
+            style="width:200px"
+          />
+        </el-form-item>
+        <el-form-item label="应付金额:" prop="amountIng" style="margin-right:50px">
+          <el-input v-model="dataForm.amountIng" :disabled="true" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="已付金额:" prop="amountPaid" style="margin-right:50px">
+          <el-input v-model="dataForm.amountPaid" :disabled="true" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="未付金额:" prop="unpaidAmount" style="margin-right:50px">
+          <el-input v-model="dataForm.unpaidAmount" :disabled="true" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="备注1:" prop="remarks" style="margin-right:50px">
+          <el-input v-model="dataForm.remarks" :disabled="true" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="备注2:" prop="remark" style="margin-right:50px">
+          <el-input v-model="dataForm.remark" :disabled="true" class="input-width"/>
+        </el-form-item>
+        <el-form-item label="状态:" prop="status" style="margin-right:50px">
+          <el-select v-model="dataForm.status" :disabled="true" placeholder="请选择收款状态" class="input-width">
+            <el-option
+              v-for="item in skList"
+              :label="item.label"
+              :value="item.value"
+              :key="item.value"
+            />
+          </el-select>
+        </el-form-item>
+      </div>
+      <div class="small-title" style="font-size: 16px">详情</div>
+      <!-- <el-button style="margin-bottom:20px" @click="addDetail">添加</el-button> -->
+
+      <el-table
+        v-loading="listLoading"
+        :data="list"
+        :summary-method="getSummaries"
+        size="small"
+        element-loading-text="正在查询中。。。"
+        border
+        fit
+        highlight-current-row
+        show-summary
+        @selection-change="handleSelectionChange"
+      >
+        <el-table-column :selectable="selectInit" type="selection" style="width:30px" />
+        <el-table-column type="index" label="序号">
+          <template scope="scope">
+            <span v-if="scope.$index < 9">0{{ scope.$index + 1 }}</span>
+            <span v-else>{{ scope.$index + 1 }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="柜号" prop="cabinetNo">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.cabinetNo"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="到港日期" prop="arrivalDate" width="170px">
+          <template slot-scope="scope">
+            <el-date-picker
+              v-model="scope.row.arrivalDate"
+              :disabled="true"
+              type="date"
+              value-format="yyyy-MM-dd"
+              style="width:140px"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="送货地点" prop="deliveryPlace">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.deliveryPlace"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="产品" prop="product">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.product"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="重量" prop="weight">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.weight"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="清关费" prop="clearanceFee">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.clearanceFee"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="清关成本" prop="clearanceCost">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.clearanceCost"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="卡车" prop="truck">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.truck"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="卡车成本" prop="truckCost">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.truckCost"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="其他费用" prop="otherExpenses">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.otherExpenses"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="其他成本" prop="otherCost">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.otherCost"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="应付金额" prop="pricePayable">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.pricePayable"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="成本价格" prop="cost">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.cost"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="备注1" prop="remarks">
+          <template slot-scope="scope">
+            <el-input
+              v-model="scope.row.remarks"
+              :disabled="true"/>
+          </template>
+        </el-table-column>
+        <!-- <el-table-column align="center" label="备注2" prop="remark">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remark" />
+          </template>
+        </el-table-column>-->
+        <!-- <el-table-column align="center" label="状态" prop="status">
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.status" />
+          </template>
+        </el-table-column>-->
+        <!-- <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              type="danger"
+              size="mini"
+              @click.native.prevent="deleteRow(scope.$index, list)"
+            >删除</el-button>
+          </template>
+        </el-table-column> -->
+      </el-table>
+    </el-form>
+  </div>
+</template>
+
+<script>
+import {
+  createCustomerBillingInfo,
+  updateCustomerBillingInfo,
+  deleteCustomerBillingInfo
+} from '@/api/customerBillingInfo'
+import { listCustomerBillingDetail } from '@/api/customerBillingDetail'
+import Pagination from '@/components/Pagination'
+export default {
+  name: 'CustomerBillingInfo',
+  components: { Pagination },
+  data() {
+    return {
+      djList: [
+        {
+          value: '1',
+          label: '正常单据'
+        },
+        {
+          value: '2',
+          label: '结转单据'
+        }
+      ],
+      skList: [
+        {
+          value: 1,
+          label: '未收款'
+        },
+        {
+          value: 2,
+          label: '部分收款'
+        },
+        {
+          value: 3,
+          label: '已收款'
+        }
+      ],
+      billDetailList: [
+        {
+          payNo: '11',
+          businessType: '1',
+          closingDate: '1',
+          amountPaid: '1',
+          unpaidAmount: '1',
+          remarks: '1',
+          remark: '1',
+          status: '1'
+        }
+      ],
+      list: null,
+      total: 0,
+      listLoading: false,
+      listQuery: {
+        page: 1,
+        limit: 100,
+        id: ''
+      },
+      dataForm: {
+        id: undefined
+      },
+      dialogFormVisible: false,
+      submiting: false,
+      dialogStatus: '',
+      textMap: {
+        update: '编辑',
+        create: '创建'
+      },
+      rules: {}
+    }
+  },
+  created() {
+    debugger
+    // console.log(JSON.parse(this.$route.query.rowData))
+    // this.dataForm = JSON.parse(this.$route.query.rowData)
+    this.listQuery.id = this.$route.query.id
+    this.getList()
+  },
+  methods: {
+    returnsales() {
+      this.$router.push({
+        path: 'customerBilling'
+      })
+    },
+    handleSelectionChange(val) {
+      this.modification = val
+    },
+    selectInit(row) {
+      return true
+    },
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        } else if (
+          index == 7 ||
+          index == 8 ||
+          index == 10 ||
+          index == 11 ||
+          index == 12 ||
+          index == 13 ||
+          index == 14
+        ) {
+          const values = data.map(item => Number(item[column.property]))
+          if (!values.every(value => isNaN(value))) {
+            sums[index] = values.reduce((prev, curr) => {
+              const value = Number(curr)
+              if (!isNaN(value)) {
+                return prev + curr
+              } else {
+                return prev
+              }
+            }, 0)
+            sums[index] += ''
+          } else {
+            sums[index] = '--'
+          }
+        } else {
+          // sums[index] = "--";
+        }
+      })
+
+      return sums
+    },
+    addDetail() {
+      console.log('add')
+      this.list.push({
+        cabinetNo: '',
+        arrivalDate: '',
+        deliveryPlace: '',
+        product: '',
+        weight: '',
+        clearanceFee: '',
+        clearanceCost: '',
+        truck: '',
+        truckCost: '',
+        otherExpenses: '',
+        otherCost: '',
+        pricePayable: '',
+        cost: '',
+        remarks: '',
+        remark: '',
+        status: ''
+      })
+    },
+    getList() {
+      this.listLoading = true
+      listCustomerBillingDetail(this.listQuery)
+        .then(response => {
+          debugger
+          this.dataForm = response.data.data
+          this.list = response.data.data.customerBillingDetailDOList
+          this.total = response.data.data.total
+          this.listLoading = false
+        })
+        .catch(() => {
+          this.list = []
+          this.total = 0
+          this.listLoading = false
+        })
+    },
+    handleFilter() {
+      this.listQuery.page = 1
+      this.getList()
+    },
+    resetForm() {
+      this.dataForm = {
+        id: undefined
+      }
+    },
+    handleCreate() {
+      this.resetForm()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    createData() {
+      this.$refs['dataForm'].validate(valid => {
+        if (valid) {
+          this.submiting = true
+          this.dataForm.customerBillingDetailDTOS = this.list
+          createCustomerBillingInfo(this.dataForm)
+            .then(response => {
+              //   this.list.unshift(response.data.data)
+              this.dialogFormVisible = false
+              this.$notify.success({
+                title: '成功',
+                message: '添加成功'
+              })
+              this.submiting = false
+              this.returnsales()
+            })
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
+            })
+        }
+      })
+    },
+    handleUpdate(row) {
+      this.dataForm = Object.assign({}, row)
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    updateData() {
+      this.$refs['dataForm'].validate(valid => {
+        if (valid) {
+          this.submiting = true
+          updateCustomerBillingInfo(this.dataForm)
+            .then(() => {
+              for (const v of this.list) {
+                if (v.id === this.dataForm.id) {
+                  const index = this.list.indexOf(v)
+                  this.list.splice(index, 1, this.dataForm)
+                  break
+                }
+              }
+              this.dialogFormVisible = false
+              this.submiting = false
+              this.$notify.success({
+                title: '成功',
+                message: '更新成功'
+              })
+            })
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
+            })
+        }
+      })
+    },
+    deleteRow(index, rows) {
+      rows.splice(index, 1)
+    }
+  }
+}
+</script>
+<style lang="scss">
+.bg-left {
+  padding-left: 30px;
+}
+.bg-right {
+  padding-right: 10px;
+  text-align: right;
+}
+.bg-bottom {
+  margin: 15px 0px;
+}
+.title-style {
+  background: #f6f7fc;
+  border-radius: 5px;
+}
+.app-container {
+  // background: ;
+}
+.title::before {
+  content: "";
+  display: inline-block;
+  width: 5px;
+  height: 30px;
+  background: #5473e8;
+  position: absolute;
+  left: 0;
+}
+.position {
+  position: relative;
+}
+.small-title {
+  position: relative;
+  padding: 10px;
+  font-weight: 600;
+  margin: 20px 0;
+}
+.small-title::before {
+  position: absolute;
+  content: "";
+  display: block;
+  background: #5473e8;
+  width: 4px;
+  height: 14px;
+  left: 0px;
+  top: 13px;
+}
+.el-form {
+  padding: 0 40px;
+}
+.ws-info-table {
+  display: -webkit-box;
+  display: -ms-flexbox;
+  display: flex;
+  -ms-flex-wrap: wrap;
+  flex-wrap: wrap;
+  border-left: 1px solid #ccc;
+  border-top: 1px solid #ccc;
+  position: relative;
+  border-left: 0;
+  border-top: 0;
+}
+.input-width {
+  width: 200px;
+}
+</style>

+ 274 - 242
unimall-admin/src/views/customerBillingDetail/customerBillingDetail.vue

@@ -1,263 +1,295 @@
 <template>
-    <div class="app-container">
-        <!-- 查询和其他操作 -->
-        <div class="filter-container">
-            <el-button v-permission="['customerBillingDetail:customerbillingdetail:list']" class="filter-item"
-                type="primary" size="mini" icon="el-icon-search" @click="handleFilter">查找</el-button>
-            <el-button v-permission="['customerBillingDetail:customerbillingdetail:create']" class="filter-item"
-                type="primary" size="mini" icon="el-icon-edit" @click="handleCreate">添加</el-button>
-        </div>
+  <div class="app-container">
+    <!-- 查询和其他操作 -->
+    <div class="filter-container">
+      <el-button
+        v-permission="['customerBillingDetail:customerbillingdetail:list']"
+        class="filter-item"
+        type="primary"
+        size="mini"
+        icon="el-icon-search"
+        @click="handleFilter">查找</el-button>
+      <el-button
+        v-permission="['customerBillingDetail:customerbillingdetail:create']"
+        class="filter-item"
+        type="primary"
+        size="mini"
+        icon="el-icon-edit"
+        @click="handleCreate">添加</el-button>
+    </div>
 
-        <!-- 查询结果 -->
-        <el-table v-loading="listLoading" :data="list" size="small" element-loading-text="正在查询中。。。" border fit
-            highlight-current-row>
-            <el-table-column align="center" label="柜号" prop="cabinet No" />
-            <el-table-column align="center" label="到港日期" prop="arrivalDate" />
-            <el-table-column align="center" label="送货地点" prop="deliveryPlace" />
-            <el-table-column align="center" label="产品" prop="product" />
-            <el-table-column align="center" label="重量" prop="weight" />
-            <el-table-column align="center" label="清关费" prop="clearanceFee" />
-            <el-table-column align="center" label="清关成本" prop="clearanceCost" />
-            <el-table-column align="center" label="卡车" prop="truck" />
-            <el-table-column align="center" label="卡车成本" prop="truckCost" />
-            <el-table-column align="center" label="其他费用" prop="otherExpenses" />
-            <el-table-column align="center" label="其他成本" prop="otherCost" />
-            <el-table-column align="center" label="应付金额" prop="pricePayable" />
-            <el-table-column align="center" label="成本价格" prop="cost" />
-            <el-table-column align="center" label="备注1" prop="remarks" />
-            <el-table-column align="center" label="备注2" prop="remark" />
-            <el-table-column align="center" label="状态" prop="status" />
-            <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
-                <template slot-scope="scope">
-                    <el-button v-permission="['customerBillingDetail:customerbillingdetail:edit']" type="primary"
-                        size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
-                    <el-button v-permission="['customerBillingDetail:customerbillingdetail:delete']" type="danger"
-                        size="mini" @click="handleDelete(scope.row)">删除</el-button>
-                </template>
-            </el-table-column>
-        </el-table>
+    <!-- 查询结果 -->
+    <el-table
+      v-loading="listLoading"
+      :data="list"
+      size="small"
+      element-loading-text="正在查询中。。。"
+      border
+      fit
+      highlight-current-row>
+      <el-table-column align="center" label="柜号" prop="cabinetNo" />
+      <el-table-column align="center" label="到港日期" prop="arrivalDate" />
+      <el-table-column align="center" label="送货地点" prop="deliveryPlace" />
+      <el-table-column align="center" label="产品" prop="product" />
+      <el-table-column align="center" label="重量" prop="weight" />
+      <el-table-column align="center" label="清关费" prop="clearanceFee" />
+      <el-table-column align="center" label="清关成本" prop="clearanceCost" />
+      <el-table-column align="center" label="卡车" prop="truck" />
+      <el-table-column align="center" label="卡车成本" prop="truckCost" />
+      <el-table-column align="center" label="其他费用" prop="otherExpenses" />
+      <el-table-column align="center" label="其他成本" prop="otherCost" />
+      <el-table-column align="center" label="应付金额" prop="pricePayable" />
+      <el-table-column align="center" label="成本价格" prop="cost" />
+      <el-table-column align="center" label="备注1" prop="remarks" />
+      <el-table-column align="center" label="备注2" prop="remark" />
+      <el-table-column align="center" label="状态" prop="status" />
+      <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            v-permission="['customerBillingDetail:customerbillingdetail:edit']"
+            type="primary"
+            size="mini"
+            @click="handleUpdate(scope.row)">编辑</el-button>
+          <el-button
+            v-permission="['customerBillingDetail:customerbillingdetail:delete']"
+            type="danger"
+            size="mini"
+            @click="handleDelete(scope.row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
 
-        <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"
-            @pagination="getList" />
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="listQuery.page"
+      :limit.sync="listQuery.limit"
+      @pagination="getList" />
 
-        <!-- 添加或修改对话框 -->
-        <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
-            <el-form ref="dataForm" :rules="rules" :model="dataForm" status-icon label-position="left"
-                label-width="100px" style="width: 400px; margin-left:50px;">
-                <el-form-item label="id" prop="id" hidden>
-                    <el-input v-model="dataForm.id" />
-                </el-form-item>
-                <el-form-item label="柜号" prop="cabinetNo">
-                    <el-input v-model="dataForm.cabinetNo" />
-                </el-form-item>
-                <el-form-item label="到港日期" prop="arrivalDate">
-                    <el-input v-model="dataForm.arrivalDate" />
-                </el-form-item>
-                <el-form-item label="送货地点" prop="deliveryPlace">
-                    <el-input v-model="dataForm.deliveryPlace" />
-                </el-form-item>
-                <el-form-item label="产品" prop="product">
-                    <el-input v-model="dataForm.product" />
-                </el-form-item>
-                <el-form-item label="重量" prop="weight">
-                    <el-input v-model="dataForm.weight" />
-                </el-form-item>
-                <el-form-item label="清关费" prop="clearanceFee">
-                    <el-input v-model="dataForm.clearanceFee" />
-                </el-form-item>
-                <el-form-item label="清关成本" prop="clearanceCost">
-                    <el-input v-model="dataForm.clearanceCost" />
-                </el-form-item>
-                <el-form-item label="卡车" prop="truck">
-                    <el-input v-model="dataForm.truck" />
-                </el-form-item>
-                <el-form-item label="卡车成本" prop="truckCost">
-                    <el-input v-model="dataForm.truckCost" />
-                </el-form-item>
-                <el-form-item label="其他费用" prop="otherExpenses">
-                    <el-input v-model="dataForm.otherExpenses" />
-                </el-form-item>
-                <el-form-item label="其他成本" prop="otherCost">
-                    <el-input v-model="dataForm.otherCost" />
-                </el-form-item>
-                <el-form-item label="应付金额" prop="pricePayable">
-                    <el-input v-model="dataForm.pricePayable" />
-                </el-form-item>
-                <el-form-item label="成本价格" prop="cost">
-                    <el-input v-model="dataForm.cost" />
-                </el-form-item>
-                <el-form-item label="备注1" prop="remarks">
-                    <el-input v-model="dataForm.remarks" />
-                </el-form-item>
-                <el-form-item label="备注2" prop="remark">
-                    <el-input v-model="dataForm.remark" />
-                </el-form-item>
-                <el-form-item label="状态" prop="status">
-                    <el-input v-model="dataForm.status" />
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click="dialogFormVisible = false">取消</el-button>
-                <el-button v-if="dialogStatus == 'create'" :loading="submiting" type="primary" @click="createData">确定
-                </el-button>
-                <el-button v-else type="primary" :loading="submiting" @click="updateData">确定</el-button>
-            </div>
-        </el-dialog>
-    </div>
+    <!-- 添加或修改对话框 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
+      <el-form
+        ref="dataForm"
+        :rules="rules"
+        :model="dataForm"
+        status-icon
+        label-position="left"
+        label-width="100px"
+        style="width: 400px; margin-left:50px;">
+        <el-form-item label="id" prop="id" hidden>
+          <el-input v-model="dataForm.id" />
+        </el-form-item>
+        <el-form-item label="柜号" prop="cabinetNo">
+          <el-input v-model="dataForm.cabinetNo" />
+        </el-form-item>
+        <el-form-item label="到港日期" prop="arrivalDate">
+          <el-input v-model="dataForm.arrivalDate" />
+        </el-form-item>
+        <el-form-item label="送货地点" prop="deliveryPlace">
+          <el-input v-model="dataForm.deliveryPlace" />
+        </el-form-item>
+        <el-form-item label="产品" prop="product">
+          <el-input v-model="dataForm.product" />
+        </el-form-item>
+        <el-form-item label="重量" prop="weight">
+          <el-input v-model="dataForm.weight" />
+        </el-form-item>
+        <el-form-item label="清关费" prop="clearanceFee">
+          <el-input v-model="dataForm.clearanceFee" />
+        </el-form-item>
+        <el-form-item label="清关成本" prop="clearanceCost">
+          <el-input v-model="dataForm.clearanceCost" />
+        </el-form-item>
+        <el-form-item label="卡车" prop="truck">
+          <el-input v-model="dataForm.truck" />
+        </el-form-item>
+        <el-form-item label="卡车成本" prop="truckCost">
+          <el-input v-model="dataForm.truckCost" />
+        </el-form-item>
+        <el-form-item label="其他费用" prop="otherExpenses">
+          <el-input v-model="dataForm.otherExpenses" />
+        </el-form-item>
+        <el-form-item label="其他成本" prop="otherCost">
+          <el-input v-model="dataForm.otherCost" />
+        </el-form-item>
+        <el-form-item label="应付金额" prop="pricePayable">
+          <el-input v-model="dataForm.pricePayable" />
+        </el-form-item>
+        <el-form-item label="成本价格" prop="cost">
+          <el-input v-model="dataForm.cost" />
+        </el-form-item>
+        <el-form-item label="备注1" prop="remarks">
+          <el-input v-model="dataForm.remarks" />
+        </el-form-item>
+        <el-form-item label="备注2" prop="remark">
+          <el-input v-model="dataForm.remark" />
+        </el-form-item>
+        <el-form-item label="状态" prop="status">
+          <el-input v-model="dataForm.status" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false">取消</el-button>
+        <el-button v-if="dialogStatus == 'create'" :loading="submiting" type="primary" @click="createData">确定
+        </el-button>
+        <el-button v-else :loading="submiting" type="primary" @click="updateData">确定</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
 import {
-    listCustomerBillingDetail,
-    createCustomerBillingDetail,
-    updateCustomerBillingDetail,
-    deleteCustomerBillingDetail
+  listCustomerBillingDetail,
+  createCustomerBillingDetail,
+  updateCustomerBillingDetail,
+  deleteCustomerBillingDetail
 } from '@/api/customerBillingDetail'
 import Pagination from '@/components/Pagination'
 export default {
-    name: 'CustomerBillingDetail',
-    components: { Pagination },
-    data() {
-        return {
-            list: null,
-            total: 0,
-            listLoading: true,
-            listQuery: {
-                page: 1,
-                limit: 20
-            },
-            dataForm: {
-                id: undefined
-            },
-            dialogFormVisible: false,
-            submiting: false,
-            dialogStatus: '',
-            textMap: {
-                update: '编辑',
-                create: '创建'
-            },
-            rules: {
-            }
-        }
+  name: 'CustomerBillingDetail',
+  components: { Pagination },
+  data() {
+    return {
+      list: null,
+      total: 0,
+      listLoading: true,
+      listQuery: {
+        page: 1,
+        limit: 100
+      },
+      dataForm: {
+        id: undefined
+      },
+      dialogFormVisible: false,
+      submiting: false,
+      dialogStatus: '',
+      textMap: {
+        update: '编辑',
+        create: '创建'
+      },
+      rules: {
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    getList() {
+      this.listLoading = true
+      listCustomerBillingDetail(this.listQuery).then(response => {
+        this.list = response.data.data.items
+        this.total = response.data.data.total
+        this.listLoading = false
+      })
+        .catch(() => {
+          this.list = []
+          this.total = 0
+          this.listLoading = false
+        })
     },
-    created() {
-        this.getList()
+    handleFilter() {
+      this.listQuery.page = 1
+      this.getList()
     },
-    methods: {
-        getList() {
-            this.listLoading = true
-            listCustomerBillingDetail(this.listQuery).then(response => {
-                this.list = response.data.data.items
-                this.total = response.data.data.total
-                this.listLoading = false
-            })
-                .catch(() => {
-                    this.list = []
-                    this.total = 0
-                    this.listLoading = false
-                })
-        },
-        handleFilter() {
-            this.listQuery.page = 1
-            this.getList()
-        },
-        resetForm() {
-            this.dataForm = {
-                id: undefined
-            }
-        },
-        handleCreate() {
-            this.resetForm()
-            this.dialogStatus = 'create'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
-            })
-        },
-        createData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    createCustomerBillingDetail(this.dataForm).then(response => {
-                        this.list.unshift(response.data.data)
-                        this.dialogFormVisible = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '添加成功'
-                        })
-                        this.submiting = false
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
+    resetForm() {
+      this.dataForm = {
+        id: undefined
+      }
+    },
+    handleCreate() {
+      this.resetForm()
+      this.dialogStatus = 'create'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    createData() {
+      this.$refs['dataForm'].validate(valid => {
+        if (valid) {
+          this.submiting = true
+          createCustomerBillingDetail(this.dataForm).then(response => {
+            this.list.unshift(response.data.data)
+            this.dialogFormVisible = false
+            this.$notify.success({
+              title: '成功',
+              message: '添加成功'
             })
-        },
-        handleUpdate(row) {
-            this.dataForm = Object.assign({}, row)
-            this.dialogStatus = 'update'
-            this.dialogFormVisible = true
-            this.$nextTick(() => {
-                this.$refs['dataForm'].clearValidate()
+            this.submiting = false
+          })
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
             })
-        },
-        updateData() {
-            this.$refs['dataForm'].validate(valid => {
-                if (valid) {
-                    this.submiting = true
-                    updateCustomerBillingDetail(this.dataForm).then(() => {
-                        for (const v of this.list) {
-                            if (v.id === this.dataForm.id) {
-                                const index = this.list.indexOf(v)
-                                this.list.splice(index, 1, this.dataForm)
-                                break
-                            }
-                        }
-                        this.dialogFormVisible = false
-                        this.submiting = false
-                        this.$notify.success({
-                            title: '成功',
-                            message: '更新成功'
-                        })
-                    })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                }
+        }
+      })
+    },
+    handleUpdate(row) {
+      this.dataForm = Object.assign({}, row)
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.$nextTick(() => {
+        this.$refs['dataForm'].clearValidate()
+      })
+    },
+    updateData() {
+      this.$refs['dataForm'].validate(valid => {
+        if (valid) {
+          this.submiting = true
+          updateCustomerBillingDetail(this.dataForm).then(() => {
+            for (const v of this.list) {
+              if (v.id === this.dataForm.id) {
+                const index = this.list.indexOf(v)
+                this.list.splice(index, 1, this.dataForm)
+                break
+              }
+            }
+            this.dialogFormVisible = false
+            this.submiting = false
+            this.$notify.success({
+              title: '成功',
+              message: '更新成功'
             })
-        },
-        handleDelete(row) {
-            this.$confirm('此操作将永久删除该记录---' + row.id + '---, 是否继续?', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning'
-            }).then(() => {
-                deleteCustomerBillingDetail(row.id).then(response => {
-                    this.$notify.success({
-                        title: '成功',
-                        message: '删除成功'
-                    })
-                    const index = this.list.indexOf(row)
-                    this.list.splice(index, 1)
-                })
-                    .catch(response => {
-                        this.$notify.error({
-                            title: '失败',
-                            message: response.data.errmsg
-                        })
-                    })
-            }).catch(() => {
-                return false
+          })
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
             })
         }
+      })
+    },
+    handleDelete(row) {
+      this.$confirm('此操作将永久删除该记录---' + row.id + '---, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteCustomerBillingDetail(row.id).then(response => {
+          this.$notify.success({
+            title: '成功',
+            message: '删除成功'
+          })
+          const index = this.list.indexOf(row)
+          this.list.splice(index, 1)
+        })
+          .catch(response => {
+            this.$notify.error({
+              title: '失败',
+              message: response.data.errmsg
+            })
+          })
+      }).catch(() => {
+        return false
+      })
     }
+  }
 }
 </script>

+ 0 - 237
unimall-admin/src/views/customerInfo/customerInfo.vue

@@ -1,237 +0,0 @@
-<template>
-    <div class="app-container">
-        <!-- 查询和其他操作 -->
-        <div class="filter-container">
-                        <el-input
-                    v-model="listQuery.customer"
-                    clearable
-                    class="filter-item"
-                    size="small"
-                    style="width: 200px;"
-                    placeholder="请输入客户"
-            />
-            <el-button v-permission="['customerInfo:customerinfo:list']" class="filter-item" type="primary" size="mini" icon="el-icon-search" @click="handleFilter">查找</el-button>
-            <el-button v-permission="['customerInfo:customerinfo:create']" class="filter-item" type="primary" size="mini" icon="el-icon-edit" @click="handleCreate">添加</el-button>
-        </div>
-
-        <!-- 查询结果 -->
-        <el-table
-                v-loading="listLoading"
-                :data="list"
-                size="small"
-                element-loading-text="正在查询中。。。"
-                border
-                fit
-                highlight-current-row
-        >
-            <el-table-column align="center" label="客户" prop="customer" />
-            <el-table-column align="center" label="账户余额" prop="unpaid amount" />
-            <el-table-column align="center" label="备注" prop="remarks" />
-            <el-table-column align="center" label="状态" prop="status" />
-            <el-table-column align="center" label="操作" class-name="small-padding fixed-width">
-                <template slot-scope="scope">
-                    <el-button v-permission="['customerInfo:customerinfo:edit']" type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
-                    <el-button v-permission="['customerInfo:customerinfo:delete']" type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button>
-                </template>
-            </el-table-column>
-        </el-table>
-
-        <pagination
-                v-show="total>0"
-                :total="total"
-                :page.sync="listQuery.page"
-                :limit.sync="listQuery.limit"
-                @pagination="getList"
-        />
-
-        <!-- 添加或修改对话框 -->
-        <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible">
-            <el-form
-                    ref="dataForm"
-                    :rules="rules"
-                    :model="dataForm"
-                    status-icon
-                    label-position="left"
-                    label-width="100px"
-                    style="width: 400px; margin-left:50px;"
-            >
-                <el-form-item label="id" prop="id" hidden>
-                    <el-input v-model="dataForm.id" />
-                </el-form-item>
-                <el-form-item label="客户" prop="customer">
-                    <el-input v-model="dataForm.customer" />
-                </el-form-item>
-                <el-form-item label="账户余额" prop="unpaid amount">
-                    <el-input v-model="dataForm.unpaid amount" />
-                </el-form-item>
-                <el-form-item label="备注" prop="remarks">
-                    <el-input v-model="dataForm.remarks" />
-                </el-form-item>
-                <el-form-item label="状态" prop="status">
-                    <el-input v-model="dataForm.status" />
-                </el-form-item>
-            </el-form>
-            <div slot="footer" class="dialog-footer">
-                <el-button @click="dialogFormVisible = false">取消</el-button>
-                <el-button v-if="dialogStatus=='create'" :loading="submiting" type="primary" @click="createData">确定</el-button>
-                <el-button v-else type="primary" :loading="submiting" @click="updateData">确定</el-button>
-            </div>
-        </el-dialog>
-    </div>
-</template>
-
-<script>
-    import {
-        listCustomerInfo,
-        createCustomerInfo,
-        updateCustomerInfo,
-        deleteCustomerInfo
-    } from '@/api/customerInfo'
-    import Pagination from '@/components/Pagination'
-    export default {
-        name: 'CustomerInfo',
-        components: { Pagination },
-        data() {
-            return {
-                list: null,
-                total: 0,
-                listLoading: true,
-                listQuery: {
-                    page: 1,
-                    limit: 20
-                },
-                dataForm: {
-                    id: undefined
-                },
-                dialogFormVisible: false,
-                submiting: false,
-                dialogStatus: '',
-                textMap: {
-                    update: '编辑',
-                    create: '创建'
-                },
-                rules: {
-                }
-            }
-        },
-        created() {
-            this.getList()
-        },
-        methods: {
-            getList() {
-                this.listLoading = true
-                listCustomerInfo(this.listQuery).then(response => {
-                    this.list = response.data.data.items
-                    this.total = response.data.data.total
-                    this.listLoading = false
-                })
-                .catch(() => {
-                    this.list = []
-                    this.total = 0
-                    this.listLoading = false
-                })
-            },
-            handleFilter() {
-                this.listQuery.page = 1
-                this.getList()
-            },
-            resetForm() {
-                this.dataForm = {
-                    id: undefined
-                }
-            },
-            handleCreate() {
-                this.resetForm()
-                this.dialogStatus = 'create'
-                this.dialogFormVisible = true
-                this.$nextTick(() => {
-                    this.$refs['dataForm'].clearValidate()
-                })
-            },
-            createData() {
-                this.$refs['dataForm'].validate(valid => {
-                    if (valid) {
-                        this.submiting = true
-                        createCustomerInfo(this.dataForm).then(response => {
-                            this.list.unshift(response.data.data)
-                            this.dialogFormVisible = false
-                            this.$notify.success({
-                                title: '成功',
-                                message: '添加成功'
-                            })
-                            this.submiting = false
-                        })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                    }
-                })
-            },
-            handleUpdate(row) {
-                this.dataForm = Object.assign({}, row)
-                this.dialogStatus = 'update'
-                this.dialogFormVisible = true
-                this.$nextTick(() => {
-                    this.$refs['dataForm'].clearValidate()
-                })
-            },
-            updateData() {
-                this.$refs['dataForm'].validate(valid => {
-                    if (valid) {
-                        this.submiting = true
-                        updateCustomerInfo(this.dataForm).then(() => {
-                            for (const v of this.list) {
-                                if (v.id === this.dataForm.id) {
-                                    const index = this.list.indexOf(v)
-                                    this.list.splice(index, 1, this.dataForm)
-                                    break
-                                }
-                            }
-                            this.dialogFormVisible = false
-                            this.submiting = false
-                            this.$notify.success({
-                                title: '成功',
-                                message: '更新成功'
-                            })
-                        })
-                        .catch(response => {
-                            this.$notify.error({
-                                title: '失败',
-                                message: response.data.errmsg
-                            })
-                            this.submiting = false
-                        })
-                    }
-                })
-            },
-            handleDelete(row) {
-                this.$confirm('此操作将永久删除该记录---' + row.id + '---, 是否继续?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    deleteCustomerInfo(row.id).then(response => {
-                        this.$notify.success({
-                            title: '成功',
-                            message: '删除成功'
-                        })
-                        const index = this.list.indexOf(row)
-                        this.list.splice(index, 1)
-                    })
-                    .catch(response => {
-                        this.$notify.error({
-                            title: '失败',
-                            message: response.data.errmsg
-                        })
-                    })
-                }).catch(() => {
-                    return false
-                })
-            }
-        }
-    }
-</script>