caojunjie 2 лет назад
Родитель
Сommit
42632a98eb

+ 16 - 0
src/api/exportTrade/purchaseContract.js

@@ -52,6 +52,14 @@ export function submit(data) {
   })
 }
 //修改和新增
+export function submitTwo(data) {
+  return request({
+    url: '/api/blade-purchase-sales/exportOrder/submit',
+    method: 'post',
+    data: data
+  })
+}
+//修改和新增
 export function deliverGoods(data) {
   return request({
     url: '/api/blade-purchase-sales/exportOrder/deliverGoods',
@@ -140,3 +148,11 @@ export function pleaseCheck(data) {
     data: data
   })
 }
+//导入销售单
+export function generatePurchaseBill(query) {
+  return request({
+    url: '/api/blade-purchase-sales/exportOrder/generatePurchaseBill',
+    method: 'get',
+    params: query
+  })
+}

+ 0 - 1
src/components/crop-select/main.vue

@@ -201,7 +201,6 @@ export default {
       if (!this.multiple) {
         this.corpList.forEach(e => {
           if (row == e.id) {
-            console.log({ ...e, index: this.cropIndex })
             this.$emit("getCorpData", { ...e, index: this.cropIndex });
           }
         });

+ 0 - 2
src/components/upload-file/main.vue

@@ -92,7 +92,6 @@ export default {
     },
     //删除附件上传触发
     rowDel(row, index, donerowDel) {
-      console.log(updateListRemove);
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -141,7 +140,6 @@ export default {
   },
   watch: {
     orderFilesList: function(rows) {
-      console.log(rows);
       this.fileData = rows;
     }
   }

+ 3 - 0
src/enums/column-name.js

@@ -8,6 +8,9 @@ const columnName = [{
   code: 2,
   name: '出口采购订单'
 }, {
+  code: 2.1,
+  name: '出口采购订单-导入销售单'
+}, {
   code: 3,
   name: '出口采购订单商品信息'
 }, {

+ 11 - 1
src/views/exportTrade/invoice/detailsPage.vue

@@ -390,7 +390,17 @@ export default {
               value: "dictValue"
             },
             disabled: true,
-            row: true
+          }, {
+            label: "提单号",
+            prop: "billLadingNo",
+            span: 8,
+            rules: [
+              {
+                required: true,
+                message: "",
+                trigger: "blur"
+              }
+            ]
           },
           {
             label: "客户详情",

+ 17 - 3
src/views/exportTrade/purchaseContract/config/customerContact.json

@@ -13,10 +13,24 @@
   "refreshBtn": false,
   "selection": true,
   "showSummary": true,
-  "column": [{
+  "column": [
+    {
+      "label": "销售单号",
+      "prop": "billNo",
+      "index": 1,
+      "width": 100,
+      "overHidden": true
+    },{
+      "label": "预交日期",
+      "prop": "plannedDeliveryDate",
+      "index": 1.1,
+      "width": 100,
+      "overHidden": true
+    },
+    {
       "label": "产品类别",
       "prop": "priceCategory",
-      "index": 1,
+      "index": 1.2,
       "width": 100,
       "overHidden": true
     },
@@ -79,7 +93,7 @@
       "overHidden": true
     },
     {
-      "label": "已收数量",
+      "label": "采购数量",
       "prop": "actualQuantity",
       "index": 9,
       "width": 120,

+ 18 - 17
src/views/exportTrade/purchaseContract/detailsPage.vue

@@ -53,12 +53,6 @@
           <el-dropdown-menu slot="dropdown">
             <el-dropdown-item :disabled="!form.id" @click.native="copyDoc"
               >复制单据</el-dropdown-item>
-            <el-dropdown-item v-if="!form.fudaPurchaseStatus" :disabled="!form.id" @click.native="PSModification(1)"
-              >排产中</el-dropdown-item>
-            <el-dropdown-item v-if="!form.productionScheduling" :disabled="!form.id" @click.native="PSModification(2)"
-              >预计货好</el-dropdown-item>
-            <el-dropdown-item v-if="form.estimateGoodGoods == '待采购'" :disabled="!form.id" @click.native="PSModification(3)"
-              >采购完成</el-dropdown-item>
           </el-dropdown-menu>
         </el-dropdown>
         <el-button
@@ -130,15 +124,15 @@
               ></el-input>
               <span v-else>{{ row.price }}</span>
             </template>
-            <template slot="orderQuantity" slot-scope="{ row }">
+            <template slot="actualQuantity" slot-scope="{ row }">
               <el-input
                 v-if="row.$cellEdit"
-                v-model="row.orderQuantity"
+                v-model="row.actualQuantity"
                 size="small"
                 oninput='this.value=this.value.replace(/[^(\d)]/g,"")'
                 @change="quantityChange(row)"
               ></el-input>
-              <span v-else>{{ row.orderQuantity | IntegerFormat }}</span>
+              <span v-else>{{ row.actualQuantity | IntegerFormat }}</span>
             </template>
             <template slot="cname" slot-scope="{ row, index }">
               <el-button
@@ -189,6 +183,12 @@
                 @click.stop="openReport()"
                 >报表打印</el-button
               >
+              <el-button type="info" size="small" :disabled="!form.id || form.fudaPurchaseStatus" @click.native="PSModification(1)"
+              >排产中</el-button>
+              <el-button type="info" size="small" :disabled="!form.id || form.productionScheduling" @click.native="PSModification(2)"
+              >预计货好</el-button>
+              <el-button type="info" size="small" :disabled="!form.id || form.estimateGoodGoods != '待采购'" @click.native="PSModification(3)"
+              >采购完成</el-button>
 <!--              <el-button-->
 <!--                type="warning"-->
 <!--                icon="el-icon-plus"-->
@@ -357,7 +357,7 @@ import feeInfo from "@/components/fee-info/main";
 import uploadFile from "@/components/upload-file/main";
 import {
   detail,
-  submit,
+  submitTwo,
   delItem,
   getDeptLazyTree,
   getGoods,
@@ -649,6 +649,10 @@ export default {
     if (this.detailData.id) {
       this.getDetail(this.detailData.id);
     }
+    if (this.detailData.form) {
+      this.form = this.detailData.form
+      this.data = this.detailData.form.orderItemsList
+    }
     this.tableOption = await this.getColumnData(
       this.getColumnName(3),
       tableOption
@@ -722,7 +726,6 @@ export default {
       });
     },
     priceChange(row) {
-      console.log(row);
       if (!row.price) {
         row.price = 0;
       } else {
@@ -731,8 +734,8 @@ export default {
     },
     quantityChange(row) {
       if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
-        row.orderQuantity = row.actualQuantity;
-        this.$message.error("修改的数量不能低于已收数量");
+        row.actualQuantity = row.orderQuantity
+        this.$message.error("修改的已收数量不能低于数量");
       }
       if (!row.orderQuantity) {
         row.orderQuantity = 0;
@@ -769,7 +772,6 @@ export default {
     },
     importGoods() {
       if (this.reData) {
-        console.log(this.reData);
         if (this.selectionList.length != 1) {
           return this.$message.error("重新选择的时候只能选择一条数据");
         } else {
@@ -981,15 +983,14 @@ export default {
             e.sort = Number(index) + 1
           })
           this.subLoading = true;
-          submit({
+          submitTwo({
             ...this.form,
             itemsVOList: this.data,
             orderFeesList: orderFeesList,
             orderFilesList: this.orderFilesList,
             tradeType: "CK",
             billType: "CG"
-          })
-            .then(res => {
+          }).then(res => {
               this.$message.success("保存成功");
               this.getDetail(res.data.data);
               if (status == "goBack") {

+ 114 - 36
src/views/exportTrade/purchaseContract/index.vue

@@ -132,11 +132,15 @@
         append-to-body
         width="80%">
       <span>
-        <avue-crud :data="dialogData" :option="dialogOption"
+        <avue-crud :data="dialogData"
+                   :option="dialogOption"
                    :page.sync="dialogPage"
                    :search.sync="params"
                    ref="dialogCrud"
+                   @resetColumn="resetColumnTwo('dialogCrud','dialogOption','dialogOptionList',2.1)"
+                   @saveColumn="saveColumnTwo('dialogCrud','dialogOption','dialogOptionList',2.1)"
                    @refresh-change="refreshChangeTwo"
+                   @search-change="searchChangeTwo"
                    @on-load="dialogOnLoad">
           <template slot="menuLeft">
                 <el-tabs v-model="activeName" @tab-click="tabHandle">
@@ -144,30 +148,33 @@
                   <el-tab-pane label="已选定数据" name="importStaging"/>
                 </el-tabs>
               </template>
+          <template slot="corpNameSearch">
+            <crop-select v-model="params.corpId" corpType="GYS"/>
+          </template>
           <template slot-scope="scope" slot="menu">
-        <el-button
-            type="text"
-            icon="el-icon-edit"
-            size="small"
-            @click.stop="importStagList(scope.row, scope.index)"
-            v-if="activeName == 'searchList'"
-            :disabled=" goodsListSave.findIndex(item => item.id == scope.row.id) !== -1 "
-        >选择
-        </el-button>
-        <el-button
-            type="text"
-            icon="el-icon-delete"
-            size="small"
-            @click.stop="removeStagList(scope.row, scope.index)"
-            v-else
-        >移除
-        </el-button>
-      </template>
+            <el-button
+                type="text"
+                icon="el-icon-edit"
+                size="small"
+                @click.stop="importStagList(scope.row, scope.index)"
+                v-if="activeName == 'searchList'"
+                :disabled=" goodsListSave.findIndex(item => item.id == scope.row.id) !== -1 "
+            >选择
+            </el-button>
+            <el-button
+                type="text"
+                icon="el-icon-delete"
+                size="small"
+                @click.stop="removeStagList(scope.row, scope.index)"
+                v-else
+            >移除
+            </el-button>
+          </template>
         </avue-crud>
       </span>
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+        <el-button type="primary" :disabled="goodsListSave.length === 0" @click="confirmImport">导 入</el-button>
       </span>
     </el-dialog>
   </div>
@@ -175,7 +182,7 @@
 
 <script>
 import option from "./config/mainList.json";
-import {getList, remove, gainUser, listXS} from "@/api/exportTrade/purchaseContract";
+import {getList, remove, gainUser, listXS,generatePurchaseBill} from "@/api/exportTrade/purchaseContract";
 import detailPage from "./detailsPage.vue";
 import { defaultDate } from "@/util/date";
 import { IntegerFormat } from "@/util/validate";
@@ -197,7 +204,8 @@ export default {
         pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
       },
       activeName: 'searchList',
-      dialogOption: {
+      dialogOption: {},
+      dialogOptionList: {
         searchShow: true,
         searchMenuSpan: 16,
         border: true,
@@ -213,48 +221,69 @@ export default {
         tip: false,
         column: [{
           label: "销售单号",
-          prop: "orderNo",
-          search:false,
+          prop: "billNo",
+          search: true,
+          searchSpan: 8,
           overHidden: true
         }, {
           label: "销售日期",
           prop: "businesDate",
+          searchProp: "businesDateList",
+          width: 100,
+          type: "date",
+          searchSpan: 8,
+          searchRange: true,
+          search: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
           overHidden: true
         }, {
           label: "供应商",
-          prop: "corpId",
+          prop: "corpName",
+          searchSpan: 8,
+          search: true,
           overHidden: true
         }, {
           label: "交货日期",
-          prop: "corpId",
+          prop: "plannedDeliveryDate",
+          searchProp: "plannedDeliveryDateList",
+          width: 100,
+          type: "date",
+          searchSpan: 8,
+          searchRange: true,
+          search: true,
+          searchDefaultTime: ["00:00:00", "23:59:59"],
+          format: "yyyy-MM-dd",
+          valueFormat: "yyyy-MM-dd HH:mm:ss",
           overHidden: true
         }, {
           label: "采购员",
-          prop: "corpId",
+          prop: "carry",
           overHidden: true
         }, {
           label: "产品名称",
-          prop: "corpId",
+          prop: "cname",
           overHidden: true
         }, {
           label: "产品编号",
-          prop: "corpId",
+          prop: "code",
           overHidden: true
         }, {
           label: "产品类别",
-          prop: "corpId",
+          prop: "priceCategory",
           overHidden: true
         }, {
           label: "产品型号",
-          prop: "corpId",
+          prop: "itemType",
           overHidden: true
         }, {
           label: "数量",
-          prop: "corpId",
+          prop: "orderQuantity",
           overHidden: true
         }, {
           label: "采购数",
-          prop: "corpId",
+          prop: "purchaseQuantity",
           overHidden: true
         }]
       },
@@ -279,9 +308,9 @@ export default {
   components: { detailPage },
   async created() {
     this.option = await this.getColumnData(this.getColumnName(2), option);
+    this.dialogOption = await this.getColumnData(this.getColumnName(2.1), this.dialogOptionList);
     this.getWorkDicts("payment_term").then(res => {
-      this.findObject(this.option.column, "paymentType").dicData =
-        res.data.data;
+      this.findObject(this.option.column, "paymentType").dicData = res.data.data;
     });
     gainUser().then(res => {
       this.findObject(this.option.column, "createUser").dicData = res.data.data;
@@ -394,7 +423,56 @@ export default {
       this.goodsListSave.push(row);
     },
     refreshChangeTwo(){
-      this.onLoad(this.page);
+      this.dialogOnLoad(this.page);
+    },
+    searchChangeTwo(params,done){
+      done()
+      this.dialogOnLoad(this.page);
+    },
+    //自定义列保存
+    async saveColumnTwo(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+//自定义列重置
+    async resetColumnTwo(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+    confirmImport(){
+      let ids = this.goodsListSave.map(item => {return item.id})
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255,255,255,0.7)'
+      });
+      generatePurchaseBill({ids:ids.join(',')}).then(res=>{
+        this.$message.success("导入成功")
+        this.detailData = {
+          form: res.data.data
+        };
+        loading.close()
+        this.dialogVisible = false
+        setTimeout(() => {
+          this.show = false;
+        }, 200);
+      }).catch(()=>{
+        loading.close()
+      })
     },
     dialogOnLoad(page, params) {
       this.dialogLoading = true;

+ 16 - 0
src/views/exportTrade/salesContract/components/goodsInfo.vue

@@ -775,14 +775,22 @@ export default {
         id: this.form.id,
         documentaryDate:this.pickerValue
       };
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255,255,255,0.7)'
+      });
       deliverGoods(data).then(res => {
         if (res.data.code == 200) {
           this.$message.success("生成成功");
           this.dialog = false
           this.pickerValue = ''
+          loading.close()
           this.$emit("backToList",this.form.id)
         }
       }).catch(()=>{
+        loading.close()
         this.pickerValue = ''
         this.dialog = false
       })
@@ -795,16 +803,24 @@ export default {
       if (!this.form.buyerId){
         return this.$message.error("采购员必填");
       }
+      const loading = this.$loading({
+        lock: true,
+        text: '加载中',
+        spinner: 'el-icon-loading',
+        background: 'rgba(255,255,255,0.7)'
+      });
       generatePurchaseNews(this.form.id,this.pickerValue).then(res => {
         if (res.data.code == 200) {
           this.$message.success("生成成功");
           this.dialog = false
           this.pickerValue = ''
+          loading.close()
           this.$emit("backToList",this.form.id)
         }
       }).catch(()=>{
         this.pickerValue = ''
         this.dialog = false
+        loading.close()
       })
     },
     getInvoice() {

+ 1 - 1
src/views/exportTrade/salesContract/config/mainList.json

@@ -343,7 +343,7 @@
       "type": "select",
       "dicData": [],
       "props": {
-        "label": "name",
+        "label": "realName",
         "value": "id"
       },
       "filterable": true,

+ 9 - 5
src/views/exportTrade/salesContract/detailsPage.vue

@@ -823,9 +823,9 @@ export default {
             filterable: true,
             remote: true,
             type: "select",
-            dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+            dicUrl: "/api/blade-user/page?size=20&current=1&realName={{key}}",
             props: {
-              label: "account",
+              label: "realName",
               value: "id",
               res: 'data.records'
             },
@@ -844,9 +844,9 @@ export default {
             filterable: true,
             remote: true,
             type: "select",
-            dicUrl: "/api/blade-user/page?size=20&current=1&account={{key}}",
+            dicUrl: "/api/blade-user/page?size=20&current=1&realName={{key}}",
             props: {
-              label: "account",
+              label: "realName",
               value: "id",
               res: 'data.records'
             },
@@ -856,7 +856,11 @@ export default {
                 message: "",
                 trigger: "blur"
               }
-            ],
+            ]
+          }, {
+            label: "提单号",
+            prop: "billLadingNo",
+            span: 6,
             row: true
           },
           {

+ 2 - 2
vue.config.js

@@ -32,9 +32,9 @@ module.exports = {
       '/api': {
         // 本地服务接口地址
         // target: 'http://192.168.3.64:1080',
-        target: 'http://192.168.0.105:1080',
+        // target: 'http://192.168.0.105:1080',
         // 打包地址
-        // target: 'http://121.37.83.47:10004',//服务器ip
+        target: 'http://121.37.83.47:10004',//服务器ip
         // target: 'http://trade.tubaosoft.com:10004',//服务器域名
         ws: true,
         pathRewrite: {