wangchao 2 rokov pred
rodič
commit
3574f0c3f7

+ 13 - 5
src/api/V2/speedGoods.js

@@ -2,8 +2,16 @@
 const baseUrl = process.env.VUE_APP_API_NEWS
 
 
-// 极速版货名list
-export const API_GET_SPEEDGOODSLIST = `${baseUrl}/speedGoodsInfo/selectInfo`
-export const API_GET_SPEEDGOODSADD = `${baseUrl}/speedGoodsInfo/api/addInfo`
-export const api_speedPositionInfoList = `${baseUrl}/speedPositionInfo/selectInfo`
-export const api_speedPositionInfoAdd = `${baseUrl}/speedPositionInfo/api/addInfo `
+// 货名
+export const api_speedGoodsList = `/speedGoodsInfo/selectInfo`
+export const api_speedGoodsAdd = `/speedGoodsInfo/api/addInfo`
+export const api_speedGoodsEdit = `/speedGoodsInfo/api/editInfo`
+export const api_speedGoodsDel = `/speedGoodsInfo/api/deleteInfo`
+
+//仓位
+export const api_speedPositionInfoList = `/speedPositionInfo/selectInfo`
+export const api_speedPositionInfoAdd = `/speedPositionInfo/api/addInfo `
+
+//客户
+export const api_speedCustomerInfoList = `/speedCustomerInfo/selectInfo`
+export const api_speedCustomerInfoAdd = `/speedCustomerInfo/api/addInfo `

+ 10 - 4
src/model/speedGoods.js

@@ -1,13 +1,19 @@
 
-import { API_GET_SPEEDGOODSLIST,API_GET_SPEEDGOODSADD,api_speedPositionInfoList,api_speedPositionInfoAdd } from '@/api/V2/speedGoods'
+import { api_speedGoodsList,api_speedGoodsAdd,api_speedPositionInfoList,api_speedPositionInfoAdd,api_speedCustomerInfoList ,api_speedCustomerInfoAdd,api_speedGoodsEdit,api_speedGoodsDel} from '@/api/V2/speedGoods'
 import { errorCatcher, errorHandle, filter } from 'base-core-lib'
 import { appRx } from './defalutConfig/indexRx'
 
-export const speedGoodsList = appRx.get(API_GET_SPEEDGOODSLIST, errorCatcher, errorHandle, filter)
-export const speedGoodsAdd = appRx.post(API_GET_SPEEDGOODSADD, errorCatcher, errorHandle, filter)
-
+// 货名
+export const speedGoodsList = appRx.get(api_speedGoodsList, errorCatcher, errorHandle, filter)
+export const speedGoodsAdd = appRx.post(api_speedGoodsAdd, errorCatcher, errorHandle, filter)
+export const speedGoodsEdit = appRx.post(api_speedGoodsEdit, errorCatcher, errorHandle, filter)
+export const speedGoodsDel = appRx.post(api_speedGoodsDel, errorCatcher, errorHandle, filter)
 
+//仓位
 export const speedPositionInfoList = appRx.get(api_speedPositionInfoList, errorCatcher, errorHandle, filter)
 export const speedPositionInfoAdd = appRx.post(api_speedPositionInfoAdd, errorCatcher, errorHandle, filter)
 
+//客户
+export const speedCustomerInfoList = appRx.get(api_speedCustomerInfoList, errorCatcher, errorHandle, filter)
+export const speedCustomerInfoAdd = appRx.post(api_speedCustomerInfoAdd, errorCatcher, errorHandle, filter)
 

+ 45 - 33
src/views/customer/customer.vue

@@ -9,18 +9,18 @@
         <el-button type="primary" size="small" @click="add()">添加</el-button>
       </div>
     </div>
-    <el-table ref="singleTable" :data="tableData" highlight-current-row style="width: 100%" class="table">
+    <el-table ref="singleTable" :data="speedCustomerInfoList" highlight-current-row style="width: 100%" class="table">
       <el-table-column type="index" width="50">
       </el-table-column>
-      <el-table-column property="date" label="姓名" width="120">
+      <el-table-column property="customerName" label="姓名" width="120">
       </el-table-column>
-      <el-table-column property="name" label="手机号" width="120">
+      <el-table-column property="customerPhone" label="手机号" width="120">
       </el-table-column>
-      <el-table-column property="address" label="银行卡号">
+      <el-table-column property="bankCard" label="银行卡号">
       </el-table-column>
-      <el-table-column property="address" label="开户行">
+      <el-table-column property="bankDeposit" label="开户行">
       </el-table-column>
-      <el-table-column property="address" label="开户支行">
+      <el-table-column property="bankDepositBranch" label="开户支行">
       </el-table-column>
       <el-table-column prop="address" label="操作" show-overflow-tooltip>
         <template scope="scope">
@@ -37,19 +37,19 @@
     <el-dialog width="320px" title="客户" :visible.sync="isShowInventory" :append-to-body="true" :close="inventoryClose">
       <el-form class="customer" label-position="right" label-width="80px">
         <el-form-item class="customer-item" label="姓名">
-          <el-input disabled placeholder="请输入身份证号" maxlength="100" size="small" />
+          <el-input placeholder="请输入姓名" maxlength="100" size="small"  v-model="dataObj.customerName"/>
         </el-form-item>
         <el-form-item class="customer-item" label="手机号">
-          <el-input disabled placeholder="请输入身份证号" maxlength="100" size="small" />
+          <el-input placeholder="请输入手机号" maxlength="100" size="small" v-model="dataObj.customerPhone"/>
         </el-form-item>
         <el-form-item class="customer-item" label="银行卡号">
-          <el-input disabled placeholder="请输入身份证号" maxlength="100" size="small" />
+          <el-input placeholder="请输入银行卡号" maxlength="100" size="small"  v-model="dataObj.bankCard"/>
         </el-form-item>
         <el-form-item class="customer-item" label="开户行">
-          <el-input disabled placeholder="请输入身份证号" maxlength="100" size="small" />
+          <el-input placeholder="请输入开户行" maxlength="100" size="small"  v-model="dataObj.bankDeposit"/>
         </el-form-item>
         <el-form-item class="customer-item" label="开户支行">
-          <el-input disabled placeholder="请输入身份证号" maxlength="100" size="small" />
+          <el-input placeholder="请输入开户支行" maxlength="100" size="small"  v-model="dataObj.bankDepositBranch"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -62,41 +62,28 @@
 
 <script>
 import {
-  gChartsData,
-} from '@/model/home/index'
-// import CenterMap from "./center-map.vue";
+  speedCustomerInfoList,
+  speedCustomerInfoAdd
+} from '@/model/speedGoods'
 export default {
   components: {
   },
   data() {
     return {
+      dataObj:{
+        compId: localStorage.getItem('ws-pf_compId')
+      },
       deptCircularPage: {},
       deptBudgetTotal: 0,
       currentPage: 1,
       pageSize: 10,
-      tableData: [{
-        date: '2016-05-02',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1518 弄'
-      }, {
-        date: '2016-05-04',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1517 弄'
-      }, {
-        date: '2016-05-01',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1519 弄'
-      }, {
-        date: '2016-05-03',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1516 弄'
-      }],
-      currentRow: null,
+      speedCustomerInfoList: [],
       searchKeyWord: '',
       isShowInventory: false,
     };
   },
   created() {
+    this.getList()
   },
   mounted() {
 
@@ -107,6 +94,20 @@ export default {
 
   },
   methods: {
+    getList() {
+      speedCustomerInfoList({
+        compId: localStorage.getItem('ws-pf_compId'),
+        currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            searchKeyWord: this.searchKeyWord,
+      })
+        .toPromise()
+        .then((response) => {
+          console.log(response)
+          this.deptBudgetTotal = response.total
+          this.speedCustomerInfoList = response.records
+        })
+    },
     handleSizeChange(val) {
       console.log(`每页 ${val} 条`)
       this.pageSize = val
@@ -135,7 +136,18 @@ export default {
     add() {
       this.isShowInventory = true
     },
-    customerConfirm() { }
+    customerConfirm() { 
+      speedCustomerInfoAdd(this.dataObj)
+        .toPromise()
+        .then((response) => {
+          console.log(response)
+          if(response.code=="200"){
+            this.$message.success('提交成功!')
+            this.isShowInventory = false
+            this.getList()
+          }
+        })
+    }
   },
 };
 </script>

+ 33 - 9
src/views/setup/goodsSettings.vue

@@ -25,10 +25,7 @@
         </template>
       </el-table-column>
     </el-table>
-    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-      :page-size="deptCircularPage.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="deptBudgetTotal">
-    </el-pagination>
-    <el-dialog width="320px" :title="goodSNameTitle" :visible.sync="show" :append-to-body="true" :close="inventoryClose">
+    <el-dialog width="320px" :title="goodsNameTitle" :visible.sync="show" :append-to-body="true" :close="inventoryClose">
       <el-form class="goodsName" label-position="right" label-width="80px">
         <el-form-item class="customer-item" label="货名">
           <el-input placeholder="请输入货名" maxlength="100" size="small" v-model="dataObj.goodsName" />
@@ -44,16 +41,18 @@
 <script>
 import {
   speedGoodsList,
-  speedGoodsAdd
+  speedGoodsAdd,
+  speedGoodsEdit
 } from '@/model/speedGoods'
 export default {
   components: {
   },
   data() {
     return {
-      goodSNameTitle:'新增',
+      goodsNameTitle:'新增',
       dataObj: {
-        compId: localStorage.getItem('ws-pf_compId')
+        compId: localStorage.getItem('ws-pf_compId'),
+        goodsName:''
       },
       deptCircularPage: {},
       deptBudgetTotal: 0,
@@ -108,23 +107,48 @@ export default {
     add() {
       this.show = true
     },
-    eidt() { },
+    edit(val) {
+      console.log(val)
+      this.goodsNameTitle = "编辑"
+      this.dataObj = val
+      this.show = true
+     },
     del(val) {
       this.$confirm('确定删除货名?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
+
+        
       }).catch(() => {
         return false
       });
     },
     goodsNameConfirm() {
-      speedGoodsAdd(this.dataObj)
+      if(this.goodsNameTitle=='新增'){
+        speedGoodsAdd(this.dataObj)
+        .toPromise()
+        .then((response) => {
+          if(response.code=="200"){
+            this.show = false
+            this.getList()
+          }
+          console.log(response)
+        })
+      }else{
+        speedGoodsEdit(this.dataObj)
         .toPromise()
         .then((response) => {debugger
+          if(response=="ok"){
+            this.show = false
+            this.$message.success('操作成功!')
+            this.getList()
+          }
           console.log(response)
         })
+      }
+
     }
   },
 };