浏览代码

添加btn

408249787 2 年之前
父节点
当前提交
5dc3b7f6a3

+ 1 - 1
src/views/repair/application-form/RepairForm.vue

@@ -303,7 +303,7 @@ export default {
         parameter = {
           ...parameter,
           ...this.queryParam,
-          type: 1,
+          type: null,
           dataScope: {
             sortBy: 'asc, desc',
             sortName: 'status, apply_time'

+ 11 - 8
src/views/workplace/backlog/NewWorkplaceBacklog.vue

@@ -114,7 +114,7 @@
               <my-icon type="icon-zichanguanli-zichantiaobo" style="font-size:58px;"/>
               <span>领用</span>
             </div>
-            <div class="btn" style="background:linear-gradient(to right,#941FFF,#BC72FB);">
+            <div class="btn" style="background:linear-gradient(to right,#941FFF,#BC72FB);" @click="$refs.sparebackform.base()">
               <my-icon type="icon-xinzengyugengxinhuopindangan-copy" style="font-size:58px;"/>
               <span>退库</span>
             </div>
@@ -188,12 +188,14 @@
     </div>
     <repair-form ref="repairForm"></repair-form>
     <SparePickForm ref="sparePickForm"></SparePickForm>
+    <SpareBackForm ref="sparebackform"></SpareBackForm>
   </div>
 </template>
 
 <script>
 import { STable } from '@/components'
 import RepairForm from './modules/RepairBaseForm'
+import SpareBackForm from '@/views/store/sparebackform/modules/BaseForm'
 import SparePickForm from '@/views/store/sparepickform/modules/BaseForm'
 import { getWorkplaceBacklogUserPage, getWorkplaceBacklogTopData, getWorkplaceBacklogWeekData, getWorkplaceBacklogPie } from '@/api/workplace/backlog'
 import { Chart } from '@antv/g2'
@@ -202,6 +204,7 @@ export default {
   components: {
     STable,
     SparePickForm,
+    SpareBackForm,
     RepairForm,
     Chart
   },
@@ -381,16 +384,18 @@ export default {
       })
     },
     getInfo () {
-      Promise.all([getWorkplaceBacklogWeekData(this.role), getWorkplaceBacklogPie(this.role)]).then(res => {
-        console.log(res)
-        this.lineData = res[0].data.reduce((pre, item) => {
+      getWorkplaceBacklogWeekData(this.role).then(res => {
+        const data = res.data.reduce((pre, item) => {
           pre.push({
             week: item.weekDayName,
             value: item.tempTotalNum
           })
           return pre
         }, [])
-        this.equipmentData = res[1].data.reduce((pre, item) => {
+        this.getLineCharts('container-line', data)
+      })
+      getWorkplaceBacklogPie(this.role).then(res => {
+        const data = res.data.reduce((pre, item) => {
           pre.push({
             item: item.typeName,
             count: item.fee,
@@ -398,9 +403,7 @@ export default {
           })
           return pre
         }, [])
-      }).then(() => {
-        this.getPieCharts('container-pie', this.equipmentData)
-        this.getLineCharts('container-line', this.lineData)
+        this.getPieCharts('container-pie', data)
       })
     },
     getPieCharts (id, data) {

+ 214 - 194
src/views/workplace/backlog/StoreWorkplaceBacklog.vue

@@ -1,200 +1,214 @@
 <template>
   <div>
-    <div class="gutter-example">
-      <a-row :gutter="20">
-        <a-col class="gutter-row" :span="8">
-          <div class="gutter-box">
-            <a-row type="flex" justify="space-between" style="flex:1; font-size:22px;font-weight: 500;color: #373737;">
-              <a-col>待入库总数</a-col>
-              <a-col><a href="/in/store/myform?status=1" target="_block">{{ topData.inTotalNum }}</a></a-col>
-            </a-row>
-            <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
-              <a-col >
-                <a-badge color="#E4007F"/>
-                <a href="/in/store/myform?type=1&status=1" target="_block"><span style="color:#E4007F;">采购入库 &nbsp; {{ topData.purchaseApplyNum }}</span></a>
-              </a-col>
-              <a-col >
-                <a-badge color="#5864FF"/>
-                <a href="/in/store/myform?type=2&status=1" target="_block">
-                  <span style="color:#5864FF;">闲置入库 &nbsp; {{ topData.spareBackApplyNum }}</span>
-                </a>
-              </a-col>
-            </a-row>
-            <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
-              <a-col >
-                <a-badge color="#F19149"/>
-                <a href="/in/store/myform?type=3&status=1" target="_block">
-                  <span style="color:#F19149;">调拨入库 &nbsp; {{ topData.applyDBNum }}</span>
+    <div v-show="visible">
+      <div class="gutter-example">
+        <a-row :gutter="20">
+          <a-col class="gutter-row" :span="8">
+            <div class="gutter-box">
+              <a-row type="flex" justify="space-between" style="flex:1; font-size:22px;font-weight: 500;color: #373737;">
+                <a-col>待入库总数</a-col>
+                <a-col><a href="/in/store/myform?status=1" target="_block">{{ topData.inTotalNum }}</a></a-col>
+              </a-row>
+              <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
+                <a-col >
+                  <a-badge color="#E4007F"/>
+                  <a href="/in/store/myform?type=1&status=1" target="_block"><span style="color:#E4007F;">采购入库 &nbsp; {{ topData.purchaseApplyNum }}</span></a>
+                </a-col>
+                <a-col >
+                  <a-badge color="#5864FF"/>
+                  <a href="/in/store/myform?type=2&status=1" target="_block">
+                    <span style="color:#5864FF;">闲置入库 &nbsp; {{ topData.spareBackApplyNum }}</span>
+                  </a>
+                </a-col>
+              </a-row>
+              <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
+                <a-col >
+                  <a-badge color="#F19149"/>
+                  <a href="/in/store/myform?type=3&status=1" target="_block">
+                    <span style="color:#F19149;">调拨入库 &nbsp; {{ topData.applyDBNum }}</span>
 
-                </a>
-              </a-col>
-              <a-col>
-                <a-badge color="#009944"/>
-                <a href="/in/store/myform?type=6&status=1" target="_block">
+                  </a>
+                </a-col>
+                <a-col>
+                  <a-badge color="#009944"/>
+                  <a href="/in/store/myform?type=6&status=1" target="_block">
 
-                  <span style="color:#009944;">其他入库 &nbsp; {{ topData.otherNum }}</span>
+                    <span style="color:#009944;">其他入库 &nbsp; {{ topData.otherNum }}</span>
 
-                </a>
+                  </a>
 
-              </a-col>
-            </a-row>
-          </div>
-        </a-col>
-        <a-col class="gutter-row" :span="8">
-          <div class="gutter-box">
-            <a-row type="flex" justify="space-between" style="flex:1; font-size:22px;font-weight: 500;color: #373737;">
-              <a-col>待出库总数</a-col>
-              <a href="/out/store/myform?status=1" target="_block">
-                <a-col>{{ topData.outTotalNum }}</a-col>
-              </a>
-            </a-row>
-            <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
-              <a-col >
-                <a-badge color="#E4007F"/>
-                <a href="/out/store/myform?type=2&status=1" target="_block">
-                  <span style="color:#E4007F;">调拨出库 &nbsp; {{ topData.outDBNum }}</span>
-                </a>
-              </a-col>
-              <a-col >
-                <a-badge color="#5864FF"/>
-                <a href="/out/store/myform?type=1&status=1" target="_block">
-                  <span style="color:#5864FF;">领用出库 &nbsp; {{ topData.lyNum }}</span>
+                </a-col>
+              </a-row>
+            </div>
+          </a-col>
+          <a-col class="gutter-row" :span="8">
+            <div class="gutter-box">
+              <a-row type="flex" justify="space-between" style="flex:1; font-size:22px;font-weight: 500;color: #373737;">
+                <a-col>待出库总数</a-col>
+                <a href="/out/store/myform?status=1" target="_block">
+                  <a-col>{{ topData.outTotalNum }}</a-col>
                 </a>
-              </a-col>
-            </a-row>
-            <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
-              <a-col >
-                <a-badge color="#F19149"/>
-                <a href="/out/store/myform?type=3&status=1" target="_block">
-                  <span style="color:#F19149;">报废出库 &nbsp; {{ topData.bfNum }}</span>
+              </a-row>
+              <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
+                <a-col >
+                  <a-badge color="#E4007F"/>
+                  <a href="/out/store/myform?type=2&status=1" target="_block">
+                    <span style="color:#E4007F;">调拨出库 &nbsp; {{ topData.outDBNum }}</span>
+                  </a>
+                </a-col>
+                <a-col >
+                  <a-badge color="#5864FF"/>
+                  <a href="/out/store/myform?type=1&status=1" target="_block">
+                    <span style="color:#5864FF;">领用出库 &nbsp; {{ topData.lyNum }}</span>
+                  </a>
+                </a-col>
+              </a-row>
+              <a-row type="flex" justify="space-between" :gutter="[0,16]" style="flex:1;font-size:18px;font-weight: 500;">
+                <a-col >
+                  <a-badge color="#F19149"/>
+                  <a href="/out/store/myform?type=3&status=1" target="_block">
+                    <span style="color:#F19149;">报废出库 &nbsp; {{ topData.bfNum }}</span>
+                  </a>
+                </a-col>
+                <a-col>
+                  <a-badge color="#009944"/>
+                  <a href="/out/store/myform?type=6&status=1" target="_block">
+
+                    <span style="color:#009944;">其他出库 &nbsp; {{ topData.otherOutNum }}</span>
+                  </a>
+
+                </a-col>
+              </a-row>
+            </div>
+          </a-col>
+          <a-col class="gutter-row" :span="8">
+            <div style="display:flex;text-align:center;background:#fff;height: 170px;">
+              <div style="width:48%;margin:auto;font-size:30px; line-height: 60px;">
+                <div>仓库总数</div>
+                <a href="/storeJituan" target="_block">
+                  <div style="font-size:24px;">{{ topData.storeNums }}</div>
                 </a>
-              </a-col>
-              <a-col>
-                <a-badge color="#009944"/>
-                <a href="/out/store/myform?type=6&status=1" target="_block">
+              </div>
+              <div style="width: 1px;height: 70px;background: #999999;margin:auto;"></div>
+              <div style="width:48%;margin:auto; font-size:30px;line-height: 60px;">
+                <div>备件总价值</div>
+                <a href="/spare/part/info" target="_block">
 
-                  <span style="color:#009944;">其他出库 &nbsp; {{ topData.otherOutNum }}</span>
+                  <div style="font-size:24px;">{{ topData.totalPrice }}</div>
                 </a>
 
-              </a-col>
-            </a-row>
-          </div>
-        </a-col>
-        <a-col class="gutter-row" :span="8">
-          <div style="display:flex;text-align:center;background:#fff;height: 170px;">
-            <div style="width:48%;margin:auto;font-size:30px; line-height: 60px;">
-              <div>仓库总数</div>
-              <div style="font-size:24px;">{{ topData.storeNums }}</div>
-            </div>
-            <div style="width: 1px;height: 70px;background: #999999;margin:auto;"></div>
-            <div style="width:48%;margin:auto; font-size:30px;line-height: 60px;">
-              <div>备件总价值</div>
-              <div style="font-size:24px;">{{ topData.totalPrice }}</div>
+              </div>
             </div>
-          </div>
-        </a-col>
-      </a-row>
-    </div>
-    <div class="gutter-example">
-      <a-row :gutter="[20,40]">
-        <a-col class="gutter-row" :span="8">
-          <div style="height: 471px;background: #FFFFFF;padding:24px">
-            <div style="display:flex;justify-content: space-between;width:160px;height: 18px; font-size:16px;color: #555555; ">
-              <div>备件类型数量统计</div>
+          </a-col>
+        </a-row>
+      </div>
+      <div class="gutter-example">
+        <a-row :gutter="[20,40]">
+          <a-col class="gutter-row" :span="8">
+            <div style="height: 471px;background: #FFFFFF;padding:24px">
+              <div style="display:flex;justify-content: space-between;width:160px;height: 18px; font-size:16px;color: #555555; ">
+                <div>备件类型数量统计</div>
               <!-- <div>设备总数100</div> -->
+              </div>
+              <div id="container-pie"></div>
             </div>
-            <div id="container-pie"></div>
-          </div>
-        </a-col>
-        <a-col class="gutter-row" :span="12">
-          <div style="height: 471px;background: #FFFFFF; padding:24px;">
-            <div style="display:flex;justify-content: space-between;width:190px;height: 18px; font-size:16px;color: #555555; margin-bottom:80px;">
-              <div style="width: 7px;background: #4D86ED;"></div>
-              <div>近一周每日出入库数据</div>
-            </div>
-            <div id="container-line"></div>
-          </div>
-        </a-col>
-        <a-col class="gutter-row" :span="4">
-          <div style="height: 471px;display:flex;flex-direction:column;justify-content: space-between">
-            <div class="btn" style="background:linear-gradient(to right,#36B5FA,#26ECF5);">
-              <my-icon type="icon-chukuguanli" style="font-size:58px;"/>
-              <span>出库</span>
-            </div>
-            <div class="btn" style="background:linear-gradient(to right,#FF416D,#FF847F);">
-              <my-icon type="icon-rukuguanli" style="font-size:58px;"/>
-              <span>入库</span>
-            </div>
-            <div class="btn" style="background:linear-gradient(to right,#FB47D1,#F96EFE);">
-              <my-icon type="icon-zichanguanli-zichantiaobo" style="font-size:58px;"/>
-              <span>调拨</span>
+          </a-col>
+          <a-col class="gutter-row" :span="12">
+            <div style="height: 471px;background: #FFFFFF; padding:24px;">
+              <div style="display:flex;justify-content: space-between;width:190px;height: 18px; font-size:16px;color: #555555; margin-bottom:80px;">
+                <div style="width: 7px;background: #4D86ED;"></div>
+                <div>近一周每日出入库数据</div>
+              </div>
+              <div id="container-line"></div>
             </div>
-            <div class="btn" style="background:linear-gradient(to right,#941FFF,#BC72FB);">
-              <my-icon type="icon-xinzengyugengxinhuopindangan-copy" style="font-size:58px;"/>
-              <span>新增</span>
+          </a-col>
+          <a-col class="gutter-row" :span="4">
+            <div style="height: 471px;display:flex;flex-direction:column;justify-content: space-between">
+              <div class="btn" style="background:linear-gradient(to right,#36B5FA,#26ECF5);" @click="handleOutAdd">
+                <my-icon type="icon-chukuguanli" style="font-size:58px;"/>
+                <span>出库</span>
+              </div>
+              <div class="btn" style="background:linear-gradient(to right,#FF416D,#FF847F);" @click="handleInAdd">
+                <my-icon type="icon-rukuguanli" style="font-size:58px;"/>
+                <span>入库</span>
+              </div>
+              <div class="btn" style="background:linear-gradient(to right,#FB47D1,#F96EFE);">
+                <my-icon type="icon-zichanguanli-zichantiaobo" style="font-size:58px;"/>
+                <span>调拨</span>
+              </div>
+              <div class="btn" style="background:linear-gradient(to right,#941FFF,#BC72FB);">
+                <my-icon type="icon-xinzengyugengxinhuopindangan-copy" style="font-size:58px;"/>
+                <span>新增</span>
+              </div>
             </div>
-          </div>
-        </a-col>
-      </a-row>
-    </div>
-    <div class="gutter-example">
-      <a-row :gutter="20">
-        <a-col class="gutter-row" :span="6">
-          <div class="information">
-            <div style="display:flex;justify-content: space-between;align-items: center; padding-bottom:20px;">
-              <div style="display:flex; width:65px;height:17px;justify-content: space-between;align-items: center;">
-                <div style=" width: 17px;height: 17px;background: #3462FD;border-radius: 50%;"></div>
-                <div style="font-size: 18px;font-weight: 800;color: #333333;">资料</div>
+          </a-col>
+        </a-row>
+      </div>
+      <div class="gutter-example">
+        <a-row :gutter="20">
+          <a-col class="gutter-row" :span="6">
+            <div class="information">
+              <div style="display:flex;justify-content: space-between;align-items: center; padding-bottom:20px;">
+                <div style="display:flex; width:65px;height:17px;justify-content: space-between;align-items: center;">
+                  <div style=" width: 17px;height: 17px;background: #3462FD;border-radius: 50%;"></div>
+                  <div style="font-size: 18px;font-weight: 800;color: #333333;">资料</div>
+                </div>
+                <div >
+                  查看全部
+                  <my-icon type="icon-xiangyou-copy" style="font-size:13px;"/>
+                </div>
               </div>
-              <div >
-                查看全部
-                <my-icon type="icon-xiangyou-copy" style="font-size:13px;"/>
+              <div
+                class="demo-infinite-container"
+              >
+                <a-list size="small" bordered :data-source="information">
+                  <a-list-item slot="renderItem" slot-scope="item,index" :class="{discolor: index%2}">
+                    <a-list-item-meta>
+                      <div slot="title" :href="item.href">{{ item.name }}</div>
+                    </a-list-item-meta>
+                    <div>{{ item.time }}</div>
+                  </a-list-item>
+                </a-list>
               </div>
             </div>
-            <div
-              class="demo-infinite-container"
-            >
-              <a-list size="small" bordered :data-source="information">
-                <a-list-item slot="renderItem" slot-scope="item,index" :class="{discolor: index%2}">
-                  <a-list-item-meta>
-                    <div slot="title" :href="item.href">{{ item.name }}</div>
-                  </a-list-item-meta>
-                  <div>{{ item.time }}</div>
-                </a-list-item>
-              </a-list>
+          </a-col>
+          <a-col class="gutter-row" :span="18">
+            <div class="information">
+              <s-table
+                ref="table"
+                size="small"
+                bordered
+                rowKey="id"
+                :columns="columns"
+                :data="loadData"
+                :pageSize="10"
+                :scroll="{ y: 190 }"
+              >
+                <span slot="action" slot-scope="record">
+                  <template>
+                    <a @click="handle(record)">详情</a>
+                    <a-divider v-if="record.status === 1" type="vertical" />
+                    <a v-if="record.status === 1" @click="dealJumpDetail(record)">跳转</a>
+                  </template>
+                </span>
+                <span slot="content" slot-scope="text" v-html="text">
+                </span>
+              </s-table>
             </div>
-          </div>
-        </a-col>
-        <a-col class="gutter-row" :span="18">
-          <div class="information">
-            <s-table
-              ref="table"
-              size="small"
-              bordered
-              rowKey="id"
-              :columns="columns"
-              :data="loadData"
-              :pageSize="10"
-              :scroll="{ y: 190 }"
-            >
-              <span slot="action" slot-scope="record">
-                <template>
-                  <a @click="handle(record)">详情</a>
-                  <a-divider v-if="record.status === 1" type="vertical" />
-                  <a v-if="record.status === 1" @click="dealJumpDetail(record)">跳转</a>
-                </template>
-              </span>
-              <span slot="content" slot-scope="text" v-html="text">
-              </span>
-            </s-table>
-          </div>
-        </a-col>
-      </a-row>
+          </a-col>
+        </a-row>
+      </div>
     </div>
+    <InBaseFrom ref="inBaseModal" @ok="handleOk"></InBaseFrom>
+    <OutBaseFrom ref="outBaseModal" @ok="handleOk"></OutBaseFrom>
+
   </div>
 </template>
 
 <script>
+import InBaseFrom from '@/views/store/instoreform/modules/BaseForm.vue'
+import OutBaseFrom from '@/views/store/outstoreform/modules/BaseForm.vue'
+
 import { STable } from '@/components'
 import { getWorkplaceBacklogUserPage, getWorkplaceBacklogTopData, getWorkplaceBacklogWeekData, getWorkplaceBacklogPie } from '@/api/workplace/backlog'
 import { Chart } from '@antv/g2'
@@ -202,25 +216,18 @@ export default {
   name: 'NewWorkplaceBacklog',
   components: {
     STable,
+    InBaseFrom,
+    OutBaseFrom,
     Chart
   },
   data () {
     return {
+      visible: true,
       equipmentData: [
-        { item: '事例一', count: 40, percent: 0.4 },
-        { item: '事例二', count: 21, percent: 0.21 },
-        { item: '事例三', count: 17, percent: 0.17 },
-        { item: '事例四', count: 13, percent: 0.13 },
-        { item: '事例五', count: 9, percent: 0.09 }
+        { item: '事例一', count: 40, percent: 0.4 }
       ],
       lineData: [
-        { week: '周一', value: 3 },
-        { week: '周二', value: 4 },
-        { week: '周三', value: 7.5 },
-        { week: '周四', value: 5 },
-        { week: '周五', value: 4.9 },
-        { week: '周六', value: 6 },
-        { week: '周日', value: 7 }
+        { week: '周一', value: 3 }
       ],
       storeNums: 0,
       allCount: 100,
@@ -361,9 +368,8 @@ export default {
       })
     },
     getInfo () {
-      Promise.all([getWorkplaceBacklogWeekData(this.role), getWorkplaceBacklogPie(this.role)]).then(res => {
-        console.log(res)
-        this.lineData = res[0].data.inStoreDetailVOS.reduce((pre, item) => {
+      getWorkplaceBacklogWeekData(this.role).then(res => {
+        const data = res.data.inStoreDetailVOS.reduce((pre, item) => {
           pre.push({
             week: item.weekDayName,
             value: item.num,
@@ -371,8 +377,8 @@ export default {
           })
           return pre
         }, [])
-        this.lineData.push(
-          ...res[0].data.outStoreDetailVOS.reduce((pre, item) => {
+        data.push(
+          ...res.data.outStoreDetailVOS.reduce((pre, item) => {
             pre.push({
               week: item.weekDayName,
               value: item.num,
@@ -382,8 +388,10 @@ export default {
             return pre
           }, [])
         )
-
-        this.equipmentData = res[1].data.reduce((pre, item) => {
+        this.getLineCharts('container-line', data)
+      })
+      getWorkplaceBacklogPie(this.role).then(res => {
+        const data = res.data.reduce((pre, item) => {
           pre.push({
             item: item.name,
             count: item.currentStock,
@@ -391,9 +399,7 @@ export default {
           })
           return pre
         }, [])
-      }).then(() => {
-        this.getPieCharts('container-pie', this.equipmentData)
-        this.getLineCharts('container-line', this.lineData)
+        this.getPieCharts('container-pie', data)
       })
     },
     getPieCharts (id, data) {
@@ -484,6 +490,20 @@ export default {
       this.chartLine.interaction('active-region')
 
       this.chartLine.render()
+    },
+    handleOk () {
+      this.visible = true
+      this.getDict()
+    },
+    handleInAdd () {
+      this.visible = false
+      const modal = this.$refs.inBaseModal
+      modal.base()
+    },
+    handleOutAdd () {
+      this.visible = false
+      const modal = this.$refs.outBaseModal
+      modal.base()
     }
   }
 }