Ver Fonte

no message

linwenxin há 5 meses atrás
pai
commit
5eb9c69dd3

+ 57 - 55
src/packageMaterial/pages/partsApply/form.vue

@@ -8,17 +8,12 @@
         </view>
         <view class="item" v-for="(item, index) in partsList" :key="index">
           <view class="row">
-            <view class="label"><text>*</text>配件{{index+1}}名称</view>
-            <u--input
-              placeholder="请输入名称"
-              border="none"
-              inputAlign="right"
-              v-model="item.name"
-            ></u--input>
+            <view class="label"><text>*</text>配件{{ index + 1 }}名称</view>
+            <u--input placeholder="请输入名称" border="none" inputAlign="right" v-model="item.name"></u--input>
             <view class="del" v-if="partsList.length > 1" @tap="delParts(index)">删除</view>
           </view>
           <view class="row">
-            <view class="label"><text>*</text>配件{{index+1}}数量</view>
+            <view class="label"><text>*</text>配件{{ index + 1 }}数量</view>
             <u-number-box v-model="item.num"></u-number-box>
           </view>
         </view>
@@ -26,7 +21,7 @@
 
       <view class="remark-container">
         <view class="title">备注</view>
-        <u--textarea v-model="remark" placeholder="请输入内容" border="none" ></u--textarea>
+        <u--textarea v-model="remark" placeholder="请输入内容" border="none"></u--textarea>
       </view>
     </view>
 
@@ -40,49 +35,52 @@
 </template>
 
 <script>
-  export default {
-    data() {
-      return {
-        id: '',
-        partsList: [],
-        remark: '',
-      }
-    },
-
-    onLoad({id}) {
-      this.id = id;
-      // this.getDetail();
-      this.addParts();
-    },
+export default {
+  data() {
+    return {
+      id: '',
+      partsList: [],
+      remark: ''
+    }
+  },
 
-    methods: {
-      addParts() {
-        if(this.partsList.length > 0 && this.partsList.some(o => !o.name)) return this.$toast('请填写配件名称');
+  onLoad({ id }) {
+    this.id = id
+    // this.getDetail();
+    this.addParts()
+  },
 
-        this.partsList.push({
-          name: '',
-          num: 1,
-        })
-      },
+  methods: {
+    addParts() {
+      if (this.partsList.length > 0 && this.partsList.some(o => !o.name)) return this.$toast('请填写配件名称')
 
-      delParts(index) {
-        this.$modal({
-          content: '确认删除吗?'
-        }).then(() => {
-          this.partsList.splice(index, 1);
-        }).catch(() => {})
-      },
+      this.partsList.push({
+        name: '',
+        num: 1
+      })
+    },
 
-      toList() {
-        this.$navToPage({
-          url: `/packageMaterial/pages/partsApply/list`
+    delParts(index) {
+      this.$modal({
+        content: '确认删除吗?'
+      })
+        .then(() => {
+          this.partsList.splice(index, 1)
         })
-      },
+        .catch(() => {})
+    },
+
+    toList() {
+      this.$navToPage({
+        url: `/packageMaterial/pages/partsApply/list`
+      })
+    },
 
-      submitData() {
-        if(this.partsList.length > 0 && this.partsList.some(o => !o.name)) return this.$toast('请填写配件名称');
+    submitData() {
+      if (this.partsList.length > 0 && this.partsList.some(o => !o.name)) return this.$toast('请填写配件名称')
 
-        this.$api.postJson('/material/parts/apply/add', {
+      this.$api
+        .postJson('/material/parts/apply/add', {
           orderBaseId: this.id,
           items: this.partsList.map(item => {
             return {
@@ -90,18 +88,22 @@
               qty: item.num
             }
           }),
-          remark: this.remark,
-        }).then(res => {
-          this.$successToast('提交成功');
-          this.crossPage.$emit('refreshWorkorderList', {tab: ''});
-          this.crossPage.$emit('refreshWorkorderDetail', '');
-          this.$navToPage({
-            url: `/packageMaterial/pages/partsApply/list`
-          }, 'redirectTo')
+          remark: this.remark
         })
-      },
-    },
+        .then(res => {
+          this.$successToast('提交成功')
+          this.crossPage.$emit('refreshWorkorderList', { tab: '' })
+          this.crossPage.$emit('refreshWorkorderDetail', '')
+          this.$navToPage(
+            {
+              url: `/packageMaterial/pages/partsApply/list`
+            },
+            'redirectTo'
+          )
+        })
+    }
   }
+}
 </script>
 
 <style lang="scss" scoped>

+ 4 - 1
src/packageWorkorder/pages/orderList.vue

@@ -274,7 +274,7 @@ export default {
     }
   },
 
-  async onReady({ tab, isYb, isWb }) {
+  onLoad({ tab, isYb, isWb }) {
     this.crossPage.$on('refreshWorkorderList', data => {
       if (data && data.tab) {
         this.curMainTab = data.tab
@@ -292,8 +292,11 @@ export default {
     this.getCount()
 
     this.curMainTab = tab || ''
+
     this.refreshList()
+  },
 
+  onReady() {
     this.resize()
   },
 

+ 13 - 5
src/pages/index/index.vue

@@ -187,7 +187,7 @@
             <view class="left">工单管理</view>
           </view>
           <view class="list">
-            <view class="item" v-for="(item, index) in orderList" :key="index" @tap="toPage(item.url)">
+            <view class="item" v-for="(item, index) in orderList" :key="index" @tap="toPageaa(item.url, item.tab)">
               <image :src="require(`@/static/images/home/order-icon${item.code}.png`)" mode=""></image>
               <text>{{ item.title }}</text>
             </view>
@@ -360,10 +360,10 @@ export default {
       ],
       orderList: [
         // 工单管理列表
-        { code: 1, title: '待接单', url: `/packageWorkorder/pages/orderList?tab=DJD` },
-        { code: 2, title: '服务中', url: `/packageWorkorder/pages/orderList?tab=FWZ` },
-        { code: 3, title: '已完成', url: `/packageWorkorder/pages/orderList?tab=YWG` },
-        { code: 4, title: '异常单', url: `/packageWorkorder/pages/orderList?tab=YCD` }
+        { code: 1, title: '待接单', url: `/packageWorkorder/pages/orderList?tab=DJD`, tab: 'DJD' },
+        { code: 2, title: '服务中', url: `/packageWorkorder/pages/orderList?tab=FWZ`, tab: 'FWZ' },
+        { code: 3, title: '已完成', url: `/packageWorkorder/pages/orderList?tab=YWG`, tab: 'YWG' },
+        { code: 4, title: '异常单', url: `/packageWorkorder/pages/orderList?tab=YCD`, tab: 'YCD' }
       ],
       otherList: [
         // 其他列表
@@ -768,6 +768,14 @@ export default {
       this.navToPage(url)
     },
 
+    toPageaa(url, tab) {
+      if (!url) return this.$toast('敬请期待~')
+      this.navToPage(url)
+      this.$nextTick(() => {
+        this.crossPage.$emit('refreshWorkorderList', { tab: tab })
+      })
+    },
+
     toFn(fn) {
       if (!fn) return this.$toast('敬请期待~')