chris 1 年間 前
コミット
11067b7f9f

+ 50 - 20
src/views/modules/order/order-add-or-update.vue

@@ -1,4 +1,4 @@
-<!--  单新增或修改 -->
+<!--  任务单新增或修改 -->
 <template>
   <div>
       <div class="my-title">{{ !id ? '新增': display ? '详情' : '修改' }}</div>
@@ -212,7 +212,7 @@
               align="center">
             </el-table-column>
             <el-table-column
-              prop="productName"
+              prop="taskType"
               header-align="center"
               align="center"
               min-width="80"
@@ -220,53 +220,52 @@
               label="工单类型">
             </el-table-column>
             <el-table-column
-              prop="productSpecifications"
+              prop="taskName"
               header-align="center"
               align="center"
-              min-width="120"
+              width="120"
               :show-tooltip-when-overflow="true"
               label="工单名称">
             </el-table-column>
             <el-table-column
-              prop="cnt"
+              prop="ranks"
               header-align="center"
               align="center"
               min-width="50"
               label="级别">
             </el-table-column>
             <el-table-column
-              prop="productNumber"
+              prop="content"
               header-align="center"
               align="center"
-              min-width="160"
+              width="160"
               :show-tooltip-when-overflow="true"
               label="工单内容">
             </el-table-column>
             <el-table-column
-              prop="price"
+              prop="receiver"
               header-align="center"
               align="center"
               min-width="100"
               label="任务接收人">
             </el-table-column>
             <el-table-column
-              prop="amount"
+              prop="planCompletionTime"
               header-align="center"
               align="center"
               min-width="80"
               label="要求完成时间">
-              <template slot-scope="scope">
-                <span>{{ (scope.row.cnt*scope.row.price).toFixed(1) }}</span>
-              </template>
             </el-table-column>
             <el-table-column
-              prop="rate"
+              prop="attachList"
               header-align="center"
               align="center"
-              min-width="100"
-              label="任务单附件">
+              label="工单附件">
               <template slot-scope="scope">
-                {{scope.row.rate}}%
+                <div v-for="(item, index) in scope.row.attachList" style="display: inline">
+                  <span v-if="index > 0">,</span>
+                  <a :key="item.fileName + index" type="primary" href="#" @click="previewFile(item.fileName, item.url)">{{ item.fileName }}</a>
+                </div>
               </template>
             </el-table-column>
             <el-table-column
@@ -284,8 +283,8 @@
               width="100"
               label="操作">
               <template slot-scope="scope">
-                <el-button type="text" size="small" @click="updateProductHandle(scope.row)">编辑</el-button>
-                <el-button style="color: red" type="text" size="small" @click="deleteProductHandle(scope.row.recordId)">删除</el-button>
+                <el-button type="text" size="small" @click="updateWorkItemHandle(scope.row)">编辑</el-button>
+                <el-button style="color: red" type="text" size="small" @click="deleteWorkItemHandle(scope.row.recordId)">删除</el-button>
               </template>
             </el-table-column>
           </el-table>
@@ -299,6 +298,9 @@
           <el-button v-if="!display" type="primary" @click="dataFormSubmit()">确定</el-button>
         </span>
     <add-or-update v-if="productListVisible"  ref="productList" @addItem="addItem" />
+    <worder-add-or-update v-if="worderListVisible" ref="worderList" @submit="addWorkItem"/>
+    <!-- 文件预览 -->
+    <preview-component v-if="previewVisible" ref="preview"/>
   </div>
 </template>
 
@@ -309,10 +311,12 @@
   import { dealStepData, dealStepLogs } from '@/api/util'
   import CusComponent from '../common/cus-component'
   import AddOrUpdate from '../product/template-add-or-update'
+  import WorderAddOrUpdate from '../worder/add-or-update'
+  import PreviewComponent from '@/views/modules/common/preview-component'
 
   export default {
     name: 'order-add-or-update',
-    components: {CusComponent, UploadComponent, UserComponent, AddOrUpdate},
+    components: {PreviewComponent, WorderAddOrUpdate, CusComponent, UploadComponent, UserComponent, AddOrUpdate},
     computed: {
       orgId: {
         get () { return this.$store.state.user.orgId }
@@ -321,6 +325,8 @@
     data () {
       return {
         productListVisible: false,
+        worderListVisible: false,
+        previewVisible: false,
         visible: false,
         display: false,
         addType: 0,
@@ -341,6 +347,8 @@
     },
     methods: {
       onChose () {
+        this.productListVisible = false
+        this.worderListVisible = false
         this.$emit('onChose')
       },
       // 初始化:addType 新增类型: 0新增,1修改 2技术确认 (目前只有2才会赋值)
@@ -404,6 +412,7 @@
         }
       },
       addWorkItem (item) {
+        this.worderListVisible = false
         if (!item.recordId) {
           item.recordId = Math.round(Math.random() * 1000000)
         }
@@ -497,7 +506,28 @@
       },
       // 添加任务工单
       addWorkItemHandle () {
-
+        this.worderListVisible = true
+        this.$nextTick(() => {
+          this.$refs.worderList.init()
+        })
+      },
+      // 编辑产品项
+      updateWorkItemHandle (row) {
+        this.worderListVisible = true
+        this.$nextTick(() => {
+          this.$refs.worderList.init(row.recordId, row)
+        })
+      },
+      // 删除产品项
+      deleteWorkItemHandle (recordId) {
+        this.workInfoDetails.splice(this.workInfoDetails.findIndex((item) => item.recordId === recordId), 1)
+      },
+      // 预览
+      previewFile (fileName, url) {
+        this.previewVisible = true
+        this.$nextTick(() => {
+          this.$refs.preview.init(fileName, url)
+        })
       }
     }
   }

+ 1 - 0
src/views/modules/order/order-amount-mask-setting.vue

@@ -1,3 +1,4 @@
+<!-- 任务单金额屏蔽 -->
 <template>
     <div>
         <div class="my-title">订单金额屏蔽设置</div>

+ 1 - 6
src/views/modules/order/order-detail.vue

@@ -1,9 +1,5 @@
+<!-- 任务单详情 -->
 <template>
-  <!-- <el-dialog
-    title="查看"
-    width="70%"
-    :close-on-click-modal="false"
-    :visible.sync="visible"> -->
   <div>
     <div class="my-title">查看</div>
     <div style="margin-left: 20px;margin-right: 20px">
@@ -141,7 +137,6 @@
     <!-- 文件预览 -->
     <preview-component v-if="previewVisible" ref="preview"/>
   </div>
-  <!-- </el-dialog> -->
 </template>
 
 <script>

+ 1 - 1
src/views/modules/order/order.vue

@@ -1,4 +1,4 @@
-<!-- 单 -->
+<!-- 任务单 -->
 <template>
   <div class="order">
     <template v-if="!addOrUpdateVisible && !detailVisible && !arrivedVisible && !confirmVisible && !noticeChangeAttachVisible && !amountMaskSettingVisible">