浏览代码

采购订单 接口联调

qinbai 3 年之前
父节点
当前提交
61ce166301

+ 5 - 5
src/api/importTrade/purchase.js

@@ -4,7 +4,7 @@ import request from '@/router/axios';
 //列表查询
 export function selectPurchaseList(data) {
   return request({
-    url: '/api/trade-purchase/import-order/list',
+    url: '/api/trade-purchase/purchase-order/list',
     method: 'get',
     params: data
   })
@@ -12,7 +12,7 @@ export function selectPurchaseList(data) {
 
 export function getItemByPid(id) {
   return request({
-    url: '/api/trade-purchase/import-order/getItemByPid',
+    url: '/api/trade-purchase/purchase-order/getItemByPid',
     method: 'get',
     params: {id}
   })
@@ -21,7 +21,7 @@ export function getItemByPid(id) {
 // 提交
 export function submitData(data) {
   return request({
-    url: '/api/trade-purchase/import-order/submit',
+    url: '/api/trade-purchase/purchase-order/submit',
     method: 'post',
     data: data
   })
@@ -39,7 +39,7 @@ export function saveData(data) {
 // 详情
 export function detailListData(id) {
   return request({
-    url: '/api/trade-purchase/import-order/'+id,
+    url: '/api/trade-purchase/purchase-order/'+id,
     method: 'get',
   })
 }
@@ -47,7 +47,7 @@ export function detailListData(id) {
 // 删除主页
 export function removeData(ids) {
   return request({
-    url: '/api/trade-purchase/import-order/remove',
+    url: '/api/trade-purchase/purchase-order/remove',
     method: 'post',
     params: {ids}
   })

+ 15 - 12
src/views/maintenance/priceManagement/configuration/customerContact.json

@@ -11,6 +11,7 @@
   "refreshBtn": false,
   "searchMenuSpan": 6,
   "dialogWidth": "60%",
+  "align": "center",
   "tree": true,
   "border": true,
   "index": true,
@@ -22,8 +23,7 @@
       "label": "编码",
       "prop": "code",
       "index": 1,
-      "width":100,
-      "cell": true,
+      "width":120,
       "rules": [
         {
           "required": true,
@@ -35,7 +35,7 @@
       "label": "大字",
       "prop": "bigCharacter",
       "index": 1,
-      "width":100,
+      "width":120,
       "cell": true,
       "rules": [
         {
@@ -48,7 +48,7 @@
       "label": "品牌",
       "prop": "brand",
       "index": 2,
-      "width":100,
+      "width":150,
       "cell": true,
       "rules": [
         {
@@ -61,7 +61,7 @@
       "label": "花纹",
       "prop": "brandItem",
       "index": 3,
-      "width":100,
+      "width":150,
       "cell": true,
       "rules": [
         {
@@ -74,7 +74,7 @@
       "label": "规格",
       "prop": "typeno",
       "index": 4,
-      "width":100,
+      "width":150,
       "cell": true,
       "rules": [
         {
@@ -87,7 +87,7 @@
       "label": "产品类别",
       "prop": "category",
       "index": 5,
-      "width":100,
+      "width":120,
       "cell": true,
       "rules": [
         {
@@ -100,7 +100,7 @@
       "label": "产品分类",
       "prop": "productCategory",
       "index": 6,
-      "width":100,
+      "width":130,
       "cell": true,
       "rules": [
         {
@@ -113,7 +113,7 @@
       "label": "供货商编码",
       "prop": "corpCode",
       "index": 6,
-      "width":100,
+      "width":150,
       "cell": true,
       "rules": [
         {
@@ -126,7 +126,7 @@
       "label": "采购价(元)",
       "prop": "purchasePrice",
       "index": 6,
-      "width":100,
+      "width":150,
       "cell": true,
       "rules": [
         {
@@ -139,7 +139,7 @@
       "label": "销售价(元)",
       "prop": "salesPrice",
       "index": 6,
-      "width":110,
+      "width":130,
       "cell": true,
       "rules": [
         {
@@ -151,8 +151,11 @@
     },{
       "label": "更新日期",
       "prop": "updateTime",
+      "type": "date",
+      "valueFormat":"yyyy-MM-dd HH:mm:ss",
+      "format":"yyyy-MM-dd",
       "index": 7,
-      "width":100,
+      "width":150,
       "cell": true,
       "rules": [
         {

+ 136 - 8
src/views/maintenance/priceManagement/detailsPageEdit.vue

@@ -2,7 +2,6 @@
   <div class="borderless">
     <div class="customer-head">
       <div class="customer-back">
-        <!--        <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
         <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
                    @click="backToList">返回列表
         </el-button>
@@ -21,8 +20,7 @@
         <basic-container style="margin-bottom: 10px">
           <el-row>
             <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
-              <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
-<!--                <avue-input-tree v-if="item.prop === 'corpsTypeId'" leaf-only multiple :props="{label:'title'}"v-model="form[item.prop]" placeholder="请选择内容" type="tree" :dic="dic"/>-->
+              <el-form-item label-width="150px" :label="item.label" :prop="item.prop" :rules="item.rules">
                 <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]" size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
                 <span v-else-if="item.type === 'select'">
                   <el-select v-model="form[item.prop]" slot="prepend" style="width: 100%;" size="small" placeholder="请选择">
@@ -46,8 +44,9 @@
               @row-update="rowUpdate"
               @row-del="rowDel">
             <template slot="code" slot-scope="{row,index}">
-              <span style="float: left;padding-top: 2px">{{ row.code }}</span>
-              <el-button type="text" size="mini" style="float: right" @click="commodityChoice(row)">选择</el-button>
+              <span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
+              <span style="margin-left: 12px;padding-top: 2px">{{ row.code }}</span>
+              <el-button type="text" v-if="row.$cellEdit" size="mini" style="float: right" @click="commodityChoice(row,index)">选择</el-button>
             </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
@@ -61,11 +60,53 @@
         </basic-container>
       </el-form>
     </div>
+    <el-dialog
+      title="导入商品"
+      append-to-body
+      class="el-dialogDeep"
+      :visible.sync="dialogVisible"
+      width="80%"
+      :close-on-click-modal="false"
+      :destroy-on-close="true"
+      :close-on-press-escape="false">
+      <el-row style="height: 0;">
+        <el-col :span="5">
+          <div>
+            <el-scrollbar>
+              <basic-container>
+                <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
+              </basic-container>
+            </el-scrollbar>
+          </div>
+        </el-col>
+        <el-col :span="19">
+          <basic-container>
+            <avue-crud :option="optionTwo"
+                       :table-loading="loading"
+                       :data="data"
+                       ref="crud"
+                       @refresh-change="refreshChange"
+                       @selection-change="selectionChange"
+                       :page.sync="page"
+                       @on-load="onLoad">
+
+            </avue-crud>
+          </basic-container>
+        </el-col>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+          <el-button @click="dialogVisible = false">取 消</el-button>
+          <el-button type="primary" @click="importGoods()" :disabled="this.tableData.length == 1 ? false:true">导 入</el-button>
+        </span>
+    </el-dialog>
   </div>
 </template>
 <script>
 import customerContact from "./configuration/customerContact.json"
 import {detail,corpsattn,typeSave} from "@/api/maintenance/priceManagement"
+import commodity from "../../salesManagement/salesContract/config/commodity.json";
+import {getList} from "@/api/basicData/configuration"
+import {getDeptLazyTreeTwo} from "@/api/basicData/basicFeesDesc";
 
 export default {
   name: "detailsPage",
@@ -158,7 +199,44 @@ export default {
             ]
           }
         ]
-      }
+      },
+      //导入商品
+      detailsSelect:"",
+      treeDeptId:'',
+      tableData:[],
+      dialogVisible: false,
+      treeOption: {
+        nodeKey: 'id',
+        lazy: true,
+        treeLoad: function (node, resolve) {
+          const parentId = (node.level === 0) ? 0 : node.data.id;
+          getDeptLazyTreeTwo(parentId).then(res => {
+            resolve(res.data.data.map(item => {
+              return {
+                ...item,
+                leaf: !item.hasChildren
+              }
+            }))
+          });
+        },
+        addBtn: false,
+        menu: false,
+        size: 'small',
+        props: {
+          labelText: '标题',
+          label: 'title',
+          value: 'value',
+          children: 'children'
+        }
+      },
+      optionTwo: commodity,
+      loading: false,
+      data: [],
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
     }
   },
   //初始化查询
@@ -232,9 +310,21 @@ export default {
     },
     //修改提交触发
     editCustomer() {
-      console.log(this.form)
       this.$refs["form"].validate((valid) => {
-        if (valid) {
+        //校验明细列表
+        let valids = true;
+        if(this.contactsData.length !=0){
+          this.contactsData.forEach((item) =>{
+            if((!item.code || !item.bigCharacter) && valids){
+              this.$message({
+                type: "warning",
+                message: "请检查明细列表第 "+(item.$index +1 )+" 行必填项"
+              });
+              valids = false;
+            }
+          })
+        }
+        if (valid && valids) {
           this.form.priceItemList = this.contactsData
           typeSave(this.form).then(res=>{
             this.$message({
@@ -248,6 +338,44 @@ export default {
         }
       });
     },
+    //选择
+    commodityChoice(row,index){
+      this.dialogVisible = true;
+      this.detailsSelect = index
+    },
+    //导入页左商品类型查询
+    nodeClick(data) {
+      this.treeDeptId = data.id;
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
+    //刷新触发
+    refreshChange() {
+      this.treeDeptId = '';
+      this.page.currentPage = 1;
+      this.onLoad(this.page);
+    },
+    //选中触发
+    selectionChange(list) {
+      this.tableData = list
+    },
+    //商品列表查询
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+      });
+    },
+    //导入
+    importGoods(){
+      if(this.tableData){
+        this.contactsData[this.detailsSelect].code = this.tableData[0].code;
+        this.dialogVisible = !this.dialogVisible
+      }
+    },
     //返回列表
     backToList() {
       this.$router.$avueRouter.closeTag();

+ 1 - 1
src/views/purchase/contract/config/mainList.json

@@ -66,7 +66,7 @@
       "width":150
     },{
       "label": "到港日期",
-      "prop": "dateOfArrival",
+      "prop": "arrivalDate",
       "type": "date",
       "format": "yyyy-MM-dd",
       "valueFormat": "yyyy-MM-dd",

+ 17 - 6
src/views/purchase/contract/detailsPage.vue

@@ -89,7 +89,7 @@
             <template slot="code" slot-scope="{row,index}">
               <span v-if="row.$cellEdit" style="float: left;color: #F56C6C;">*</span>
               <span style="margin-left: 12px;padding-top: 2px">{{ row.code }}</span>
-              <el-button type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
+              <el-button v-if="row.$cellEdit" type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
             </template>
             <template slot-scope="{row,index}" slot="menu">
               <el-button
@@ -575,9 +575,16 @@ export default {
       let id = this.$route.query.id.replace(/\"/g, "")
       detailListData(id).then(res => {
         this.form = res.data.data;
-        this.detailedData = res.data.data.itemsVOList
-        this.advantageProjectData = res.data.data.orderFeesList
-        this.bankOfDepositData = res.data.data.orderFilesList
+        console.log(res)
+        if(res.data.data.itemsVOList){
+          this.contactsData = res.data.data.itemsVOList
+        }
+        if(res.data.data.orderFeesList){
+          this.advantageProjectData = res.data.data.orderFeesList
+        }
+        if( res.data.data.orderFilesList){
+          this.bankOfDepositData = res.data.data.orderFilesList
+        }
       })
     }
   },
@@ -595,8 +602,12 @@ export default {
           submitDto.itemsVOList = this.contactsData
           submitDto.orderFeesList = this.advantageProjectData
           submitDto.orderFilesList = this.bankOfDepositData
-          submitData(submitDto).then(res => {})
-          this.backToList()
+          submitDto.tradeType = "JK"
+          submitData(submitDto).then(res => {
+            if(res.data.success){
+              this.$message.success("操作成功!")
+            }
+          })
         } else {
           return false;
         }

+ 8 - 10
src/views/purchase/contract/index.vue

@@ -186,34 +186,32 @@ export default {
       console.log('1')
     },
     onLoad(page, params) {
+      console.log()
       if(params){
         if (params.businesDate != undefined) {
-          params.businesStartDate = params.businesDate[0];
-          params.businesEndDate = params.businesDate[1];
+          params.businesStartDate = params.businesDate[0]+ " " + "00:00:00";
+          params.businesEndDate = params.businesDate[1] + " " + "23:59:59";
           this.$delete(params,'businesDate')
         }
         if (params.accountsCollectionDate!= undefined) {
-          params.accountsCollectionStartDate = params.accountsCollectionDate[0];
-          params.accountsCollectionEndDate = params.accountsCollectionDate[1];
+          params.accountsCollectionStartDate = params.accountsCollectionDate[0]+ " " + "00:00:00";
+          params.accountsCollectionEndDate = params.accountsCollectionDate[1] + " " + "23:59:59";
           this.$delete(params,'accountsCollectionDate')
         }
         if (params.dateOfArrival!= undefined) {
-          params.dateOfStartArrival = params.dateOfArrival[0];
-          params.dateOfEndArrival = params.dateOfArrival[1];
+          params.dateOfStartArrival = params.dateOfArrival[0]+ " " + "00:00:00";
+          params.dateOfEndArrival = params.dateOfArrival[1] + " " + "23:59:59";
           this.$delete(params,'dateOfArrival')
         }
       }
       let queryParams = Object.assign({}, params, {
         size: page.pageSize,
         current: page.currentPage,
+        tradeType:"JK"  //进口参数
       })
       selectPurchaseList(queryParams).then(res => {
         this.dataList = res.data.data.records
         this.page.total = res.data.data.total
-        this.dataList.forEach(item => {
-          this.$set(item,'insideList',[])
-          this.$set(item,'loading', true)
-        })
       })
     },
     //表格展开触发

+ 4 - 4
src/views/salesManagement/salesContract/detailsPage.vue

@@ -727,6 +727,10 @@ export default {
       this.page.currentPage = 1;
       this.onLoad(this.page);
     },
+    //选中触发
+    selectionChange(list) {
+      this.tableData = list
+    },
     //费用刷新触发
     refreshChangeCost() {
       this.treeDeptIdCost = '';
@@ -749,10 +753,6 @@ export default {
       this.tableData = []
       this.dialogVisible = false
     },
-    //选中触发
-    selectionChange(list) {
-      this.tableData = list
-    },
     //费用选中触发
     selectionChangeCost(list){
       this.tableDataCost = list