瀏覽代碼

no message

linwenxin 7 月之前
父節點
當前提交
28f2080020

+ 75 - 0
src/api/material-system/material.js

@@ -0,0 +1,75 @@
+import request, { postBlob, handleImport } from '@/utils/request'
+
+export function newGetMaterialList(data) {
+  return request({
+    url: `/sys/material/zfire/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function newGetMaterialListExport(data, name) {
+  return postBlob({
+    url: '/sys/material/zfire/list/export',
+    data,
+    name
+  })
+}
+
+export function newMaterialListImport(data) {
+  return handleImport('sys/material/batch/update', data.formdata, data.id || '')
+}
+
+// 获取辅材列表
+export function getMaterialList(params) {
+  return request({
+    url: '/sys/material/list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取辅材信息
+export function getMaterial(params) {
+  return request({
+    url: '/sys/material/detail',
+    method: 'get',
+    params
+  })
+}
+
+// 新增辅材
+export function addMaterial(params) {
+  return request({
+    url: '/sys/material/add',
+    method: 'post',
+    data: params
+  })
+}
+
+// 编辑辅材
+export function editMaterial(params) {
+  return request({
+    url: '/sys/material/update',
+    method: 'post',
+    data: params
+  })
+}
+
+// 辅材增量同步
+export function materialSync(params) {
+  return request({
+    url: '/sys/material/sync',
+    method: 'post',
+    params
+  })
+}
+
+// 辅材全量同步
+export function materialAllSync(params) {
+  return request({
+    url: '/sys/material/all-sync',
+    method: 'post',
+    params
+  })
+}

+ 154 - 0
src/api/material-system/vender.js

@@ -0,0 +1,154 @@
+import request, { postBlob } from '@/utils/request'
+
+// 供应产品
+
+// 获取新供应商产品信息列表
+export function getNewVenderGoodsList(data) {
+  return request({
+    url: `/vender/goods/rela/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+// 导出
+export function exportVenderGoods(data, name) {
+  return postBlob({
+    url: '/vender/goods/rela/list/export',
+    data,
+    name
+  })
+}
+
+// -----------------------------------------
+
+export function newGetVenderList(data) {
+  return request({
+    url: `/vender/master/zfire/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function newGetVenderListExport(data, name) {
+  return postBlob({
+    url: '/vender/master/zfire/list/export',
+    data,
+    name
+  })
+}
+
+// 获取供应商资料列表
+export function getVenderList(params) {
+  return request({
+    url: '/vender/master/list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取供应商资料信息
+export function getVender(params) {
+  return request({
+    url: '/vender/master/detail',
+    method: 'get',
+    params
+  })
+}
+
+// 新增供应商资料
+export function addVender(params) {
+  return request({
+    url: '/vender/master/add',
+    method: 'post',
+    data: params
+  })
+}
+
+// 编辑供应商资料
+export function editVender(params) {
+  return request({
+    url: '/vender/master/update',
+    method: 'post',
+    data: params
+  })
+}
+
+// 获取供应商产品关系维护单列表
+export function getVenderGoodsSheetList(params) {
+  return request({
+    url: '/vender/manager/list',
+    method: 'get',
+    params
+  })
+}
+
+// 获取供应商产品关系维护单信息
+export function getVenderGoodsSheet(params) {
+  return request({
+    url: '/vender/manager/detail',
+    method: 'get',
+    params
+  })
+}
+
+// 新增供应商产品关系维护单
+export function addVenderGoodsSheet(params) {
+  return request({
+    url: '/vender/manager/add',
+    method: 'post',
+    data: params
+  })
+}
+
+// 编辑供应商产品关系维护单
+export function editVenderGoodsSheet(params) {
+  return request({
+    url: '/vender/manager/update',
+    method: 'post',
+    data: params
+  })
+}
+
+// 删除供应商产品关系维护单
+export function delVenderGoodsSheet(params) {
+  return request({
+    url: '/vender/manager/del',
+    method: 'post',
+    params
+  })
+}
+
+// 审核供应商产品关系维护单
+export function confirmVenderGoodsSheet(params) {
+  return request({
+    url: '/vender/manager/confirm',
+    method: 'post',
+    params
+  })
+}
+
+// 获取供应商产品信息列表
+export function getVenderGoodsList(params) {
+  return request({
+    url: '/vender/goods/list',
+    method: 'get',
+    params
+  })
+}
+
+export function getNewVenderList(data) {
+  return request({
+    url: `/vender/manager/zfire/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+// 导出
+export function exportNewVenderList(data, name) {
+  return postBlob({
+    url: '/vender/manager/zfire/list/export',
+    data,
+    name
+  })
+}

+ 63 - 0
src/api/material-system/vender/shop-purchase-apply.js

@@ -0,0 +1,63 @@
+import request, { postBlob } from '@/utils/request'
+
+// 获取网点采购单列表
+export function getPurchaseApplySheetList(params) {
+  return request({
+    url: '/vender/shop-purchase-apply/list',
+    method: 'get',
+    params
+  })
+}
+// 获取新网点采购单列表
+export function getNewPurchaseApplySheetList(data) {
+  return request({
+    url: `/vender/shop-purchase-apply/zfire/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+// 导出
+export function exportNewPurchaseApplySheetList(data, name) {
+  return postBlob({
+    url: 'vender/shop-purchase-apply/zfire/list/export',
+    data,
+    name
+  })
+}
+
+// 获取网点采购单信息
+export function getPurchaseApplySheet(params) {
+  return request({
+    url: '/vender/shop-purchase-apply/detail',
+    method: 'get',
+    params
+  })
+}
+
+// 编辑网点采购单
+export function editPurchaseApplySheet(params) {
+  return request({
+    url: '/vender/shop-purchase-apply/update',
+    method: 'post',
+    data: params
+  })
+}
+
+// 核实网点采购单
+export function verifyPurchaseApplySheet(params) {
+  return request({
+    url: '/vender/shop-purchase-apply/verify',
+    method: 'get',
+    params
+  })
+}
+
+// 撤消网点采购单
+export function revokePurchaseApplySheet(params) {
+  return request({
+    url: '/vender/shop-purchase-apply/revoke',
+    method: 'get',
+    params
+  })
+}

+ 2 - 203
src/views/auxiliaryFittings/home/index.vue

@@ -1,17 +1,6 @@
 <template>
   <div class="dashboard_container">
-    <div class="refresh" @click="refreshData">
-      <el-radio-group v-model="radio1">
-        <el-radio-button :label="1">辅材</el-radio-button>
-        <el-radio-button :label="2">配件</el-radio-button>
-      </el-radio-group>
-      <span>
-        <span style="color: #1d82ff">刷新数据</span>
-        <i class="el-icon-refresh-left" style="color: #1d82ff"></i>
-      </span>
-    </div>
-    <!-- 辅材 -->
-    <template v-if="radio1 == 1">
+    <template>
       <div class="flex">
         <div class="mode" @click="gotopage('auxiliaryPriceManagement', '', '')">
           <div class="title">辅材列表配置统计</div>
@@ -340,195 +329,6 @@
         </div>
       </div>
     </template>
-    <!-- 配件 -->
-    <template v-if="radio1 == 2">
-      <div class="flex">
-        <div class="mode" @click="gotopage('attachmentProfile', '', '')">
-          <div class="title">配件资料配置统计</div>
-          <div class="flex head">
-            <div class="tab">
-              <div class="text">
-                <div class="num">{{ collectData.allpGoodsNum }}</div>
-                <div class="title">总配置数量</div>
-              </div>
-            </div>
-            <div class="tab">
-              <div class="text">
-                <div class="num">{{ collectData.onPGoodsNum }}</div>
-                <div class="title">有效配置数量</div>
-              </div>
-            </div>
-            <div class="tab">
-              <div class="text">
-                <div class="num">{{ collectData.offPGoodsNum }}</div>
-                <div class="title">无效配置数量</div>
-              </div>
-            </div>
-          </div>
-        </div>
-        <div class="mode">
-          <div class="title">配件采购入库单统计</div>
-          <div class="flex head">
-            <div class="tab" @click="gotopage('partsStorage', '已保存数量', 'SAVE')">
-              <div class="text">
-                <div class="num">{{ collectData.savePurchasePNum }}</div>
-                <div class="title">已保存数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('partsStorage', '已审核数量', 'OK')">
-              <div class="text">
-                <div class="num">{{ collectData.okPurchasePNum }}</div>
-                <div class="title">已审核数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('partsStorage', '审核失败数量', 'FAIL')">
-              <div class="text">
-                <div class="num">{{ collectData.failPurchasePNum }}</div>
-                <div class="title">审核失败数量</div>
-              </div>
-            </div>
-          </div>
-        </div>
-        <div class="mode">
-          <div class="title">配件采购退货单统计</div>
-          <div class="flex head">
-            <div class="tab" @click="gotopage('partsReturn', '已保存数量', 'SAVE')">
-              <div class="text">
-                <div class="num">{{ collectData.savePurchaseRetPNum }}</div>
-                <div class="title">已保存数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('partsReturn', '已审核数量', 'OK')">
-              <div class="text">
-                <div class="num">{{ collectData.okPurchaseRetPNum }}</div>
-                <div class="title">已审核数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('partsReturn', '审核失败数量', 'FAIL')">
-              <div class="text">
-                <div class="num">{{ collectData.failPurchaseRetPNum }}</div>
-                <div class="title">审核失败数量</div>
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-      <div class="flex">
-        <div class="mode" style="min-width: 66.33%">
-          <div class="title">配件销售订单统计</div>
-          <div class="flex head">
-            <div class="tab" @click="gotopage('attachmentSalesOrder', '已保存数量', 'SAVE')">
-              <div class="text">
-                <div class="num">{{ collectData.saveSalesPNum }}</div>
-                <div class="title">已保存数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('attachmentSalesOrder', '已提交数量', 'SUBMIT')">
-              <div class="text">
-                <div class="num">{{ collectData.submitSalesPgNum }}</div>
-                <div class="title">已提交数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('attachmentSalesOrder', '已支付未提交', 'PAY_NOT_TAKE')">
-              <div class="text">
-                <div class="num">{{ collectData.payNoTakeSalesPgNum }}</div>
-                <div class="title">已支付未提交</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('attachmentSalesOrder', '已支付已提交', 'PAY_TAKE')">
-              <div class="text">
-                <div class="num">{{ collectData.payTakeSalesPgNum }}</div>
-                <div class="title">已支付已提交</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('attachmentSalesOrder', '取消订单数量', 'CANCEL')">
-              <div class="text">
-                <div class="num">{{ collectData.cancelSalesPgNum }}</div>
-                <div class="title">取消订单数量</div>
-              </div>
-            </div>
-          </div>
-        </div>
-        <div class="mode">
-          <div class="title">配件新件返还统计</div>
-          <div class="flex head">
-            <div class="tab" @click="gotopage('attachmentNewReturn', '已保存数量', 'SAVE')">
-              <div class="text">
-                <div class="num">{{ collectData.saveNewNum }}</div>
-                <div class="title">已保存数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('attachmentNewReturn', '已提交数量', 'SUBMIT')">
-              <div class="text">
-                <div class="num">{{ collectData.submitNewNum }}</div>
-                <div class="title">已提交数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('attachmentNewReturn', '审核通过数量', 'OK')">
-              <div class="text">
-                <div class="num">{{ collectData.okNewNum }}</div>
-                <div class="title">审核通过数量</div>
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-
-      <div class="flex">
-        <div class="mode">
-          <div class="title">配件旧件返还统计</div>
-          <div class="flex head">
-            <div class="tab" @click="gotopage('attachmentOldReturn', '已保存数量', 'SAVE')">
-              <div class="text">
-                <div class="num">{{ collectData.saveOldNum }}</div>
-                <div class="title">已保存数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('attachmentOldReturn', '已提交数量', 'SUBMIT')">
-              <div class="text">
-                <div class="num">{{ collectData.submitOldNum }}</div>
-                <div class="title">已提交数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('attachmentOldReturn', '审核通过数量', 'OK')">
-              <div class="text">
-                <div class="num">{{ collectData.okOldNum }}</div>
-                <div class="title">审核通过数量</div>
-              </div>
-            </div>
-          </div>
-        </div>
-        <div class="mode">
-          <div class="title">配件旧件返厂单统计</div>
-          <div class="flex head">
-            <div class="tab" @click="gotopage('oldPartsReturnFactory', '已保存数量', 'SAVE')">
-              <div class="text">
-                <div class="num">{{ collectData.saveOldFactoryNum }}</div>
-                <div class="title">已保存数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('oldPartsReturnFactory', '已提交数量', 'SUBMIT')">
-              <div class="text">
-                <div class="num">{{ collectData.submitOldFactoryNum }}</div>
-                <div class="title">已提交数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('oldPartsReturnFactory', '审核通过数量', 'OK')">
-              <div class="text">
-                <div class="num">{{ collectData.okOldFactoryNum }}</div>
-                <div class="title">审核通过数量</div>
-              </div>
-            </div>
-            <div class="tab" @click="gotopage('oldPartsReturnFactory', '审核失败数量', 'FAIL')">
-              <div class="text">
-                <div class="num">{{ collectData.failOldFactoryNum }}</div>
-                <div class="title">审核失败数量</div>
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-    </template>
   </div>
 </template>
 
@@ -537,8 +337,7 @@ import { dataCountMaterialCount } from '@/api/dataCount.js'
 export default {
   data() {
     return {
-      collectData: {},
-      radio1: 1
+      collectData: {}
     }
   },
   created() {

+ 17 - 1
src/views/auxiliaryFittings/supplier/index.vue

@@ -20,7 +20,7 @@
           <zj-form-container ref="formRef" :form-data="formData" :styleSwitch="false">
             <zj-form-module
               title=""
-              label-width="100px"
+              label-width="120px"
               :showPackUp="false"
               :form-data="formData"
               :form-items="formItems"
@@ -86,6 +86,7 @@ export default {
         remark: '',
         status: 'ON',
         venderType: 'M',
+        isAuto: '',
         imageUrl: [],
         checkList: []
       },
@@ -330,6 +331,21 @@ export default {
           }
         },
         {
+          md: 6,
+          isShow: true,
+          name: 'el-radio',
+          options: [
+            { label: '是', value: 'YES' },
+            { label: '否', value: 'NO' }
+          ],
+          attributes: {},
+          formItemAttributes: {
+            label: '是否自动审核',
+            prop: 'isAuto',
+            rules: [...required]
+          }
+        },
+        {
           md: 24,
           isShow: true,
           name: 'slot-component',

+ 322 - 0
src/views/auxiliaryFittings/vender/components/ShopPurchaseArea.vue

@@ -0,0 +1,322 @@
+<template>
+  <el-form
+    ref="dataForm"
+    v-loading="loading"
+    :model="dataForm"
+    :rules="dataFormRules"
+    label-position="left"
+    label-width="90px"
+  >
+    <el-form-item v-if="formDisabled" label="单据编号" prop="sheetId">
+      <el-input disabled :value="dataForm.sheetId" />
+    </el-form-item>
+    <el-row :gutter="20">
+      <el-col :span="8">
+        <el-form-item label="网点" prop="shopId">
+          <el-select v-model="dataForm.shopId" :disabled="formDisabled" placeholder="请选择网点" style="width: 100%">
+            <el-option
+              v-for="(item, index) in authShop"
+              :key="index"
+              :label="shopLabelStrHandle(item)"
+              :value="item.shopId"
+            />
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8">
+        <el-form-item label="供应商" prop="venderId">
+          <el-select
+            v-model="dataForm.venderId"
+            filterable
+            :disabled="formDisabled"
+            placeholder="请选择供应商"
+            style="width: 100%"
+          >
+            <el-option
+              v-for="(item, index) in venderList"
+              :key="index"
+              :label="vendorLabelStrHandle(item)"
+              :value="item.venderId"
+            />
+          </el-select>
+        </el-form-item>
+      </el-col>
+      <el-col :span="8">
+        <el-form-item label="状态" prop="flag">
+          <el-input disabled :value="sheetFlagStr('label', dataForm.flag)" />
+        </el-form-item>
+      </el-col>
+    </el-row>
+    <el-form-item v-if="dataForm.notes3" label="申请单备注">
+      <el-input v-model="dataForm.notes3" disabled />
+    </el-form-item>
+    <el-form-item label="备注">
+      <el-input
+        v-model="dataForm.notes2"
+        autocomplete="off"
+        placeholder="备注"
+        :disabled="inputParam.openType === 'view'"
+      />
+    </el-form-item>
+    <el-row>
+      <el-col>
+        <el-divider>采购明细</el-divider>
+      </el-col>
+      <el-col>
+        <el-table
+          ref="goodsTable"
+          :data="dataForm.items"
+          max-height="500"
+          size="mini"
+          border
+          header-cell-class-name="headerRowColor"
+          class="detail-table"
+          show-summary
+          :summary-method="getSummaries"
+        >
+          <el-table-column prop="goodsId" label="辅材编号" />
+          <el-table-column prop="goodsName" label="辅材名称" width="230" />
+          <el-table-column prop="estimateCost" label="预估进价" header-align="left" align="center" />
+          <el-table-column prop="purchaseQty" label="订货数量" header-align="left" align="center" />
+          <el-table-column prop="deliverQty" label="供应数量" header-align="left" align="center">
+            <template slot-scope="{ $index, row }">
+              <label v-if="inputParam.openType === 'view'">{{ row.deliverQty + ' /' + row.measureUnit }}</label>
+              <el-form-item
+                v-else
+                style="margin: 18px 0"
+                label-width="0"
+                size="mini"
+                :prop="'items.' + $index + '.deliverQty'"
+                :rules="dataFormRules.deliverQty"
+              >
+                <el-input v-model="row.deliverQty" size="mini">
+                  <template slot="suffix">{{ ' /' + row.measureUnit }}</template>
+                </el-input>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <template v-if="dataForm.flag === 100">
+            <el-table-column prop="recQty" label="验收数量" />
+            <el-table-column prop="recGiftQty" label="验收赠品数量" />
+          </template>
+          <el-table-column prop="measureUnit" label="采购单位" />
+          <el-table-column prop="productModel" label="商品型号" />
+          <el-table-column prop="specification" label="规格" />
+        </el-table>
+        <el-row>
+          <el-col :span="24"
+            ><div>共 {{ goodsTotalCount }} 条记录</div></el-col
+          >
+        </el-row>
+      </el-col>
+    </el-row>
+    <div style="text-align: right">
+      <el-button @click="cancelForm">取 消</el-button>
+      <el-button v-if="checkBtn('edit')" type="primary" :disabled="saveBtn" @click="submitForm('edit')"
+        >保 存</el-button
+      >
+      <el-button v-if="checkBtn('verify')" type="success" @click="verifySheet(dataForm.sheetId)">核 实</el-button>
+      <el-button v-if="checkBtn('revoke')" type="danger" @click="revokeSheet(dataForm.sheetId)">撤 消</el-button>
+    </div>
+  </el-form>
+</template>
+
+<script>
+import {
+  editPurchaseApplySheet,
+  revokePurchaseApplySheet,
+  getPurchaseApplySheet,
+  verifyPurchaseApplySheet
+} from '@/api/material-system/vender/shop-purchase-apply'
+import { getVenderList } from '@/api/material-system/vender'
+
+export default {
+  name: 'ShopPurchaseArea',
+  props: {
+    inputParam: {
+      type: Object,
+      default: function () {
+        return {
+          openType: 'add',
+          sheetId: ''
+        }
+      }
+    }
+  },
+  data() {
+    const validateDeliverQty = (rule, value, callback) => {
+      this.saveBtn = true
+      if (Number.isNaN(parseFloat(value))) {
+        return callback(new Error('请输入数字值'))
+      }
+      if (parseFloat(value) < 0) {
+        return callback(new Error('不能少于0'))
+      }
+      this.saveBtn = false
+      callback()
+    }
+    return {
+      loading: true,
+      dataForm: {
+        sheetId: '', // 单据ID
+        shopId: '', // 网点ID
+        shopName: '', // 网点名称
+        venderId: '', // 供应商ID
+        venderName: '', // 供应商名称
+        notes2: '', // 备注
+        notes3: '', // 网点备注
+        flag: '',
+        items: [] // 关系辅材列表
+      },
+      dataFormRules: {
+        deliverQty: [{ validator: validateDeliverQty, trigger: 'blur' }]
+      },
+      venderList: [],
+      saveBtn: false // 保存按钮状态
+    }
+  },
+  computed: {
+    formDisabled() {
+      return this.inputParam.openType === 'view' || this.dataForm.sheetId !== ''
+    },
+    goodsTotalCount: function () {
+      return this.dataForm && this.dataForm.items ? this.dataForm.items.length : 0
+    }
+  },
+  mounted() {
+    this.getVenderList()
+    this.getDetail()
+  },
+  methods: {
+    getDetail(id) {
+      this.loading = true
+      // const openType = this.inputParam.openType
+      const sheetId = id || this.inputParam.sheetId
+      getPurchaseApplySheet({ sheetId }).then(res => {
+        this.setDataForm(res.data)
+        this.loading = false
+      })
+    },
+    cancelForm() {
+      this.$parent.$refs.pageRef.refreshList()
+      this.$emit('update:isOpen', false)
+    },
+    submitForm(type) {
+      this.$refs.dataForm.validate(valid => {
+        if (valid) {
+          editPurchaseApplySheet(this.dataForm).then(() => {
+            this.$successMsg('保存成功')
+          })
+        }
+      })
+    },
+    setDataForm(data) {
+      this.dataForm = {
+        sheetId: data.sheetId, // 单据编号
+        shopId: data.shopId, // 网点ID
+        venderId: data.venderId, // 供应商Id
+        flag: data.flag,
+        notes: data.notes, // 备注
+        items: data.items // 关系商品列表
+      }
+    },
+    checkBtn(type) {
+      const typeMap = {
+        add: this.inputParam.openType === type,
+        edit: this.dataForm.flag === 1 && this.inputParam.openType === type,
+        revoke: this.dataForm.flag === 1,
+        verify: this.dataForm.flag === 1
+      }
+      // 检查按钮权限
+      return this.checkBtnRole(type) && typeMap[type]
+    },
+    // 获取供应商列表
+    getVenderList() {
+      getVenderList({ pageNum: 1, pageSize: -1, flag: 1 }).then(res => {
+        this.venderList = res.data.records
+      })
+    },
+    // 核实 采购申请单
+    verifySheet(sheetId) {
+      this.$confirm(
+        `此操作将核实 ${sheetId} 单据,<span style="color: #ff0000;">当前内容如果已修改将忽略保存</span>,是否继续?`,
+        '提示',
+        {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+          dangerouslyUseHTMLString: true
+        }
+      )
+        .then(() => {
+          this.loading = true
+          verifyPurchaseApplySheet({ sheetId: sheetId }).then(
+            () => {
+              setTimeout(() => {
+                this.inputParam.openType = 'view'
+                this.getDetail(sheetId)
+                this.$successMsg('核实成功')
+                this.loading = false
+              }, 2000)
+            },
+            () => {
+              this.loading = false
+            }
+          )
+        })
+        .catch(() => console.log('取消'))
+    },
+    // 撤消单据
+    revokeSheet(sheetId) {
+      this.$confirm(`此操作将撤消 ${sheetId} 单据, 是否继续?`, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          revokePurchaseApplySheet({ sheetId: sheetId }).then(() => {
+            this.cancelForm()
+            this.$successMsg('撤消成功')
+          })
+        })
+        .catch(() => console.log('取消'))
+    },
+
+    getSummaries(param) {
+      const { columns, data } = param
+      const sums = []
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计'
+          return
+        }
+        const values = data.map(item => Number(item[column.property]))
+        if (!values.every(value => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr)
+            if (!isNaN(value)) {
+              return prev + curr
+            } else {
+              return prev
+            }
+          }, 0)
+        } else {
+          sums[index] = ''
+        }
+      })
+
+      return sums
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.detail-table {
+  width: 100%;
+  margin: 15px 0;
+  ::v-deep .el-input__suffix-inner {
+    color: red;
+  }
+}
+</style>

+ 288 - 0
src/views/auxiliaryFittings/vender/components/VenderGoodsArea.vue

@@ -0,0 +1,288 @@
+<template>
+  <div style="padding: 20px">
+    <el-form ref="dataForm" :model="dataForm" :rules="dataFormRules" label-position="left" label-width="120px">
+      <el-form-item v-if="!(inputParam.openType === 'add')" label="单据编号" prop="sheetId">
+        <el-input autocomplete="off" placeholder="单据编号" :disabled="true" :value="dataForm.sheetId" />
+      </el-form-item>
+      <el-form-item label="供应商" prop="venderId">
+        <el-select
+          v-model="dataForm.venderId"
+          :disabled="inputParam.openType === 'view'"
+          placeholder="请选择供应商"
+          style="width: 100%"
+          filterable
+        >
+          <el-option v-for="(item, index) in venderList" :key="index" :label="item.venderName" :value="item.venderId" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="备注" prop="notes">
+        <el-input
+          v-model="dataForm.notes"
+          autocomplete="off"
+          placeholder="备注"
+          :disabled="inputParam.openType === 'view'"
+        />
+      </el-form-item>
+      <el-row>
+        <el-col>
+          <el-button size="small" :disabled="inputParam.openType === 'view'" @click="innerVisible = true"
+            >添加商品</el-button
+          >
+        </el-col>
+        <el-col>
+          <el-table
+            ref="goodsTable"
+            :data="dataForm.items"
+            height="300"
+            size="mini"
+            border
+            header-cell-class-name="headerRowColor"
+            style="width: 100%; margin: 15px 0"
+          >
+            <el-table-column prop="goodsId" label="辅材编号" width="80" />
+            <el-table-column prop="goodsName" label="辅材名称" width="180" />
+            <el-table-column prop="productModel" label="商号型号" />
+            <el-table-column prop="specification" label="规格" />
+            <el-table-column prop="cost" label="进价">
+              <template slot-scope="scope">
+                <el-input v-model="scope.row.cost" :disabled="inputParam.openType === 'view'" />
+              </template>
+            </el-table-column>
+            <el-table-column prop="ndays" label="供货天数">
+              <template slot-scope="scope">
+                <el-input v-model="scope.row.ndays" :disabled="inputParam.openType === 'view'" />
+              </template>
+            </el-table-column>
+            <el-table-column prop="flag" label="状态">
+              <template slot-scope="scope">
+                <el-select
+                  v-model="scope.row.flag"
+                  placeholder="请选择状态"
+                  style="width: 100%"
+                  :disabled="inputParam.openType === 'view'"
+                >
+                  <el-option
+                    v-for="(item, index) in select_item_flag"
+                    :key="index"
+                    :label="item.label"
+                    :value="item.value"
+                  />
+                </el-select>
+              </template>
+            </el-table-column>
+            <el-table-column v-if="!(inputParam.openType === 'view')" align="center" label="" min-width="50">
+              <template slot-scope="scope">
+                <el-button type="text" @click="delItem(scope.$index)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <el-row>
+            <el-col :span="24"
+              ><div>共 {{ goodsTotalCount }} 条记录</div></el-col
+            >
+          </el-row>
+        </el-col>
+      </el-row>
+    </el-form>
+    <el-dialog
+      width="60%"
+      title="商品列表"
+      :visible.sync="innerVisible"
+      append-to-body
+      :close-on-click-modal="false"
+      @close="
+        $refs.goodsTable.clearSelection()
+        searchGoods = ''
+      "
+    >
+      <el-input
+        v-model="searchGoods"
+        size="mini"
+        placeholder="输入关键字搜索"
+        style="margin-bottom: 5px"
+        :clearable="true"
+      />
+      <el-table
+        ref="goodsTable"
+        :data="
+          goodsList.filter(
+            data =>
+              !searchGoods ||
+              data.goodsName.toLowerCase().includes(searchGoods.toLowerCase()) ||
+              data.categoryName.toLowerCase().includes(searchGoods.toLowerCase())
+          )
+        "
+        :row-key="getRowKeys"
+        height="400"
+        size="mini"
+        border
+        header-cell-class-name="headerRowColor"
+        style="width: 100%"
+      >
+        <el-table-column type="selection" width="55" :reserve-selection="true" />
+        <el-table-column prop="goodsId" label="辅材编号" width="80" />
+        <el-table-column prop="goodsName" label="辅材名称" width="280" />
+        <el-table-column prop="goodsCode" label="辅材代码" />
+        <el-table-column prop="categoryName" label="小类名称" />
+        <el-table-column prop="productModel" label="商号型号" />
+        <el-table-column prop="specification" label="规格" />
+      </el-table>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="selGoods">确 定</el-button>
+      </div>
+    </el-dialog>
+    <div style="text-align: right">
+      <el-button @click="cancelForm">取 消</el-button>
+      <el-button v-if="!(inputParam.openType === 'view')" type="primary" @click="submitForm">保 存</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import {
+  addVenderGoodsSheet,
+  editVenderGoodsSheet,
+  getVenderGoodsSheet,
+  getVenderList
+} from '@/api/material-system/vender'
+import { getMaterialList } from '@/api/material-system/material'
+
+export default {
+  name: 'VenderGoodsArea',
+  props: {
+    inputParam: {
+      type: Object,
+      default: function () {
+        return {
+          openType: 'add',
+          sheetId: ''
+        }
+      }
+    }
+  },
+  data() {
+    return {
+      loading: true,
+      dataForm: {
+        sheetId: '', // 单据ID
+        venderId: '', // 供应商ID
+        venderName: '',
+        notes: '', // 备注
+        items: [] // 关系辅材列表
+      },
+      goodsList: [], // 商品列表
+      venderList: [], // 供应商列表
+      select_item_flag: [
+        { label: '有效', value: 1 },
+        { label: '无效', value: 0 }
+      ],
+      dataFormRules: {
+        venderId: [{ required: true, message: '请选择供应商', trigger: 'change' }]
+      },
+      innerVisible: false,
+      searchGoods: ''
+    }
+  },
+  computed: {
+    goodsTotalCount: function () {
+      return this.dataForm && this.dataForm.items ? this.dataForm.items.length : 0
+    }
+  },
+  mounted() {
+    this.getDetail()
+    this.getVenderList()
+    if (this.inputParam.openType === 'add') {
+      this.getMaterialList()
+    }
+  },
+  methods: {
+    getDetail(id) {
+      this.loading = true
+      const openType = this.inputParam.openType
+      const sheetId = id || this.inputParam.sheetId
+      if (openType !== 'add') {
+        getVenderGoodsSheet({ sheetId }).then(res => {
+          this.setDataForm(res.data)
+          this.loading = false
+        })
+      } else {
+        this.loading = false
+      }
+    },
+    setDataForm(data) {
+      this.dataForm = {
+        sheetId: data.sheetId, // 单据编号
+        venderId: data.venderId, // 供应商Id
+        notes: data.notes, // 备注
+        items: data.items // 关系商品列表
+      }
+    },
+    cancelForm() {
+      this.$emit('getList')
+      this.$emit('update:isOpen', false)
+    },
+    // 获取辅材列表
+    getMaterialList() {
+      getMaterialList({ pageNum: 1, pageSize: -1, status: 1 }).then(res => {
+        this.goodsList = res.data.records
+      })
+    },
+    // 获取供应商列表
+    getVenderList() {
+      getVenderList({ pageNum: 1, pageSize: 100, flag: 1 }).then(res => {
+        this.venderList = res.data.records
+      })
+    },
+    // 提交 新增编辑 供应商关系商品维护单
+    submitForm() {
+      this.$refs.dataForm.validate(valid => {
+        if (valid) {
+          this.dataForm.venderName = this.getArraysName(this.venderList, this.dataForm, 'venderId', 'venderName')
+          if (this.inputParam.openType === 'edit') {
+            editVenderGoodsSheet(this.dataForm).then(() => {
+              this.cancelForm()
+              this.$successMsg('编辑成功')
+            })
+          } else {
+            addVenderGoodsSheet(this.dataForm).then(() => {
+              this.cancelForm()
+              this.$successMsg('新增成功')
+            })
+          }
+        }
+      })
+    },
+    // 选中辅材添加到表单中
+    selGoods() {
+      this.$refs.goodsTable.selection.forEach(value => {
+        const index = this.dataForm.items.findIndex(item => {
+          return item.goodsId === value.goodsId
+        })
+        // 添加不在列表的商品
+        if (index < 0) {
+          this.dataForm.items.push({
+            goodsId: value.goodsId,
+            goodsName: value.goodsName,
+            productModel: value.productModel,
+            specification: value.specification,
+            cost: 0,
+            ndays: 365,
+            flag: 1
+          })
+        }
+      })
+      this.$refs.goodsTable.clearSelection()
+      this.innerVisible = false
+    },
+    // 删除明细
+    delItem(index) {
+      this.dataForm.items.splice(index, 1)
+    },
+    getRowKeys(row) {
+      return row.id
+    }
+  }
+}
+</script>
+
+<style scoped></style>

+ 209 - 0
src/views/auxiliaryFittings/vender/shop-purchase/index.vue

@@ -0,0 +1,209 @@
+<template>
+  <div style="height: 100%">
+    <template v-if="shopPurchaseArea && shopPurchaseAreaParam.openType !== 'add'">
+      <el-page-header
+        :content="shopPurchaseAreaParam.openType === 'view' ? '查看网点采购单' : '编辑网点采购单'"
+        @back="backUpdPage"
+      />
+      <el-divider />
+    </template>
+    <div v-show="showListArea" style="height: 100%">
+      <template-page
+        ref="pageRef"
+        :getList="getList"
+        :exportList="exportList"
+        :columnParsing="columnParsing"
+        :operation="operation()"
+        :optionsEvensGroup="optionsEvensGroup"
+        :tableAttributes="tableAttributes"
+        :tableEvents="tableEvents"
+      >
+      </template-page>
+    </div>
+    <!-- 新增编辑单据 -->
+    <shop-purchase-area
+      v-if="shopPurchaseArea"
+      :is-open.sync="shopPurchaseArea"
+      :input-param="shopPurchaseAreaParam"
+      @getList="$refs.pageRef.refreshList()"
+    />
+    <!-- 预览表单 -->
+    <print-form
+      v-if="isPreview"
+      :is-preview.sync="isPreview"
+      :shop-purchase-form="salesForm"
+      @getList="$refs.pageRef.refreshList()"
+    />
+  </div>
+</template>
+
+<script>
+import {
+  verifyPurchaseApplySheet,
+  getPurchaseApplySheetList,
+  revokePurchaseApplySheet,
+  getPurchaseApplySheet,
+  getNewPurchaseApplySheetList,
+  exportNewPurchaseApplySheetList
+} from '@/api/material-system/vender/shop-purchase-apply'
+import ShopPurchaseArea from '../components/ShopPurchaseArea'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+export default {
+  name: 'ShopPurchase',
+  components: { ShopPurchaseArea, TemplatePage },
+  mixins: [import_mixin],
+
+  data() {
+    return {
+      shopPurchaseArea: false,
+      shopPurchaseAreaParam: {
+        openType: 'add',
+        sheetId: ''
+      },
+      dataList: null, // 列表数据
+      listLoading: true, // 列表加载loading
+      currentPage: 1, // 当前页码
+      pageSize: 10, // 每页数量
+      listTotal: 0, // 列表总数
+      screenForm: {
+        // 筛选表单数据
+        submitTime: '', // 创建时间
+        flag: '', // 状态
+        keyword: '', // 关键词
+        sheetId: '', // 单据编号
+        shopId: ''
+      },
+      purchaseForm: {},
+      isPreview: false,
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增单据',
+              click: () => {
+                this.addOrEdit('add')
+              },
+              isRole: this.checkBtnRole('add')
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true,
+        columnExpand: (h, { row, index, columm }) => {
+          return (
+            <div style="padding-left:95px">
+              <el-form label-position="left" inline class="demo-table-expand">
+                <el-form-item label="备注">
+                  <span>{row.notes2}</span>
+                </el-form-item>
+              </el-form>
+            </div>
+          )
+        }
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
+    }
+  },
+  computed: {
+    showListArea: function () {
+      return !(this.isPreview || this.shopPurchaseArea)
+    }
+  },
+  created() {
+    //       this.$refs.pageRef.refreshList();
+  },
+  methods: {
+    // 新增编辑 采购入库单
+    addOrEdit(type, id) {
+      this.shopPurchaseArea = true
+      this.shopPurchaseAreaParam.openType = type
+      this.shopPurchaseAreaParam.sheetId = id
+    },
+    // 操作事件
+    handleCommand(param) {
+      console.log(333, param)
+      if (param[1] === 'view' || param[1] === 'edit') {
+        this.addOrEdit(param[1], param[0])
+      } else {
+        this[param[1] + 'Sheet'](param[0])
+      }
+    },
+    backUpdPage() {
+      this.$refs.pageRef.refreshList()
+      this.shopPurchaseArea = false
+    },
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getNewPurchaseApplySheetList(...p)
+    },
+    // 列表导出函数
+    exportList: exportNewPurchaseApplySheetList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            <el-dropdown onCommand={p => this.handleCommand(p)}>
+              <el-button type="text">
+                更多
+                <i class="el-icon-arrow-down el-icon--right" />
+              </el-button>
+              <el-dropdown-menu slot="dropdown">
+                {this.checkBtnRole('view') ? (
+                  <el-dropdown-item icon="el-icon-view" command={[row.sheetId, 'view']}>
+                    查看
+                  </el-dropdown-item>
+                ) : null}
+
+                {row.flag === 1 ? (
+                  <div>
+                    {this.checkBtnRole('edit') ? (
+                      <el-dropdown-item icon="el-icon-edit" command={[row.sheetId, 'edit']}>
+                        编辑
+                      </el-dropdown-item>
+                    ) : null}
+                    {this.checkBtnRole('verify') ? (
+                      <el-dropdown-item icon="el-icon-lock" command={[row.sheetId, 'verify']}>
+                        核实
+                      </el-dropdown-item>
+                    ) : null}
+                    {this.checkBtnRole('revoke') ? (
+                      <el-dropdown-item icon="el-icon-unlock" command={[row.sheetId, 'revoke']}>
+                        撤消
+                      </el-dropdown-item>
+                    ) : null}
+                    {this.checkBtnRole('view') ? (
+                      <el-dropdown-item icon="el-icon-printer" command={[row.sheetId, 'view']}>
+                        预览
+                      </el-dropdown-item>
+                    ) : null}
+                  </div>
+                ) : null}
+              </el-dropdown-menu>
+            </el-dropdown>
+          </div>
+        )
+      }
+    }
+  }
+}
+</script>
+
+<style scoped></style>

+ 192 - 0
src/views/auxiliaryFittings/vender/vender-goods-sheet/index.vue

@@ -0,0 +1,192 @@
+<template>
+  <div style="height: 100%">
+    <template v-if="venderGoodsArea && venderGoodsAreaParam.openType === 'add'">
+      <el-page-header class="pdt" content="新增关系维护单" @back="backUpdPage" />
+      <el-divider />
+    </template>
+    <template v-else-if="venderGoodsArea && venderGoodsArea.openType !== 'add'">
+      <el-page-header
+        class="pdt"
+        :content="venderGoodsAreaParam.openType === 'view' ? '查看关系维护单' : '编辑关系维护单'"
+        @back="backUpdPage"
+      />
+      <el-divider />
+    </template>
+    <div v-show="!venderGoodsArea" style="height: 100%">
+      <template-page
+        ref="pageRef"
+        :getList="getList"
+        :exportList="exportList"
+        :columnParsing="columnParsing"
+        :operation="operation()"
+        :optionsEvensGroup="optionsEvensGroup"
+        :tableAttributes="tableAttributes"
+        :tableEvents="tableEvents"
+      >
+      </template-page>
+    </div>
+    <vender-goods-area
+      v-if="venderGoodsArea"
+      :is-open.sync="venderGoodsArea"
+      :input-param="venderGoodsAreaParam"
+      @getList="$refs.pageRef.refreshList()"
+    />
+  </div>
+</template>
+
+<script>
+import {
+  confirmVenderGoodsSheet,
+  delVenderGoodsSheet,
+  getVenderGoodsSheetList,
+  getNewVenderList,
+  exportNewVenderList
+} from '@/api/material-system/vender'
+import VenderGoodsArea from '../components/VenderGoodsArea'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+export default {
+  name: 'VenderGoodsSheet',
+  components: { VenderGoodsArea, TemplatePage },
+  mixins: [import_mixin],
+  data() {
+    return {
+      venderGoodsArea: false,
+      venderGoodsAreaParam: {
+        openType: 'add',
+        sheetId: ''
+      },
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增单据',
+              click: () => {
+                this.addOrEdit('add')
+              },
+              isRole: this.checkBtnRole('add')
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
+    }
+  },
+  methods: {
+    // 新增编辑 辅材
+    addOrEdit(type, id) {
+      this.venderGoodsArea = true
+      this.venderGoodsAreaParam.openType = type
+      this.venderGoodsAreaParam.sheetId = id
+    },
+    // 删除单据
+    delSheet(sheetId) {
+      delVenderGoodsSheet({ sheetId: sheetId }).then(() => {
+        this.$refs.pageRef.refreshList()
+
+        this.$successMsg('删除成功')
+      })
+    },
+    // 审核 供应商关系商品维护单
+    confirmSheet(sheetId) {
+      confirmVenderGoodsSheet({ sheetId: sheetId }).then(() => {
+        this.$refs.pageRef.refreshList()
+
+        this.$successMsg('审核成功')
+      })
+    },
+    backUpdPage() {
+      this.$refs.pageRef.refreshList()
+      this.venderGoodsArea = false
+    },
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getNewVenderList(...p)
+    },
+    // 列表导出函数
+    exportList: exportNewVenderList,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return (h, { row, index, column }) => {
+        return (
+          <div class="operation-btns">
+            {this.checkBtnRole('view') ? (
+              <el-button
+                size="mini"
+                type="text"
+                onClick={() => {
+                  this.addOrEdit('view', row.sheetId)
+                }}
+              >
+                查看
+              </el-button>
+            ) : null}
+            {this.checkBtnRole('edit') && row.flag === 0 ? (
+              <el-button
+                type="text"
+                size="mini"
+                style="margin-right: 10px;"
+                onClick={() => {
+                  this.addOrEdit('edit', row.sheetId)
+                }}
+              >
+                编辑
+              </el-button>
+            ) : null}
+            {this.checkBtnRole('confirm') && row.flag === 0 ? (
+              <el-popconfirm
+                style="margin-right: 10px;"
+                title="确定审核吗?"
+                onConfirm={() => {
+                  this.confirmSheet(row.sheetId)
+                }}
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  审核
+                </el-button>
+              </el-popconfirm>
+            ) : null}
+            {this.checkBtnRole('del') && row.flag === 0 ? (
+              <el-popconfirm
+                style="margin-right: 10px;"
+                title="确定删除吗?"
+                onConfirm={() => {
+                  this.delSheet(row.sheetId)
+                }}
+              >
+                <el-button slot="reference" size="mini" type="text">
+                  删除
+                </el-button>
+              </el-popconfirm>
+            ) : null}
+          </div>
+        )
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+.pdt {
+  padding: 20px 20px 0 20px;
+}
+</style>

+ 70 - 0
src/views/auxiliaryFittings/vender/vender-goods/index.vue

@@ -0,0 +1,70 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :columnParsing="columnParsing"
+    :exportList="exportList"
+    :tableAttributes="tableAttributes"
+    :tableEvents="tableEvents"
+  >
+  </template-page>
+</template>
+
+<script>
+import { getVenderGoodsList, getNewVenderGoodsList, exportVenderGoods } from '@/api/material-system/vender'
+import { downloadFiles } from '@/utils/util'
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+export default {
+  name: 'VenderGoods',
+  components: { TemplatePage },
+  mixins: [import_mixin],
+  data() {
+    return {
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增单据',
+              click: () => {
+                this.addOrEdit('add')
+              },
+              isRole: this.checkBtnRole('add')
+            }
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: []
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(...p) {
+      this.recordSelected = []
+      return getNewVenderGoodsList(...p)
+    },
+    // 列表导出函数
+    exportList: exportVenderGoods,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    }
+  }
+}
+</script>
+
+<style scoped></style>

+ 344 - 0
src/views/partsManagement/accessoriesHome/index.vue

@@ -0,0 +1,344 @@
+<template>
+  <div class="dashboard_container">
+    <template>
+      <div class="flex">
+        <div class="mode" @click="gotopage('attachmentProfile', '', '')">
+          <div class="title">配件资料配置统计</div>
+          <div class="flex head">
+            <div class="tab">
+              <div class="text">
+                <div class="num">{{ collectData.allpGoodsNum }}</div>
+                <div class="title">总配置数量</div>
+              </div>
+            </div>
+            <div class="tab">
+              <div class="text">
+                <div class="num">{{ collectData.onPGoodsNum }}</div>
+                <div class="title">有效配置数量</div>
+              </div>
+            </div>
+            <div class="tab">
+              <div class="text">
+                <div class="num">{{ collectData.offPGoodsNum }}</div>
+                <div class="title">无效配置数量</div>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="mode">
+          <div class="title">配件采购入库单统计</div>
+          <div class="flex head">
+            <div class="tab" @click="gotopage('partsStorage', '已保存数量', 'SAVE')">
+              <div class="text">
+                <div class="num">{{ collectData.savePurchasePNum }}</div>
+                <div class="title">已保存数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('partsStorage', '已审核数量', 'OK')">
+              <div class="text">
+                <div class="num">{{ collectData.okPurchasePNum }}</div>
+                <div class="title">已审核数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('partsStorage', '审核失败数量', 'FAIL')">
+              <div class="text">
+                <div class="num">{{ collectData.failPurchasePNum }}</div>
+                <div class="title">审核失败数量</div>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="mode">
+          <div class="title">配件采购退货单统计</div>
+          <div class="flex head">
+            <div class="tab" @click="gotopage('partsReturn', '已保存数量', 'SAVE')">
+              <div class="text">
+                <div class="num">{{ collectData.savePurchaseRetPNum }}</div>
+                <div class="title">已保存数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('partsReturn', '已审核数量', 'OK')">
+              <div class="text">
+                <div class="num">{{ collectData.okPurchaseRetPNum }}</div>
+                <div class="title">已审核数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('partsReturn', '审核失败数量', 'FAIL')">
+              <div class="text">
+                <div class="num">{{ collectData.failPurchaseRetPNum }}</div>
+                <div class="title">审核失败数量</div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="flex">
+        <div class="mode" style="min-width: 66.33%">
+          <div class="title">配件销售订单统计</div>
+          <div class="flex head">
+            <div class="tab" @click="gotopage('attachmentSalesOrder', '已保存数量', 'SAVE')">
+              <div class="text">
+                <div class="num">{{ collectData.saveSalesPNum }}</div>
+                <div class="title">已保存数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('attachmentSalesOrder', '已提交数量', 'SUBMIT')">
+              <div class="text">
+                <div class="num">{{ collectData.submitSalesPgNum }}</div>
+                <div class="title">已提交数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('attachmentSalesOrder', '已支付未提交', 'PAY_NOT_TAKE')">
+              <div class="text">
+                <div class="num">{{ collectData.payNoTakeSalesPgNum }}</div>
+                <div class="title">已支付未提交</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('attachmentSalesOrder', '已支付已提交', 'PAY_TAKE')">
+              <div class="text">
+                <div class="num">{{ collectData.payTakeSalesPgNum }}</div>
+                <div class="title">已支付已提交</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('attachmentSalesOrder', '取消订单数量', 'CANCEL')">
+              <div class="text">
+                <div class="num">{{ collectData.cancelSalesPgNum }}</div>
+                <div class="title">取消订单数量</div>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="mode">
+          <div class="title">配件新件返还统计</div>
+          <div class="flex head">
+            <div class="tab" @click="gotopage('attachmentNewReturn', '已保存数量', 'SAVE')">
+              <div class="text">
+                <div class="num">{{ collectData.saveNewNum }}</div>
+                <div class="title">已保存数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('attachmentNewReturn', '已提交数量', 'SUBMIT')">
+              <div class="text">
+                <div class="num">{{ collectData.submitNewNum }}</div>
+                <div class="title">已提交数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('attachmentNewReturn', '审核通过数量', 'OK')">
+              <div class="text">
+                <div class="num">{{ collectData.okNewNum }}</div>
+                <div class="title">审核通过数量</div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div class="flex">
+        <div class="mode">
+          <div class="title">配件旧件返还统计</div>
+          <div class="flex head">
+            <div class="tab" @click="gotopage('attachmentOldReturn', '已保存数量', 'SAVE')">
+              <div class="text">
+                <div class="num">{{ collectData.saveOldNum }}</div>
+                <div class="title">已保存数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('attachmentOldReturn', '已提交数量', 'SUBMIT')">
+              <div class="text">
+                <div class="num">{{ collectData.submitOldNum }}</div>
+                <div class="title">已提交数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('attachmentOldReturn', '审核通过数量', 'OK')">
+              <div class="text">
+                <div class="num">{{ collectData.okOldNum }}</div>
+                <div class="title">审核通过数量</div>
+              </div>
+            </div>
+          </div>
+        </div>
+        <div class="mode">
+          <div class="title">配件旧件返厂单统计</div>
+          <div class="flex head">
+            <div class="tab" @click="gotopage('oldPartsReturnFactory', '已保存数量', 'SAVE')">
+              <div class="text">
+                <div class="num">{{ collectData.saveOldFactoryNum }}</div>
+                <div class="title">已保存数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('oldPartsReturnFactory', '已提交数量', 'SUBMIT')">
+              <div class="text">
+                <div class="num">{{ collectData.submitOldFactoryNum }}</div>
+                <div class="title">已提交数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('oldPartsReturnFactory', '审核通过数量', 'OK')">
+              <div class="text">
+                <div class="num">{{ collectData.okOldFactoryNum }}</div>
+                <div class="title">审核通过数量</div>
+              </div>
+            </div>
+            <div class="tab" @click="gotopage('oldPartsReturnFactory', '审核失败数量', 'FAIL')">
+              <div class="text">
+                <div class="num">{{ collectData.failOldFactoryNum }}</div>
+                <div class="title">审核失败数量</div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </template>
+  </div>
+</template>
+
+<script>
+import { dataCountMaterialCount } from '@/api/dataCount.js'
+export default {
+  data() {
+    return {
+      collectData: {}
+    }
+  },
+  created() {
+    this.refreshData()
+  },
+  methods: {
+    refreshData() {
+      dataCountMaterialCount().then(res => {
+        this.collectData = res.data
+      })
+    },
+    gotopage(name, pageName, pageCode, pageType) {
+      if (pageCode) {
+        this.$router.push({
+          name: name,
+          params: {
+            pageName: pageName,
+            pageType: pageType || '-',
+            pageCode: pageCode
+          }
+        })
+      } else {
+        this.$router.push({
+          name: name
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.dashboard_container {
+  background: #f5f5f5;
+  padding: 20px;
+  min-height: calc(100vh - 86px);
+  box-sizing: border-box;
+
+  .refresh {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    // text-align: right;
+    margin-bottom: 10px;
+
+    span {
+      cursor: pointer;
+    }
+
+    i {
+      font-weight: bold;
+      margin-left: 4px;
+      cursor: pointer;
+    }
+  }
+
+  .flex {
+    display: flex;
+    margin-bottom: 10px;
+  }
+
+  .flex_asb {
+    display: flex;
+    justify-content: space-between;
+  }
+
+  .mode {
+    flex: 1;
+    padding: 10px;
+    margin-right: 10px;
+    background-color: #ffffff;
+    border-radius: 10px;
+
+    .title {
+      font-weight: bold;
+    }
+
+    .head {
+      padding-top: 12px !important;
+      margin: 0 !important;
+      margin-bottom: 0 !important;
+    }
+
+    .opacity {
+      opacity: 0;
+    }
+
+    .tab {
+      display: flex;
+      align-items: center;
+      flex: 1;
+      cursor: pointer;
+
+      .text {
+        margin: 0 10px;
+
+        .title {
+          color: #999999;
+          font-size: 12px;
+          margin-top: 8px;
+        }
+
+        .num {
+          font-size: 22px;
+          font-weight: bold;
+        }
+      }
+
+      .img {
+        width: 46px;
+        height: 46px;
+        margin-left: 20px;
+      }
+    }
+
+    .child {
+      border-right: 1px solid #dddddd;
+
+      .text {
+        .title {
+          margin-top: 8px;
+          margin-bottom: 0;
+        }
+      }
+    }
+
+    .child:last-child {
+      border-right: none;
+    }
+  }
+
+  .mode:last-child {
+    margin-right: 0;
+  }
+
+  .container_bottom {
+    width: 100%;
+    height: 350px;
+    padding: 10px;
+    background-color: #ffffff;
+    margin-top: 10px;
+    border-radius: 10px;
+  }
+}
+</style>