Explorar el Código

【新增】直接调拨单

莫绍宝 hace 3 años
padre
commit
aaf0007ece

+ 109 - 0
src/api/supply/direct.js

@@ -0,0 +1,109 @@
+import request from '@/utils/request'
+
+// 获取列表
+export function getList(params) {
+  return request({
+    url: '/requisition/list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取详情
+export function getDetail(params) {
+  return request({
+    url: '/requisition/detail',
+    method: 'get',
+    params
+  })
+}
+
+// 审批
+export function examineApply(params) {
+  return request({
+    url: '/invoice/approvalInvoice',
+    method: 'post',
+    data: params
+  })
+}
+
+// 获取仓位列表
+export function getPositionList(params) {
+  return request({
+    url: '/stock/listPosition',
+    method: 'get',
+    params
+  })
+}
+
+// 检查库存
+export function checkStock(params) {
+  return request({
+    url: '/invoice/stockNumber',
+    method: 'get',
+    params
+  })
+}
+
+// 申请/撤回
+export function submitApply(params) {
+  return request({
+    url: '/invoice/submit',
+    method: 'post',
+    params
+  })
+}
+
+// 删除
+export function deleteApply(params) {
+  return request({
+    url: '/invoice/delete',
+    method: 'post',
+    params
+  })
+}
+
+// 新增
+export function addApply(params) {
+  return request({
+    url: '/invoice/add',
+    method: 'post',
+    data: params
+  })
+}
+
+// 编辑
+export function editApply(params) {
+  return request({
+    url: '/invoice/update',
+    method: 'post',
+    data: params
+  })
+}
+
+// 获取仓库列表
+export function getWarehouseList(params) {
+  return request({
+    url: '/stock/listStock',
+    method: 'get',
+    params
+  })
+}
+
+// 获取产品列表
+export function getGoodsList(params) {
+  return request({
+    url: '/retail/list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取经销商列表
+export function getDealerList(params) {
+  return request({
+    url: '/customer/list',
+    method: 'get',
+    params
+  })
+}

+ 5 - 0
src/views/supply/direct.vue

@@ -0,0 +1,5 @@
+<template>
+  <div>
+    <router-view />
+  </div>
+</template>

+ 333 - 0
src/views/supply/direct/components/direct_detail.vue

@@ -0,0 +1,333 @@
+<template>
+  <div class="detail-container">
+    <el-page-header @back="goBack" content="详情"></el-page-header>
+
+    <div class="main-title">
+      <div class="title">发货申请单信息</div>
+    </div>
+
+    <div class="diy-table-1">
+      <el-row>
+        <el-col :span="8" class="item">
+          <div class="label">发货申请单号</div>
+          <div class="value">{{detailData.id}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">申请日期</div>
+          <div class="value">{{detailData.createTime}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据状态</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商编号</div>
+          <div class="value">{{detailData.customerNumber}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商名称</div>
+          <div class="value">{{detailData.customerName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">仓库</div>
+          <div class="value">{{detailData.correspondName}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">备注</div>
+          <div class="value">{{detailData.remark}}</div>
+        </el-col>
+        <el-col :span="24" class="item file">
+          <div class="label">附件</div>
+          <div class="value">
+            <div class="file-list">
+              <div class="file-item">
+                <el-image v-if="checkFileType(detailData.fileUrl) == 'image'" class="img" :src="imageURL + detailData.fileUrl" :preview-src-list="[imageURL + detailData.fileUrl]"></el-image>
+                <div v-else class="box2" @click="openLink(detailData.fileUrl)">
+                  <img src="@/assets/common/word.png" v-if="checkFileType(detailData.fileUrl) == 'word'" />
+                  <img src="@/assets/common/excel.png" v-if="checkFileType(detailData.fileUrl) == 'excel'" />
+                  <img src="@/assets/common/ppt.png" v-if="checkFileType(detailData.fileUrl) == 'ppt'" />
+                  <img src="@/assets/common/pdf.png" v-if="checkFileType(detailData.fileUrl) == 'pdf'" />
+                  <div class="name ellipsis-3">{{ detailData.fileName }}</div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">制单人</div>
+          <div class="value">{{detailData.createBy}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">制单日期</div>
+          <div class="value">{{detailData.createTime}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">审核人</div>
+          <div class="value">{{detailData.approvalName}}</div>
+        </el-col>
+        <el-col :span="6" class="item">
+          <div class="label">审核日期</div>
+          <div class="value">{{detailData.approvalTime}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">审批说明</div>
+          <div class="value">{{detailData.approvalRemark}}</div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="main-title">
+      <div class="title">货品信息</div>
+    </div>
+
+    <div class="table" style="margin-top: 20px">
+      <el-table :data="detailData.orders" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-tag size="mini" style="margin: 0 5px;" v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="申请数量" prop="invoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="审批数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+      </el-table>
+    </div>
+
+    <div v-if="isExamine">
+      <div class="main-title">
+        <div class="title">审批记录</div>
+      </div>
+      <div class="diy-table-1">
+        <el-row :gutter="0">
+          <el-col :span="12" class="item">
+            <div class="label">审批人</div>
+            <div class="value">{{detailData.approvalName}}</div>
+          </el-col>
+          <el-col :span="12" class="item">
+            <div class="label">审批结果</div>
+            <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+          </el-col>
+          <el-col :span="24" class="item">
+            <div class="label">审批说明</div>
+            <div class="value">{{detailData.approvalRemark}}</div>
+          </el-col>
+        </el-row>
+      </div>
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button  type="primary" @click="openDeliverDialog">直调发货</el-button>
+        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+          <el-button slot="reference">关 闭</el-button>
+        </el-popconfirm>
+      </div>
+    </div>
+
+    <el-dialog
+      title="直调发货"
+      :visible.sync="isShowDeliverDialog"
+      width="80%">
+      <el-form ref="deliverForm" :model="deliverForm" label-width="70px" size="small" label-position="left">
+        <el-row :gutter="20">
+          <el-col :xs="24" :sm="8" :lg="8">
+            <el-form-item label="工程订单" prop="orderNum">
+              <el-input v-model="deliverForm.orderNum" placeholder="请输入工程订单"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="8" :lg="8" style="height: 51px;">
+            <el-form-item label="发货日期" prop="date">
+              <el-date-picker
+                v-model="deliverForm.date"
+                type="date"
+                value-format="yyyy-MM-dd"
+                style="width: 100%;"
+                placeholder="选择日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="24" :sm="8" :lg="8">
+            <el-form-item label="发货仓库" prop="warehouse">
+              <el-select v-model="deliverForm.warehouse" placeholder="请选择发货仓库">
+                <el-option
+                  v-for="item in warehouseList"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <div class="table" style="margin-top: 20px">
+        <el-table :data="detailData.orders" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+          <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span v-for="(item, index) in scope.row.stockIds" :key="index">{{item.name}}</span>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="库存数" prop="stockNumber" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="申请数量" prop="invoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="审批数量" prop="approvalNumber" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+        </el-table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDeliverDialog">取 消</el-button>
+        <el-button type="primary" @click="submitDeliverForm">确 定</el-button>
+      </span>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import { getDetail } from "@/api/supply/direct";
+import { getFileUrl } from '@/api/common';
+
+export default {
+  name: 'DirectDetail',
+  componentName: 'DirectDetail',
+  props: ['listItem'],
+  filters: {
+    statusFilter(val) {
+      const statusList = [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ];
+      let obj = statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
+  data() {
+    return {
+      imageURL: this.$imageUrl,
+      detailData: {},
+
+      isShowDeliverDialog: false,
+      deliverForm: {
+        orderNum: '',
+        date: '',
+      },
+      warehouseList: [],
+    }
+  },
+
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+    isExamine() {
+      return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === "FAIL"
+    },
+  },
+
+  created() {
+    this.getDetail();
+  },
+
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+      })
+    },
+
+    // 检查文件类型
+    checkFileType(url) {
+      if(!url) return '';
+			const fileSuffix = url.substring(url.lastIndexOf(".") + 1);
+
+			if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
+				return 'image';
+			}else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
+				return 'word';
+			}else if(['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
+				return 'excel';
+			}else if(['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
+				return 'ppt';
+			}else if(['pdf'].includes(fileSuffix)) {
+				return 'pdf';
+			}else {
+        return '';
+      }
+		},
+
+    // 打开链接
+    openLink(url) {
+      getFileUrl({key: url}).then(res => {
+        window.open(res.data);
+      })
+    },
+
+    // 打开 直调发货
+    openDeliverDialog() {
+      this.isShowDeliverDialog = true;
+    },
+
+    // 关闭 直调发货
+    closeDeliverDialog() {
+      this.isShowDeliverDialog = false;
+    },
+
+    // 提交 直调发货
+    submitDeliverForm() {
+
+    },
+
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+  .main-title {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: 20px;
+    height: 60px;
+    border-bottom: 1px solid #DCDFE6;
+    margin-bottom: 20px;
+    .title {
+      font-size: 16px;
+      font-weight: 600;
+      padding-left: 10px;
+    }
+  }
+</style>

+ 295 - 0
src/views/supply/direct/components/direct_examine.vue

@@ -0,0 +1,295 @@
+<template>
+  <div class="detail-container">
+    <el-page-header @back="goBack" content="审批"></el-page-header>
+
+    <div class="main-title">
+      <div class="title">发货申请单信息</div>
+    </div>
+
+    <div class="diy-table-1">
+      <el-row>
+        <el-col :span="8" class="item">
+          <div class="label">发货申请单号</div>
+          <div class="value">{{detailData.id}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">申请日期</div>
+          <div class="value">{{detailData.createTime}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">单据状态</div>
+          <div class="value">{{detailData.examineStatus | statusFilter}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商编号</div>
+          <div class="value">{{detailData.customerNumber}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">经销商名称</div>
+          <div class="value">{{detailData.customerName}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">仓库</div>
+          <div class="value">{{detailData.correspondName}}</div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">备注</div>
+          <div class="value">{{detailData.remark}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">制单人</div>
+          <div class="value">{{detailData.createBy}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label">制单日期</div>
+          <div class="value">{{detailData.createTime}}</div>
+        </el-col>
+        <el-col :span="8" class="item">
+          <div class="label"></div>
+          <div class="value"></div>
+        </el-col>
+      </el-row>
+    </div>
+
+    <div class="main-title">
+      <div class="title">货品信息</div>
+    </div>
+
+    <div class="table" style="margin-top: 20px">
+      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="发货仓库" prop="stockIds" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-select v-model="scope.row.stockIds" placeholder="请选择发货仓库" size="small" multiple filterable @change="changeWarehouse(scope.$index)">
+              <el-option :label="item.name" :value="item.id" v-for="(item, index) in positionList" :key="index"></el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="库存数" prop="stockNumber" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="销售订单号" prop="retailOrderId" min-width="180" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品编码" prop="materialCode" min-width="120" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="计量单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="申请数量" prop="invoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="审批数量" prop="approvalNumber" min-width="100" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.approvalNumber" size="small" type="number"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remark" size="small"></el-input>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <div class="main-title">
+      <div class="title">审批信息</div>
+    </div>
+    <div class="diy-table-1">
+      <el-row :gutter="0">
+        <el-col :span="12" class="item">
+          <div class="label">审批人</div>
+          <div class="value">{{userName}}</div>
+        </el-col>
+        <el-col :span="12" class="item">
+          <div class="label">审批结果</div>
+          <div class="value">
+            <el-radio-group v-model="examineForm.status">
+              <el-radio :label="true">通过</el-radio>
+              <el-radio :label="false">驳回</el-radio>
+            </el-radio-group>
+          </div>
+        </el-col>
+        <el-col :span="24" class="item">
+          <div class="label">审批说明</div>
+          <div class="value"><el-input v-model="examineForm.remark" placeholder="请输入内容"></el-input></div>
+        </el-col>
+      </el-row>
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button type="primary" @click="clickSubmitForm" :loading="formLoading">{{ formLoading ? '提交中 ...' : '提 交' }}</el-button>
+        <el-popconfirm
+          title="确定关闭吗?"
+          @onConfirm="goBack"
+          style="margin-left: 10px;"
+        >
+          <el-button slot="reference">关 闭</el-button>
+        </el-popconfirm>
+      </div>
+    </div>
+
+  </div>
+</template>
+
+<script>
+import { getDetail, examineApply, getPositionList, checkStock } from "@/api/supply/direct";
+
+export default {
+  name: 'DirectExamine',
+  componentName: 'DirectExamine',
+  props: ['listItem'],
+  filters: {
+    statusFilter(val) {
+      const statusList = [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ];
+      let obj = statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
+  data() {
+    return {
+      detailData: {},
+      goodsList: [],
+      userName: JSON.parse(localStorage.getItem("supply_user")).nickName,
+
+      formLoading: false,
+      examineForm: {
+        status: true,
+        remark: '',
+      },
+      positionList: [],
+    }
+  },
+
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+
+  created() {
+    this.getDetail();
+  },
+
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        this.detailData = res.data;
+
+        res.data.orders.forEach((item, index) => {
+          if(item.stockIds && item.stockIds.length > 0) {
+            item.stockIds = item.stockIds.map((it, idx) => {
+              return it.id;
+            });
+          }
+        });
+
+        this.goodsList = res.data.orders;
+        this.getPositionList();
+      })
+    },
+
+    // 获取仓位列表
+    getPositionList() {
+      getPositionList({
+        correspondId: this.detailData.correspondId
+      }).then((res) => {
+        this.positionList = res.data;
+      })
+    },
+
+    // 修改仓位
+    changeWarehouse(index) {
+      if(this.goodsList[index].stockIds && this.goodsList[index].stockIds.length > 0) {
+        checkStock({
+          materialId: this.goodsList[index].materialId,
+          StockIds: this.goodsList[index].stockIds.join(',')
+        }).then(res => {
+          this.goodsList[index].stockNumber = res.data;
+        })
+      }else {
+        this.goodsList[index].stockNumber = 0;
+      }
+    },
+
+    // 提交审批
+    clickSubmitForm() {
+      for(let i=0; i<this.goodsList.length; i++) {
+        if(this.goodsList[i].stockIds && this.goodsList[i].stockIds.length < 1) {
+          this.$errorMsg('请选择发货仓库');
+          return;
+        }
+        if(this.goodsList[i].stockNumber < 1) {
+          this.$errorMsg('库存不足');
+          return;
+        }
+        if(this.goodsList[i].approvalNumber > this.goodsList[i].stockNumber) {
+          this.$errorMsg('审批数量不可大于库存数');
+          return;
+        }
+        if(this.goodsList[i].approvalNumber > this.goodsList[i].invoiceNum) {
+          this.$errorMsg('审批数量不可大于申请数量');
+          return;
+        }
+      }
+
+      this.formLoading = true;
+      examineApply({
+        id: this.listItem.id,
+        examineStatus: this.examineForm.status ? 'OK' : 'FAIL',
+        approvalRemark: this.examineForm.remark,
+        orders: this.goodsList
+      }).then(res => {
+        this.$successMsg('审批成功');
+        this.goBack();
+        this.$parent.getList();
+      }).finally(res => {
+        this.formLoading = false;
+      })
+    },
+
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+  .main-title {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: 20px;
+    height: 60px;
+    border-bottom: 1px solid #DCDFE6;
+    margin-bottom: 20px;
+    .title {
+      font-size: 16px;
+      font-weight: 600;
+      padding-left: 10px;
+    }
+  }
+
+  ::v-deep input::-webkit-outer-spin-button,
+  ::v-deep input::-webkit-inner-spin-button {
+    -webkit-appearance: none;
+  }
+  ::v-deep input[type='number'] {
+    -moz-appearance: textfield;
+  }
+</style>

+ 534 - 0
src/views/supply/direct/components/direct_form.vue

@@ -0,0 +1,534 @@
+<template>
+  <div class="detail-container">
+    <el-page-header @back="goBack" :content="listItem ? '编辑':'新增'"></el-page-header>
+
+    <div class="main-title">
+      <div class="title">发货申请单信息</div>
+    </div>
+
+    <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="90px" size="small" label-position="right">
+      <el-row :gutter="20">
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="订单号" prop="id">
+            <el-input v-model="mainForm.orderNum" placeholder="系统自动生成" readonly></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
+          <el-form-item label="单据日期" prop="date">
+            <el-date-picker
+              v-model="mainForm.date"
+              type="date"
+              value-format="yyyy-MM-dd"
+              style="width: 100%;"
+              placeholder="选择日期">
+            </el-date-picker>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="制单人" prop="createMan">
+            <el-input v-model="mainForm.createMan" readonly></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="24" :lg="16">
+          <el-form-item label="备注" prop="remark">
+            <el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="12" :lg="8">
+          <el-form-item label="经销商" prop="jxsNum">
+            <el-select v-model="mainForm.jxsNum" placeholder="请选择经销商" style="width: 100%;" disabled>
+              <el-option :label="item.name" :value="item.id" v-for="(item, index) in dealerList" :key="index"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :xs="24" :sm="8" :lg="8">
+          <el-form-item label="附件" prop="fileUrl">
+            <fileUpload :fileList="fileList" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <div class="main-title">
+      <div class="title">货品信息</div>
+      <div>
+        <span style="font-size: 14px; margin-right: 10px">仓库</span>
+        <el-select v-model="screenForm.warehouse" placeholder="请选择发货仓库" size="small" filterable clearable :disabled="goodsList.length > 0">
+          <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
+        </el-select>
+        <el-divider direction="vertical"></el-divider>
+        <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加引用</el-button>
+      </div>
+    </div>
+
+    <div class="table" style="margin-top: 20px">
+      <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
+        <el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
+        <el-table-column align="center" label="引用单号" prop="orderId" min-width="180" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="数量" prop="qty" min-width="80" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="申请数量" prop="invoiceNum" min-width="110" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.invoiceNum" size="small"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="已申请数量" prop="alreadyInvoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column align="center" label="未申请数量" prop="refundableQty" min-width="100" show-overflow-tooltip> </el-table-column>
+        <el-table-column align="center" label="备注" prop="remark" min-width="160" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-input v-model="scope.row.remark" size="small"></el-input>
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="操作" width="100" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+    
+    <div class="page-footer">
+      <div class="footer" :class="classObj">
+        <el-button type="primary" @click="clickSubmitForm('SAVE')">保 存</el-button>
+        <el-button type="primary" @click="clickSubmitForm('WAIT')">提交审核</el-button>
+        <el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
+          <el-button slot="reference">关 闭</el-button>
+        </el-popconfirm>
+      </div>
+    </div>
+
+    <el-dialog title="添加产品" :visible.sync="isShowDialog" width="80%">
+      <el-form ref="screenForm" :model="screenForm" size="small" label-position="left" label-width="70px">
+        <el-row :gutter="20">
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="warehouse" label="选择仓库">
+              <el-select v-model="screenForm.warehouse" placeholder="请选择仓库" size="small" filterable clearable :disabled="goodsList.length > 0 || tableSelection.length > 0">
+                <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="type" label="产品大类">
+              <el-select v-model="screenForm.type" placeholder="选择产品大类" style="width: 100%" :disabled="goodsList.length > 0 || tableSelection.length > 0">
+                <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6">
+            <el-form-item prop="orderNum" label="订单号">
+              <el-input v-model="screenForm.orderNum" placeholder="请输入订单号"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="12" :sm="6" :lg="6" class="tr">
+            <el-form-item label="">
+              <el-button size="small" @click="resetScreenForm">清空</el-button>
+              <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <div class="table">
+        <el-table :data="tableGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="tableSelectionChange">
+          <el-table-column align="center" type="selection" width="55" :selectable='checkboxSelect'></el-table-column>
+          <el-table-column align="center" label="订单号" prop="orderId" min-width="180" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="单位" prop="unit" min-width="80" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="数量" prop="qty" min-width="80" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="本次申请数量" prop="invoiceNum" min-width="110" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-input v-model="scope.row.invoiceNum" size="small"></el-input>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="已申请数量" prop="alreadyInvoiceNum" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="未申请数量" prop="refundableQty" min-width="100" show-overflow-tooltip></el-table-column>
+          <el-table-column align="center" label="总库存数量" prop="stockAdequate" min-width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              {{scope.row.stockAdequate | stockFilter}}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="对应库存数量" prop="stockCorrespond" min-width="110" show-overflow-tooltip></el-table-column>
+        </el-table>
+        <div class="pagination clearfix" style="margin-top: 10px">
+          <div class="fr">
+            <el-pagination
+              @current-change="handleTableCurrentChange"
+              :current-page="currentPage"
+              :page-size="10"
+              background
+              layout="prev, pager, next"
+              :total="listTotal">
+            </el-pagination>
+          </div>
+        </div>
+      </div>
+      
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="closeDialog">取 消</el-button>
+        <el-button type="primary" @click="submitAddGoods">确 定</el-button>
+      </span>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import { getDetail, addApply, editApply, getGoodsList, getWarehouseList, getDealerList } from "@/api/supply/direct";
+import { getDictList } from '@/api/common'
+import { findElem } from '@/utils/util'
+import fileUpload from '@/components/Common/file-upload.vue'
+
+export default {
+  components: {
+    fileUpload
+  },
+  name: 'DirectForm',
+  componentName: 'DirectForm',
+  props: ['listItem'],
+  filters: {
+    stockFilter(val) {
+      const MAP = {
+        0: '不充足',
+        1: '充足'
+      }
+      return MAP[val]
+    }
+  },
+  data() {
+    return {
+      mainForm: {
+        orderNum: '',
+        date: '',
+        jxsNum: '',
+        remark: '',
+        createMan: '',
+      },
+      mainFormRules: {
+        date: [
+          { required: true, message: '请选择单据日期', trigger: 'change' }
+        ],
+      },
+      dealerList: [],
+      fileList: [],
+      goodsList: [],
+
+      warehouseList: [],
+      isShowDialog: false,
+      screenForm: {
+        warehouse: '',
+        type: '',
+        orderNum: '',
+      },
+      currentPage: 1,
+      listTotal: 0,
+      typeList: [],
+      
+      tableGoodsList: [],
+      tableSelection: [],
+    }
+  },
+
+  computed: {
+    sidebar() {
+      return this.$store.state.app.sidebar
+    },
+    classObj() {
+      return {
+        hideSidebar: !this.sidebar.opened,
+        openSidebar: this.sidebar.opened
+      }
+    },
+  },
+
+  created() {
+    this.getDictList();
+    this.getWarehouseList();
+    this.getDealerList();
+    if(this.listItem) {
+      this.getDetail();
+    }else {
+      this.mainForm.jxsNum = JSON.parse(localStorage.getItem("supply_user")).customerId;
+      this.mainForm.createMan = JSON.parse(localStorage.getItem("supply_user")).nickName;
+    }
+  },
+
+  methods: {
+    // 返回列表
+    goBack() {
+      this.$emit('backListFormDetail');
+    },
+
+    // 获取详情
+    getDetail() {
+      getDetail({id: this.listItem.id}).then(res => {
+        let data = res.data;
+        this.mainForm.orderNum = data.id;
+        this.mainForm.date = data.orderTime;
+        this.mainForm.jxsNum = data.customerNumber;
+        this.mainForm.createMan = data.createBy;
+        this.mainForm.remark = data.remark;
+        this.screenForm.warehouse = data.correspondId;
+        this.fileList = data.fileUrl ? [{
+          url: data.fileUrl,
+          name: data.fileName
+        }] : [];
+        data.orders.forEach(item => {
+          item.orderId = item.id;
+        })
+        this.goodsList = data.orders;
+      })
+    },
+
+    // 获取仓库列表
+    getWarehouseList() {
+      getWarehouseList({
+        pageNum: 1,
+        pageSize: -1
+      }).then((res) => {
+        this.warehouseList = res.data.records;
+      })
+    },
+
+    getDictList() {
+      getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
+        this.typeList = res.data;
+      })
+    },
+
+    // 获取经销商列表
+    getDealerList() {
+      getDealerList({
+        pageNum: 1,
+        pageSize: -1,
+        bindUser: false
+      }).then(res => {
+        this.dealerList = res.data.records;
+      })
+    },
+
+    // 获取商品列表
+    getGoodsList() {
+      getGoodsList({
+        pageNum: this.currentPage,
+        pageSize: 10,
+        stockId: this.screenForm.warehouse,
+        mainId: this.screenForm.type,
+        id: this.screenForm.orderNum,
+        examineStatus: 'OK',
+        type: 1,
+      }).then(res => {
+        let goodsList = [];
+        res.data.records.forEach(item => {
+          goodsList.push({
+            orderId: item.id,
+            retailId: item.retailId,
+            saleTypeName: item.saleTypeName,
+            materialId: item.materialId,
+            materialCode: item.materialCode,
+            materialName: item.materialName,
+            specification: item.specification,
+            unit: item.unit,
+            qty: item.qty,
+            invoiceNum: item.invoiceNum,
+            alreadyInvoiceNum: item.alreadyInvoiceNum,
+            refundableQty: item.refundableQty,
+            stockAdequate: item.stockAdequate,
+            stockCorrespond: item.stockCorrespond,
+          })
+        });
+
+        let oldGoodsList = this.goodsList;
+        let newGoodsList = goodsList;
+        for(let i = 0; i < oldGoodsList.length; i++) {
+          let oldItem = oldGoodsList[i]
+          for(let j = 0; j < newGoodsList.length; j++) {
+            let newItem = newGoodsList[j]
+            if(newItem.materialId === oldItem.materialId){
+              newGoodsList[j].selected = true;
+              break;
+            }
+          }
+        }
+
+        this.tableGoodsList = newGoodsList;
+        this.listTotal = res.data.total;
+      })
+    },
+
+    // 查询重复值并禁选
+    checkboxSelect(row, rowIndex) {
+      if (row.selected) {
+        return false // 禁用
+      }else{
+        return true // 不禁用
+      }
+    },
+
+    // 点击 选择商品
+    openDialog() {
+      if(!this.screenForm.warehouse) {
+        return this.$errorMsg('请选择仓库');
+      }
+      this.isShowDialog = true;
+      if(this.screenForm.warehouse && this.screenForm.type) {
+        this.getGoodsList();
+      }
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      if(!this.screenForm.warehouse || !this.screenForm.type) {
+        return this.$errorMsg('请选择仓库和产品大类');
+      }
+      this.currentPage = 1;
+      this.getGoodsList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.tableGoodsList = [];
+      // this.getGoodsList();
+    },
+
+    // 更改列表当前页
+    handleTableCurrentChange(val) {
+      if(this.tableSelection.length > 0) {
+        return this.$errorMsg('已选择产品不可切换');
+      }
+      this.currentPage = val;
+      this.getGoodsList();
+    },
+
+    // 关闭 弹窗
+    closeDialog() {
+      this.isShowDialog = false;
+    },
+
+    // 列表选择
+    tableSelectionChange(val) {
+      this.tableSelection = val;
+    },
+
+    // 数组去重
+    delRepeat(arr1, arr2) {
+      let allArr = arr1.concat(arr2); // 两个数组对象合并
+      let newArr = []; // 存放去重后数据的新数组
+      for(let i=0; i<allArr.length; i++){  // 循环allArr数组对象的内容
+        let flag = true;  // 建立标记,判断数据是否重复,true为不重复
+        for(let j=0; j<newArr.length; j++){  // 循环新数组的内容
+          if(allArr[i].materialId == newArr[j].materialId){ // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
+            flag = false;
+          }
+        }
+        if(flag){ // 判断是否重复
+          newArr.push(allArr[i]); // 不重复的放入新数组。  新数组的内容会继续进行上边的循环。
+        }
+      }
+      return newArr;
+    },
+
+    // 确定 添加产品
+    submitAddGoods() {
+      let allList = this.tableGoodsList;
+      let selectList = this.tableSelection;
+      let submitList = [];
+
+      for(let i = 0; i < allList.length; i++) {
+        for(let j = 0; j < selectList.length; j++) {
+          if(selectList[j].orderId == allList[i].orderId){
+            submitList.push(allList[i]);
+          }
+        }
+      }
+      // this.goodsList = this.goodsList.concat(submitList);
+
+      this.goodsList = this.delRepeat(submitList, this.goodsList);
+      this.isShowDialog = false;
+      this.tableGoodsList = [];
+    },
+
+    // 删除产品
+    deleteItem(index) {
+      this.goodsList.splice(index, 1);
+      // this.goodsList = this.goodsList.filter((item) => {
+      //   return item.orderId != id
+      // })
+    },
+
+    // 保存
+    clickSubmitForm(status) {
+      this.$refs.mainForm.validate((valid) => {
+        if (valid) {
+          for(let i=0; i<this.goodsList.length; i++) {
+            if(!this.goodsList[i].invoiceNum) {
+              this.$errorMsg('请输入申请数量');
+              return;
+            }
+          }
+          for(let i=0; i<this.goodsList.length; i++) {
+            if(this.goodsList[i].invoiceNum > this.goodsList[i].qty) {
+              this.$errorMsg('申请数量不能大于总数量');
+              return;
+            }
+          }
+
+          let correspondName = this.warehouseList[findElem(this.warehouseList, 'id', this.screenForm.warehouse)].name;
+          let params = {
+            id: this.listItem ? this.listItem.id : '',
+            orderTime: this.mainForm.date + ' 00:00:00',
+            remark: this.mainForm.remark,
+            fileUrl: this.fileList && this.fileList.length > 0 ? this.fileList[0].url : '',
+            fileName: this.fileList && this.fileList.length > 0 ? this.fileList[0].name : '',
+            orderType: 1, // 1零售单 2家用工程 3商用工程
+            correspondId: this.screenForm.warehouse,
+            correspondName,
+            orders: this.goodsList,
+            examineStatus: status,
+          }
+          if(this.listItem) {
+            editApply(params).then(res => {
+              this.$successMsg('编辑成功');
+              this.goBack();
+              this.$parent.getList();
+            })
+          }else {
+            addApply(params).then(res => {
+              this.$successMsg('添加成功');
+              this.goBack();
+              this.$parent.getList();
+            })
+          }
+        }
+      })
+    },
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .detail-container {
+    width: 100%;
+    height: 100%;
+  }
+  .main-title {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: 20px;
+    height: 60px;
+    border-bottom: 1px solid #DCDFE6;
+    margin-bottom: 20px;
+    .title {
+      font-size: 16px;
+      font-weight: 600;
+      padding-left: 10px;
+    }
+  }
+</style>

+ 320 - 0
src/views/supply/direct/direct_list.vue

@@ -0,0 +1,320 @@
+<template>
+  <div class="app-container">
+    <div v-show="!isShowDetail && !isShowExamine && !isShowForm">
+      <!-- 筛选条件 -->
+      <div class="screen-container">
+        <el-form ref="screenForm" :model="screenForm" label-width="100px" size="small" label-position="left">
+          <el-row :gutter="20">
+            <el-col :xs="24" :sm="24" :lg="24">
+              <el-form-item prop="status" label-width="0">
+                <el-radio-group v-model="screenForm.status" size="medium" @change="getList()">
+                  <el-radio-button label="">全部</el-radio-button>
+                  <el-radio-button v-for="(item, index) in statusList" :key="index" :label="item.value">{{item.label}}</el-radio-button>
+                </el-radio-group>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="直接调拨单号" prop="orderNum">
+                <el-input v-model="screenForm.orderNum" placeholder="请输入直接调拨单号"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="仓库" prop="warehouse">
+                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="经销商编码" prop="jxsNum">
+                <el-input v-model="screenForm.jxsNum" placeholder="请输入经销商编码"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="经销商名称" prop="jxsName">
+                <el-input v-model="screenForm.jxsName" placeholder="请输入经销商名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="发货申请日期" prop="date">
+                <el-date-picker
+                  v-model="screenForm.date"
+                  type="datetimerange"
+                  range-separator="至"
+                  style="width: 100%;"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                  start-placeholder="开始日期"
+                  end-placeholder="结束日期">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="产品名称" prop="chName">
+                <el-input v-model="screenForm.chName" placeholder="请输入产品名称"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :xs="24" :sm="12" :lg="6">
+              <el-form-item label="规格型号" prop="model">
+                <el-input v-model="screenForm.model" placeholder="请输入规格型号"></el-input>
+              </el-form-item>
+            </el-col>
+            
+            <el-col :xs="24" :sm="12" :lg="6" class="tr">
+              <el-form-item label="">
+                <el-button size="small" @click="resetScreenForm">清空</el-button>
+                <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+
+      <div class="mymain-container">
+        <div class="btn-group clearfix">
+          <div class="fl">
+            <el-button size="small" type="primary" icon="el-icon-plus" @click="toForm()">新增</el-button>
+          </div>
+          <div class="fr">
+            <ExportButton :exUrl="'admin/user/mch/export'" :exParams="exParams" />
+          </div>
+        </div>
+        <div class="table">
+          <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
+            <el-table-column align="center" label="直接调拨单号" prop="id" min-width="180" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
+              <template slot-scope="scope">
+                {{scope.row.examineStatus | statusFilter}}
+              </template>
+            </el-table-column>
+            <el-table-column align="center" label="单据日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商编码" prop="customerNumber" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="经销商名称" prop="customerName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="调拨方向" prop="direction" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品编码" prop="materialCode" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="调拨数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="调出仓库" prop="correspondName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="调出仓位" prop="stockName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="调入仓库" prop="inCorrespondName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="调入仓位" prop="inStockName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="备注信息" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制单人" prop="createBy" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核人" prop="approvalName" min-width="100" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="审核日期" prop="approvalTime" min-width="160" show-overflow-tooltip></el-table-column>
+            <el-table-column align="center" label="操作" width="180" fixed="right">
+              <template slot-scope="scope">
+                <el-button type="text" @click="toForm(scope.row)" v-if="scope.row.examineStatus === 'SAVE'">编辑</el-button>
+                <el-button type="text" @click="toExamine(scope.row)" v-if="scope.row.examineStatus === 'WAIT'">审单</el-button>
+                <el-button type="text" @click="toDetail(scope.row)">详情</el-button>
+                <el-popconfirm style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)" >
+                  <el-button slot="reference" type="text">删除</el-button>
+                </el-popconfirm>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+      </div>
+      <div class="pagination clearfix">
+        <div class="fr">
+          <el-pagination
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+            :current-page="currentPage"
+            :page-sizes="[10, 20, 30, 50]"
+            :page-size="10"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="listTotal">
+          </el-pagination>
+        </div>
+      </div>
+    </div>
+    
+    <DirectDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
+    <DirectExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
+    <DirectForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
+
+  </div>
+</template>
+
+<script>
+import { getList, submitApply, deleteApply } from "@/api/supply/direct";
+import DirectDetail from "@/views/supply/direct/components/direct_detail";
+import DirectExamine from "@/views/supply/direct/components/direct_examine";
+import DirectForm from "@/views/supply/direct/components/direct_form";
+
+let that
+export default {
+  components: {
+    DirectDetail,
+    DirectExamine,
+    DirectForm
+  },
+  filters: {
+    statusFilter(val) {
+      let obj = that.statusList.find(o => o.value == val);
+      return obj ? obj.label : ''
+    }
+  },
+  data() {
+    return {
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      dataList: null, // 列表数据
+      listLoading: false, // 列表加载loading
+      screenForm: { // 筛选表单数据
+        orderNum: '',
+        warehouse: '',
+        jxsNum: '',
+        jxsName: '',
+        date: '',
+        chName: '',
+        model: '',
+        status: '',
+      },
+      statusList: [
+        { label: '已保存', value: 'SAVE' },
+        { label: '待审核', value: 'WAIT' },
+        { label: '审核通过', value: 'OK' },
+        { label: '审核驳回', value: 'FAIL' },
+        { label: '已关闭', value: 'CLOSE' },
+      ],
+
+      queryItem: {},
+      isShowDetail: false,
+      isShowExamine: false,
+      isShowForm: false,
+    }
+  },
+
+  computed: {
+    exParams() {
+      return {
+        id: this.screenForm.orderNum,
+        correspondId: this.screenForm.warehouse,
+        customerNumber: this.screenForm.jxsNum,
+        customerName: this.screenForm.jxsName,
+        productName: this.screenForm.chName,
+        specification: this.screenForm.model,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        examineStatus: this.screenForm.status,
+      }
+    },
+  },
+
+  beforeCreate() {
+    that = this;
+  },
+
+  created() {
+    this.getList();
+  },
+
+  methods: {
+    // 查询按钮权限
+    checkBtnRole(value) {
+      // let btnRole = this.$route.meta.roles;
+      // if(!btnRole) {return true}
+      // let index = btnRole.indexOf(value);
+      // return index >= 0;
+      return true
+    },
+
+    // 查询列表
+    getList() {
+      this.listLoading = true;
+
+      let params = {
+        pageNum: this.currentPage,
+        pageSize: this.pageSize,
+        id: this.screenForm.orderNum,
+        correspondId: this.screenForm.warehouse,
+        customerNumber: this.screenForm.jxsNum,
+        customerName: this.screenForm.jxsName,
+        productName: this.screenForm.chName,
+        specification: this.screenForm.model,
+        startTime: this.screenForm.date ? this.screenForm.date[0] : '',
+        endTime: this.screenForm.date ? this.screenForm.date[1] : '',
+        examineStatus: this.screenForm.status,
+      };
+      getList(params).then((res) => {
+        this.dataList = res.data.records;
+        this.listTotal = res.data.total;
+        this.listLoading = false;
+      })
+    },
+
+    // 提交筛选表单
+    submitScreenForm() {
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 重置筛选表单
+    resetScreenForm() {
+      this.$refs.screenForm.resetFields();
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改每页数量
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = 1;
+      this.getList();
+    },
+
+    // 更改当前页
+    handleCurrentChange(val) {
+      this.currentPage = val;
+      this.getList();
+    },
+
+    // 进入表单
+    toForm(item) {
+      this.queryItem = item;
+      this.isShowForm = true;
+    },
+
+    // 进入审批
+    toExamine(item) {
+      this.queryItem = item;
+      this.isShowExamine = true;
+    },
+
+    // 进入详情
+    toDetail(item) {
+      this.queryItem = item;
+      this.isShowDetail = true;
+    },
+
+    backList() {
+      this.queryItem = {};
+      this.isShowDetail = false;
+      this.isShowExamine = false;
+      this.isShowForm = false;
+    },
+
+    handleDelete(id) {
+      deleteApply({id}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+
+    // 申请/撤回
+    handleSubmit(id, examineStatus) {
+      submitApply({id, examineStatus}).then(res => {
+        this.$successMsg();
+        this.getList();
+      })
+    },
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 1 - 5
src/views/supply/retail/components/retail_detail.vue

@@ -6,7 +6,7 @@
       <div class="title">提货进度</div>
     </div>
     <div class="progress-container">
-      <el-progress :text-inside="true" :stroke-width="26" :percentage="progress || 0"></el-progress>
+      <el-progress :text-inside="true" :stroke-width="26" :percentage="detailData.thjd ? (detailData.thjd * 100) : 0"></el-progress>
     </div>
 
     <div class="main-title">
@@ -245,10 +245,6 @@ export default {
     isExamine() {
       return this.detailData.examineStatus === 'OK' || this.detailData.examineStatus === 'FAIL'
     },
-    progress() {
-      if(this.detailData.totalQty == 0) return 0;
-      return (this.detailData.hasSendQty * 100) / (this.detailData.totalQty * 100);
-    }
   },
 
   created() {

+ 2 - 2
src/views/supply/retail/retail_list.vue

@@ -78,11 +78,11 @@
         </div>
         <div class="table">
           <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
-            <el-table-column align="center" label="提货进度" min-width="120" show-overflow-tooltip>
+            <!-- <el-table-column align="center" label="提货进度" min-width="120" show-overflow-tooltip>
               <template slot-scope="scope">
                 <el-progress :text-inside="true" :stroke-width="26" :percentage="((scope.row.hasSendQty * 100) / (scope.row.totalQty * 100)) || 0"></el-progress>
               </template>
-            </el-table-column>
+            </el-table-column> -->
             <el-table-column align="center" label="审核状态" prop="examineStatus" min-width="100" show-overflow-tooltip>
               <template slot-scope="scope">
                 {{scope.row.examineStatus | statusFilter}}