فهرست منبع

Merge branch 'master' of http://120.46.159.163:7400/ezhizao/ezhizao_dms_vue

guoyujia 1 سال پیش
والد
کامیت
64cba9db33

+ 3 - 3
src/api/business/productionTask.js

@@ -23,10 +23,10 @@ export function getProcessDetailsByTechnicalProcessId(data) {
 }
 
 // 根据工序id,获取对应的设备列表
-export function getSubDetailProcessEquipments(data) {
+export function getSubDetailProcessEquipments(query) {
   return request({
     url: baseUrl + '/business/productionTask/getSubDetailProcessEquipments',
-    method: 'post',
-    data: data
+    method: 'get',
+    params: query
   })
 }

+ 9 - 51
src/views/business/productionBatch/form.vue

@@ -34,37 +34,20 @@
       </el-form>
     </div>
     <template #footer>
-      <el-button type="primary" icon="Finished" @click="submitForm">保存</el-button>
+      <el-button type="primary" icon="Finished" @click="handleSave">保存</el-button>
     </template>
   </el-dialog>
 </template>
 <script setup>
-import { listProduct } from '@/api/business/product'
-import { savePlanDetailSubDetail, listPlanDetailSubDetail } from '@/api/business/planDetailSubDetail.js'
-import { listTechnologicalProcessDetail } from '@/api/business/technologicalProcessDetail'
-import { ref } from 'vue'
+import { savePlanDetailSubDetail } from '@/api/business/planDetailSubDetail.js'
 
 const { proxy } = getCurrentInstance()
-/** 父组件传参 */
-const props = defineProps({
-  getList: {
-    type: Function,
-    default: null
-  }
-})
-const { getList, planDetail } = toRefs(props)
-/** 字典数组区 */
+const emit = defineEmits(['handleSaveSuccess'])
 
 /** 表单抽屉 页变量 */
 const loading = ref(false)
 const detailsRow = ref({})
-const ids = ref([])
-const equipmentSingle = ref(false)
-const equipmentMultiple = ref(false)
 const visible = ref(false)
-const technologicalOptions = ref([])
-const product = ref({})
-const isFullscreen = ref(false)
 const validateLotNumber = (rule, value, callback) => {
   const min = 0
   const max = detailsRow.value.totalLotNumber
@@ -100,29 +83,11 @@ function open(row) {
   if (row) {
     detailsRow.value = row
     form.value.lotNumber = row.totalLotNumber
-
-    //现在不需要查产品以及工艺,计划单已经有自带的technologicalProcessId了
-    // listProduct({ id: form.value.productId, drawingNumber: form.value.drawingNumber }).then((res) => {
-    //   if (res.rows.length > 0) {
-    //     product.value = res.rows[0]
-    //   }
-
-    // })
-    // listTechnologicalProcessDetail({ technologicalProcessId: form.value.technologicalProcessId }).then((response) => {
-    //   technologicalOptions.value = response.rows
-    //   console.log(technologicalOptions.value)
-    // })
-
-    loading.value = false
-  } else {
-    loading.value = false
+    if (!form.value.issuanceDate) {
+      form.value.issuanceDate = proxy.moment().format('YYYY-MM-DD')
+    }
   }
-}
-
-/** 取消按钮 */
-function cancel() {
-  visible.value = false
-  reset()
+  loading.value = false
 }
 
 /** 表单重置 */
@@ -143,7 +108,7 @@ function reset() {
 }
 
 /** 提交按钮 */
-function submitForm() {
+function handleSave() {
   proxy.$refs['productRef'].validate((valid) => {
     if (valid) {
       /**工艺版本变成P2拉取过来先绑定个假数据 */
@@ -151,20 +116,13 @@ function submitForm() {
         if (res.code == 200) {
           proxy.$modal.msgSuccess('保存成功!')
           visible.value = false
-          console.log('form', detailsRow.value)
           detailsRow.value.id = detailsRow.value.productionPlanDetailId
-          props.getList(detailsRow.value)
+          emit('handleSaveSuccess')
         }
       })
     }
   })
 }
-// 多选框选中数据
-function handleSelectionChange(selection) {
-  ids.value = selection.map((item) => item.id)
-  equipmentSingle.value = selection.length != 1
-  equipmentMultiple.value = !selection.length
-}
 
 /** 暴露给父组件的方法 */
 defineExpose({

+ 10 - 4
src/views/business/productionBatch/index.vue

@@ -5,7 +5,14 @@
       <el-form class="list-search-container" :model="queryParams" ref="queryRef" :inline="true">
         <el-form-item class="section-title" label="生产计划" />
         <el-form-item label="产品描述:">
-          <el-input placeholder="请输入产品描述" v-model="queryParams.keywords" @keyup.enter="handleQuery"  @keydown.enter.prevent clearable style="width: 200px" />
+          <el-input
+            placeholder="请输入产品描述"
+            v-model="queryParams.keywords"
+            @keyup.enter="handleQuery"
+            @keydown.enter.prevent
+            clearable
+            style="width: 200px"
+          />
         </el-form-item>
         <el-form-item>
           <el-button type="info" icon="Search" @click="handleQuery"> <i class="el-icon-thumb" aria-hidden="true" />搜索 </el-button>
@@ -172,7 +179,7 @@
       </section>
     </section>
     <!-- 表单 -->
-    <production-batch-form ref="productionRef" :plan-detail="detailRow" :get-list="handlePlanDetailCurrentChange" />
+    <production-lot-form ref="productionRef" @handlerSaveSuccess="handlePlanDetailCurrentChange" />
     <equipment ref="equipmentRef" :get-list="handleProcessCurrentChange" :multipleSelected="equipmentSelected" :multiple="true" />
   </div>
 </template>
@@ -184,7 +191,7 @@ import { savePlanDetailSubDetail, listPlanDetailSubDetail, delPlanDetailSubDetai
 import { saveBatchEquipment, listEquipment, delEquipment } from '@/api/business/productionPlanDetailEquipment.js'
 import { listTechnologicalProcessDetail } from '@/api/business/technologicalProcessDetail.js'
 import equipment from '@/views/dialog/equipment.vue'
-import productionBatchForm from './form'
+import productionLotForm from './form'
 const { proxy } = getCurrentInstance()
 
 /** 生产子计划列表 */
@@ -337,7 +344,6 @@ function handleProcessCurrentChange(row) {
 
 /** 设备选择对话框 */
 function openEquipment() {
-  console.log(subRow.value, '456')
   for (var i = 0; i < equipmentList.value.length; i++) {
     equipmentCodeIds.value.push(equipmentList.value[i].equipmentDetailCode)
   }

+ 2 - 2
src/views/business/productionTask/index.vue

@@ -245,8 +245,8 @@ const _getProcessDetailsByTechnicalProcessId = (technologicalProcessId) => {
 
 const _getSubDetailProcessEquipments = (processId) => {
   getSubDetailProcessEquipments({
-    productionPlanDetailSubDetailId: currentSubDetail.id,
-    technologicalProcessId: currentSubDetail.technologicalProcessId,
+    productionPlanDetailSubDetailId: currentSubDetail.value.id,
+    technologicalProcessId: currentSubDetail.value.technologicalProcessId,
     processId: processId
   }).then((res) => {
     equipmentList.value = res.rows