linwenxin пре 1 година
родитељ
комит
8c719fcd03

+ 18 - 0
src/api/workOrderPool.js

@@ -1,5 +1,23 @@
 import request, { postBlob, getBlob, handleImport } from '@/utils/request'
 
+
+
+export function changeOrderChangeWorker(data) {
+  return request({
+    url: `/changeOrder/changeWorker`,
+    method: 'post',
+    data
+  })
+}
+
+export function changeOrderChangeAppointmentTime(data) {
+  return request({
+    url: `/changeOrder/changeAppointmentTime`,
+    method: 'post',
+    data
+  })
+}
+
 export function orderBaseFlag(params) {
   return request({
     url: `/order/base/flag`,

+ 18 - 0
src/utils/common.js

@@ -1,5 +1,23 @@
 import { MessageBox, Message, Notification } from '@zjlib/element-ui2'
 
+export function addHours(str) {
+  // 获取当前时间
+  var currentDate = new Date(str);
+
+  // 增加一小时
+  currentDate.setHours(currentDate.getHours() + 1);
+
+  // 转换 "YYYY-MM-DD HH:mm:ss" 格式
+  var formattedDate = currentDate.getFullYear() + '-' +
+    ('0' + (currentDate.getMonth() + 1)).slice(-2) + '-' +
+    ('0' + currentDate.getDate()).slice(-2) + ' ' +
+    ('0' + currentDate.getHours()).slice(-2) + ':' +
+    ('0' + currentDate.getMinutes()).slice(-2) + ':' +
+    ('0' + currentDate.getSeconds()).slice(-2);
+
+  return formattedDate
+}
+
 export function tableDataParsing(fieldBeans) {
   return fieldBeans.map((item, index) => {
     var tiling =

+ 10 - 51
src/views/workOrder/workOrderPool/components/mixins/showRecordSelected.js

@@ -1,4 +1,6 @@
 import { required } from '@/components/template/rules_verify.js'
+import { orderBaseList } from "@/api/workOrderPool.js"
+import { tableDataParsing } from "@/utils/common.js"
 export default {
   props: {
     recordSelected: {
@@ -8,6 +10,7 @@ export default {
   },
   data() {
     return {
+      columns: []
     }
   },
   watch: {
@@ -19,58 +22,14 @@ export default {
       immediate: true,
     },
   },
+  created() {
+    orderBaseList({ "pageNum": 1, "pageSize": 1, "params": [{ "param": "a.id", "compare": "=", "value": "0" }] }).then(res => {
+      this.columns = tableDataParsing(
+        res.fieldBeans.filter(item => !~["orderFlags", "orderType"].indexOf(item.jname))
+      )
+    })
+  },
   computed: {
-    columns() {
-      return [
-        {
-          columnAttributes: {
-            label: '产品品牌',
-            prop: 'brandId'
-          },
-        },
-        {
-          columnAttributes: {
-            label: '产品大类',
-            prop: 'mainId'
-          },
-        },
-        {
-          columnAttributes: {
-            label: '产品小类',
-            prop: 'smallId'
-          },
-        },
-        {
-          columnAttributes: {
-            label: '产品机型',
-            prop: 'selectedItemsName'
-          },
-        },
-        {
-          columnAttributes: {
-            label: '数量',
-            prop: 'num'
-          },
-        },
-        {
-          columnAttributes: {
-            label: '备注',
-            prop: 'remark'
-          },
-        },
-        {
-          columnAttributes: {
-            label: '操作',
-          },
-          render: (h, { row, column, index }) => {
-            return <div style="padding-left:10px">
-              <el-button type="text" onClick={() => {
-              }}>删除</el-button>
-            </div>
-          }
-        }
-      ]
-    },
     selectedItems() {
       return [{
         name: 'slot-component',

+ 15 - 1
src/views/workOrder/workOrderPool/components/reassignment/index.vue

@@ -11,6 +11,9 @@
     <!-- 操作按钮 -->
     <div>
       <div style="box-sizing: border-box;padding: 16px;text-align:right;">
+        <el-button size="mini" @click="$emit('close')">
+          取消
+        </el-button>
         <el-button type="primary" size="mini" @click="allVerify">
           确定
         </el-button>
@@ -23,6 +26,7 @@
 import pandanxinxi from '../../detailModule/workOrderInfo/mixins/pandanxinxi.js'
 import showRecordSelected from "../mixins/showRecordSelected.js"
 import { required } from '@/components/template/rules_verify.js'
+import { changeOrderChangeWorker } from "@/api/workOrderPool.js"
 export default {
   mixins: [
     pandanxinxi,
@@ -65,7 +69,17 @@ export default {
   methods: {
     allVerify() {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-
+        changeOrderChangeWorker({
+          ids: this.orderInfo.recordSelected.map(item => item.id),
+          websitId: this.orderInfo.websitId,
+          workerIds: this.orderInfo.orderWorkers.map(item => item.workerId),
+        }).then(res => {
+          this.$message({
+            type: 'success',
+            message: '派单成功!'
+          })
+          this.$emit("close")
+        })
       })
     },
   }

+ 16 - 1
src/views/workOrder/workOrderPool/components/reschedule/index.vue

@@ -11,6 +11,9 @@
     <!-- 操作按钮 -->
     <div>
       <div style="box-sizing: border-box;padding: 16px;text-align:right;">
+        <el-button size="mini" @click="$emit('close')">
+          取消
+        </el-button>
         <el-button type="primary" size="mini" @click="allVerify">
           确定
         </el-button>
@@ -22,6 +25,8 @@
 <script>
 import showRecordSelected from "../mixins/showRecordSelected.js"
 import { required } from '@/components/template/rules_verify.js'
+import { changeOrderChangeAppointmentTime } from "@/api/workOrderPool.js"
+import { addHours } from "@/utils/common.js"
 export default {
   mixins: [
     showRecordSelected
@@ -68,7 +73,17 @@ export default {
   methods: {
     allVerify() {
       this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-
+        changeOrderChangeAppointmentTime({
+          ids: this.orderInfo.recordSelected.map(item => item.id),
+          appointmentTime: this.orderInfo.appointmentTime,
+          appointmentEndTime: this.orderInfo.appointmentTime
+        }).then(res => {
+          this.$message({
+            type: 'success',
+            message: '约单成功!'
+          })
+          this.$emit("close")
+        })
       })
     },
   }

+ 3 - 3
src/views/workOrder/workOrderPool/detailModule/workOrderInfo/mixins/pandanxinxi.js

@@ -214,12 +214,12 @@ export default {
       if (this.orderInfo.websitId) {
         memberListPageV2({ "pageNum": 1, "pageSize": -1, "params": [{ "param": "b.examine_status", "compare": "=", "value": "OK" }, { "param": "b.websit_id", "compare": "=", "value": this.orderInfo.websitId }] }).then(res => {
           this.workerList = res.data.records.map(item => {
-            var { id, ...data } = item
+            var { id,userId, ...data } = item
             return {
-              value: id,
+              value: userId,
               label: data.nickName,
               data: {
-                workerId: id,
+                workerId: userId,
                 workerName: data.nickName,
                 workerIdcard: data.idCard,
                 workerMobile: data.mobile,

+ 6 - 3
src/views/workOrder/workOrderPool/index.vue

@@ -3,7 +3,7 @@
   <template-page ref="pageRef" :getList="getList" :operation="operation" :exportList="exportList"
     :optionsEvensGroup="optionsEvensGroup" :columnParsing="columnParsing" :tableAttributes="tableAttributes"
     :tableEvents="tableEvents" :moreParameters="moreParameters" :screeningAnalysis="screeningAnalysis"
-    :filterMethod="filterMethod">
+    :filterMethod="filterMethod" :replaceOrNotMap="true">
     <!-- 创建工单 -->
     <div class="cartographer_big">
       <el-dialog title="创建工单" width="100%" :modal="false" :visible.sync="createFormBool" :before-close="handleClose">
@@ -20,14 +20,14 @@
     <div class="cartographer_big">
       <el-dialog title="批量预约 / 改约" width="100%" :modal="false" :visible.sync="rescheduleBool"
         :before-close="rescheduleClose">
-        <Reschedule v-if="rescheduleBool" :recordSelected="recordSelected"/>
+        <Reschedule v-if="rescheduleBool" :recordSelected="recordSelected" @close="rescheduleClose" />
       </el-dialog>
     </div>
     <!-- 批量派工/改派 -->
     <div class="cartographer_big">
       <el-dialog title="批量派工 / 改派" width="100%" :modal="false" :visible.sync="reassignmentBool"
         :before-close="reassignmentClose">
-        <Reassignment v-if="reassignmentBool" :recordSelected="recordSelected"/>
+        <Reassignment v-if="reassignmentBool" :recordSelected="recordSelected" @close="reassignmentClose" />
       </el-dialog>
     </div>
   </template-page>
@@ -271,6 +271,7 @@ export default {
       this.$nextTick(() => {
         this.createFormBool = false
         this.detailFormBool = false
+        this.recordSelected = []
         this.$refs?.pageRef?.refreshList()
       })
     },
@@ -278,11 +279,13 @@ export default {
     rescheduleClose() {
       this.rescheduleBool = false
       this.recordSelected = []
+      this.$refs?.pageRef?.refreshList()
     },
 
     reassignmentClose() {
       this.reassignmentBool = false
       this.recordSelected = []
+      this.$refs?.pageRef?.refreshList()
     },
 
   }