瀏覽代碼

no message

linwenxin 5 月之前
父節點
當前提交
14f3ebdda5

+ 40 - 1
src/views/setting/workContactLetter/workContactLetterPage/index.vue

@@ -897,6 +897,44 @@ export default {
       ]
     }
   },
+  created() {
+    if (this.$route?.query?.orderBaseId) {
+      const loading = this.$loading({
+        lock: true,
+        text: '正在前往创建工作联络函页面......',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      })
+      this.openForm(() => {
+        this.formData.orderId = this.$route?.query?.orderBaseId
+        orderBaseDetail({
+          orderBaseId: this.$route?.query?.orderBaseId,
+          returnErr: true
+        })
+          .then(res => {
+            loading.close()
+            if (res.data.orderProducts.length == 1) {
+              this.formData.mainId = res.data.orderProducts?.[0]?.mainId || ''
+              this.formData.mainName = res.data.orderProducts?.[0]?.mainName || ''
+            }
+            this.formData.orderSmallType = res.data?.orderSmallType || ''
+            this.formData.orderSmallTypeText = res.data?.orderSmallTypeText || ''
+            this.formData.orderCreateTime = res.data?.createTime || ''
+            this.formData.websitId = res.data?.websitId || ''
+            this.formData.websitName = res.data?.websitName || ''
+          })
+          .catch(err => {
+            this.formData.mainId = ''
+            this.formData.mainName = ''
+            this.formData.orderSmallType = ''
+            this.formData.orderSmallTypeText = ''
+            this.formData.orderCreateTime = ''
+            this.formData.websitId = ''
+            this.formData.websitName = ''
+          })
+      })
+    }
+  },
   methods: {
     // 列表请求函数
     getList(p, cb) {
@@ -928,7 +966,7 @@ export default {
       this.recordSelected = data
     },
     // 打开创建弹窗
-    openForm() {
+    openForm(cb) {
       Promise.all([
         getWebsit({ status: true }),
         letterManagerListUser({
@@ -968,6 +1006,7 @@ export default {
             ...data
           }
         })
+        cb?.()
         this.formDialog = true
       })
     },

+ 35 - 0
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/buttons/workContactLetter.vue

@@ -0,0 +1,35 @@
+<template>
+  <div class="withinLine">
+    <el-button @click="abnormal" :disabled="disabled" type="primary" size="mini">工作联络函</el-button>
+  </div>
+</template>
+
+<script>
+import buttonMixin from './button_mixin.js'
+import { MessageBox } from '@zjlib/element-ui2'
+export default {
+  mixins: [buttonMixin],
+  methods: {
+    abnormal() {
+      this.$router.push({
+        name: 'workContactLetterPage',
+        query: {
+          orderBaseId: this?.orderInfo?.id
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.withinLine {
+  display: inline-block;
+
+  ::v-deep .el-button {
+    margin-left: 0;
+    margin-right: 10px;
+    margin-bottom: 10px;
+  }
+}
+</style>

+ 6 - 1
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/index.vue

@@ -87,6 +87,9 @@
         <!-- 21,总部下载 -->
         <orderBaseDow v-if="orderInfo && orderInfo.isImportExcel" :orderInfo="orderInfo" :orderType="orderType" />
         <!-- <cloneWorkOrderBtn v-if="~btnRestrict.indexOf(20)" :orderInfo="orderInfo" :orderType="orderType" /> -->
+
+        <!-- 工作联络函 -->
+        <workContactLetter :orderInfo="orderInfo" :orderType="orderType" />
       </div>
       <div style="box-sizing: border-box; padding: 10px 10px 0" v-else>
         <!-- 关闭 -->
@@ -119,6 +122,7 @@ import cancelOrder from './buttons/cancelOrder.vue'
 import orderReject from './buttons/orderReject.vue'
 import activateOrder from './buttons/activateOrder.vue'
 import orderBaseDow from './buttons/orderBaseDow.vue'
+import workContactLetter from './buttons/workContactLetter.vue'
 
 export default {
   components: {
@@ -133,7 +137,8 @@ export default {
     orderReject,
     activateOrder,
     cloneWorkOrderBtn,
-    orderBaseDow
+    orderBaseDow,
+    workContactLetter
   },
   mixins: [
     workOrderLogic,