whj 1 年之前
父节点
当前提交
3aec3b8df0

+ 62 - 50
src/api/repair/application-form.js

@@ -7,7 +7,7 @@ import { stringify } from 'qs'
  * @param parameter
  * @returns {*}
  */
-export function getRepairApplicationFormPage(parameter) {
+export function getRepairApplicationFormPage (parameter) {
   return axios({
     url: '/repair/application-forms/page?' + stringify(parameter),
     method: 'get',
@@ -17,7 +17,7 @@ export function getRepairApplicationFormPage(parameter) {
   })
 }
 
-export function getRepairApplicationFormPoolPage(parameter) {
+export function getRepairApplicationFormPoolPage (parameter) {
   return axios({
     url: '/repair/application-forms/pool/page?' + stringify(parameter),
     method: 'get',
@@ -33,7 +33,7 @@ export function getRepairApplicationFormPoolPage(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function addRepairApplicationForm(parameter) {
+export function addRepairApplicationForm (parameter) {
   return axios({
     url: '/repair/application-forms',
     method: 'POST',
@@ -50,7 +50,7 @@ export function addRepairApplicationForm(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function againRepairApplicationForm(parameter) {
+export function againRepairApplicationForm (parameter) {
   return axios({
     url: '/repair/application-forms/again',
     method: 'POST',
@@ -67,7 +67,7 @@ export function againRepairApplicationForm(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function saveFormByApplication(parameter) {
+export function saveFormByApplication (parameter) {
   return axios({
     url: '/repair/application-forms/' + parameter.id,
     method: 'POST',
@@ -81,7 +81,7 @@ export function saveFormByApplication(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function updateRepairApplicationForm(parameter) {
+export function updateRepairApplicationForm (parameter) {
   return axios({
     url: '/repair/application-forms/' + parameter.id,
     method: 'PUT',
@@ -95,7 +95,7 @@ export function updateRepairApplicationForm(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function fetchRepairApplicationForm(parameter) {
+export function fetchRepairApplicationForm (parameter) {
   return axios({
     url: '/repair/application-forms/' + parameter.id,
     method: 'get',
@@ -110,7 +110,7 @@ export function fetchRepairApplicationForm(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function getCalendarNotice(parameter) {
+export function getCalendarNotice (parameter) {
   return axios({
     url: '/repair/application-forms/login/notice',
     method: 'get',
@@ -125,7 +125,7 @@ export function getCalendarNotice(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function getDispatchUser(parameter) {
+export function getDispatchUser (parameter) {
   return axios({
     url: '/upms/user-depts/repair-manager',
     method: 'get',
@@ -140,7 +140,7 @@ export function getDispatchUser(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function getSbPositions(parameter) {
+export function getSbPositions (parameter) {
   return axios({
     url: '/sb/positions/longYan?' + stringify(parameter),
     method: 'get',
@@ -155,7 +155,7 @@ export function getSbPositions(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function getSbPositions2(parameter) {
+export function getSbPositions2 (parameter) {
   return axios({
     url: '/sb/positions/longYan2?' + stringify(parameter),
     method: 'get',
@@ -170,7 +170,7 @@ export function getSbPositions2(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function queryRepairApplicationForm(parameter) {
+export function queryRepairApplicationForm (parameter) {
   return axios({
     url: '/repair/application-forms?' + stringify(parameter),
     method: 'get',
@@ -186,7 +186,7 @@ export function queryRepairApplicationForm(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function deleteRepairApplicationForms(parameter) {
+export function deleteRepairApplicationForms (parameter) {
   return axios({
     url: '/repair/application-forms',
     method: 'DELETE',
@@ -200,7 +200,7 @@ export function deleteRepairApplicationForms(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function deleteRepairApplicationForm(parameter) {
+export function deleteRepairApplicationForm (parameter) {
   return axios({
     url: '/repair/application-forms/' + parameter.id,
     method: 'DELETE',
@@ -214,7 +214,7 @@ export function deleteRepairApplicationForm(parameter) {
  * @param parameter :
  * @returns {*}
  */
-export function exportRepairApplicationForm(parameter) {
+export function exportRepairApplicationForm (parameter) {
   return axios({
     url: '/repair/application-forms/export?' + stringify(parameter),
     method: 'get',
@@ -230,7 +230,7 @@ export function exportRepairApplicationForm(parameter) {
  * @param parameter :
  * @returns {*}
  */
-export function joinHoliday(parameter) {
+export function joinHoliday (parameter) {
   return axios({
     url: `/repair/application-forms/join/${parameter}`,
     method: 'get',
@@ -245,7 +245,7 @@ export function joinHoliday(parameter) {
  * @param parameter :
  * @returns {*}
  */
-export function cancelHoliday(parameter) {
+export function cancelHoliday (parameter) {
   return axios({
     url: `/repair/application-forms/cancel/${parameter}`,
     method: 'get',
@@ -260,7 +260,7 @@ export function cancelHoliday(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function changeApplicationForm(parameter) {
+export function changeApplicationForm (parameter) {
   return axios({
     url: '/repair/application-forms/change/' + parameter.id,
     method: 'PUT',
@@ -273,7 +273,7 @@ export function changeApplicationForm(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function changeEditForm(parameter) {
+export function changeEditForm (parameter) {
   return axios({
     url: '/repair/application-forms/edit/error/info',
     method: 'PUT',
@@ -286,7 +286,7 @@ export function changeEditForm(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function finish(parameter) {
+export function finish (parameter) {
   return axios({
     url: '/repair/application-forms/finish/' + parameter.id,
     method: 'PUT',
@@ -299,7 +299,7 @@ export function finish(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function changeFieldTemplateData(parameter) {
+export function changeFieldTemplateData (parameter) {
   return axios({
     url: '/customize/fieldTemplateData/ticket/' + parameter.id,
     method: 'PUT',
@@ -312,7 +312,7 @@ export function changeFieldTemplateData(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function examine(parameter) {
+export function examine (parameter) {
   return axios({
     url: '/repair/application-forms/examine/' + parameter.id,
     method: 'PUT',
@@ -326,7 +326,7 @@ export function examine(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function examineOk(result, parameter) {
+export function examineOk (result, parameter) {
   return axios({
     url: '/repair/application-forms/examined/' + parameter.id + '/' + result,
     method: 'PUT',
@@ -339,7 +339,7 @@ export function examineOk(result, parameter) {
  * @param parameter
  * @returns {*}
  */
-export function pushCalendar(parameter) {
+export function pushCalendar (parameter) {
   return axios({
     url: '/repair/application-forms/addCalendar/' + parameter.id,
     method: 'PUT',
@@ -352,7 +352,7 @@ export function pushCalendar(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function getCalendar(parameter) {
+export function getCalendar (parameter) {
   return axios({
     url: '/repair/application-forms/tuiCalendar?' + stringify(parameter),
     method: 'get',
@@ -367,7 +367,7 @@ export function getCalendar(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function repairVerify(parameter) {
+export function repairVerify (parameter) {
   return axios({
     url: '/repair/application-forms/repair/verify',
     method: 'PUT',
@@ -381,21 +381,33 @@ export function repairVerify(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function dispatchModelByDTO(parameter) {
+export function dispatchModelByDTO (parameter) {
   return axios({
     url: '/repair/application-forms/dispatch/' + parameter.id,
     method: 'PUT',
     data: parameter
   })
 }
-
 /**
  * update func
  * parameter: { }
  * @param parameter
  * @returns {*}
  */
-export function transferApplyByDTO(parameter) {
+export function batchBack (parameter) {
+  return axios({
+    url: '/sb/infos/yiBiao/batch/back-store',
+    method: 'PUT',
+    data: parameter
+  })
+}
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function transferApplyByDTO (parameter) {
   return axios({
     url: '/repair/application-forms/transfer',
     method: 'PUT',
@@ -409,7 +421,7 @@ export function transferApplyByDTO(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function refusedByDTO(parameter) {
+export function refusedByDTO (parameter) {
   return axios({
     url: '/repair/application-forms/refused/' + parameter.id,
     method: 'PUT',
@@ -423,7 +435,7 @@ export function refusedByDTO(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function receive(parameter) {
+export function receive (parameter) {
   return axios({
     url: '/repair/application-forms/deal/' + parameter.id,
     method: 'PUT',
@@ -437,7 +449,7 @@ export function receive(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function nonPlanToPlan(parameter) {
+export function nonPlanToPlan (parameter) {
   return axios({
     url: '/repair/application-forms/nonPlan/toPlan/' + parameter.id,
     method: 'PUT',
@@ -451,7 +463,7 @@ export function nonPlanToPlan(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function closeRepair(parameter) {
+export function closeRepair (parameter) {
   return axios({
     url: '/repair/application-forms/close/repair',
     method: 'PUT',
@@ -464,7 +476,7 @@ export function closeRepair(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function closeRepair2(parameter) {
+export function closeRepair2 (parameter) {
   return axios({
     url: '/repair/application-forms/close/repair2',
     method: 'PUT',
@@ -477,7 +489,7 @@ export function closeRepair2(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function approve(parameter) {
+export function approve (parameter) {
   return axios({
     url: '/repair/application-forms/approve/' + parameter.id,
     method: 'PUT',
@@ -485,7 +497,7 @@ export function approve(parameter) {
   })
 }
 
-export function receiveRepair(parameter) {
+export function receiveRepair (parameter) {
   return axios({
     url: '/repair/application-forms/receive/repair',
     method: 'PUT',
@@ -493,7 +505,7 @@ export function receiveRepair(parameter) {
   })
 }
 
-export function reportRepair(parameter) {
+export function reportRepair (parameter) {
   return axios({
     url: '/repair/application-forms/report/repair',
     method: 'PUT',
@@ -507,7 +519,7 @@ export function reportRepair(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function returnRepair(parameter) {
+export function returnRepair (parameter) {
   return axios({
     url: '/repair/application-forms/returnRepair/' + parameter.id,
     method: 'PUT',
@@ -520,7 +532,7 @@ export function returnRepair(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function verifyPassRepair(parameter) {
+export function verifyPassRepair (parameter) {
   return axios({
     url: '/repair/application-forms/verify/mm/pass/' + parameter.id,
     method: 'PUT',
@@ -533,7 +545,7 @@ export function verifyPassRepair(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function verifyRefusedRepair(parameter) {
+export function verifyRefusedRepair (parameter) {
   return axios({
     url: '/repair/application-forms/verify/mm/refused/' + parameter.id,
     method: 'PUT',
@@ -546,7 +558,7 @@ export function verifyRefusedRepair(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function verifyProduceRepair(parameter) {
+export function verifyProduceRepair (parameter) {
   return axios({
     url: '/repair/application-forms/verify/produce/pass/' + parameter.id,
     method: 'PUT',
@@ -559,7 +571,7 @@ export function verifyProduceRepair(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function verifyProduceRefusedRepair(parameter) {
+export function verifyProduceRefusedRepair (parameter) {
   return axios({
     url: '/repair/application-forms/verify/produce/refused/' + parameter.id,
     method: 'PUT',
@@ -572,7 +584,7 @@ export function verifyProduceRefusedRepair(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function applyVerifyRepair(parameter) {
+export function applyVerifyRepair (parameter) {
   return axios({
     url: '/repair/application-forms/apply/verify/' + parameter.id,
     method: 'PUT',
@@ -585,7 +597,7 @@ export function applyVerifyRepair(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function recoverRepair(parameter) {
+export function recoverRepair (parameter) {
   return axios({
     url: '/repair/application-forms/recover/' + parameter.id,
     method: 'PUT',
@@ -598,7 +610,7 @@ export function recoverRepair(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function applyBigRepair(parameter) {
+export function applyBigRepair (parameter) {
   return axios({
     url: '/repair/application-forms/apply/bigRepair/' + parameter.id,
     method: 'PUT',
@@ -611,7 +623,7 @@ export function applyBigRepair(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function getProducerUser(parameter) {
+export function getProducerUser (parameter) {
   return axios({
     url: '/upms/user-depts/producer',
     method: 'get',
@@ -626,14 +638,14 @@ export function getProducerUser(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function checkBigRepair(parameter) {
+export function checkBigRepair (parameter) {
   return axios({
     url: '/repair/application-forms/verify/bigRepair/' + parameter.id,
     method: 'PUT',
     data: parameter
   })
 }
-export function repairCancel(parameter) {
+export function repairCancel (parameter) {
   return axios({
     url: '/repair/application-forms/repair/delete/' + parameter.id,
     method: 'PUT'
@@ -645,7 +657,7 @@ export function repairCancel(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function receiveProfessor(parameter) {
+export function receiveProfessor (parameter) {
   return axios({
     url: '/sb/infos/gain/repair/professor/' + parameter.id,
     method: 'get',
@@ -660,7 +672,7 @@ export function receiveProfessor(parameter) {
  * @param parameter
  * @returns {*}
  */
-export function backRepair(parameter) {
+export function backRepair (parameter) {
   return axios({
     url: '/repair/application-forms/back/repair',
     method: 'put',

+ 138 - 109
src/views/sb/info/SbInfoC.vue

@@ -12,7 +12,7 @@
                       <a-input v-model.trim="queryParam.keyword" placeholder="关键字" />
                     </a-form-item>
                   </a-col>
-                  <!-- <a-col :md="6" :sm="24">
+                  <a-col :md="6" :sm="24">
                     <a-form-item label="车间位置">
                       <a-select v-model="queryParam.positionId" placeholder="请选择">
                         <a-select-option
@@ -29,7 +29,7 @@
                       <a-input v-model.trim="queryParam.name" placeholder="名称"/>
                     </a-form-item>
                   </a-col>
-                  <a-col :md="6" :sm="24">
+                  <!-- <a-col :md="6" :sm="24">
                     <a-form-item label="父位号">
                       <a-input v-model.trim="queryParam.no" placeholder="父位号"/>
                     </a-form-item>
@@ -38,18 +38,18 @@
                     <a-form-item label="设备位号">
                       <a-input v-model.trim="queryParam.positionNo" placeholder="设备位号"/>
                     </a-form-item>
-                  </a-col>
-                  <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
+                  </a-col> -->
+                  <a-col :md="6" :sm="24" >
                     <a-form-item label="生产商">
                       <a-input v-model.trim="queryParam.producerId" placeholder="生产商"/>
                     </a-form-item>
-                  </a-col> -->
+                  </a-col>
                   <!--                  <a-col :md="6" :sm="24">
                     <a-form-item label="设备自编号">
                       <a-input v-model="queryParam.zbh" placeholder="设备自编号"/>
                     </a-form-item>
                   </a-col>-->
-                  <!-- <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
+                  <a-col :md="6" :sm="24">
                     <a-form-item label="设备等级">
                       <a-select v-model="queryParam.level" placeholder="请选择">
                         <a-select-option
@@ -60,7 +60,7 @@
                         </a-select-option>
                       </a-select>
                     </a-form-item>
-                  </a-col> -->
+                  </a-col>
                   <!--                  <a-col :md="6" :sm="24">
                     <a-form-item label="自定义类型">
                       <a-select v-model="queryParam.useType" placeholder="请选择">
@@ -83,6 +83,19 @@
                       <a-range-picker v-model="dateRange" />
                     </a-form-item>
                   </a-col>
+                  <a-col :md="6" :sm="24" >
+                    <a-form-item label="设备状态">
+                      <a-select v-model="queryParam.status" placeholder="请选择">
+                        <a-select-option
+                          v-for="(label,value) in statusMap"
+                          :key="value"
+                          :defaultValue="DictCache.VALUE.SB_INFO_STATUS.IN_USE"
+                          :label="label"
+                          :value="parseInt(value)">{{ label }}
+                        </a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
                   <!-- <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
                     <a-form-item label="规格型号">
                       <a-input v-model="queryParam.model" placeholder="规格型号"/>
@@ -102,19 +115,7 @@
                       </a-tree-select>
                     </a-form-item>
                   </a-col>
-                  <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
-                    <a-form-item label="设备状态">
-                      <a-select v-model="queryParam.status" placeholder="请选择">
-                        <a-select-option
-                          v-for="(label,value) in statusMap"
-                          :key="value"
-                          :defaultValue="DictCache.VALUE.SB_INFO_STATUS.IN_USE"
-                          :label="label"
-                          :value="parseInt(value)">{{ label }}
-                        </a-select-option>
-                      </a-select>
-                    </a-form-item>
-                  </a-col>
+
                   <a-col :md="6" :sm="24" :style="{ display: expand ? 'block' : 'none' }">
                     <a-form-item label="主子设备">
                       <a-select v-model="queryParam.isChild" placeholder="请选择">
@@ -148,7 +149,7 @@
                       </a-select>
                     </a-form-item>
                   </a-col> -->
-                  <a-col :span="6" :style="{ textAlign: 'right' }">
+                  <a-col :span="6" >
                     <span class="table-page-search-submitButtons">
                       <a-button type="primary" @click="handleOk">查询</a-button>
                       <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
@@ -180,6 +181,8 @@
                 修改导入
               </a-button>
               <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handlePrintBatch()">批量打印</a-button>
+              <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handleBackBatch(13)">批量退库</a-button>
+              <a-button style="margin-left: 8px" type="primary" icon="printer" @click="handleBackBatch(4)">批量报废</a-button>
               <!-- <a-button style="margin-left: 8px" type="primary" icon="reload" @click="handleMeasureBatch()">批量检定</a-button> -->
               <a-button style="margin-left: 8px" v-if="$auth('sb-infos-generate-code-all')" :loading="confirmLoading" type="primary" @click="batchGenerate()">重新生成二维码</a-button>
               <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-infos-del')">
@@ -203,7 +206,19 @@
               </a-dropdown>
             </div>
 
-            <s-table ref="table" :onExpand="onExpand" size="default" rowKey="id" :widthSpace="true" :columns="columns" :data="loadData" :alert="options.alert" :rowSelection="options.rowSelection" :scroll="{x: 1500, y: BaseTool.Constant.scrollY}" showPagination="auto" :rowClassName="rowClassName">
+            <s-table
+              ref="table"
+              :onExpand="onExpand"
+              size="default"
+              rowKey="id"
+              :widthSpace="true"
+              :columns="columns"
+              :data="loadData"
+              :alert="options.alert"
+              :rowSelection="options.rowSelection"
+              :scroll="{x: 1300, y: BaseTool.Constant.scrollY}"
+              showPagination="auto"
+              :rowClassName="rowClassName">
               <template #positionNo="text,record">
                 <a @click="showChangeLog(record)">{{ text }}</a>
               </template>
@@ -224,7 +239,7 @@
                         <a-menu-item key="0">
                           <a @click="handleView(record)">查看</a>
                         </a-menu-item>
-                         <a-menu-item key="1">
+                        <a-menu-item key="1">
                           <a v-if="$auth('sb-infos-edit')" @click="addLogBySb(record)">新增记录</a>
                         </a-menu-item>
                         <a-menu-item key="1">
@@ -307,6 +322,7 @@
     <base-form-location ref="baseFormLocation" @ok="handleOk" />
     <SbChangeLogSelectModal ref="sbChangeRecordSelectModal" @ok="handleOk" />
     <AddLogForm ref="addLogForm" @ok="handleLogOk" />
+    <BackForm ref="backForm" @ok="handleOk" />
     <ListModal ref="listModal" />
   </div>
 </template>
@@ -314,6 +330,7 @@
 <script>
 import { STable, Ellipsis } from '@/components'
 import BaseForm from './modules/BaseForm'
+import BackForm from './modules/BackForm'
 import ListModal from './modules/ListModal'
 import AddLogForm from './modules/AddLogForm'
 import DetailSbMeasure from '@/views/sb/measurelog/modules/DetailSbCheckBatch'
@@ -333,7 +350,7 @@ import {
   fetchSbInfo,
   fetchSbInfos,
   exportSbInfo2,
-  batchLocationList,
+  batchLocationList
 } from '@/api/sb/info'
 import { queryDept } from '@/api/upms/dept'
 import { generateSbCodeAll } from '@/api/upms/code'
@@ -367,42 +384,43 @@ export default {
     BaseFormStatusLog,
     SbChangeLogSelectModal,
     ListModal,
+    BackForm
   },
   props: {
     filter: {
       type: Number,
-      default: -1,
+      default: -1
     },
     useType: {
       type: Number,
-      default: null,
+      default: null
     },
     correctType: {
       type: Number,
-      default: 1,
+      default: 1
     },
     measureStatus: {
       type: Number,
-      default: null,
+      default: null
     },
     isMeasure: {
       type: Number,
-      default: null,
+      default: null
     },
     isSelf: {
       type: Number,
-      default: null,
+      default: null
     },
     typeFlag: {
       type: Number,
-      default: null,
+      default: null
     },
     status: {
       type: Number,
-      default: null,
-    },
+      default: null
+    }
   },
-  data() {
+  data () {
     return {
       // 查询参数
       queryParam: {
@@ -413,7 +431,7 @@ export default {
         isSelf: this.isSelf,
         id: this.$route.query.id,
         typeId: this.$route.query.typeId,
-        status: this.$route.query.status || this.status,
+        status: this.$route.query.status || this.status
       },
       expand: false,
       record: {},
@@ -458,7 +476,7 @@ export default {
           title: '车间',
           checked: true,
           width: 100,
-          dataIndex: 'positionName',
+          dataIndex: 'positionName'
         },
         // {
         //   title: '位置',
@@ -470,14 +488,14 @@ export default {
           title: '父位号',
           dataIndex: 'no',
           width: 100,
-          checked: true,
+          checked: true
         },
 
         {
           title: '设备名称',
           checked: true,
           dataIndex: 'name',
-          width: 100,
+          width: 100
         },
         {
           title: '设备等级',
@@ -486,13 +504,13 @@ export default {
           width: 120,
           customRender: (text, record, index) => {
             return this.BaseTool.Object.getField(this.levelMap, text)
-          },
+          }
         },
         {
           title: '规格、型号',
           dataIndex: 'model',
           width: 150,
-          checked: true,
+          checked: true
         },
         // {
         //   title: '操作类型',
@@ -544,7 +562,7 @@ export default {
           title: '厂牌',
           dataIndex: 'producerId',
           width: 100,
-          checked: true,
+          checked: true
         },
         /* {
           title: '自定义类型',
@@ -579,13 +597,13 @@ export default {
           title: '出厂编号',
           dataIndex: 'zzh',
           width: 100,
-          checked: true,
+          checked: true
         },
         {
           title: '管理编号',
           dataIndex: 'positionNo',
           width: 120,
-          checked: true,
+          checked: true
         },
         /* {
           title: '是否显示',
@@ -656,7 +674,7 @@ export default {
           title: '有效期限',
           dataIndex: 'nextCheckDate',
           width: 120,
-          checked: true,
+          checked: true
         },
         /*  {
           title: '检定截止',
@@ -675,7 +693,7 @@ export default {
           title: '检定单位',
           checked: true,
           dataIndex: 'dph',
-          width: 100,
+          width: 100
         },
         {
           title: '是否强检',
@@ -684,13 +702,13 @@ export default {
           checked: true,
           customRender: (text, record, index) => {
             return this.BaseTool.Object.getField(this.checkTypeMap, text)
-          },
+          }
         },
         {
           title: '备注',
           checked: true,
           dataIndex: 'remark',
-          width: 100,
+          width: 100
         },
         {
           title: '操作',
@@ -698,9 +716,9 @@ export default {
           checked: true,
           fixed: 'right',
           align: 'center',
-          width: '120',
-          scopedSlots: { customRender: 'action' },
-        },
+          width: 120,
+          scopedSlots: { customRender: 'action' }
+        }
       ],
       childColumns1: [
         {
@@ -710,13 +728,13 @@ export default {
           checked: true,
           customRender: (text, record, index) => {
             return index + 1
-          },
+          }
         },
         {
           title: '设备名称',
           checked: true,
           width: 200,
-          dataIndex: 'sbName',
+          dataIndex: 'sbName'
         },
         {
           title: '操作类型',
@@ -725,45 +743,45 @@ export default {
           dataIndex: 'otherType',
           customRender: (text, record, index) => {
             return this.BaseTool.Object.getField(this.otherTypeMap, text)
-          },
+          }
         },
         {
           title: '操作人',
           checked: true,
           width: 200,
-          dataIndex: 'createdUserName',
+          dataIndex: 'createdUserName'
         },
         {
           title: '处理人员',
           checked: true,
           width: 200,
-          dataIndex: 'updateUserName',
+          dataIndex: 'updateUserName'
         },
         {
           title: '异常处理描述',
           checked: true,
           width: 200,
-          dataIndex: 'exceptionDescription',
+          dataIndex: 'exceptionDescription'
         },
         {
           title: '操作内容',
           checked: true,
           width: 200,
-          dataIndex: 'content',
+          dataIndex: 'content'
         },
         {
           title: '文件查看',
           checked: true,
           dataIndex: 'sbMeasureLogCredential',
           width: 120,
-          scopedSlots: { customRender: 'sbMeasureLogCredential' },
+          scopedSlots: { customRender: 'sbMeasureLogCredential' }
         },
         {
           title: '操作时间',
           checked: true,
           width: 200,
-          dataIndex: 'createdTime',
-        },
+          dataIndex: 'createdTime'
+        }
       ],
       otherTypeMap: {},
       // 加载数据方法 必须为 Promise 对象
@@ -773,8 +791,8 @@ export default {
           ...this.queryParam,
           dataScope: {
             sortBy: 'asc',
-            sortName: 'position_no',
-          },
+            sortName: 'position_no'
+          }
         }
         this.selectedRowKeys = []
         return getSbInfoPage2(Object.assign(parameter, this.queryParam)).then((res) => {
@@ -789,17 +807,17 @@ export default {
           show: true,
           clear: () => {
             this.selectedRowKeys = []
-          },
+          }
         },
         rowSelection: {
           selectedRowKeys: this.selectedRowKeys,
-          onChange: this.onSelectChange,
-        },
+          onChange: this.onSelectChange
+        }
       },
-      optionAlertShow: false,
+      optionAlertShow: false
     }
   },
-  created() {
+  created () {
     console.log('this.$route.query.parentId: ' + this.$route.query.parentId)
     this.queryParam.parentId = this.$route.query.parentId
     this.queryParam.parentName = this.$route.query.parentName
@@ -823,7 +841,7 @@ export default {
     })
   },
   methods: {
-    tableOption() {
+    tableOption () {
       this.setTree()
       if (!this.optionAlertShow) {
         this.options = {
@@ -831,7 +849,7 @@ export default {
             show: true,
             clear: () => {
               this.selectedRowKeys = []
-            },
+            }
           },
           rowSelection: {
             selectedRowKeys: this.selectedRowKeys,
@@ -839,21 +857,21 @@ export default {
             getCheckboxProps: (record) => ({
               props: {
                 disabled: false,
-                name: record.id,
-              },
-            }),
-          },
+                name: record.id
+              }
+            })
+          }
         }
         this.optionAlertShow = true
       } else {
         this.options = {
           alert: false,
-          rowSelection: null,
+          rowSelection: null
         }
         this.optionAlertShow = false
       }
     },
-    batchDelete(id) {
+    batchDelete (id) {
       let ids = []
       if (this.BaseTool.String.isBlank(id)) {
         const length = this.selectedRows.length
@@ -871,7 +889,7 @@ export default {
         this.$refs.table.clearSelected()
       })
     },
-    batchGenerate() {
+    batchGenerate () {
       this.confirmLoading = true
       this.$message.info('正在生成请稍后')
       generateSbCodeAll().then((res) => {
@@ -881,21 +899,21 @@ export default {
         this.$refs.table.clearSelected()
       })
     },
-    handleEdit(record) {
+    handleEdit (record) {
       fetchSbInfo({ id: record.id }).then((res) => {
         this.visible = false
         const modal = this.$refs.baseModal
         modal.base(res.data)
       })
     },
-    handlePrint(record) {
+    handlePrint (record) {
       this.visible = false
       fetchSbInfo({ id: record.id }).then((res) => {
         const modal = this.$refs.printInSbInfoBatch
         modal.base([res.data])
       })
     },
-    batchLocation() {
+    batchLocation () {
       let ids = []
       const length = this.selectedRows.length
       if (length === 0) {
@@ -910,7 +928,7 @@ export default {
         modal.base(res.data)
       })
     },
-    batchIncorrect(id) {
+    batchIncorrect (id) {
       let ids = []
       if (this.BaseTool.String.isBlank(id)) {
         const length = this.selectedRows.length
@@ -926,7 +944,7 @@ export default {
       const modal = this.$refs.baseModalMeasure
       modal.base(ids, this.correctType)
     },
-    batchIncorrectInStore(id) {
+    batchIncorrectInStore (id) {
       let ids = []
       if (this.BaseTool.String.isBlank(id)) {
         const length = this.selectedRows.length
@@ -942,11 +960,11 @@ export default {
       const modal = this.$refs.baseModalMeasureInStore
       modal.base(ids, this.correctType)
     },
-    handleMeasureBatch() {
+    handleMeasureBatch () {
       const modal = this.$refs.detailSbMeasureModal
       modal.base()
     },
-    handlePrintBatch() {
+    handlePrintBatch () {
       this.visible = false
       let ids = []
       const length = this.selectedRows.length
@@ -960,7 +978,18 @@ export default {
         modal.base(res.data)
       })
     },
-    handleStart(record) {
+    handleBackBatch (status) {
+      let ids = []
+      const length = this.selectedRows.length
+      if (length === 0) {
+        this.$message.info('请选择设备')
+        return
+      }
+      ids = this.selectedRows.map((item) => item.id)
+      const modal = this.$refs.backForm
+      modal.base(ids, status)
+    },
+    handleStart (record) {
       const modal = this.$refs.baseModalStatusLog
       modal.base(null, {
         sbId: record.id,
@@ -968,10 +997,10 @@ export default {
         changeUserId: this.$store.getters.userInfo.userId,
         actualUser: this.$store.getters.userInfo.realName,
         preStatus: record.status,
-        afterStatus: this.DictCache.VALUE.SB_INFO_STATUS.IN_USE,
+        afterStatus: this.DictCache.VALUE.SB_INFO_STATUS.IN_USE
       })
     },
-    handleStop(record) {
+    handleStop (record) {
       const modal = this.$refs.baseModalStatusLog
       modal.base(null, {
         sbId: record.id,
@@ -979,33 +1008,33 @@ export default {
         changeUserId: this.$store.getters.userInfo.userId,
         actualUser: this.$store.getters.userInfo.realName,
         preStatus: record.status,
-        afterStatus: this.DictCache.VALUE.SB_INFO_STATUS.IN_STOP,
+        afterStatus: this.DictCache.VALUE.SB_INFO_STATUS.IN_STOP
       })
     },
-    handleAdd() {
+    handleAdd () {
       this.visible = false
       this.$refs.baseModal.base()
     },
-    handleView(record) {
+    handleView (record) {
       fetchSbInfo({ id: record.id }).then((res) => {
         this.visible = false
         const modal = this.$refs.detailModal
         modal.base(res.data)
       })
     },
-    showChangeLog(record) {
+    showChangeLog (record) {
       console.log(record)
       console.log(this.$refs)
       this.$refs.sbChangeRecordSelectModal.base({}, { sbId: record.id })
     },
-    handleCopy(record) {
+    handleCopy (record) {
       this.visible = false
       fetchSbInfo({ id: record.id }).then((res) => {
         const modal = this.$refs.baseModal
         modal.base(res.data, 1)
       })
     },
-    handleOk() {
+    handleOk () {
       this.visible = true
       this.setTree()
       if (this.dateRange != null) {
@@ -1030,11 +1059,11 @@ export default {
       }
       this.$refs.table.refresh()
     },
-    onSelectChange(selectedRowKeys, selectedRows) {
+    onSelectChange (selectedRowKeys, selectedRows) {
       this.selectedRowKeys = selectedRowKeys
       this.selectedRows = selectedRows
     },
-    resetSearchForm() {
+    resetSearchForm () {
       this.queryParam = {
         filter: this.filter,
         useType: this.useType,
@@ -1043,26 +1072,26 @@ export default {
         isSelf: this.isSelf,
         id: this.$route.query.id,
         typeId: this.$route.query.typeId,
-        status: this.$route.query.status || this.status,
+        status: this.$route.query.status || this.status
       }
       this.visible = true
       this.$refs.table.refresh(true)
     },
-    doExport() {
+    doExport () {
       const parameter = {
         ...this.queryParam,
         sbIds: this.selectedRowKeys,
         dataScope: {
           sortBy: 'asc',
-          sortName: 'no',
-        },
+          sortName: 'no'
+        }
       }
       console.log(parameter)
       exportSbInfo2(parameter).then((file) => {
         this.BaseTool.UPLOAD.downLoadExportExcel(file)
       })
     },
-    setTree(record = {}) {
+    setTree (record = {}) {
       queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then((res) => {
         this.areaList = res.data
       })
@@ -1075,7 +1104,7 @@ export default {
       this.queryParam.typeId = selectedKeys.length > 0 ? selectedKeys[0] : ''
       this.$refs.table.refresh(true)
     },
-    onExpand(expanded, record) {
+    onExpand (expanded, record) {
       // expanded判断展开or收缩操作,record当前行数据
       this.childMap = []
       getLogBySbId({ sbId: record.id }).then((res) => {
@@ -1083,33 +1112,33 @@ export default {
         this.$forceUpdate()
       })
     },
-    getLogBySbId(record, createdUserName) {
+    getLogBySbId (record, createdUserName) {
       getLogBySbId({ sbId: record.id, createdUserName }).then((res) => {
         record.childMap = res.data.rows
         this.$forceUpdate()
       })
     },
-    addLogBySb(record) {
+    addLogBySb (record) {
       this.record = record
       this.$refs.addLogForm.base(record)
     },
-    handleLogOk(val) {
+    handleLogOk (val) {
       getLogBySbId({ sbId: val.sbId }).then((res) => {
         this.record.childMap = res.data.rows
         this.$forceUpdate()
       })
     },
-    doImport() {
+    doImport () {
       this.$refs.importModal.base(null, null)
     },
-    doImportStandard() {
+    doImportStandard () {
       // this.$refs.importModalStandard.base()
       this.$refs.importModalUpdate2.base(null, 1, this.typeFlag)
     },
-    doImportForUpdate() {
+    doImportForUpdate () {
       this.$refs.importModalUpdate2.base(null, 2, 2)
     },
-    rowClassName(record, index) {
+    rowClassName (record, index) {
       if (record.measureStatus === 1 && record.status !== 7) return 'orange'
       switch (record.status) {
         case 1:
@@ -1122,8 +1151,8 @@ export default {
         case 7:
           return 'gray'
       }
-    },
-  },
+    }
+  }
 }
 </script>
 <style lang="less" scoped>

+ 87 - 0
src/views/sb/info/modules/BackForm.vue

@@ -0,0 +1,87 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+      <row-list :col="1">
+        <row-item>
+          <a-form-item
+            label="备注"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-textarea
+              :rows="4"
+              v-decorator="['remark']"/>
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import { batchBack } from '@/api/repair/application-form'
+
+export default {
+  name: 'DispatchBaseForm',
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      // 下拉框map
+      ids: [],
+      status: 0
+    }
+  },
+  props: {
+  },
+  created () {
+    // 下拉框map
+  },
+  methods: {
+    base (ids, status) {
+      this.visible = true
+      // 如果是空标识添加
+      this.modalTitle = status === 4 ? '报废' : '退库'
+      this.ids = ids
+      this.status = status
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        values.ids = this.ids
+        values.status = this.status
+        batchBack(values).then(res => {
+          this.confirmLoading = false
+          this.handleCancel()
+        })
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      console.log(values)
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        console.log(values)
+        this.$emit('ok', values)
+      }
+    }
+  }
+}
+</script>

+ 7 - 7
src/views/sb/info/modules/BaseFormMeasure.vue

@@ -18,13 +18,13 @@
           <thead border="1px">
             <tr>
               <th width="100px">序号</th>
-              <th width="150px">是否在库</th>
+              <!-- <th width="150px">是否在库</th> -->
               <th width="150px">设备名称</th>
               <th width="150px">型号</th>
               <th width="150px">出厂编号</th>
               <!-- <th width="150px">是否是子设备</th>-->
-              <th width="150px">设备位置</th>
-              <th width="350px">选择父设备</th>
+              <!-- <th width="150px">设备位置</th> -->
+              <!-- <th width="350px">选择父设备</th> -->
               <th width="150px">设备位号</th>
               <th width="150px">检定周期</th>
               <th width="150px">检定日期</th>
@@ -38,10 +38,10 @@
           <tbody v-if="ListForm.length>0">
             <tr v-for="(item,i) in ListForm" :key="item.id">
               <td>{{ i+1 }}</td>
-              <td> <a-switch v-model="item.sbStatus" >
+              <!-- <td> <a-switch v-model="item.sbStatus" >
                 <a-icon slot="checkedChildren" type="check" />
                 <a-icon slot="unCheckedChildren" type="close" />
-              </a-switch></td>
+              </a-switch></td> -->
               <td>{{ item.sbName }}</td>
               <td>{{ item.sbModel }}</td>
               <td><div> {{ item.zzh }}</div></td>
@@ -51,7 +51,7 @@
                   <a-icon slot="unCheckedChildren" type="close" />
                 </a-switch>
               </td>-->
-              <td>
+              <!-- <td>
                 <div v-if="item.sbStatus">{{ item.sbPositionName }}</div>
                 <a-tree-select
                   v-else
@@ -75,7 +75,7 @@
                   <a-button type="primary" @click="handleSbSelect(item.sbPositionId,i)">选择</a-button>
                 </div>
                 <div v-else>无</div>
-              </td>
+              </td> -->
               <td>
                 <div > {{ item.sbPositionNo }}</div>