Ver código fonte

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-pc

gjy 4 anos atrás
pai
commit
75eca29b67

+ 1 - 1
.env.production

@@ -4,7 +4,7 @@
 
 NODE_ENV = 'production'
 # base api
-VUE_APP_BASE_API = 'https://192.168.1.100:8090/'
+VUE_APP_BASE_API = 'http://127.0.0.1:9100/'
 
 # 微服务相关接口配置
 ## 任务消息

+ 1 - 1
package-lock.json

@@ -19313,7 +19313,7 @@
       }
     },
     "winsea-component-library": {
-      "version": "http://47.101.10.107:8081/repository/npm-hossted/winsea-component-library/-/winsea-component-library-1.0.1.tgz",
+      "version": "http://maven.zthymaoyi.com/nexus/repository/npm-hosted/winsea-component-library/-/winsea-component-library-1.0.1.tgz",
       "integrity": "sha512-qRQ4BPiIsFj6QqoJIBDiC+IniGkTBhrpyjXRhp/TWTG/s1igUjn9D4acCmkeCsFRgevvlkDfEme0Na8tmhmtDg==",
       "requires": {
         "ali-oss": "^6.5.1",

+ 2 - 1
package.json

@@ -49,6 +49,7 @@
     "base-template-lib": "^1.0.7-beta",
     "countup": "^1.8.2",
     "echarts": "4.2.1",
+    "element-china-area-data": "^5.0.2",
     "element-ui": "^2.13.2",
     "form-making-advanced": "^1.2.6",
     "js-cookie": "2.2.0",
@@ -72,7 +73,7 @@
     "vue-seamless-scroll": "^1.1.17",
     "vuedraggable": "2.20.0",
     "vuex": "3.1.0",
-    "winsea-component-library": "http://47.101.10.107:8081/repository/npm-hossted/winsea-component-library/-/winsea-component-library-1.0.1.tgz",
+    "winsea-component-library": "http://maven.zthymaoyi.com/nexus/repository/npm-hosted/winsea-component-library/-/winsea-component-library-1.0.1.tgz",
     "winseaview": "^2.5.11",
     "xe-utils": "^2.3.0"
   },

+ 1 - 2
src/api/V2/warehouse/index.js

@@ -1,9 +1,8 @@
 export const API_GET_WAREHOUSE_BASEINFO = '/warehouseBaseInfo/selectWarehouseViewinfo'
-
+export const API_POST_ADD_WAREHOUSE_BASEINFO = '/warehouseBaseInfo/api/addWarehouse'
 //仓库列表查看
 export const API_GET_WAREHOUSE_LOOK = '/warehouseBaseInfo/getWarehouse'
 //仓库名称下拉
 export const API_GET_WAREHOUSE_CUSTOMDROPDOWN = '/warehouseBaseInfo/selectWarehouse'
 
 export const API_GET_WAREHOUSE_DELETE = '/warehouseBaseInfo/api/deleteWarehouse'
-

+ 3 - 2
src/components/mapdrag/mapdrag.vue

@@ -118,9 +118,9 @@ export default {
       this.map.on('click', function (e) {
         var marker = new AMap.Marker({
           position: new AMap.LngLat(e.lnglat.getLng(), e.lnglat.getLat()), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
-          title: '北京',
         })
         that.map.remove(that.markers)
+        that.$emit('marker', e)
         that.markers.push(marker)
         // 将创建的点标记添加到已有的地图实例:
         that.map.add(marker)
@@ -150,6 +150,7 @@ export default {
             that.marker.setPosition(e.poi.location)
             placeSearch.search() // 关键字查询查询
             geocoder.getAddress(e.poi.location, function (status, result) {
+              console.log(status)
               if (status === 'complete') {
                 var obj = {}
                 that.province = result.regeocode.addressComponent.province
@@ -235,8 +236,8 @@ export default {
         }
         var district = new AMap.DistrictSearch(opts) // 注意:需要使用插件同步下发功能才能这样直接使用
         function getData(data) {
+          that.$emit('selectedAddress', data)
           // 清除地图上的所有覆盖物
-          // console.log(data)
           that.areacode = data.citycode
           var bounds = data.boundaries
           if (data.level === 'country') {

+ 4 - 2
src/model/warehouse/index.js

@@ -2,16 +2,18 @@ import { errorCatcher, errorHandle, filter } from 'base-core-lib'
 import { appRx } from '../defalutConfig/indexRx'
 import {
     API_GET_WAREHOUSE_BASEINFO,
+    API_POST_ADD_WAREHOUSE_BASEINFO,
     API_GET_WAREHOUSE_LOOK,
     API_GET_WAREHOUSE_CUSTOMDROPDOWN,
     API_GET_WAREHOUSE_DELETE,
 } from '@/api/V2/warehouse'
 // 列表
 export const getList = appRx.get(API_GET_WAREHOUSE_BASEINFO, errorCatcher, errorHandle, filter)
+// 添加
+export const addList = appRx.post(API_POST_ADD_WAREHOUSE_BASEINFO, errorCatcher, errorHandle, filter)
 //仓库查看
-export const getLook = appRx.get( API_GET_WAREHOUSE_LOOK, errorCatcher, errorHandle, filter)
+export const getLook = appRx.get(API_GET_WAREHOUSE_LOOK, errorCatcher, errorHandle, filter)
 //仓库下拉
 export const xiala = appRx.get( API_GET_WAREHOUSE_CUSTOMDROPDOWN, errorCatcher, errorHandle, filter)
 //删除
 export const deletewarehouse = appRx.get(API_GET_WAREHOUSE_DELETE, errorCatcher, errorHandle, filter)
-

+ 91 - 169
src/views/warehouse/warehouseManagementAdd.vue

@@ -37,7 +37,7 @@ npm install vue-amap --save// 仓库添加
           class="readonly"
         >
           <ws-input
-            v-model="deptBudgetList.contractNo"
+            v-model="deptBudgetList.warehouseName"
             placeholder="请输入仓库名"
             maxlength="20"
             size="small"
@@ -46,7 +46,7 @@ npm install vue-amap --save// 仓库添加
         <!--负责人-->
         <ws-form-item label="负责人" span="1" prop="buyer" class="readonly">
           <ws-input
-            v-model="deptBudgetList.buyer"
+            v-model="deptBudgetList.personCharge"
             placeholder="请输入负责人姓名"
             maxlength="100"
             size="small"
@@ -56,7 +56,7 @@ npm install vue-amap --save// 仓库添加
         <!--负责人电话-->
         <ws-form-item label="负责人电话" span="1" prop="shippingType">
           <ws-input
-            v-model="deptBudgetList.shippingType"
+            v-model="deptBudgetList.personPhone"
             placeholder="请输入负责人手机号码"
             maxlength="100"
             size="small"
@@ -65,79 +65,26 @@ npm install vue-amap --save// 仓库添加
 
         <!--仓库所在地-->
         <ws-form-item label="仓库所在地" span="1" prop="acceptanceMethod">
-          <el-select
-            v-model="deptBudgetList.acceptanceMethod"
-            placeholder="请选择仓库所在地"
-            style="width: 100%"
-            filterable
-            @change="selectunitList"
-          >
-            <el-option
-              v-for="(item, index) in unitList"
-              :key="item.constValue"
-              :label="item.constValue"
-              :value="item.constValue"
-            >
-              <span class="unit-left" style="float: left">
-                <span v-if="item.flag == 'delete'"> {{ item.constValue }}</span>
-                <!-- 新增文本框 -->
-                <div
-                  style="width: 160px"
-                  v-if="item.flag !== 'delete'"
-                  @click.stop
-                >
-                  <ws-input
-                    v-model="item.constValue"
-                    clearable
-                    maxlength="10"
-                    style="width: 100%"
-                  ></ws-input>
-                </div>
-              </span>
-              <span style="float: right; color: #8492a6; font-size: 13px">
-                <!-- 对号 -->
-                <i
-                  class="el-icon-check"
-                  style="line-height: 29px; margin-left: 10px"
-                  v-if="item.flag !== 'delete'"
-                  @click.stop="saveClick(item, index)"
-                ></i>
-                <!-- 编辑 -->
-                <i
-                  class="el-icon-edit"
-                  style="line-height: 29px; margin-left: 10px"
-                  v-if="item.flag == 'delete'"
-                  @click.stop="editClick(item, index)"
-                ></i>
-                <!-- 删除 -->
-                <i
-                  class="el-icon-delete"
-                  style="line-height: 29px"
-                  @click.stop="deleteClick(item, index)"
-                ></i>
-              </span>
-            </el-option>
-            <!-- 新增按钮 -->
-            <el-option value="" label="">
-              <div
-                style="
-                  text-align: right;
-                  border-top: 1px solid #dcdfe6;
-                  padding: 5px;
-                "
-              >
-                <ws-button type="primary" @click.stop="addClick">{{
-                  $t('button.add')
-                }}</ws-button>
-              </div>
-            </el-option>
-          </el-select>
+          <el-cascader
+            :options="options_"
+            v-model="selectedOptions"
+            clearable
+            size="large"
+            placeholder="请选择交货地"
+            style="width: 200%"
+            @change="handleChange"
+          />
         </ws-form-item>
 
         <!--详细地址-->
-        <ws-form-item label="详细地址" span="1" prop="buyer" class="readonly">
+        <ws-form-item
+          label="详细地址"
+          span="1"
+          prop="detailedAddress"
+          class="readonly"
+        >
           <ws-input
-            v-model="deptBudgetList.buyer"
+            v-model="deptBudgetList.detailedAddress"
             placeholder="请输入详细地址"
             maxlength="100"
             size="small"
@@ -147,12 +94,17 @@ npm install vue-amap --save// 仓库添加
         <!--总吨量(吨)-->
         <ws-form-item label="总吨量(吨)" span="1" prop="settlementMethod">
           <ws-input
-            v-model="deptBudgetList.settlementMethod"
+            :readonly="true"
+            v-model="totalStorage"
             maxlength="100"
             size="small"
           />
         </ws-form-item>
-        <div style="width: 100%" class="flex" v-for="item in freightspace">
+        <div
+          style="width: 100%"
+          class="flex position"
+          v-for="(item, index) in freightspace"
+        >
           <ws-form-item
             label="仓库编号"
             span="1"
@@ -166,7 +118,7 @@ npm install vue-amap --save// 仓库添加
               size="small"
             />
           </ws-form-item>
-          <ws-form-item label="仓位储(吨)" span="1" prop="contractNo">
+          <ws-form-item label="仓位储(吨)" span="1" prop="contractNo">
             <ws-input
               v-model="item.maxStorage"
               placeholder="请输入仓位最大容量"
@@ -183,23 +135,24 @@ npm install vue-amap --save// 仓库添加
               size="small"
             />
           </ws-form-item>
+          <img
+            width="22"
+            height="22"
+            class="add"
+            @click="add"
+            src="../../../public/img/add.png"
+            alt=""
+          />
+          <img
+            width="22"
+            height="22"
+            class="del"
+            @click="del(index)"
+            src="../../../public/img/del.png"
+            alt=""
+          />
         </div>
       </ws-info-table>
-      <img
-        width="22"
-        height="22"
-        class="add"
-        @click="add"
-        src="../../../public/img/add.png"
-        alt=""
-      />
-      <img
-        width="22"
-        height="22"
-        class="del"
-        src="../../../public/img/del.png"
-        alt=""
-      />
     </ws-form>
     <ws-form ref="deptBudgetList" :model="deptBudgetList">
       <ws-upload
@@ -216,7 +169,7 @@ npm install vue-amap --save// 仓库添加
       />
     </ws-form>
     <!-- <ws-button @click="exportlist()"></ws-button> -->
-    <map-drag></map-drag>
+    <map-drag @marker="marker" @selectedAddress="selectedAddress"></map-drag>
     <!-- 提交 -->
     <div style="text-align: right; padding: 10px" class="center">
       <el-button
@@ -232,6 +185,7 @@ npm install vue-amap --save// 仓库添加
 <script>
 //  import { getVesselOne } from '@/model/procurement/basic'
 //  import { dayjs } from 'base-core-lib'
+import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
 import {
   packList,
   addList,
@@ -239,7 +193,7 @@ import {
   addxiala,
   editxiala,
   delxiala,
-} from '@/model/contarct/index'
+} from '@/model/warehouse/index'
 import WsUpload from '@/components/WsUpload'
 import mapDrag from '@/components/mapdrag/mapdrag'
 export default {
@@ -259,9 +213,13 @@ export default {
   data() {
     let self = this
     return {
-      deptBudgetList: {},
+      deptBudgetList: {
+        totalStorage: 0,
+      },
+      options_: regionData,
       heightData: '600px',
       zoom: 7,
+      selectedOptions: [],
       center: [116.244694, 39.517344],
       window: '',
       polygons: [
@@ -296,81 +254,28 @@ export default {
       name: '',
     }
   },
-  activated() {
-    setTimeout(() => {
-      this.drawBounds()
-    }, 200)
+  activated() {},
+  computed: {
+    totalStorage: function () {
+      var maxStorage = 0
+      for (var i = 0; i < this.freightspace.length; i++) {
+        maxStorage += Number(this.freightspace[i].maxStorage)
+      }
+      return maxStorage
+    },
   },
   methods: {
+    marker: function (item) {
+      this.deptBudgetList.warehousePositioning =
+        item.lnglat.lat + ',' + item.lnglat.lng
+    },
+    selectedAddress(e) {
+      this.deptBudgetList.warehousePositioning =
+        e.center.lat + ',' + e.center.lng
+    },
     confirmPositioncity() {
       this.listDate.level = 'city'
       this.listDate.country = this.name
-      this.drawBounds()
-    },
-    drawBounds() {
-      var that = this
-      // 加载
-      AMap.plugin('AMap.DistrictSearch', function () {
-        var districtSearch = new AMap.DistrictSearch({
-          // 关键字对应的行政区级别,country表示国家
-          level: that.listDate.level,
-          //  显示下级行政区级数,1表示返回下一级行政区
-          subdistrict: 1,
-        })
-        // 搜索所有省/直辖市信息
-        districtSearch.search(that.listDate.country, function (status, result) {
-          if (that.listDate.level == 'country') {
-            that.citylist = result.districtList[0].districtList
-          }
-          // 查询成功时,result即为对应的行政区信息
-        })
-      })
-      var geocoder = new AMap.Geocoder({
-        radius: 1000,
-        extensions: 'all',
-        city: '全国',
-      })
-      geocoder.getLocation(that.listDate.countrys, (status, result) => {
-        if (status === 'complete' && result.geocodes.length) {
-          let lnglat = result.geocodes[0].location
-          self.lng = lnglat.lng
-          self.lat = lnglat.lat
-          self.center = [self.lng, self.lat]
-        }
-      })
-      // console.log(that.district)
-      if (!that.district) {
-        //实例化DistrictSearch
-        var opts = {
-          subdistrict: 0, //获取边界不需要返回下级行政区
-          extensions: 'all', //返回行政区边界坐标组等具体信息
-          level: that.listDate.level, //查询行政级别为 市
-        }
-        that.district = new AMap.DistrictSearch(opts)
-      }
-      //行政区查询
-      let code = that.listDate.country + ''
-      // that.district.search(code, function (status, result) {
-      // console.log(result)
-      that.polygons = []
-      // var bounds = result.districtList[0].boundaries
-      //   if (bounds) {
-      //     for (var i = 0, l = bounds.length; i < l; i++) {
-      //       //生成行政区划polygon
-      //       var polygon = new AMap.Polygon({
-      //         strokeWeight: 1,
-      //         path: bounds[i],
-      //         fillOpacity: 0.4,
-      //         fillColor: '#80d8ff',
-      //         strokeColor: '#0091ea',
-      //       })
-      //       that.polygons.push(polygon)
-      //     }
-      //   }
-      //   console.log('polygons')
-      //   AMap.Polygon.bind(that.polygons)
-      //   that.$refs.map.$amap.setFitView(that.polygons) //视口自适应
-      // })
     },
     // 关闭 dialog时 处理文件url 初始化upload组件
     handleClose() {
@@ -383,6 +288,14 @@ export default {
         remark: '',
       })
     },
+    del(index) {
+      if (this.freightspace.length > 1) {
+        this.freightspace.splice(index, 1)
+      }
+    },
+    handleChange(value) {
+      this.selectedOptions = value
+    },
     returnsales() {
       this.$router.push({ path: 'purchaseContract' })
     },
@@ -408,15 +321,24 @@ export default {
     },
 
     submit() {
+      console.log(this.freightspace)
+
       this.$refs.deptBudgetList.validate((valid) => {
         if (valid) {
-          this.deptBudgetList.compId = this.compId
-          this.deptBudgetList.contractType = 2
+          this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
+          this.deptBudgetList.warehousePrivate =
+            CodeToText[this.selectedOptions[0]]
+          this.deptBudgetList.warehouseCity =
+            CodeToText[this.selectedOptions[1]]
+          this.deptBudgetList.warehouseArea =
+            CodeToText[this.selectedOptions[2]]
+          this.deptBudgetList.warehousePositionInfoList = this.freightspace
+          this.deptBudgetList.totalStorage = this.totalStorage
           addList(this.deptBudgetList)
             .toPromise()
             .then((response) => {
               this.$message.success('添加成功')
-              this.$router.push({ path: 'salesContract' })
+              this.$router.push({ path: 'warehouseManagementList' })
             })
         } else {
           EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
@@ -553,12 +475,12 @@ export default {
 .add,
 .del {
   position: absolute;
-  right: 167px;
-  top: 94px;
+  right: -38px;
+  top: 9px;
   cursor: pointer;
 }
 .del {
-  right: 140px;
+  right: -70px;
 }
 .amap-page-container {
   width: 300px;

+ 21 - 29
src/views/warehouse/warehouseManagementList.vue

@@ -70,20 +70,20 @@
     <div class="connert">
       <el-table
         class="wenzi"
-        :data="contractList.records"
+        :data="warehouseList"
         style="width: 100%; margin-top: 20px"
         height="780"
       >
-        <el-table-column prop="contractNo" label="仓库名" width="80">
+        <el-table-column prop="warehouseName" label="库房名" width="80">
         </el-table-column>
-        <el-table-column prop="goodsName" label="仓库编号" width="80">
+        <el-table-column prop="binNumber" label="仓位编号" width="80">
         </el-table-column>
-        <el-table-column prop="weight" label="容量(吨)"> </el-table-column>
-        <el-table-column prop="unitContractPrice" label="入库量(吨)">
+        <el-table-column prop="capacity" label="容量(吨)"> </el-table-column>
+        <el-table-column prop="inNetWeight" label="入库量(吨)">
         </el-table-column>
-        <el-table-column prop="packingMethod" label="出库量(吨)">
+        <el-table-column prop="outNetWeight" label="出库量(吨)">
         </el-table-column>
-        <el-table-column prop="buyer" label="应余量(吨)"> </el-table-column>
+        <el-table-column prop="storage" label="应余量(吨)"> </el-table-column>
         <el-table-column prop="seller" label="出入库" width="160">
           <button
             type="primary"
@@ -194,7 +194,7 @@ export default {
         year: dayjs().format('YYYY'),
         month: dayjs().format('MM'),
       },
-      contractList: [],
+      warehouseList: [],
       deptBudgetList: {},
       historyList: [],
       pickerBeginDateBefore: {
@@ -286,30 +286,22 @@ export default {
     getList() {
       getList({
         compId: sessionStorage.getItem('ws-pf_compId'),
-        contractType: this.contractType,
-        currentPage: this.currentPage,
-        pageSize: this.pageSize,
-        searchType: this.searchType,
-        searchKeyWord: this.searchKeyWord,
-        startDate: this.startDate,
-        endDate: this.endDate,
-        contrPage: this.contrPage,
       })
         .toPromise()
         .then((response) => {
-          for (var i = 0; i < response.records.length; i++) {
-            if (response.records[i].addressUrl != null) {
-              response.records[i].addressUrlArray = response.records[
-                i
-              ].addressUrl.split(',')
-            } else {
-              response.records[i].addressUrlArray = []
-            }
-          }
-          this.deptCircularPage.currentPage = response.current
-          this.deptCircularPage.pageSize = response.size
-          this.deptBudgetTotal = response.total
-          this.contractList = response
+          // for (var i = 0; i < response.records.length; i++) {
+          //   if (response.records[i].addressUrl != null) {
+          //     response.records[i].addressUrlArray = response.records[
+          //       i
+          //     ].addressUrl.split(',')
+          //   } else {
+          //     response.records[i].addressUrlArray = []
+          //   }
+          // }
+          // this.deptCircularPage.currentPage = response.current
+          // this.deptCircularPage.pageSize = response.size
+          // this.deptBudgetTotal = response.total
+          this.warehouseList = response
         })
     },
     editClick(row) {

+ 14 - 6
src/views/warehouse/warehouseManagementLook.vue

@@ -32,10 +32,10 @@
               @change="selectpackingMethod"
             >
               <ws-option
-                v-for="item in packtypeList"
+                v-for="item in unitList"
                 :key="item.constKey"
-                :label="item.constValue"
-                :value="item.constValue"
+                :label="item.warehouseName"
+                :value="item.warehouseName"
               />
             </ws-select>
           </ws-form-item>
@@ -223,6 +223,7 @@ export default {
       contractType: 2,
       startDate: null,
       endDate: null,
+      unitList:[],
       // 提交类型
       submitType: true,
       selectpackingMethod: {},
@@ -252,7 +253,7 @@ export default {
     // this.getVesselData();
     // this.getList()
     this.loaddata()
-    this.getLook()
+    //this.getLook()
     this.showType = this.isShow
   },
   methods: {
@@ -297,12 +298,19 @@ export default {
     },
     loaddata() {
       // 仓库名称
-      xiala({ compId: 'CON1' })
+      xiala({ compId: sessionStorage.getItem('ws-pf_compId')})
         .toPromise()
         .then((response) => {
           this.packtypeList = response
         })
         this.getUnitList()
+
+         // 数据
+      getLook({ id:this.compId })
+        .toPromise()
+        .then((response) => {
+          this.deptBudgetList = response
+        })
     },
     getUnitList() {
       xiala({
@@ -321,7 +329,7 @@ export default {
           })
           //
           if (currItem) {
-            this.selectContract(currItem.constValue)
+            this.getLook(currItem.constValue)
           }
         })
     },

+ 1 - 1
vue.config.js

@@ -144,7 +144,7 @@ module.exports = {
         // target: 'http://standard-dev.winsea.com/', //目标地址
         // target: 'http://localhost:8090/',
         // target: 'http://192.168.1.124:8090/',
-        target: 'http://192.168.1.124:8090/',
+        target: 'http://192.168.1.120:8090/',
         // target: 'http://192.168.24.5:8098',//目标地址
         // target: 'http://product-server.winsea.com/',
         // target: 'http://192.168.24.5:8098',//目标地址