Mr.Shi
2023-09-05 3878c57a2bd710295931303ea85439a596838dfd
minipro_standard/pages_adjust/pages/outboundDetails/outboundDetails.vue
@@ -16,7 +16,7 @@
            <view style="margin-top: 0 " class="content_list_item_content_item">
               <view class="content_list_item_content_item_label">单据类型:</view>
               <view class="content_list_item_content_item_nr" v-if="data.billType">
                  {{ orderTyepToStr(data.billType) }}
                  {{ seeText(data.billType) }}
               </view>
            </view>
            <view class="content_list_item_content_item">
@@ -114,24 +114,88 @@
</template>
<script>
   import { orderTyepToStr } from '@/util/constData.js'
   import {
      orderTyepToStr
   } from '@/util/constData.js'
   import {
      getBoundDetail,
      cancelBound
   } from '@/util/api/materialStorage'
   export default {
      data() {
         return {
            data: {},
            types: [
               { name: '全部', id: '', isActive: true },
               { name: '采购订单', id: '0', isActive: false },
               { name: '生产工单', id: '1', isActive: false },
               { name: '销售订单', id: '2', isActive: false },
               { name: '转库单', id: '3', isActive: false },
               { name: '盘点单', id: '4', isActive: false },
            id: null,
            data: {
               code: "",
               createName: "",
               planDate: "",
               dealDate: "",
               status: 0,
               originType: 0,
               originCode: "",
               updateName: "",
               updateMobile: "",
               updateTime: "",
               warehouseName: "",
               warehouseCode: "",
               outPlandate: "",
               inPlandate: "",
               woutboundDetailsWait: [],
               woutboundDetailsOut: []
            },
            types: [{
                  name: '全部',
                  id: '',
                  isActive: true
               },
               {
                  name: '采购订单',
                  id: '0',
                  isActive: false
               },
               {
                  name: '生产工单',
                  id: '1',
                  isActive: false
               },
               {
                  name: '销售订单',
                  id: '2',
                  isActive: false
               },
               {
                  name: '转库单',
                  id: '3',
                  isActive: false
               },
               {
                  name: '盘点单',
                  id: '4',
                  isActive: false
               },
            ],
            materailArray: []
         };
      },
      onLoad(option) {
         this.id = option.id
         getBoundDetail({
            id: option.id
         })
         .then(res => {
            this.data = res.data
            if (this.data.status === 1) {
               this.materailArray.push(...this.data.woutboundDetailsOut)
            } else {
               this.materailArray.push(...this.data.woutboundDetailsWait)
            }
         })
      },
      methods: {
         seeText(id) {
            return orderTyepToStr(id)
         },
         tyepToStr(type) {
            //  <!-- 1、车间领料;2、车间备料;3、其他;4、完工入库 -->
            for (const item of this.types) {
@@ -142,10 +206,17 @@
            return '-'
         },
         submit() {
         },
         cancel() {
            cancelBound({ id: this.id })
               .then(res => {
                  uni.showToast({ title: '取消成功', icon: 'success', duration: 2000 });
                  uni.navigateBack({ delta: 1 });
               })
               .catch(err => {
                  uni.showToast({ title: err.message, icon: 'error', duration: 2000 });
               })
         }
      }
   }