Procházet zdrojové kódy

产品拆分页面以及其他静态需求完成

cz před 2 roky
rodič
revize
ff3e562f27

+ 9 - 2
src/api/inventory-management/combination.js

@@ -29,7 +29,7 @@ export function getCanQuantity(data = {}) {
   })
 }
 
-// 获取可组合数量
+// 
 export function getCombinationNameList(data = {}) {
   return request({
     url: '/api/victoriatourist/stockCombination/getCombinationList',
@@ -39,4 +39,11 @@ export function getCombinationNameList(data = {}) {
 }
 
 
-
+// 批量组合
+export function batchCombination(data = {}) {
+  return request({
+    url: '/api/victoriatourist/stockCombination/add_batch',
+    method: 'post',
+    data: data,
+  })
+}

+ 13 - 15
src/api/inventory-management/split.js

@@ -1,9 +1,9 @@
 import request from '@/router/axios'
 
-// 产品组合列表
-export function getCombinationList(data = {}) {
+// 产品拆分列表
+export function getSplitList(data = {}) {
   return request({
-    url: '/api/victoriatourist/stockCombination/page',
+    url: '/api/victoriatourist/stockCombination/splitPage',
     method: 'post',
     data: data,
   })
@@ -11,32 +11,30 @@ export function getCombinationList(data = {}) {
 
 
 
-// 产品组合添加
-export function addCombination(data = {}) {
+// 产品拆分添加
+export function addSplit(data = {}) {
   return request({
-    url: '/api/victoriatourist/stockCombination/add',
+    url: '/api/victoriatourist/stockCombination/split',
     method: 'post',
     data: data,
   })
 }
 
-// 获取可组合数量
-export function getCanQuantity(data = {}) {
+// 批量拆分
+export function batchSplit(data = {}) {
   return request({
-    url: '/api/victoriatourist/stockCombination/getQuantityByWarehouseId',
+    url: '/api/victoriatourist/stockCombination/split_batch',
     method: 'post',
     data: data,
   })
 }
 
-// 获取可组合数量
-export function getCombinationNameList(data = {}) {
+
+// 获取可拆分数量
+export function getCanQuantity(data = {}) {
   return request({
-    url: '/api/victoriatourist/stockCombination/getCombinationList',
+    url: '/api/victoriatourist/stockCombination/getSplitQuantityByWarehouseId',
     method: 'post',
     data: data,
   })
 }
-
-
-

+ 9 - 0
src/api/order-management/JDReturnGoods/index.js

@@ -75,3 +75,12 @@ export function queryStatus(data = {}) {
     data: data,
   })
 }
+
+//修改物流信息
+export function editLogistics(data = {}) {
+  return request({
+    url: '/api/victoriatourist/logisticsInfo/editLogistics',
+    method: 'post',
+    data: data,
+  })
+}

+ 19 - 14
src/components/inbound-outbound/addOutbound.vue

@@ -105,6 +105,11 @@
               </el-select>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="预约号">
+              <el-input placeholder="请输入" v-model="form.adw"></el-input>
+            </el-form-item>
+          </el-col>
         </el-row>
 
         <div style="margin-bottom: 20px">
@@ -247,20 +252,20 @@ export default {
             trigger: "change",
           },
         ],
-        logisticsCompanyCode: [
-          {
-            required: true,
-            message: "请选择物流/快递公司",
-            trigger: "change",
-          },
-        ],
-        logisticsCode: [
-          {
-            required: true,
-            message: "请输入快递单号",
-            trigger: "blur",
-          },
-        ],
+        // logisticsCompanyCode: [
+        //   {
+        //     required: true,
+        //     message: "请选择物流/快递公司",
+        //     trigger: "change",
+        //   },
+        // ],
+        // logisticsCode: [
+        //   {
+        //     required: true,
+        //     message: "请输入快递单号",
+        //     trigger: "blur",
+        //   },
+        // ],
       },
     };
   },

+ 1 - 0
src/page/index/top/index.vue

@@ -91,6 +91,7 @@
           ></i>
         </div>
       </el-tooltip>
+
       <img class="top-bar__img" :src="userInfo.avatar" />
       <el-dropdown>
         <span class="el-dropdown-link">

+ 589 - 0
src/page/index/top/top-notice copy.vue

@@ -0,0 +1,589 @@
+<template>
+  <el-popover placement="bottom" width="350" trigger="click" ref="popover">
+    <el-tabs v-model="activeName" stretch>
+      <el-tab-pane
+        :label="spellItLabel('全部', allList.length)"
+        name="first"
+      ></el-tab-pane>
+      <el-tab-pane
+        :label="spellItLabel('邮件', mailList.length)"
+        name="second"
+      ></el-tab-pane>
+      <el-tab-pane
+        :label="spellItLabel('待办', backlogList.length)"
+        name="third"
+      ></el-tab-pane>
+      <el-tab-pane
+        :label="spellItLabel('通知', noticeList.length)"
+        name="fourth"
+      ></el-tab-pane>
+      <el-tab-pane
+        :label="spellItLabel('历史消息', historyNoticeList.length)"
+        name="five"
+      ></el-tab-pane>
+    </el-tabs>
+    <el-scrollbar style="height: 300px; position: relative">
+      <div v-if="activeName === 'first'">
+        <div
+          v-for="(item, index) in allList"
+          :key="index"
+          class="notice"
+          @click="clickNotice(item)"
+        >
+          <div class="noticeImg" v-if="item.msgType === 1">
+            <img src="/img/mail.png" alt="" style="width: 38px; height: 38px" />
+          </div>
+          <div class="noticeImg" v-else-if="item.msgType === 2">
+            <img
+              src="/img/backlog.png"
+              alt=""
+              style="width: 38px; height: 38px"
+            />
+          </div>
+          <div class="noticeImg" v-else>
+            <img
+              src="/img/notice.png"
+              alt=""
+              style="width: 38px; height: 38px"
+            />
+          </div>
+          <div class="noticeContent">
+            <div class="contentTitle">
+              <span>{{ index + 1 }}、 {{ item.content }}</span>
+            </div>
+            <div class="contentCreateTime">
+              <span>{{ item.createTime }}</span>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div v-if="activeName === 'second'">
+        <div style="width: 100%; text-align: center">
+          <span
+            style="color: #cccccc; cursor: pointer"
+            size="mini"
+            @click="allRead"
+            >点击清空</span
+          >
+        </div>
+        <div
+          v-for="(item, index) in mailList"
+          :key="index"
+          class="notice"
+          @click="clickNotice(item)"
+        >
+          <div class="noticeImg">
+            <img src="/img/mail.png" alt="" style="width: 38px; height: 38px" />
+          </div>
+          <div class="noticeContent">
+            <div class="contentTitle">
+              <span>{{ index + 1 }}、 {{ item.content }}</span>
+            </div>
+            <div class="contentCreateTime">
+              <span>{{ item.createTime }}</span>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div v-if="activeName === 'third'">
+        <div
+          v-for="(item, index) in backlogList"
+          :key="index"
+          class="notice"
+          @click="clickNotice(item)"
+        >
+          <div class="noticeImg">
+            <img
+              src="/img/backlog.png"
+              alt=""
+              style="width: 38px; height: 38px"
+            />
+          </div>
+          <div class="noticeContent">
+            <div class="contentTitle">
+              <span>{{ index + 1 }}、 {{ item.content }}</span>
+            </div>
+            <div class="contentCreateTime">
+              <span>{{ item.createTime }}</span>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div v-if="activeName === 'fourth'">
+        <div
+          v-for="(item, index) in noticeList"
+          :key="index"
+          class="notice"
+          @click="clickNotice(item)"
+        >
+          <div class="noticeImg">
+            <img
+              src="/img/notice.png"
+              alt=""
+              style="width: 38px; height: 38px"
+            />
+          </div>
+          <div class="noticeContent">
+            <div class="contentTitle">
+              <span>{{ index + 1 }}、 {{ item.content }}</span>
+            </div>
+            <div class="contentCreateTime">
+              <span>{{ item.createTime }}</span>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <el-scrollbar v-if="activeName === 'five'" style="height: 275px">
+        <div
+          v-for="(item, index) in historyNoticeList"
+          :key="index"
+          class="notice"
+          @click="clickNotice(item)"
+        >
+          <div class="noticeImg">
+            <img
+              src="/img/notice.png"
+              alt=""
+              style="width: 38px; height: 38px"
+            />
+          </div>
+          <div class="noticeContent">
+            <div class="contentTitle">
+              <span>{{ index + 1 }}、 {{ item.content }}</span>
+            </div>
+            <div class="contentCreateTime">
+              <span>{{ item.createTime }}</span>
+            </div>
+          </div>
+        </div>
+      </el-scrollbar>
+      <div
+        style="width: 100%; text-align: center; position: absolute; bottom: 5px"
+        v-if="activeName === 'five'"
+      >
+        <span
+          style="color: #66b1ff; cursor: pointer"
+          size="mini"
+          @click="goToHistory"
+          >历史消息</span
+        >
+      </div>
+    </el-scrollbar>
+    <div slot="reference">
+      <el-badge is-dot v-if="judgeStatus()">
+        <i class="el-icon-bell"></i>
+      </el-badge>
+      <el-badge v-else>
+        <i class="el-icon-bell"></i>
+      </el-badge>
+    </div>
+  </el-popover>
+</template>
+
+<script>
+// import { mapGetters } from 'vuex'
+// import { messageList, deleteByIds, readAllMail, readNotice } from '@/api/socket'
+// import Utils from '@/util/transit'
+
+export default {
+  name: "top-notice",
+  data() {
+    return {
+      activeName: "first",
+      historyNoticeList: [],
+      allList: [],
+      mailList: [],
+      backlogList: [],
+      noticeList: [],
+      ipUrl: "wss://www.findoma.com/handle-api",
+      ws: null, //建立的连接
+      lockReconnect: false, //是否真正建立连接
+      timeout: 28 * 1000, //30秒一次心跳
+      timeoutObj: null, //心跳心跳倒计时
+      serverTimeoutObj: null, //心跳倒计时
+      timeoutnum: null, //断开 重连倒计时
+    };
+  },
+  created() {
+    this.getMessageList();
+    this.initWebpack();
+  },
+  mounted() {
+    Utils.$on("webSocketClose", () => {
+      this.ws.close();
+      //清除时间
+      clearTimeout(this.timeoutObj);
+      clearTimeout(this.serverTimeoutObj);
+    });
+  },
+  computed: mapGetters(["dictData", "userInfo"]),
+
+  methods: {
+    allRead() {
+      let readList = this.mailList.map((item) => item.id);
+      let readStr = readList.join();
+      readAllMail({
+        mailIds: readStr,
+        isRead: "1",
+        nowStatus: "4",
+        mailbox: "",
+      }).then(() => {
+        // setTimeout(() => {
+        //   this.$refs.popover.doClose()
+        //   deleteByIds(readList).then(() => {
+        //     this.getMessageList(true)
+        //   })
+        // }, 1000)
+        setTimeout(() => {
+          this.$refs.popover.doClose();
+          readNotice(readList).then(() => {
+            this.getMessageList(true);
+          });
+        }, 1000);
+      });
+    },
+    spellItLabel(text, index) {
+      if (index > 0) {
+        return text + " (" + index + ")";
+      } else {
+        return text;
+      }
+    },
+    judgeStatus() {
+      if (
+        (this.mailList && this.mailList.length > 0) ||
+        (this.backlogList && this.backlogList.length > 0) ||
+        (this.noticeList && this.noticeList.length > 0)
+      ) {
+        return true;
+      } else {
+        return false;
+      }
+    },
+    clickNotice(item) {
+      if ([1, 11].includes(item.msgType)) {
+        if (item.busiId) {
+          this.$root.busiId = item.busiId;
+        }
+        if (this.$route.path === "/tenant/bussiness/mailbox/index") {
+          let $chars = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";
+          let maxPos = $chars.length;
+          let random = "";
+          for (let i = 0; i < 32; i++) {
+            random += $chars.charAt(Math.floor(Math.random() * maxPos));
+          }
+          this.$root.mailRefresh = random;
+        } else {
+          this.$router.replace({
+            path: "/tenant/bussiness/mailbox/index",
+          });
+        }
+      } else if ([3].includes(item.msgType)) {
+        this.$router.replace({
+          path: "/tenant/trading/arrivalAmountClaim/index",
+        });
+      } else if ([4].includes(item.msgType)) {
+        this.$router.replace({
+          path: "/tenant/procurement/receipt/index",
+        });
+      } else if ([5].includes(item.msgType)) {
+        this.$router.replace({
+          path: "/tenant/trading/finishedProductManagement/index",
+        });
+      } else if ([6].includes(item.msgType)) {
+        this.$router.replace({
+          path: "/tenant/trading/quotationManagement/index",
+        });
+      } else if ([7, 8, 9, 10].includes(item.msgType)) {
+        this.$router.replace({
+          path: "/tenant/trading/salesContractManagement/index",
+        });
+      } else if ([13].includes(item.msgType)) {
+        this.$router.replace({
+          path: "/tenant/customer/customerManagement/index",
+        });
+      } else if ([14].includes(item.msgType)) {
+        this.$router.replace({
+          path: "/tenant/wms/purchase/index",
+        });
+      } else if ([17].includes(item.msgType)) {
+        this.$router.replace({
+          path: "/tenant/oa/EmployeesDaily",
+        });
+      } else if ([18].includes(item.msgType)) {
+        this.$router.replace({
+          path: "/tenant/cashier/payment/index",
+        });
+      } else if ([19].includes(item.msgType)) {
+        if (item.busiId) {
+          this.$root.sendFailure = item.busiId;
+        } else {
+          this.$root.sendFailure = 111;
+        }
+        if (this.$route.path !== "/tenant/bussiness/mailbox/index") {
+          this.$router.replace({
+            path: "/tenant/bussiness/mailbox/index",
+          });
+        }
+      } else {
+        if (this.userInfo.tenant_id === "GOLDSUN") {
+          this.$router.replace({
+            path: "/process/backlog/index",
+          });
+        } else {
+          this.$router.replace({
+            path: "/activiti/task/index",
+          });
+        }
+      }
+      setTimeout(() => {
+        this.$refs.popover.doClose();
+        // deleteByIds([item.id]).then(() => {
+        //   this.getMessageList(true)
+        // })
+        readNotice([item.id]).then(() => {
+          this.getMessageList(true);
+        });
+      }, 1000);
+    },
+    goToHistory() {
+      this.$router.replace({
+        path: "/tenant/oa/historyMessage/index",
+      });
+    },
+    getMessageList(status) {
+      messageList().then((res) => {
+        // console.log(res, 'sss')
+        //历史消息取的是已读的
+        this.historyNoticeList = res.data.data.list.filter(
+          (item) => item.isRead === 1
+        );
+
+        //全部的消息 取的是未读
+        this.allList = res.data.data.list.filter((item) => item.isRead !== 1);
+        this.mailList = this.allList.filter((item) => item.msgType === 1);
+        this.backlogList = this.allList.filter((item) => item.msgType === 2);
+        this.noticeList = this.allList.filter(
+          (item) => item.msgType !== 1 && item.msgType !== 2
+        );
+        if (this.allList && this.allList.length > 0 && !status) {
+          this.$refs.popover.doShow();
+        }
+      });
+    },
+    getMessage(data) {
+      if (
+        data.details &&
+        data.details.rows &&
+        data.details.rows.length > 0 &&
+        data.details.rows.indexOf("测试发送消息") === -1
+      ) {
+        for (let i = 0; i < data.details.rows.length; i++) {
+          if (window.Notification) {
+            var ua = navigator.userAgent.toLowerCase();
+            if (ua.indexOf("safari") !== -1) {
+              if (ua.indexOf("chrome") !== -1) {
+                Notification.requestPermission().then(function (permission) {
+                  if (permission == "granted") {
+                    var notification = new Notification("WINFASTER-消息通知", {
+                      body: JSON.parse(data.details.rows[i]).notice.content,
+                      icon: "some/icon/url",
+                    });
+                    notification.onclick = function () {
+                      notification.close();
+                    };
+                  } else {
+                    Notification.requestPermission();
+                    console.log("没有权限,用户拒绝:Notification");
+                  }
+                });
+              } else {
+                // Safari
+                Notification.requestPermission(function (permission) {
+                  if (permission == "granted") {
+                    var notification = new Notification("WINFASTER-消息通知", {
+                      body: JSON.parse(data.details.rows[i]).notice.content,
+                      icon: "some/icon/url",
+                    });
+                    notification.onclick = function () {
+                      notification.close();
+                    };
+                  } else {
+                    Notification.requestPermission();
+                    console.log("没有权限,用户拒绝:Notification");
+                  }
+                });
+              }
+            }
+          } else {
+            console.log("不支持Notification");
+          }
+          if (
+            JSON.parse(data.details.rows[i]).notice.msgType === 1 &&
+            this.$route.path === "/tenant/bussiness/mailbox/index"
+          ) {
+            Utils.$emit("MoveOrMark", "allUnread");
+          }
+        }
+        this.getMessageList();
+      }
+    },
+    // connectWebSocket() {
+    //   // 传入登入账户
+    //   var ws = new WebSocket(
+    //     process.env.VUE_APP_MESSAGE_URL + '/saas-socket/saas/socket/websocket/notice?userId=' + this.$store.state.user.userInfo.user_id
+    //   )
+    //   // 申请一个WebSocket对象,参数是服务端地址,同http协议使用http://开头一样,WebSocket协议的url使用ws://开头,另外安全的WebSocket协议使用wss://开头
+    //   ws.onopen = function () {
+    //     // 当WebSocket创建成功时,触发onopen事件
+    //     console.log('创建连接成功')
+    //     // 将消息发送到服务端
+    //     ws.send('hello')
+    //   }
+    //   ws.onmessage = function (e) {
+    //     // 当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
+    //     var obj = JSON.parse(e.data)
+    //     func1(obj)
+    //   }
+    //   let func2 = function func3(val) {
+    //     // 在此处即可同时使用websocket的数据和data数据,method函数
+    //     this.getMessage(val.data)
+    //   }
+    //   let func1 = func2.bind(this)
+    //   ws.onclose = function () {
+    //     // 当客户端收到服务端发送的关闭连接请求时,触发onclose事件
+    //     console.log('close')
+    //   }
+    //   ws.onerror = function (error) {
+    //     // 如果出现连接、处理、接收、发送数据失败的时候触发onerror事件
+    //     console.log(error)
+    //   }
+    // },
+    initWebpack() {
+      this.ws = new WebSocket(
+        process.env.VUE_APP_MESSAGE_URL +
+          "/saas-socket/saas/socket/websocket/notice?userId=" +
+          this.$store.state.user.userInfo.user_id
+      );
+      this.ws.onopen = this.onopen;
+      this.ws.onmessage = this.onmessage;
+      this.ws.onclose = this.onclose;
+      this.ws.onerror = this.onerror;
+    },
+    reconnect() {
+      //重新连接
+      let that = this;
+      if (that.lockReconnect) {
+        return;
+      }
+      that.lockReconnect = true;
+      //没连接上会一直重连,设置延迟避免请求过多
+      that.timeoutnum && clearTimeout(that.timeoutnum);
+      that.timeoutnum = setTimeout(() => {
+        //新连接
+        that.initWebpack();
+        that.lockReconnect = false;
+      }, 5000);
+    },
+    reset() {
+      //重置心跳
+      let that = this;
+      //清除时间
+      clearTimeout(that.timeoutObj);
+      clearTimeout(that.serverTimeoutObj);
+      //重启心跳
+      that.start();
+    },
+    start() {
+      //开启心跳
+      var self = this;
+      self.timeoutObj && clearTimeout(self.timeoutObj);
+      self.serverTimeoutObj && clearTimeout(self.serverTimeoutObj);
+      self.timeoutObj = setTimeout(() => {
+        //这里发送一个心跳,后端收到后,返回一个心跳消息,
+        if (self.ws.readyState == 1) {
+          //如果连接正常
+          self.ws.send("heartCheck");
+        } else {
+          //否则重连
+          self.reconnect();
+        }
+        self.serverTimeoutObj = setTimeout(function () {
+          //超时关闭
+          console.log("超时");
+          self.ws.close();
+          setTimeout(() => {
+            self.reconnect();
+          }, 1000);
+        }, self.timeout);
+      }, self.timeout);
+    },
+    onopen() {
+      this.ws.send(1);
+      //开启心跳
+      this.start();
+    },
+    onmessage(e) {
+      let func2 = function func3(val) {
+        // 在此处即可同时使用websocket的数据和data数据,method函数
+        this.getMessage(val.data);
+      };
+      let func1 = func2.bind(this);
+      var obj = JSON.parse(e.data);
+      func1(obj);
+      // console.log(e, '心跳机制返回')
+      // 在此处进行返回的信息处理
+      // 收到服务器信息,心跳重置
+      this.reset();
+    },
+    onclose() {
+      // console.log('close')
+      //重连
+      // this.reconnect()
+    },
+    onerror() {
+      // console.log('error')
+      //重连
+      this.reconnect();
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.notice {
+  padding: 12px 24px;
+  border-bottom: 1px solid #e8eaec;
+  font-size: 12px;
+  cursor: pointer;
+  display: flex;
+}
+.noticeImg {
+  width: 38px;
+  height: 38px;
+  border-radius: 100%;
+  margin-top: 5px;
+  margin-right: 10px;
+  overflow: hidden;
+}
+.noticeContent {
+  -webkit-box-flex: 1;
+  flex: 1;
+}
+.contentTitle {
+  width: 100%;
+  text-align: left;
+  font-size: 14px;
+  font-weight: 400;
+  line-height: 22px;
+  color: #515a6e;
+  margin-bottom: 4px;
+}
+.contentCreateTime {
+  width: 100%;
+  text-align: left;
+  font-size: 12px;
+  color: #808695;
+}
+</style>

+ 53 - 55
src/page/index/top/top-notice.vue

@@ -1,20 +1,16 @@
 <template>
-  <el-popover placement="bottom"
-              width="350"
-              trigger="click">
-
+  <el-popover placement="bottom" width="350" trigger="click">
     <el-tabs v-model="activeName">
-      <el-tab-pane label="邮件(1)"
-                   name="first"></el-tab-pane>
-      <el-tab-pane label="消息(2)"
-                   name="second"></el-tab-pane>
-      <el-tab-pane label="通知"
-                   name="third"></el-tab-pane>
+      <el-tab-pane label="邮件(1)" name="first"></el-tab-pane>
+      <el-tab-pane label="消息(2)" name="second"></el-tab-pane>
+      <el-tab-pane label="通知" name="third"></el-tab-pane>
     </el-tabs>
-    <el-scrollbar style="height:300px">
-      <avue-notice :data="data"
-                   :option="option"
-                   @page-change="pageChange"></avue-notice>
+    <el-scrollbar style="height: 300px">
+      <avue-notice
+        :data="data"
+        :option="option"
+        @page-change="pageChange"
+      ></avue-notice>
     </el-scrollbar>
     <div slot="reference">
       <el-badge is-dot>
@@ -25,61 +21,63 @@
 </template>
 
 <script>
-let list = [{
-  img: '/img/bg/vip1.png',
-  title: '史蒂夫·乔布斯 关注了你',
-  subtitle: '05-08 15:08',
-  tag: '已经开始',
-  status: 0
-}, {
-  img: '/img/bg/vip2.png',
-  title: '斯蒂夫·沃兹尼亚克 关注了你',
-  subtitle: '05-08 15:08',
-  tag: '未开始',
-  status: 1
-}, {
-  img: '/img/bg/vip3.png',
-  title: '蒂姆·库克 关注了你',
-  subtitle: '05-08 15:08',
-  status: 3,
-  tag: '有错误'
-}, {
-  img: '/img/bg/vip4.png',
-  title: '比尔·费尔南德斯 关注了你',
-  subtitle: '05-08 15:08',
-  status: 4,
-  tag: '已完成'
-}];
+let list = [
+  {
+    img: "/img/bg/vip1.png",
+    title: "史蒂夫·乔布斯 关注了你",
+    subtitle: "05-08 15:08",
+    tag: "已经开始",
+    status: 0,
+  },
+  {
+    img: "/img/bg/vip2.png",
+    title: "斯蒂夫·沃兹尼亚克 关注了你",
+    subtitle: "05-08 15:08",
+    tag: "未开始",
+    status: 1,
+  },
+  {
+    img: "/img/bg/vip3.png",
+    title: "蒂姆·库克 关注了你",
+    subtitle: "05-08 15:08",
+    status: 3,
+    tag: "有错误",
+  },
+  {
+    img: "/img/bg/vip4.png",
+    title: "比尔·费尔南德斯 关注了你",
+    subtitle: "05-08 15:08",
+    status: 4,
+    tag: "已完成",
+  },
+];
 export default {
   name: "top-notice",
-  data () {
+  data() {
     return {
-      activeName: 'first',
+      activeName: "first",
       option: {
         props: {
-          img: 'img',
-          title: 'title',
-          subtitle: 'subtitle',
-          tag: 'tag',
-          status: 'status'
+          img: "img",
+          title: "title",
+          subtitle: "subtitle",
+          tag: "tag",
+          status: "status",
         },
       },
       data: list,
-    }
-  },
-  created () {
-
+    };
   },
+  created() {},
   methods: {
-    pageChange (page, done) {
+    pageChange(page, done) {
       setTimeout(() => {
-        this.$message.success('页码' + page)
+        this.$message.success("页码" + page);
         this.data = this.data.concat(list);
         done();
-      }, 1000)
-
+      }, 1000);
     },
-  }
+  },
 };
 </script>
 

+ 12 - 0
src/router/page/index.js

@@ -329,6 +329,18 @@ export default [{
     }, ],
   },
   {
+    path: '/order-management/JDinspection',
+    component: Layout,
+    redirect: '/order-management/JDinspection/index',
+    children: [{
+      path: 'index',
+      name: '京东退货质检',
+      component: () => import( /* webpackChunkName: "page" */ '@/views/order-management/JDinspection/index'),
+      props: true,
+    }, ],
+  },
+
+  {
     path: '/order-management/JDReturnGoods',
     component: Layout,
     redirect: '/order-management/JDReturnGoods/logisticsList',

+ 45 - 0
src/views/inbound-outbound/abnormalManage/addFollow.vue

@@ -34,6 +34,25 @@
           </el-col>
         </el-row>
         <el-row>
+          <el-col :span="8">
+            <el-form-item label="下一跟进人" prop="nextHandleUser">
+              <el-select
+                v-model="form.nextHandleUser"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in userList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
           <el-col :span="10">
             <el-form-item label="跟进时间" prop="handleTime">
               <el-date-picker
@@ -46,6 +65,25 @@
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row>
+          <el-col :span="10">
+            <el-form-item label="处理方式">
+              <el-select
+                v-model="form.handleTime"
+                allow-create
+                placeholder="请选择"
+              >
+                <el-option
+                  v-for="item in options"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
         <el-form-item label="跟进记录" prop="explain">
           <el-input
             v-model="form.explain"
@@ -108,6 +146,13 @@ export default {
             trigger: "change",
           },
         ],
+        nextHandleUser: [
+          {
+            required: true,
+            message: "请选择跟进人",
+            trigger: "change",
+          },
+        ],
         handleTime: [
           {
             required: true,

+ 84 - 19
src/views/inbound-outbound/outbound/JDoutbound/index.vue

@@ -11,6 +11,8 @@ import * as API from "@/api/inbound-outbound/outbound/JDoutbound.js";
 import { getOrderDetails } from "@/api/inbound-outbound/outbound/salesOutbound.js";
 import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
 
+import { getToken } from "@/util/auth";
+
 export default {
   components: {
     test,
@@ -20,6 +22,10 @@ export default {
   },
   data() {
     return {
+      uploadHeader: {
+        Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
+        "Blade-Auth": "bearer " + getToken(),
+      },
       outboundTypeList: [],
       warehouseTypeList: [],
       warehouseSelectList: [],
@@ -27,11 +33,11 @@ export default {
         otherButton: {
           list: [
             {
-              name: "合并出库",
+              name: "Excel导入",
               methodsText: "add",
               type: "primary",
               add: () => {
-                this.handleAdd();
+                this.excelImport();
               },
             },
           ],
@@ -72,6 +78,9 @@ export default {
         logisticsCompanyCode: "",
         orderDetailsList: [],
       },
+      openExcel: false,
+      excelForm: {},
+      excelLoading: false,
     };
   },
   created() {
@@ -141,6 +150,7 @@ export default {
         );
       });
     },
+
     handleCancel() {
       this.open = false;
     },
@@ -174,6 +184,27 @@ export default {
         </div>
       );
     },
+    excelImport() {
+      this.openExcel = true;
+      this.excelForm = {
+        warehouseId: "",
+      };
+    },
+    handleProgress() {
+      this.excelLoading = true;
+    },
+    handleError(err) {
+      this.msgInfo(`${err} , 请重试`);
+      this.openExcel = false;
+      this.excelLoading = false;
+    },
+    handleSuccess() {
+      this.msgSuccess("导入成功! ");
+      setTimeout(() => {
+        this.excelLoading = false;
+        this.openExcel = false;
+      }, 300);
+    },
   },
 };
 </script>
@@ -181,9 +212,9 @@ export default {
 
 <template>
   <div class="box-card">
-    <!-- <el-card class="header">
+    <el-card class="header">
       <test :form-config="btnForm"></test>
-    </el-card> -->
+    </el-card>
     <el-card class="body-main">
       <query
         :selectConfig="[]"
@@ -268,28 +299,62 @@ export default {
         ref="addOutbound"
       ></add-outbound>
     </el-dialog>
+
+    <el-dialog
+      title="Excel导入"
+      :visible.sync="openExcel"
+      v-if="openExcel"
+      width="40%"
+      top="20vh"
+      v-loading="excelLoading"
+      element-loading-text="文件导入中,请稍后!"
+      element-loading-spinner="el-icon-loading"
+      element-loading-background="rgba(0, 0, 0, 0.2)"
+    >
+      <el-form
+        label-position="right"
+        :model="excelForm"
+        ref="excelForm"
+        label-width="80px"
+      >
+        <el-form-item label="Excel">
+          <el-upload
+            action="/api/victoriatourist/newJdBack/excelImport"
+            :data="excelForm"
+            :headers="uploadHeader"
+            :on-success="handleSuccess"
+            :on-progress="handleProgress"
+            :show-file-list="false"
+            :on-error="handleError"
+            accept=".xlsx"
+          >
+            <el-button size="small" type="primary">点击导入</el-button>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
   </div>
 </template>
 
 
 <style lang="scss" scoped>
-// .box-card {
-//   height: calc(100vh - 110px);
-//   overflow-y: auto;
-//   display: flex;
-//   flex-direction: column;
-//   .header {
-//     // height: 100px;
-//     margin-bottom: 10px;
-//     box-sizing: border-box;
-//   }
-//   .body-main {
-//     flex: 1;
-//     overflow-y: auto;
-//   }
-// }
 .box-card {
   height: calc(100vh - 110px);
   overflow-y: auto;
+  display: flex;
+  flex-direction: column;
+  .header {
+    // height: 100px;
+    margin-bottom: 10px;
+    box-sizing: border-box;
+  }
+  .body-main {
+    flex: 1;
+    overflow-y: auto;
+  }
 }
+// .box-card {
+//   height: calc(100vh - 110px);
+//   overflow-y: auto;
+// }
 </style>

+ 12 - 0
src/views/inbound-outbound/outbound/manualOutbound/index.vue

@@ -111,6 +111,7 @@ export default {
       };
       this.open = true;
     },
+    handleAddOne(row) {},
     handleCancel() {
       this.open = false;
     },
@@ -188,6 +189,17 @@ export default {
           prop="createTime"
           width="150"
         />
+        <el-table-column label="操作" align="center" width="100">
+          <template slot-scope="scope">
+            <el-button
+              type="text"
+              v-if="false"
+              @click="handleAddOne(scope.row)"
+            >
+              出库
+            </el-button>
+          </template>
+        </el-table-column>
       </el-table>
       <pagination
         v-show="total > 0"

+ 31 - 9
src/views/inventory-management/combination/addCombination.vue

@@ -123,21 +123,20 @@
               添加产品</el-button
             >
           </div>
-          <el-table :data="form.productCombinationList">
-            <el-table-column label="产品名称" prop="name"> </el-table-column>
-            <el-table-column label="可组合数量" prop="name"> </el-table-column>
-            <el-table-column label="组合数量" prop="linkQuantity">
+          <el-table :data="form.productList">
+            <el-table-column label="产品名称" prop="productName">
+            </el-table-column>
+            <!-- <el-table-column label="可组合数量" prop="name"> </el-table-column> -->
+            <el-table-column label="组合数量" prop="combinationQuantity">
               <template slot-scope="scope">
                 <el-form-item
-                  :prop="
-                    'productCombinationList.' + scope.$index + '.linkQuantity'
-                  "
-                  :rules="formRules.linkQuantity"
+                  :prop="'productList.' + scope.$index + '.combinationQuantity'"
+                  :rules="formRules.combinationQuantity"
                   :inline-message="true"
                   label-width="0"
                 >
                   <el-input
-                    v-model="scope.row.linkQuantity"
+                    v-model="scope.row.combinationQuantity"
                     placeholder="请输入"
                     size="mini"
                   >
@@ -268,6 +267,14 @@ export default {
       this.$refs.form.validate((valid) => {
         if (valid) {
           this.loading = true;
+          if (this.submitType === "20") {
+            this.form.productList = this.form.productList.map((x) => ({
+              productId: x.productId,
+              combinationQuantity: x.combinationQuantity,
+              combinationWarehouseId: this.form.combinationWarehouseId,
+              sourceWarehouseId: this.form.sourceWarehouseId,
+            }));
+          }
           this.$emit("submit");
         }
       });
@@ -275,6 +282,21 @@ export default {
     handleCancel() {
       this.$emit("cancel");
     },
+    handleSelect(row) {
+      const flag = this.form.productList.some((x) => x.productId === row.id);
+      if (flag) return this.msgInfo("该产品已经选择");
+      const product = {
+        productId: row.id,
+        productName: row.name,
+        combinationQuantity: "",
+      };
+      this.form.productList.push(product);
+      this.msgSuccess("选择成功");
+    },
+    deleteRow(index) {
+      this.form.productList.splice(index, 1);
+      this.msgSuccess("删除成功");
+    },
   },
 };
 </script>

+ 25 - 14
src/views/inventory-management/combination/index.vue

@@ -51,6 +51,7 @@ export default {
         // },
       ],
       tableList: [],
+      total: 0,
       loading: false,
       titleText: "组合操作",
       open: false,
@@ -91,12 +92,16 @@ export default {
         combinationQuantity: "",
       };
       this.submitType = "10";
-
       this.open = true;
     },
     handleBatch() {
       this.titleText = "批量组合";
       this.submitType = "20";
+      this.form = {
+        productId: "",
+        combinationQuantity: "",
+        productList: [],
+      };
       this.open = true;
     },
     handleCancel() {
@@ -118,19 +123,18 @@ export default {
           }
         );
       } else {
-        console.log("piliangzuhe");
-        // API.addCombination(this.form).then(
-        //   () => {
-        //     this.msgSuccess("操作成功");
-        //     this.$refs.addCombination.loading = false;
-        //     this.open = false;
-        //     this.getList();
-        //   },
-        //   (err) => {
-        //     console.log("addCombination: " + err);
-        //     this.$refs.addCombination.loading = false;
-        //   }
-        // );
+        API.batchCombination(this.form.productList).then(
+          () => {
+            this.msgSuccess("操作成功");
+            this.$refs.addCombination.loading = false;
+            this.open = false;
+            this.getList();
+          },
+          (err) => {
+            console.log("addCombination: " + err);
+            this.$refs.addCombination.loading = false;
+          }
+        );
       }
     },
   },
@@ -185,6 +189,13 @@ export default {
           </template>
         </el-table-column> -->
       </el-table>
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
     </el-card>
 
     <el-dialog

+ 70 - 22
src/views/inventory-management/query/index.vue

@@ -36,6 +36,17 @@ export default {
       tableList: [],
       total: 0,
       loading: false,
+      open: false,
+      form: {},
+      rules: {
+        aa: [
+          {
+            required: true,
+            message: "请输入数量",
+            trigger: "blur",
+          },
+        ],
+      },
     };
   },
   created() {
@@ -108,6 +119,23 @@ export default {
       };
       this.handleQuery();
     },
+    handleTurn({ row }) {
+      const arr = row.defectiveQuantity.split(".");
+      this.form = { ...row, canSum: arr[0] };
+      this.open = true;
+    },
+    handleSubmit() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          if (Number(this.form.aa) > this.form.canSum) {
+            return this.msgInfo("数量不可大于次品数量");
+          }
+        }
+      });
+    },
+    handleCancel() {
+      this.open = false;
+    },
   },
 };
 </script>
@@ -153,19 +181,16 @@ export default {
             align="left"
             prop="defectiveQuantity"
           />
-          <!-- <el-table-column label="查看" align="left">
-            <template>
-              <el-button type="text" @click="deleteRow(scope.$index)"
-                >出库记录</el-button
-              >
-              <el-button type="text" @click="deleteRow(scope.$index)"
-                >入库记录</el-button
-              >
-              <el-button type="text" @click="deleteRow(scope.$index)"
-                >调仓记录</el-button
+          <el-table-column label="操作" align="center" width="100">
+            <template slot-scope="scope">
+              <el-button
+                type="text"
+                v-if="scope.row.defectiveQuantity !== '0.00'"
+                @click="handleTurn(scope)"
+                >次品转良品</el-button
               >
             </template>
-          </el-table-column> -->
+          </el-table-column>
         </el-table>
       </div>
 
@@ -198,19 +223,16 @@ export default {
             prop="defectiveQuantity"
           />
 
-          <!-- <el-table-column label="查看" align="left">
-            <template>
-              <el-button type="text" @click="deleteRow(scope.$index)"
-                >出库记录</el-button
-              >
-              <el-button type="text" @click="deleteRow(scope.$index)"
-                >入库记录</el-button
-              >
-              <el-button type="text" @click="deleteRow(scope.$index)"
-                >调仓记录</el-button
+          <el-table-column label="操作" align="center" width="100">
+            <template slot-scope="scope">
+              <el-button
+                type="text"
+                v-if="scope.row.defectiveQuantity !== '0.00'"
+                @click="handleTurn(scope)"
+                >次品转良品</el-button
               >
             </template>
-          </el-table-column> -->
+          </el-table-column>
         </el-table>
       </div>
 
@@ -255,6 +277,32 @@ export default {
         :limit.sync="queryParams.pageSize"
         @pagination="getList"
       />
+
+      <el-dialog
+        title="次品转良品"
+        :visible.sync="open"
+        v-if="open"
+        width="20%"
+        top="20vh"
+      >
+        <el-form
+          ref="form"
+          :model="form"
+          :rules="rules"
+          label-width="50px"
+          label-position="right"
+        >
+          <el-form-item label="数量" prop="aa">
+            <el-input v-model="form.aa" placeholder="请输入数量"> </el-input>
+          </el-form-item>
+        </el-form>
+        <div style="text-align: center; margin-top: 15px">
+          <el-button size="small" @click="handleCancel">取消 </el-button>
+          <el-button type="primary" size="small" @click="handleSubmit">
+            确定</el-button
+          >
+        </div>
+      </el-dialog>
     </el-card>
   </div>
 </template>

+ 47 - 30
src/views/inventory-management/split/addSplit.vue

@@ -28,11 +28,12 @@
             </el-form-item>
           </el-row>
           <!-- <el-row> 规格:xxxxxxxx </el-row> -->
-          <el-form-item label="拆分后放置仓库" prop="combinationWarehouseId">
+          <el-form-item label="拆分后放置仓库" prop="splitWarehouseId">
             <el-select
-              v-model="form.combinationWarehouseId"
+              v-model="form.splitWarehouseId"
               placeholder="请选择"
               style="width: 100%"
+              @change="handleGetCanQuantity"
             >
               <el-option
                 v-for="item in warehouseSelectList"
@@ -43,7 +44,7 @@
               </el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="成品所在仓库" prop="sourceWarehouseId">
+          <el-form-item label="组合所在仓库" prop="sourceWarehouseId">
             <el-select
               v-model="form.sourceWarehouseId"
               placeholder="请选择"
@@ -62,9 +63,9 @@
 
           <el-row>
             <el-col :span="8">
-              <el-form-item label="拆分数量" prop="combinationQuantity">
+              <el-form-item label="拆分数量" prop="splitQuantity">
                 <el-input
-                  v-model="form.combinationQuantity"
+                  v-model="form.splitQuantity"
                   :disabled="canQuantity === 0"
                   placeholder="请输入"
                 >
@@ -77,12 +78,9 @@
         <div v-else>
           <el-row :gutter="10">
             <el-col :span="12">
-              <el-form-item
-                label="拆分后放置仓库"
-                prop="combinationWarehouseId"
-              >
+              <el-form-item label="拆分后放置仓库" prop="splitWarehouseId">
                 <el-select
-                  v-model="form.combinationWarehouseId"
+                  v-model="form.splitWarehouseId"
                   placeholder="请选择"
                   style="width: 100%"
                 >
@@ -97,12 +95,11 @@
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="成品所在仓库" prop="sourceWarehouseId">
+              <el-form-item label="组合所在仓库" prop="sourceWarehouseId">
                 <el-select
                   v-model="form.sourceWarehouseId"
                   placeholder="请选择"
                   style="width: 100%"
-                  @change="handleGetCanQuantity"
                 >
                   <el-option
                     v-for="item in warehouseSelectList"
@@ -123,21 +120,19 @@
               添加产品</el-button
             >
           </div>
-          <el-table :data="form.productCombinationList">
-            <el-table-column label="产品名称" prop="name"> </el-table-column>
-            <el-table-column label="可拆分数量" prop="name"> </el-table-column>
-            <el-table-column label="拆分数量" prop="linkQuantity">
+          <el-table :data="form.productList">
+            <el-table-column label="产品名称" prop="productName">
+            </el-table-column>
+            <el-table-column label="拆分数量" prop="splitQuantity">
               <template slot-scope="scope">
                 <el-form-item
-                  :prop="
-                    'productCombinationList.' + scope.$index + '.linkQuantity'
-                  "
-                  :rules="formRules.linkQuantity"
+                  :prop="'productList.' + scope.$index + '.splitQuantity'"
+                  :rules="formRules.splitQuantity"
                   :inline-message="true"
                   label-width="0"
                 >
                   <el-input
-                    v-model="scope.row.linkQuantity"
+                    v-model="scope.row.splitQuantity"
                     placeholder="请输入"
                     size="mini"
                   >
@@ -182,13 +177,12 @@
 import labelTitle from "@/components/label-title/index.vue";
 import selectProduct from "@/components/select-product/index.vue";
 
-import {
-  getCombinationNameList,
-  getCanQuantity,
-} from "@/api/inventory-management/split.js";
-
 import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
 
+import { getCombinationNameList } from "@/api/inventory-management/combination.js";
+
+import { getCanQuantity } from "@/api/inventory-management/split.js";
+
 export default {
   name: "addSplit",
   components: { labelTitle, selectProduct },
@@ -216,21 +210,21 @@ export default {
             trigger: "change",
           },
         ],
-        combinationWarehouseId: [
+        splitWarehouseId: [
           {
             required: true,
-            message: "请选择组合后放置仓库",
+            message: "请选择拆分后放置仓库",
             trigger: "change",
           },
         ],
         sourceWarehouseId: [
           {
             required: true,
-            message: "请选择半成品所在仓库",
+            message: "请选择组合所在仓库",
             trigger: "change",
           },
         ],
-        combinationQuantity: [
+        splitQuantity: [
           {
             required: true,
             message: "请输入组合数量",
@@ -267,6 +261,14 @@ export default {
     handleSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
+          if (this.submitType === "20") {
+            this.form.productList = this.form.productList.map((x) => ({
+              productId: x.productId,
+              splitQuantity: x.splitQuantity,
+              splitWarehouseId: this.form.splitWarehouseId,
+              sourceWarehouseId: this.form.sourceWarehouseId,
+            }));
+          }
           this.loading = true;
           this.$emit("submit");
         }
@@ -275,6 +277,21 @@ export default {
     handleCancel() {
       this.$emit("cancel");
     },
+    handleSelect(row) {
+      const flag = this.form.productList.some((x) => x.productId === row.id);
+      if (flag) return this.msgInfo("该产品已经选择");
+      const product = {
+        productId: row.id,
+        productName: row.name,
+        splitQuantity: "",
+      };
+      this.form.productList.push(product);
+      this.msgSuccess("选择成功");
+    },
+    deleteRow(index) {
+      this.form.productList.splice(index, 1);
+      this.msgSuccess("删除成功");
+    },
   },
 };
 </script>

+ 33 - 22
src/views/inventory-management/split/index.vue

@@ -51,6 +51,7 @@ export default {
         // },
       ],
       tableList: [],
+      total: 0,
       loading: false,
       titleText: "拆分操作",
       open: false,
@@ -67,14 +68,14 @@ export default {
   methods: {
     getList() {
       this.loading = true;
-      API.getCombinationList(this.queryParams).then(
+      API.getSplitList(this.queryParams).then(
         (res) => {
           this.tableList = res.data.data.records;
           this.total = res.data.data.total;
           this.loading = false;
         },
         (err) => {
-          console.log("getCombinationList: " + err);
+          console.log("getSplitList: " + err);
           this.loading = false;
         }
       );
@@ -86,16 +87,20 @@ export default {
       this.titleText = "拆分操作";
       this.form = {
         productId: "",
-        combinationWarehouseId: "",
         sourceWarehouseId: "",
-        combinationQuantity: "",
+        splitWarehouseId: "",
+        splitQuantity: "",
       };
       this.submitType = "10";
-
       this.open = true;
     },
     handleBatch() {
       this.titleText = "批量拆分";
+      this.form = {
+        sourceWarehouseId: "",
+        splitWarehouseId: "",
+        productList: [],
+      };
       this.submitType = "20";
       this.open = true;
     },
@@ -106,32 +111,31 @@ export default {
 
     handleSubmit() {
       if (this.submitType === "10") {
-        API.addCombination(this.form).then(
+        API.addSplit(this.form).then(
           () => {
             this.msgSuccess("操作成功");
-            this.$refs.addCombination.loading = false;
+            this.$refs.addSplit.loading = false;
             this.open = false;
             this.getList();
           },
           (err) => {
-            console.log("addCombination: " + err);
-            this.$refs.addCombination.loading = false;
+            console.log("addSplit: " + err);
+            this.$refs.addSplit.loading = false;
           }
         );
       } else {
-        console.log("piliangchaifen");
-        // API.addCombination(this.form).then(
-        //   () => {
-        //     this.msgSuccess("操作成功");
-        //     this.$refs.addCombination.loading = false;
-        //     this.open = false;
-        //     this.getList();
-        //   },
-        //   (err) => {
-        //     console.log("addCombination: " + err);
-        //     this.$refs.addCombination.loading = false;
-        //   }
-        // );
+        API.batchSplit(this.form.productList).then(
+          () => {
+            this.msgSuccess("操作成功");
+            this.$refs.addSplit.loading = false;
+            this.open = false;
+            this.getList();
+          },
+          (err) => {
+            console.log("batchSplit: " + err);
+            this.$refs.addSplit.loading = false;
+          }
+        );
       }
     },
   },
@@ -186,6 +190,13 @@ export default {
           </template>
         </el-table-column> -->
       </el-table>
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
     </el-card>
 
     <el-dialog

+ 211 - 88
src/views/order-management/JDReturnGoods/logisticsList.vue

@@ -1,25 +1,41 @@
 
 <script>
+import test from "@/components/form-test/index.vue";
 import query from "@/components/query/index.vue";
 import OrderDetails from "@/components/order/details.vue";
 import PurchaseDetails from "@/components/purchase/details.vue";
-import sendGoods from "@/components/purchase/sendGoods.vue";
 
+import sendGoods from "@/components/purchase/sendGoods.vue";
+import addLogistics from "../addLogistics.vue";
+// import addReturnGoods from "./addReturnGoods.vue";
 import * as API from "@/api/order-management/JDReturnGoods/index.js";
-import {
-  logisticsSelectData,
-  arrivalNotice,
-} from "@/api/purchase-management/deliver-goods/index.js";
+import { logisticsSelectData } from "@/api/purchase-management/deliver-goods/index.js";
 
 export default {
   components: {
+    test,
     query,
     OrderDetails,
     PurchaseDetails,
     sendGoods,
+    addLogistics,
   },
   data() {
     return {
+      btnForm: {
+        otherButton: {
+          list: [
+            {
+              name: "添加物流",
+              methodsText: "add",
+              type: "primary",
+              add: () => {
+                this.handleAdd();
+              },
+            },
+          ],
+        },
+      },
       loading: false,
       logisticsDataSourceList: [],
       logisticsStatusList: [],
@@ -29,6 +45,11 @@ export default {
           prop: "businessType",
           data: [],
         },
+        {
+          label: "状态",
+          prop: "type",
+          data: [],
+        },
       ],
       queryParams: {
         pageNum: 1,
@@ -58,6 +79,10 @@ export default {
         ],
       },
       logisticsData: [],
+      showType: "",
+      form: {},
+      openOne: false,
+      titleTextOne: "",
     };
   },
   created() {
@@ -70,11 +95,16 @@ export default {
     this.logisticsStatusList = businessDictData.find(
       (item) => item.code === "logisticsStatus"
     ).children;
-    console.log(this.logisticsStatusList, "assss");
+
     this.selectConfig[0].data = this.logisticsDataSourceList.map((item) => ({
       label: item.dictValue,
       value: item.dictKey,
     }));
+
+    this.selectConfig[1].data = this.logisticsStatusList.map((item) => ({
+      label: item.dictValue,
+      value: item.dictKey,
+    }));
     this.getList();
   },
   methods: {
@@ -96,6 +126,7 @@ export default {
       this.getList();
     },
     async lookProgress(row) {
+      // this.showType = "20";
       this.msgSuccess("数据请求中,请稍后!");
       this.titleText = "查看物流";
       const { data } = await API.queryStatus({ id: row.id });
@@ -138,7 +169,27 @@ export default {
         }
       }
     },
+    handleAdd() {
+      this.titleTextOne = "添加物流数据";
+      this.form = {
+        businessCode: "",
+        logisticsCompanyCode: "",
+        businessType: "",
+        logisticsStatus: "",
+        code: "",
+      };
+      this.openOne = true;
+    },
     handleUpdate(row) {
+      this.titleTextOne = "编辑物流数据";
+      this.form = {
+        ...row,
+        businessType: row.businessType + "",
+        logisticsStatus: row.logisticsStatus + "",
+      };
+      this.openOne = true;
+    },
+    handleRenew(row) {
       this.$confirm("确定更新状态?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
@@ -167,6 +218,39 @@ export default {
         }
       );
     },
+    handleCancel() {
+      this.openOne = false;
+    },
+    handleSubmit() {
+      this.$refs.addLogistics.loading = true;
+      if (this.form.id) {
+        API.editLogistics(this.form).then(
+          () => {
+            this.msgSuccess("编辑成功");
+            this.$refs.addLogistics.loading = false;
+            this.openOne = false;
+            this.getList();
+          },
+          (err) => {
+            console.log("editLogistics: " + err);
+            this.$refs.addLogistics.loading = false;
+          }
+        );
+      } else {
+        API.JDreGoodsAdd(this.form).then(
+          () => {
+            this.msgSuccess("新建成功");
+            this.$refs.addLogistics.loading = false;
+            this.openOne = false;
+            this.getList();
+          },
+          (err) => {
+            console.log("JDreGoodsAdd: " + err);
+            this.$refs.addLogistics.loading = false;
+          }
+        );
+      }
+    },
     handleSubmit1() {
       this.$refs.arriveForm.validate((valid) => {
         if (valid) {
@@ -187,96 +271,124 @@ export default {
 };
 </script>
 <template>
-  <el-card class="box-card">
-    <query
-      :selectConfig="selectConfig"
-      :req="queryParams"
-      :isShowMore="false"
-      @handleQuery="handleQuery"
-      @handleMore="
-        () => {
-          queryDialog = true;
-        }
-      "
-    ></query>
-    <el-table :data="tableList" v-loading="loading">
-      <el-table-column
-        label="来源"
-        align="left"
-        prop="businessType"
-        :formatter="
-          (row) => dictDataEcho(row.businessType, logisticsDataSourceList)
+  <div class="box-card">
+    <el-card class="header">
+      <test :form-config="btnForm"></test>
+    </el-card>
+    <el-card class="body-main">
+      <query
+        :selectConfig="selectConfig"
+        :req="queryParams"
+        :isShowMore="false"
+        @handleQuery="handleQuery"
+        @handleMore="
+          () => {
+            queryDialog = true;
+          }
         "
-      />
-      <el-table-column label="单号" align="left" prop="businessCode">
-        <template slot-scope="scope">
-          <div class="show_underline" @click="lookDetails(scope.row)">
-            {{ scope.row.businessCode }}
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column label="物流/快递公司" align="left" prop="companyName" />
-      <el-table-column label="物流/快递单号" align="left" prop="code">
-        <template slot-scope="scope">
-          <div class="show_underline" @click="lookProgress(scope.row)">
-            {{ scope.row.code }}
-          </div>
-        </template>
-      </el-table-column>
+      ></query>
+      <el-table :data="tableList" v-loading="loading">
+        <el-table-column
+          label="来源"
+          align="left"
+          prop="businessType"
+          :formatter="
+            (row) => dictDataEcho(row.businessType, logisticsDataSourceList)
+          "
+        />
+        <el-table-column label="单号" align="left" prop="businessCode">
+          <template slot-scope="scope">
+            <div class="show_underline" @click="lookDetails(scope.row)">
+              {{ scope.row.businessCode }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="物流/快递公司"
+          align="left"
+          prop="companyName"
+        />
+        <el-table-column label="物流/快递单号" align="left" prop="code">
+          <template slot-scope="scope">
+            <div class="show_underline" @click="lookProgress(scope.row)">
+              {{ scope.row.code }}
+            </div>
+          </template>
+        </el-table-column>
 
-      <el-table-column label="状态" align="left" prop="logisticsStatus">
-        <template slot-scope="scope">
-          <div
-            :style="{ color: scope.row.logisticsStatus === -1 ? 'red' : '' }"
-          >
-            {{ showStatus(scope.row) }}
-          </div>
-        </template></el-table-column
-      >
-      <el-table-column label="操作" align="center" width="160">
-        <template slot-scope="scope">
-          <el-button
-            type="text"
-            @click="handleUpdate(scope.row)"
-            v-if="scope.row.logisticsStatus === -1"
-          >
-            更新状态
-          </el-button>
-          <el-button
-            type="text"
-            @click="handleArrive(scope.row)"
-            v-if="scope.row.businessType === 1"
-          >
-            到货通知
-          </el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    <pagination
-      v-show="total > 0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
+        <el-table-column label="状态" align="left" prop="logisticsStatus">
+          <template slot-scope="scope">
+            <div
+              :style="{ color: scope.row.logisticsStatus === -1 ? 'red' : '' }"
+            >
+              {{ showStatus(scope.row) }}
+            </div>
+          </template></el-table-column
+        >
+        <el-table-column label="操作" align="center" width="200">
+          <template slot-scope="scope">
+            <el-button type="text" @click="handleUpdate(scope.row)">
+              修改
+            </el-button>
+            <el-button
+              type="text"
+              @click="handleRenew(scope.row)"
+              v-if="scope.row.logisticsStatus === -1"
+            >
+              更新状态
+            </el-button>
+            <el-button
+              type="text"
+              @click="handleArrive(scope.row)"
+              v-if="scope.row.businessType === 1"
+            >
+              到货通知
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </el-card>
 
     <el-dialog
       :title="titleText"
       :visible.sync="open"
       v-if="open"
       width="40%"
-      top="100px"
+      top="50px"
     >
-      <el-timeline :reverse="false">
-        <el-timeline-item
-          placement="top"
-          v-for="(activity, index) in activities"
-          :key="index"
-          :timestamp="activity.ftime"
-        >
-          {{ activity.context }}
-        </el-timeline-item>
-      </el-timeline>
+      <div>
+        <el-timeline :reverse="false">
+          <el-timeline-item
+            placement="top"
+            v-for="(activity, index) in activities"
+            :key="index"
+            :timestamp="activity.ftime"
+          >
+            {{ activity.context }}
+          </el-timeline-item>
+        </el-timeline>
+      </div>
+    </el-dialog>
+    <el-dialog
+      :title="titleTextOne"
+      :visible.sync="openOne"
+      v-if="openOne"
+      width="40%"
+      top="50px"
+    >
+      <addLogistics
+        :form="form"
+        @submit="handleSubmit"
+        @cancel="handleCancel"
+        ref="addLogistics"
+      ></addLogistics>
     </el-dialog>
 
     <el-dialog
@@ -354,7 +466,7 @@ export default {
         >
       </div>
     </el-dialog>
-  </el-card>
+  </div>
 </template>
 
 
@@ -363,5 +475,16 @@ export default {
 .box-card {
   height: calc(100vh - 110px);
   overflow-y: auto;
+  display: flex;
+  flex-direction: column;
+  .header {
+    // height: 100px;
+    margin-bottom: 10px;
+    box-sizing: border-box;
+  }
+  .body-main {
+    flex: 1;
+    overflow-y: auto;
+  }
 }
 </style>

+ 204 - 0
src/views/order-management/JDinspection/addInspection.vue

@@ -0,0 +1,204 @@
+<template>
+  <div v-loading="loading">
+    <div class="form-box">
+      <el-form
+        label-position="top"
+        :model="form"
+        ref="form"
+        :rules="formRules"
+        label-width="100px"
+      >
+        <el-row :gutter="10">
+          <el-col :span="4">
+            <el-form-item label="采购单号" prop="purchaseCode">
+              <el-input v-model="form.purchaseCode" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="10">
+            <el-form-item label="供应商" prop="supplierName">
+              <el-input v-model="form.supplierName" disabled></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="10">
+          <el-col :span="4">
+            <el-form-item label="物流公司" prop="logisticsCompanyName">
+              <el-input v-model="form.logisticsCompanyName" disabled></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="物流/快递单号" prop="code">
+              <el-input v-model="form.code" disabled></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <div style="margin-bottom: 20px">
+          <labelTitle content="质检明细"></labelTitle>
+        </div>
+
+        <el-form-item>
+          <el-table :data="form.changeProductList">
+            <el-table-column label="物品编码" prop="productCode">
+            </el-table-column>
+            <el-table-column label="物品名称" prop="productName">
+            </el-table-column>
+            <el-table-column label="待质检数量" prop="totalQuantity">
+            </el-table-column>
+            <el-table-column label="质检合格" prop="qualifiedQuantity">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="
+                    'changeProductList.' + scope.$index + '.qualifiedQuantity'
+                  "
+                  :rules="formRules.qualifiedQuantity"
+                  :inline-message="true"
+                  label-width="0"
+                >
+                  <el-input
+                    v-model="scope.row.qualifiedQuantity"
+                    placeholder="请输入"
+                    size="mini"
+                  >
+                  </el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column label="质检不合格" prop="disqualificationQuantity">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="
+                    'changeProductList.' +
+                    scope.$index +
+                    '.disqualificationQuantity'
+                  "
+                  :rules="formRules.disqualificationQuantity"
+                  :inline-message="true"
+                  label-width="0"
+                >
+                  <el-input
+                    v-model="scope.row.disqualificationQuantity"
+                    placeholder="请输入"
+                    size="mini"
+                  >
+                  </el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+            <el-table-column label="备注" prop="remark">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'changeProductList.' + scope.$index + '.remark'"
+                  :rules="formRules.remark"
+                  :inline-message="true"
+                  label-width="0"
+                >
+                  <el-input
+                    v-model="scope.row.remark"
+                    placeholder="请输入"
+                    size="mini"
+                  >
+                  </el-input>
+                </el-form-item>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-form-item>
+      </el-form>
+    </div>
+    <div style="text-align: center; margin-top: 15px">
+      <el-button size="small" @click="handleCancel">取消 </el-button>
+      <el-button type="primary" size="small" @click="handleSubmit">
+        确定</el-button
+      >
+    </div>
+  </div>
+</template>
+
+<script>
+import labelTitle from "@/components/label-title/index.vue";
+
+import { getToken } from "@/util/auth";
+
+export default {
+  name: "addInspection",
+  components: { labelTitle },
+  props: {
+    form: {
+      type: Object,
+      default: () => {},
+    },
+    warehouseSelectList: {
+      type: Array,
+      default: () => [],
+    },
+  },
+  data() {
+    return {
+      uploadHeader: {
+        Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
+        "Blade-Auth": "bearer " + getToken(),
+      },
+      loading: false,
+      selectDialog: false,
+      formRules: {
+        qualifiedQuantity: [
+          {
+            required: true,
+            message: "请输入质检合格数量",
+            trigger: "blur",
+          },
+        ],
+        disqualificationQuantity: [
+          {
+            required: true,
+            message: "请输入质检不合格数量",
+            trigger: "blur",
+          },
+        ],
+      },
+    };
+  },
+  created() {},
+  methods: {
+    handleSubmit() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          for (let i = 0; i < this.form.changeProductList.length; i++) {
+            if (
+              Number(this.form.changeProductList[i].qualifiedQuantity) +
+                Number(
+                  this.form.changeProductList[i].disqualificationQuantity
+                ) >
+              Number(this.form.changeProductList[i].totalQuantity)
+            ) {
+              return this.msgInfo("质检合格和质检不合格总合不能大于待质检数量");
+            }
+          }
+          this.loading = true;
+          this.$emit("submit");
+        }
+      });
+    },
+    handleCancel() {
+      this.$emit("cancel");
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.form-box {
+  height: calc(100vh - 280px);
+  overflow: auto;
+  box-sizing: border-box;
+  padding: 10px;
+}
+::v-deep {
+  .el-form-item {
+    margin-bottom: 3px;
+  }
+  .el-form--label-top .el-form-item__label {
+    padding: 8px 0 0 0;
+  }
+}
+</style>

+ 285 - 0
src/views/order-management/JDinspection/index.vue

@@ -0,0 +1,285 @@
+vbase
+
+<script>
+import test from "@/components/form-test/index.vue";
+import query from "@/components/query/index.vue";
+
+import * as API from "@/api/inbound-outbound/arrivalInspection.js";
+
+import { warehouseSelectList } from "@/api/product-material/warehouse/index.js";
+import addInspection from "./addInspection.vue";
+
+export default {
+  components: {
+    test,
+    query,
+    addInspection,
+  },
+  data() {
+    return {
+      warehouseSelectList: [],
+      warehouseTypeList: [],
+      qualityStatusList: [],
+      btnForm: {
+        otherButton: {
+          list: [
+            {
+              name: "发起调仓",
+              methodsText: "send",
+              type: "primary",
+              send: () => {
+                this.handleSend();
+              },
+            },
+          ],
+        },
+      },
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        keyword: "",
+        status: "",
+      },
+      selectConfig: [
+        {
+          label: "质检状态",
+          prop: "status",
+          data: [],
+        },
+      ],
+      tableList: [],
+      total: 0,
+      loading: false,
+      titleText: "京东退货质检",
+      open: false,
+      form: {
+        outWarehouseId: "",
+        inWarehouseId: "",
+        remark: "",
+        changeProductList: [],
+      },
+    };
+  },
+  created() {
+    const businessDictData = JSON.parse(
+      window.localStorage.getItem("businessDict")
+    );
+    this.qualityStatusList = businessDictData.find(
+      (item) => item.code === "qualityStatus"
+    ).children;
+    this.selectConfig[0].data = this.qualityStatusList.map((item) => ({
+      label: item.dictValue,
+      value: item.dictKey,
+    }));
+    // warehouseSelectList().then((res) => {
+    //   this.warehouseSelectList = res.data.data;
+    //   this.selectConfig[0].data = this.warehouseSelectList.map((item) => ({
+    //     label: item.name,
+    //     value: item.id,
+    //   }));
+    //   this.selectConfig[1].data = this.warehouseSelectList.map((item) => ({
+    //     label: item.name,
+    //     value: item.id,
+    //   }));
+    // });
+    this.getList();
+  },
+  methods: {
+    getList() {
+      this.loading = true;
+      API.qualityTestingList(this.queryParams).then(
+        (res) => {
+          this.tableList = res.data.data.records;
+          this.total = res.data.data.total;
+          this.loading = false;
+        },
+        (err) => {
+          console.log("qualityTestingList: " + err);
+          this.loading = false;
+        }
+      );
+    },
+    handleQuery() {
+      this.getList();
+    },
+    handleSend() {
+      this.form = {
+        outWarehouseId: "",
+        inWarehouseId: "",
+        remark: "",
+        changeProductList: [],
+      };
+      this.open = true;
+    },
+    handleCancel() {
+      this.open = false;
+    },
+
+    handleSubmit() {
+      const arr = this.form.changeProductList.map((x) => {
+        return {
+          id: x.id,
+          qualifiedQuantity: x.qualifiedQuantity,
+          disqualificationQuantity: x.disqualificationQuantity,
+          warehouseId: x.warehouseId,
+        };
+      });
+      API.addInspection(arr).then(
+        () => {
+          this.msgSuccess("添加成功");
+          this.$refs.addInspection.loading = false;
+          this.open = false;
+          this.getList();
+        },
+        (err) => {
+          console.log("addInspection: " + err);
+          this.$refs.addInspection.loading = false;
+        }
+      );
+    },
+    handleReceive(row) {
+      this.open = true;
+      this.$nextTick(() => {
+        this.$refs.addInspection.loading = true;
+        API.qualityTestingDetails({ qualityInfoId: row.id }).then(
+          (res) => {
+            let list = res.data.data;
+
+            this.form = {
+              purchaseCode: row.code,
+              supplierName: row.supplierName,
+              logisticsCompanyName: row.logisticsCompanyName,
+              code: row.logisticsInfoCode,
+              changeProductList: list,
+            };
+            this.$refs.addInspection.loading = false;
+          },
+          (err) => {
+            console.log("qualityTestingDetails: " + err);
+            this.$refs.addInspection.loading = false;
+          }
+        );
+      });
+    },
+  },
+};
+</script>
+
+
+<template>
+  <div class="box-card">
+    <el-card class="body-main">
+      <query
+        :selectConfig="selectConfig"
+        :req="queryParams"
+        :isShowMore="true"
+        @handleQuery="handleQuery"
+        @handleMore="
+          () => {
+            queryDialog = true;
+          }
+        "
+      ></query>
+      <el-table :data="tableList" v-loading="loading">
+        <!-- <el-table-column
+          label="采购单号"
+          align="left"
+          prop="code"
+          width="150"
+        /> -->
+        <!-- <el-table-column label="供应商" align="left" prop="supplierName" /> -->
+
+        <el-table-column
+          label="产品名称"
+          align="left"
+          prop="productName"
+          width="100"
+        />
+        <el-table-column label="退货数量" align="left" prop="sum" width="100" />
+        <el-table-column label="仓库名称" align="left" prop="sum" width="100" />
+        <el-table-column
+          label="物流公司"
+          align="left"
+          prop="logisticsCompanyName"
+          width="100"
+        />
+        <el-table-column
+          label="物流/快递单号"
+          align="left"
+          prop="logisticsInfoCode"
+        />
+        <!-- <el-table-column
+          label="采购员"
+          align="left"
+          prop="createUserName"
+          width="100"
+        /> -->
+        <el-table-column
+          label="采购时间"
+          align="left"
+          prop="createTime"
+          width="150"
+        />
+        <!-- <el-table-column label="调入仓库" align="left" prop="warehouseName" /> -->
+        <el-table-column
+          label="状态"
+          align="left"
+          prop="status"
+          width="100"
+          :formatter="(row) => dictDataEcho(row.status, qualityStatusList)"
+        />
+        <el-table-column label="操作" align="center" width="120">
+          <template slot-scope="scope">
+            <el-button
+              type="text"
+              @click="handleReceive(scope.row)"
+              v-if="scope.row.status < 3"
+              >质检
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="total > 0"
+        :total="total"
+        :page.sync="queryParams.pageNum"
+        :limit.sync="queryParams.pageSize"
+        @pagination="getList"
+      />
+    </el-card>
+
+    <el-dialog
+      :title="titleText"
+      :visible.sync="open"
+      v-if="open"
+      width="80%"
+      top="60px"
+    >
+      <add-inspection
+        :form="form"
+        @submit="handleSubmit"
+        @cancel="handleCancel"
+        ref="addInspection"
+      ></add-inspection>
+    </el-dialog>
+  </div>
+</template>
+
+
+<style lang="scss" scoped>
+.box-card {
+  height: calc(100vh - 110px);
+  overflow-y: auto;
+  display: flex;
+  flex-direction: column;
+  .header {
+    // height: 100px;
+    margin-bottom: 10px;
+    box-sizing: border-box;
+  }
+  .body-main {
+    flex: 1;
+    overflow-y: auto;
+  }
+}
+</style>

+ 180 - 0
src/views/order-management/addLogistics.vue

@@ -0,0 +1,180 @@
+<template>
+  <div v-loading="loading">
+    <div class="form-box">
+      <el-form
+        label-position="top"
+        :model="form"
+        ref="form"
+        :rules="formRules"
+        label-width="100px"
+      >
+        <el-row :gutter="10">
+          <el-col :span="6">
+            <el-form-item label="单号" prop="businessCode">
+              <el-input v-model="form.businessCode"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="数据来源" prop="businessType">
+              <el-select
+                v-model="form.businessType"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in logisticsDataSourceList"
+                  :key="item.dictKey"
+                  :label="item.dictValue"
+                  :value="item.dictKey"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="6">
+            <el-form-item label="物流状态" prop="logisticsStatus">
+              <el-select
+                v-model="form.logisticsStatus"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in logisticsStatusList"
+                  :key="item.dictKey"
+                  :label="item.dictValue"
+                  :value="item.dictKey"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row :gutter="10">
+          <el-col :span="6">
+            <el-form-item label="物流信息" prop="logisticsCompanyCode">
+              <el-select
+                v-model="form.logisticsCompanyCode"
+                placeholder="请选择"
+                style="width: 100%"
+              >
+                <el-option
+                  v-for="item in logisticsData"
+                  :key="item.code"
+                  :label="item.name"
+                  :value="item.code"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="物流/快递单" prop="code">
+              <el-input
+                v-model="form.code"
+                placeholder="物流/快递单号"
+              ></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+    </div>
+    <div style="text-align: center; margin-top: 15px">
+      <el-button size="small" @click="handleCancel">取消 </el-button>
+      <el-button type="primary" size="small" @click="handleSubmit">
+        确定</el-button
+      >
+    </div>
+  </div>
+</template>
+
+<script>
+import labelTitle from "@/components/label-title/index.vue";
+import { getLogisticsData } from "@/api/system/common.js";
+
+export default {
+  name: "addLogistics",
+  components: { labelTitle },
+  props: {
+    form: {
+      type: Object,
+      default: () => {},
+    },
+  },
+  data() {
+    return {
+      loading: false,
+      formRules: {
+        logisticsCompanyCode: [
+          {
+            required: true,
+            message: "请选择物流信息",
+            trigger: "change",
+          },
+        ],
+        code: [
+          {
+            required: true,
+            message: "请输入物流/快递单号",
+            trigger: "blur",
+          },
+        ],
+      },
+      selectDialog: false,
+      logisticsData: [],
+      logisticsDataSourceList: [],
+      logisticsStatusList: [],
+      // form: {
+      //   businessCode: "",
+      //   logisticsCompanyCode: "",
+      //   businessType: "",
+      //   logisticsStatus: "",
+      //   code: "",
+      // },
+    };
+  },
+  created() {
+    getLogisticsData({ keyword: "" }).then((res) => {
+      this.logisticsData = res.data.data;
+    });
+    const businessDictData = JSON.parse(
+      window.localStorage.getItem("businessDict")
+    );
+    this.logisticsDataSourceList = businessDictData.find(
+      (item) => item.code === "logisticsDataSource"
+    ).children;
+    this.logisticsStatusList = businessDictData.find(
+      (item) => item.code === "logisticsStatus"
+    ).children;
+  },
+  methods: {
+    handleSubmit() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.loading = true;
+          this.$emit("submit");
+        }
+      });
+    },
+    handleCancel() {
+      this.$emit("cancel");
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.form-box {
+  height: calc(100vh - 280px);
+  overflow: auto;
+  box-sizing: border-box;
+  padding: 10px;
+}
+::v-deep {
+  .el-form-item {
+    margin-bottom: 3px;
+  }
+  .el-form--label-top .el-form-item__label {
+    padding: 8px 0 0 0;
+  }
+}
+</style>

+ 7 - 1
src/views/purchase-management/deliver-goods/index.vue

@@ -115,6 +115,9 @@ export default {
     handleSelectionChange(arr) {
       this.selectData = arr;
     },
+    handleReturn(row) {
+      console.log(row, "ass");
+    },
     handleSend(row) {
       this.form = {
         businessId: row.id,
@@ -315,9 +318,12 @@ export default {
           prop="createName"
           width="120"
         /> -->
-        <el-table-column label="操作" align="center" width="240">
+        <el-table-column label="操作" align="center" width="280">
           <template slot-scope="scope">
             <div v-if="scope.row.status !== 99 && scope.row.status !== 50">
+              <el-button type="text" @click="handleReturn(scope.row)">
+                退货
+              </el-button>
               <el-button type="text" @click="handleSend(scope.row)">
                 发货通知
               </el-button>

+ 34 - 3
src/views/purchase-management/purchase/addPurchase.vue

@@ -11,7 +11,7 @@
         <el-row>
           <el-col :span="8">
             <el-form-item label="供应商" prop="supplierId">
-                  <el-select
+              <el-select
                 v-model="form.supplierId"
                 placeholder="请选择"
                 style="width: 100%"
@@ -62,8 +62,25 @@
             >
             </el-table-column>
             <el-table-column label="单位" prop="goodsUnit"> </el-table-column>
-
-            <el-table-column label="采购数量" prop="quantity">
+            <el-table-column label="采购数量" prop="assq"> </el-table-column>
+            <el-table-column label="已采购数量" prop="assw"> </el-table-column>
+            <el-table-column label="此次采购数量" prop="quantity">
+              <template slot-scope="scope">
+                <el-form-item
+                  :prop="'goodsList.' + scope.$index + '.quantity'"
+                  :rules="formRules.quantity"
+                  :inline-message="true"
+                  label-width="0"
+                >
+                  <el-input
+                    v-model="scope.row.quantity"
+                    placeholder="请输入"
+                    size="mini"
+                    @change="handleChange"
+                  >
+                  </el-input>
+                </el-form-item>
+              </template>
             </el-table-column>
 
             <el-table-column label="单价" prop="unitPrice">
@@ -156,6 +173,13 @@ export default {
             trigger: "change",
           },
         ],
+        quantity: [
+          {
+            required: true,
+            message: "请输入采购数量",
+            trigger: "blur",
+          },
+        ],
         unitPrice: [
           {
             required: true,
@@ -193,6 +217,13 @@ export default {
     handleSubmit() {
       this.$refs.form.validate((valid) => {
         if (valid) {
+          const data = [...this.form.goodsList];
+          for (let i = 0; i < data.length; i++) {
+            const e = data[i];
+            if (Number(e.assw) + Number(e.quantity) > Number(e.quantity)) {
+              return this.msgInfo("此次采购数量和已采购数量合不可大于采购数量");
+            }
+          }
           this.loading = true;
           this.$emit("submit");
         }

+ 1 - 1
src/views/purchase-management/purchase/index.vue

@@ -27,7 +27,7 @@ export default {
         otherButton: {
           list: [
             {
-              name: this.$t("purchase_management.purchase.purchase"),
+              name: "采购",
               methodsText: "add",
               type: "primary",
               add: () => {