You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3244 lines
116 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 month ago
​
​
​
​
​
​
1 month ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
2 months ago
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
2 months ago
2 months ago
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
2 months ago
​
​
​
2 months ago
​
​
​
2 months ago
​
​
​
2 months ago
​
​
​
2 months ago
2 months ago
​
​
​
2 months ago
2 months ago
​
​
​
​
​
​
2 months ago
2 months ago
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
2 months ago
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
2 months ago
​
​
​
​
​
​
2 months ago
2 months ago
​
​
​
​
​
2 months ago
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
1 month ago
3 months ago
​
​
​
2 months ago
​
​
​
​
3 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
2 months ago
​
​
​
​
​
​
​
​
​
​
​
1 month ago
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
3 months ago
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
2 months ago
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
2 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
2 months ago
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
2 months ago
​
3 months ago
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
3 months ago
​
2 months ago
​
​
​
3 months ago
2 months ago
​
​
2 months ago
​
​
​
​
​
​
​
3 months ago
​
2 months ago
​
3 months ago
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
4 weeks ago
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
2 months ago
​
​
​
​
​
​
​
​
2 months ago
2 months ago
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
2 months ago
3 months ago
​
2 months ago
​
​
​
​
​
​
​
​
3 months ago
​
​
2 months ago
​
​
​
​
3 months ago
2 months ago
​
2 months ago
​
​
​
3 months ago
​
2 months ago
​
​
3 months ago
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
2 months ago
​
3 months ago
2 months ago
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
2 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
1 month ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 months ago
​
​
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <div class="mod-config yzz">
  3. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  4. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  5. <el-form-item :label="'申请单号'">
  6. <el-input v-model="searchData.notifyNo" style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'申请账号'">
  9. <el-input v-model="searchData.userName" style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'工单号'">
  12. <el-input v-model="searchData.orderNo" style="width: 120px"></el-input>
  13. </el-form-item>
  14. <el-form-item label="状态" >
  15. <el-select v-model="searchData.status" placeholder="请选择" style="width: 120px">
  16. <el-option label="全部" value=""></el-option>
  17. <el-option label="ISSUE" value="ISSUE"></el-option>
  18. <el-option label="CANCEL" value="CANCEL"></el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item :label="'申请单日期'">
  22. <el-date-picker
  23. style="width: 120px"
  24. v-model="searchData.startDate"
  25. type="date"
  26. value-format="yyyy-MM-dd"
  27. placeholder="选择日期">
  28. </el-date-picker>
  29. </el-form-item>
  30. <el-form-item style="margin-top: 23px;">
  31. <label style="margin-left: 0px;font-size: 19px">&#10142</label>
  32. </el-form-item>
  33. <el-form-item :label="' '">
  34. <el-date-picker
  35. style="width: 120px"
  36. v-model="searchData.endDate"
  37. type="date"
  38. value-format="yyyy-MM-dd"
  39. placeholder="选择日期">
  40. </el-date-picker>
  41. </el-form-item>
  42. <el-form-item label="推送WCS" >
  43. <el-select v-model="searchData.pushWcsFlag" placeholder="请选择" style="width: 120px">
  44. <el-option label="全部" value=""></el-option>
  45. <el-option label="未推送" value="未推送"></el-option>
  46. <el-option label="部分推送" value="部分推送"></el-option>
  47. <el-option label="推送完成" value="推送完成"></el-option>
  48. <el-option label="出库完成" value="出库完成"></el-option>
  49. </el-select>
  50. </el-form-item>
  51. <el-form-item :label="' '">
  52. <el-button type="primary" @click="searchTable()">查询</el-button>
  53. <!-- <el-button type="primary" @click="createNotifyModal()">新增</el-button> -->
  54. <download-excel
  55. :fields="fields()"
  56. :data="exportData"
  57. type="xls"
  58. :name="exportName"
  59. :header="exportHeader"
  60. :footer="exportFooter"
  61. :fetch="createExportData"
  62. :before-generate="startDownload"
  63. :before-finish="finishDownload"
  64. worksheet="导出信息"
  65. class="el-button el-button--primary el-button--medium">
  66. {{ '导出' }}
  67. </download-excel>
  68. </el-form-item>
  69. </el-form>
  70. </el-form>
  71. <el-table
  72. :data="dataList"
  73. @row-click="changeData"
  74. :height="height"
  75. border
  76. highlight-current-row
  77. ref="mainTable"
  78. v-loading="dataListLoading"
  79. style="width: 100%; ">
  80. <el-table-column
  81. v-for="(item,index) in columnList1" :key="index"
  82. :sortable="item.columnSortable"
  83. :prop="item.columnProp"
  84. :header-align="item.headerAlign"
  85. :show-overflow-tooltip="item.showOverflowTooltip"
  86. :align="item.align"
  87. :fixed="item.fixed==''?false:item.fixed"
  88. :min-width="item.columnWidth"
  89. :label="item.columnLabel">
  90. <template slot-scope="scope">
  91. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  92. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  93. style="width: 100px; height: 80px"/></span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column
  97. header-align="center"
  98. align="center"
  99. width="300"
  100. label="操作">
  101. <template slot-scope="scope">
  102. <a type="text" size="small" v-if="scope.row.status==='ISSUE'" @click="closeNotifyModel(scope.row)">关闭</a>
  103. <a type="text" size="small" v-if="scope.row.status==='CLOSED'" @click="openNotify(scope.row)">开启</a>
  104. <a type="text" size="small" v-if="scope.row.pushWcsFlag!=='出库完成'&&scope.row.pushWcsFlag!=='推送完成'&&scope.row.status==='ISSUE'" @click="previewInventory(scope.row)" style="margin-left: 10px;">推送WCS</a>
  105. <!-- rqrq - 取消下达按钮,只在状态为ISSUE且未推送WCS时显示 -->
  106. <a type="text" size="small" v-if="scope.row.status==='ISSUE'&&scope.row.pushWcsFlag==='未推送'" @click="cancelIssueNotifyHandle(scope.row)" style="margin-left: 10px;">取消下达</a>
  107. <!-- rqrq - 未推送才允许整单删除,后端会同时删指定物料 -->
  108. <a type="text" size="small" v-if="scope.row.pushWcsFlag==='未推送'" :style="{marginLeft: '10px', color: deleteWholeLoading ? '#C0C4CC' : '#F56C6C', cursor: deleteWholeLoading ? 'not-allowed' : 'pointer'}" @click="deleteUnpushedNotify(scope.row)">整单删除</a>
  109. <!-- <a type="text" size="small" v-if="scope.row.pushWcsFlag!=='Y'" @click="pushToWcs(scope.row)" style="margin-left: 10px;">推送WCS</a>-->
  110. </template>
  111. </el-table-column>
  112. </el-table>
  113. <el-pagination
  114. @size-change="sizeChangeHandle"
  115. @current-change="currentChangeHandle"
  116. :current-page="pageIndex"
  117. :page-sizes="[20, 50, 100, 1000]"
  118. :page-size="pageSize"
  119. :total="totalPage"
  120. layout="total, sizes, prev, pager, next, jumper">
  121. </el-pagination>
  122. <el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
  123. <el-tab-pane label="申请单明细" name="detail">
  124. <el-table
  125. :data="dataList2"
  126. :height="height"
  127. border
  128. v-loading="dataListLoading"
  129. style="width: 100%; ">
  130. <!-- <el-table-column-->
  131. <!-- header-align="center"-->
  132. <!-- align="center"-->
  133. <!-- width="80"-->
  134. <!-- label="操作">-->
  135. <!-- <template slot-scope="scope">-->
  136. <!-- <a type="text" size="small" v-if="currentRow.status==='ISSUE'" @click="deleteNotifySOSPlus(scope.row)">删除</a>-->
  137. <!-- </template>-->
  138. <!-- </el-table-column>-->
  139. <el-table-column
  140. v-for="(item,index) in columnList2" :key="index"
  141. :sortable="item.columnSortable"
  142. :prop="item.columnProp"
  143. :header-align="item.headerAlign"
  144. :show-overflow-tooltip="item.showOverflowTooltip"
  145. :align="item.align"
  146. :fixed="item.fixed==''?false:item.fixed"
  147. :min-width="item.columnWidth"
  148. :label="item.columnLabel">
  149. <template slot-scope="scope">
  150. <!-- rqrq - 是否推送WCS特殊显示:Y显示绿色"是",否则显示灰色"否" -->
  151. <span v-if="item.columnProp === 'pushWmsFlag'" :style="{color: scope.row.pushWmsFlag === 'Y' ? '#67C23A' : '#909399'}">
  152. {{ scope.row.pushWmsFlag === 'Y' ? '是' : '否' }}
  153. </span>
  154. <!-- rqrq - 立库取出特殊显示:Y显示绿色"是",否则显示灰色"否" -->
  155. <span v-else-if="item.columnProp === 'transportFlag'" :style="{color: scope.row.transportFlag === 'Y' ? '#67C23A' : '#909399'}">
  156. {{ scope.row.transportFlag === 'Y' ? '是' : '否' }}
  157. </span>
  158. <!-- 普通列显示 -->
  159. <span v-else-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  160. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  161. style="width: 100px; height: 80px"/></span>
  162. </template>
  163. </el-table-column>
  164. <!-- rqrq - 申请单明细操作列不冻结:弹窗/页签里fixed会额外叠表,表头出现空白格且操作列错位 -->
  165. <el-table-column
  166. header-align="center"
  167. align="center"
  168. width="120"
  169. label="操作">
  170. <template slot-scope="scope">
  171. <a type="text" size="small" v-if="scope.row.pushWmsFlag !== 'Y' && currentRow && currentRow.pushWcsFlag === '未推送'" @click="enterSOSDetail(scope.row)" style="margin-right: 10px;">修改</a>
  172. <a type="text" size="small" v-if="scope.row.pushWmsFlag !== 'Y' && currentRow && currentRow.pushWcsFlag === '未推送'" @click="deleteNotifySOSPlus(scope.row)">删除</a>
  173. </template>
  174. </el-table-column>
  175. </el-table>
  176. </el-tab-pane>
  177. <el-tab-pane label="材料明细" name="sub">
  178. <el-table
  179. :data="dataList3"
  180. :height="height"
  181. border
  182. :row-class-name="tableRowClassName"
  183. v-loading="dataListLoading"
  184. @row-dblclick="handleMaterialRowDblClick"
  185. style="width: 100%; ">
  186. <!-- <el-table-column-->
  187. <!-- header-align="center"-->
  188. <!-- align="center"-->
  189. <!-- width="80"-->
  190. <!-- label="操作">-->
  191. <!-- <template slot-scope="scope">-->
  192. <!-- <a type="text" size="small" v-if="currentRow.status==='ISSUE'" @click="deleteNotifyMaterial(scope.row)">删除</a>-->
  193. <!-- </template>-->
  194. <!-- </el-table-column>-->
  195. <el-table-column
  196. v-for="(item,index) in columnList3" :key="index"
  197. :sortable="item.columnSortable"
  198. :prop="item.columnProp"
  199. :header-align="item.headerAlign"
  200. :show-overflow-tooltip="item.showOverflowTooltip"
  201. :align="item.align"
  202. :fixed="item.fixed==''?false:item.fixed"
  203. :min-width="item.columnWidth"
  204. :label="item.columnLabel">
  205. <template slot-scope="scope">
  206. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  207. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  208. style="width: 100px; height: 80px"/></span>
  209. </template>
  210. </el-table-column>
  211. <!-- rqrq - 材料明细指定物料:仅已下达申请单可维护标签/批次指定;不冻结,避免页签切换后操作列失真 -->
  212. <el-table-column
  213. header-align="center"
  214. align="center"
  215. width="110"
  216. label="操作">
  217. <template slot-scope="scope">
  218. <!-- 指定物料跟本行订单是否已推送WCS走,已推送的订单行不能再改分配 - rqrq -->
  219. <a type="text" size="small" v-if="canSpecifyMaterial(scope.row)" @click="openNoOrderMaterialAllocDialog(scope.row)">指定物料</a>
  220. </template>
  221. </el-table-column>
  222. </el-table>
  223. </el-tab-pane>
  224. <!-- rqrq - 指定物料清单页签:展示当前申请单已保存的标签/批次指定,不含备注 -->
  225. <el-tab-pane label="指定物料清单" name="allocDetail">
  226. <el-table
  227. :data="allocDetailList"
  228. :height="height"
  229. border
  230. v-loading="allocDetailLoading"
  231. style="width: 100%;">
  232. <el-table-column prop="itemNo" label="订单序号" width="90" header-align="center" align="right"></el-table-column>
  233. <el-table-column prop="soorderNo" label="订单号" min-width="130" header-align="center" align="center"></el-table-column>
  234. <el-table-column label="bom行号" width="90" header-align="center" align="right">
  235. <template slot-scope="scope">
  236. <span>{{ scope.row.bOMItemNo || scope.row.bomItemNo || scope.row.BOMItemNo || scope.row.bomitemNo }}</span>
  237. </template>
  238. </el-table-column>
  239. <el-table-column prop="partNo" label="物料编码" min-width="150" header-align="center" align="center"></el-table-column>
  240. <el-table-column prop="allocSeq" label="指定序号" width="90" header-align="center" align="right"></el-table-column>
  241. <el-table-column prop="allocTypeName" label="指定类型" width="90" header-align="center" align="center"></el-table-column>
  242. <el-table-column prop="serialNo" label="标签号" min-width="160" header-align="center" align="center"></el-table-column>
  243. <el-table-column prop="batchNo" label="批次号" min-width="140" header-align="center" align="center"></el-table-column>
  244. <el-table-column prop="allocQty" label="指定数量" width="100" header-align="center" align="right"></el-table-column>
  245. </el-table>
  246. </el-tab-pane>
  247. <el-tab-pane label="材料汇总" name="sum">
  248. <el-table
  249. :data="dataList4"
  250. :height="height"
  251. border
  252. v-loading="dataListLoading"
  253. style="width: 100%; ">
  254. <!-- <el-table-column-->
  255. <!-- header-align="center"-->
  256. <!-- align="center"-->
  257. <!-- width="80"-->
  258. <!-- fixed="left"-->
  259. <!-- label="操作">-->
  260. <!-- <template slot-scope="scope">-->
  261. <!-- <a type="text" size="small" @click="printLabel(scope.row)">打印标签</a>-->
  262. <!-- </template>-->
  263. <!-- </el-table-column>-->
  264. <el-table-column
  265. v-for="(item,index) in columnList4" :key="index"
  266. :sortable="item.columnSortable"
  267. :prop="item.columnProp"
  268. :header-align="item.headerAlign"
  269. :show-overflow-tooltip="item.showOverflowTooltip"
  270. :align="item.align"
  271. :fixed="item.fixed==''?false:item.fixed"
  272. :min-width="item.columnWidth"
  273. :label="item.columnLabel">
  274. <template slot-scope="scope">
  275. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  276. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  277. style="width: 100px; height: 80px"/></span>
  278. </template>
  279. </el-table-column>
  280. </el-table>
  281. </el-tab-pane>
  282. <el-tab-pane label="预定标签清单" name="labelDetail">
  283. <el-table
  284. :data="dataList7"
  285. :height="height"
  286. border
  287. v-loading="dataListLoading"
  288. style="width: 100%; ">
  289. <el-table-column
  290. v-for="(item,index) in columnList6" :key="index"
  291. :sortable="item.columnSortable"
  292. :prop="item.columnProp"
  293. :header-align="item.headerAlign"
  294. :show-overflow-tooltip="item.showOverflowTooltip"
  295. :align="item.align"
  296. :fixed="item.fixed==''?false:item.fixed"
  297. :min-width="item.columnWidth"
  298. :label="item.columnLabel">
  299. <template slot-scope="scope">
  300. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  301. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  302. style="width: 100px; height: 80px"/></span>
  303. </template>
  304. </el-table-column>
  305. </el-table>
  306. </el-tab-pane>
  307. </el-tabs>
  308. <el-dialog title="关闭原因" :close-on-click-modal="false" v-drag :visible.sync="closeModalFlag" width="450px">
  309. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  310. <el-row :gutter="20">
  311. <el-col :span="24">
  312. <el-form-item >
  313. <el-input
  314. type="textarea"
  315. v-model="closeData.closeRemark "
  316. :rows="3"
  317. resize='none'
  318. maxlength="200"
  319. show-word-limit
  320. style="height: 60px" >
  321. </el-input>
  322. </el-form-item>
  323. </el-col>
  324. </el-row>
  325. </el-form>
  326. <el-footer style="height:40px;margin-top: 60px;text-align:center">
  327. <el-button type="primary" @click="closeNotify()">保存</el-button>
  328. <el-button type="primary" @click="closeModalFlag=false">关闭</el-button>
  329. </el-footer>
  330. </el-dialog>
  331. <!-- 物料明细对话框 -->
  332. <el-dialog title="申请明细" :close-on-click-modal="false" v-drag :visible.sync="materialModalFlag" width="900px">
  333. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  334. <el-row :gutter="20">
  335. <el-col :span="6">
  336. <el-form-item :label="'生产订单号'">
  337. <el-input v-model="sobomData.orderNo" disabled></el-input>
  338. </el-form-item>
  339. </el-col>
  340. <el-col :span="6">
  341. <el-form-item :label="'产品编码'">
  342. <el-input v-model="sobomData.partNo" disabled></el-input>
  343. </el-form-item>
  344. </el-col>
  345. </el-row>
  346. </el-form>
  347. <div class="yzzTable">
  348. <el-table :height="400" :data="sobomList" border v-loading="bomLoadFlag" style="width: 100%;">
  349. <el-table-column
  350. prop="componentPartNo"
  351. label="物料编码"
  352. sortable
  353. headerAlign="center"
  354. width="120"
  355. align="left">
  356. </el-table-column>
  357. <el-table-column
  358. prop="componentPartDesc"
  359. label="物料描述"
  360. headerAlign="center"
  361. width="200"
  362. align="left"
  363. show-overflow-tooltip>
  364. </el-table-column>
  365. <el-table-column
  366. prop="qtyRequired"
  367. label="需求数量"
  368. headerAlign="center"
  369. width="100"
  370. align="right">
  371. </el-table-column>
  372. <!-- rqrq - 新增可用库存列 -->
  373. <el-table-column
  374. prop="availableQty"
  375. label="可用库存"
  376. headerAlign="center"
  377. width="100"
  378. align="right">
  379. <template slot-scope="scope">
  380. <span :style="{fontWeight: 'bold', color: (scope.row.availableQty < scope.row.qtyRequired) ? '#F56C6C' : ''}">
  381. {{ scope.row.availableQty }}
  382. </span>
  383. </template>
  384. </el-table-column>
  385. <el-table-column
  386. prop="qtyToIssue"
  387. label="本次申请数量"
  388. headerAlign="center"
  389. width="120"
  390. align="right">
  391. <template slot-scope="scope">
  392. <el-input v-model="scope.row.qtyToIssue" type="number" style="height: 11px; width: 98%;" :step="0"
  393. :min="0"></el-input>
  394. </template>
  395. </el-table-column>
  396. <el-table-column
  397. prop="remark"
  398. label="备注"
  399. headerAlign="center"
  400. width="200"
  401. align="left">
  402. <template slot-scope="scope">
  403. <el-input v-model="scope.row.remark" style="padding: 0;width: 100%"></el-input>
  404. </template>
  405. </el-table-column>
  406. <el-table-column prop="" header-align="center" align="center" min-width="80" label="操作">
  407. <template slot-scope="scope">
  408. <el-button type="primary" @click="qtyAllForBom(scope.row)" style="width: 100%">全数领料</el-button>
  409. </template>
  410. </el-table-column>
  411. </el-table>
  412. </div>
  413. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  414. <el-button type="primary" @click="saveMaterialDetail()">保存</el-button>
  415. <el-button type="primary" @click="materialModalFlag=false">关闭</el-button>
  416. </el-footer>
  417. </el-dialog>
  418. <!-- 编辑材料明细对话框 -->
  419. <el-dialog title="编辑材料明细" :close-on-click-modal="false" v-drag :visible.sync="editMaterialModalFlag" width="600px">
  420. <el-form :inline="true" label-position="top" label-width="120px" style="margin-top: 20px;">
  421. <el-row>
  422. <el-col span="8">
  423. <el-form-item label="申请单序号">
  424. <el-input v-model="editMaterialData.itemNo" disabled></el-input>
  425. </el-form-item>
  426. </el-col>
  427. <el-col span="8">
  428. <el-form-item label="材料编码">
  429. <el-input v-model="editMaterialData.componentPartNo" disabled></el-input>
  430. </el-form-item>
  431. </el-col>
  432. <el-col span="8">
  433. <el-form-item label="生产订单">
  434. <el-input v-model="editMaterialData.soorderNo" disabled></el-input>
  435. </el-form-item>
  436. </el-col>
  437. </el-row>
  438. <el-row>
  439. <el-col span="8">
  440. <el-form-item label="需求时间">
  441. <el-input v-model="editMaterialData.needDate" disabled></el-input>
  442. </el-form-item>
  443. </el-col>
  444. <el-col span="8">
  445. <el-form-item label="申请数量" required>
  446. <el-input
  447. v-model="editMaterialData.qtyToIssue"
  448. :min="0"
  449. style="width: 98%;"
  450. @input="value => editMaterialData.qtyToIssue = value
  451. .replace(/[^\d.]/g, '')
  452. .replace(/\.{2,}/g, '.')
  453. .replace(/^\./, '0.')
  454. .replace(/(\.\d{4}).*/, '$1')
  455. .replace(/^0+(?=\d)/, '0')
  456. .replace(/^0+(?=\.)/, '0')"
  457. ></el-input>
  458. </el-form-item>
  459. </el-col>
  460. <el-col span="8">
  461. <el-form-item label="类型">
  462. <el-input v-model="editMaterialData.issueType" disabled></el-input>
  463. </el-form-item>
  464. </el-col>
  465. </el-row>
  466. </el-form>
  467. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  468. <el-button type="primary" @click="saveEditMaterialDetail()">保存</el-button>
  469. <el-button type="primary" @click="editMaterialModalFlag=false">关闭</el-button>
  470. </el-footer>
  471. </el-dialog>
  472. <!-- 推送WCS预览弹窗只展示物料汇总与指定明细,标签集中在一个单元格内 - rqrq -->
  473. <el-dialog
  474. title="库存匹配情况预览"
  475. :visible.sync="previewDialogVisible"
  476. :close-on-click-modal="false"
  477. v-drag
  478. width="70%">
  479. <!-- rqrq - 目的地只展示不编辑,口径与海安无订单查看页保持一致 -->
  480. <el-form :inline="true" label-position="left" style="margin-bottom: 10px;">
  481. <el-form-item label="单据目的地:" style="margin-bottom: 0;">
  482. <span style="font-weight: bold;">
  483. {{ getAreaDisplayText(currentProductionArea) }}
  484. </span>
  485. </el-form-item>
  486. </el-form>
  487. <el-table
  488. :data="previewData"
  489. border
  490. v-loading="previewLoading"
  491. style="width: 100%;"
  492. height="360"
  493. :row-class-name="getRowClassName">
  494. <el-table-column prop="soorderNo" label="订单号" width="130" align="center">
  495. <template slot-scope="scope">
  496. <span v-if="scope.row.displayRowType !== 'SPECIFIED'">{{ scope.row.soorderNo }}</span>
  497. </template>
  498. </el-table-column>
  499. <el-table-column prop="itemNo" label="订单序号" width="85" align="center">
  500. <template slot-scope="scope">
  501. <span v-if="scope.row.displayRowType !== 'SPECIFIED'">{{ scope.row.itemNo }}</span>
  502. </template>
  503. </el-table-column>
  504. <el-table-column prop="bomItemNo" label="BOM行号" width="85" align="center">
  505. <template slot-scope="scope">
  506. <span v-if="scope.row.displayRowType !== 'SPECIFIED'">{{ scope.row.bomItemNo }}</span>
  507. </template>
  508. </el-table-column>
  509. <el-table-column prop="partNo" label="物料编码" min-width="145" align="center">
  510. <template slot-scope="scope">
  511. <span v-if="scope.row.displayRowType !== 'SPECIFIED'">{{ scope.row.partNo }}</span>
  512. </template>
  513. </el-table-column>
  514. <el-table-column prop="specifiedContent" label="指定内容" min-width="180" align="left" show-overflow-tooltip>
  515. <template slot-scope="scope">
  516. <span v-if="scope.row.displayRowType === 'SPECIFIED'" class="specified-content">
  517. {{ scope.row.specifiedContent }}
  518. </span>
  519. </template>
  520. </el-table-column>
  521. <el-table-column prop="requiredQty" label="需求数量" width="100" align="right">
  522. <template slot-scope="scope">
  523. <span>{{ formatPreviewQty(scope.row.requiredQty) }}</span>
  524. </template>
  525. </el-table-column>
  526. <el-table-column prop="matchedQty" label="匹配数量" width="100" align="right">
  527. <template slot-scope="scope">
  528. <span>{{ formatPreviewQty(scope.row.matchedQty) }}</span>
  529. </template>
  530. </el-table-column>
  531. <el-table-column prop="matchedSerialNos" label="标签号" min-width="360" align="left" class-name="wrap-text-column">
  532. <template slot-scope="scope">
  533. <div class="matched-labels">{{ scope.row.matchedSerialNos }}</div>
  534. </template>
  535. </el-table-column>
  536. <el-table-column
  537. prop="failureMessage"
  538. label="不可推送原因"
  539. min-width="240"
  540. align="left"
  541. show-overflow-tooltip>
  542. <template slot-scope="scope">
  543. <!-- 服务端返回订单级阻断原因,避免库存数量满足但按钮禁用时现场无法判断处理方向 - rqrq -->
  544. <span v-if="scope.row.failureMessage || scope.row.failureCode" class="failure-message">
  545. {{ formatFailureMessage(scope.row.failureMessage, scope.row.failureCode) }}
  546. </span>
  547. </template>
  548. </el-table-column>
  549. </el-table>
  550. <span slot="footer" class="dialog-footer">
  551. <el-button type="primary" class="yzzButtonAn" @click="pushToWCS" :loading="pushLoading"
  552. :disabled="previewLoading || pushLoading || !canPushPreview">
  553. {{ pushLoading ? '推送中...' : '推送至WCS' }}
  554. </el-button>
  555. <el-button @click="closePreviewDialog" :disabled="previewLoading || pushLoading">关闭</el-button>
  556. </span>
  557. </el-dialog>
  558. <!-- rqrq - 海安指定物料策略弹窗:维护单行物料批次/标签分配优先级 -->
  559. <el-dialog title="指定物料" :close-on-click-modal="false" v-drag :visible.sync="noOrderAllocDialogVisible" width="1100px">
  560. <el-form :inline="true" label-position="top">
  561. <el-form-item label="物料号">
  562. <el-input v-model="noOrderAllocForm.partNo" disabled style="width: 160px"></el-input>
  563. </el-form-item>
  564. <el-form-item label="物料描述">
  565. <el-input v-model="noOrderAllocForm.partDesc" disabled style="width: 320px"></el-input>
  566. </el-form-item>
  567. <el-form-item label="子站点">
  568. <el-input v-model="noOrderAllocForm.subSite" disabled style="width: 100px"></el-input>
  569. </el-form-item>
  570. <el-form-item label="申请数量">
  571. <el-input v-model="noOrderAllocForm.qtyToIssue" disabled style="width: 120px"></el-input>
  572. </el-form-item>
  573. </el-form>
  574. <div style="margin-bottom: 10px;">
  575. <el-button type="primary" size="small" @click="addNoOrderAllocRow('LABEL')">新增标签指定</el-button>
  576. <el-button type="primary" size="small" @click="addNoOrderAllocRow('BATCH')">新增批次指定</el-button>
  577. <span style="margin-left: 10px; color: #909399; font-size: 12px;">保存后按当前列表顺序进行指定匹配</span>
  578. </div>
  579. <div class="rq">
  580. <el-table :data="noOrderAllocForm.allocList" border v-loading="noOrderAllocLoading" height="360px" style="width: 100%;">
  581. <el-table-column prop="rowNo" label="序号" width="60" align="center"></el-table-column>
  582. <el-table-column prop="allocType" label="类型" width="90" align="center">
  583. <template slot-scope="scope">
  584. <span>{{ scope.row.allocType === 'LABEL' ? '标签' : '批次' }}</span>
  585. </template>
  586. </el-table-column>
  587. <el-table-column label="标签号" min-width="160" align="center">
  588. <template slot-scope="scope">
  589. <el-input
  590. v-if="scope.row.allocType === 'LABEL'"
  591. v-model="scope.row.serialNo"
  592. readonly
  593. placeholder="点击选择标签"
  594. @click.native="openNoOrderAvailableLabelDialog(scope.$index, 'LABEL')">
  595. </el-input>
  596. <span v-else>-</span>
  597. </template>
  598. </el-table-column>
  599. <el-table-column label="批次号" min-width="140" align="center">
  600. <template slot-scope="scope">
  601. <el-input
  602. v-if="scope.row.allocType === 'BATCH'"
  603. v-model="scope.row.batchNo"
  604. readonly
  605. placeholder="点击选择批次"
  606. @click.native="openNoOrderAvailableLabelDialog(scope.$index, 'BATCH')">
  607. </el-input>
  608. <span v-else>-</span>
  609. </template>
  610. </el-table-column>
  611. <el-table-column label="指定数量" width="120" align="center">
  612. <template slot-scope="scope">
  613. <el-input v-model="scope.row.allocQty" type="number" :min="0" :disabled="scope.row.allocType === 'LABEL'"></el-input>
  614. </template>
  615. </el-table-column>
  616. <!-- rqrq - 指定物料弹窗操作列不冻结:弹窗内fixed会与输入行高冲突,出现空白列和末行裁切 -->
  617. <el-table-column label="操作" width="200" align="center">
  618. <template slot-scope="scope">
  619. <el-button type="text" size="small" @click="moveNoOrderAllocRow(scope.$index, -1)">上移</el-button>
  620. <el-button type="text" size="small" @click="moveNoOrderAllocRow(scope.$index, 1)">下移</el-button>
  621. <el-button type="text" size="small" @click="removeNoOrderAllocRow(scope.$index)">删除</el-button>
  622. </template>
  623. </el-table-column>
  624. </el-table>
  625. </div>
  626. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  627. <el-button type="primary" :loading="noOrderAllocSaving" :disabled="noOrderAllocSaving" @click="saveNoOrderMaterialAlloc">保存</el-button>
  628. <el-button :disabled="noOrderAllocSaving" @click="noOrderAllocDialogVisible = false">关闭</el-button>
  629. </el-footer>
  630. </el-dialog>
  631. <!-- rqrq - 在库可用标签选择弹窗:双击回填指定行的标签号或批次号;展示所在托盘/位置/层,托盘号、数量、接收日期、失效日期可前端排序 -->
  632. <el-dialog
  633. :title="noOrderLabelPickMode === 'BATCH' ? '选择批次' : '选择标签'"
  634. :close-on-click-modal="false"
  635. append-to-body
  636. v-drag
  637. :visible.sync="noOrderLabelPickDialogVisible"
  638. width="1280px">
  639. <el-table
  640. :data="noOrderLabelPickList"
  641. border
  642. highlight-current-row
  643. height="420px"
  644. v-loading="noOrderLabelPickLoading"
  645. @row-dblclick="handleNoOrderAvailableLabelDblClick"
  646. style="width: 100%;">
  647. <el-table-column prop="serialNo" label="标签号" min-width="160" align="center" show-overflow-tooltip></el-table-column>
  648. <el-table-column prop="palletId" label="所在托盘号" min-width="140" align="center" sortable show-overflow-tooltip></el-table-column>
  649. <el-table-column prop="position" label="位置号" min-width="90" align="center"></el-table-column>
  650. <el-table-column prop="layer" label="层数" width="80" align="center"></el-table-column>
  651. <el-table-column prop="qty" label="数量" width="100" align="center" sortable :formatter="formatNoOrderPickQty"></el-table-column>
  652. <el-table-column prop="batchNo" label="批次号" min-width="140" align="center" show-overflow-tooltip></el-table-column>
  653. <el-table-column prop="receiveDate" label="接收日期" min-width="160" align="center" sortable></el-table-column>
  654. <el-table-column prop="expiredDate" label="失效日期" min-width="160" align="center" sortable></el-table-column>
  655. <el-table-column prop="wdr" label="WDR" min-width="100" align="center" show-overflow-tooltip></el-table-column>
  656. </el-table>
  657. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  658. <el-button @click="noOrderLabelPickDialogVisible = false">关闭</el-button>
  659. </el-footer>
  660. </el-dialog>
  661. </div>
  662. </template>
  663. <script>
  664. import {
  665. haiAnSearchNotifyHeaderNew,
  666. haiAnSearchNotifyOrderListNew,
  667. haiAnSearchNotifyMaterialListNew,
  668. haiAnSearchSumNotifyMaterialListNew,
  669. haiAnSearchMaterialListDetail,
  670. haiAnSearchNotifyLogNew,
  671. haiAnSearchNotifyLogCloseNew,
  672. haiAnUpdateNotifyStatusNew,
  673. haiAnCheckUserHasUnissueShopOrder,
  674. haiAnCancelIssueNotify,
  675. haiAnDeleteNotifySOSPlus,
  676. haiAnDeleteUnpushedNotify,
  677. haiAnUpdateMaterialDetail,
  678. haiAnGetSOSBOMForIssureNew,
  679. haiAnSaveMaterialDetail,
  680. haiAnCheckIssueNotifyInventory,
  681. haiAnPushInventoryToWcs,
  682. getNoOrderMaterialAllocList,
  683. saveNoOrderMaterialAllocList,
  684. getNoOrderAvailableInStockLabelList,
  685. getNoOrderMaterialAllocListByNotifyNo
  686. } from '@/api/haianWarehouse/searchIssureNotify.js'
  687. import { showHaianWcsPushResult } from '@/utils/haianWcsPushResult'
  688. import { haiAnGetAreaList } from '@/api/haianWarehouse/warehousePallet.js'
  689. export default {
  690. name: 'searchIssureNotify54',
  691. data() {
  692. return {
  693. height:200,
  694. activeName: 'detail',
  695. dataList: [],
  696. dataList2: [],
  697. dataList3: [],
  698. dataList4: [],
  699. dataList5: [],
  700. dataList6: [],
  701. dataList7: [], // 预定标签清单数据 - rqrq
  702. userBuList:[],
  703. createNotifyFlag: false,
  704. saveOrderDetailFlag: false,
  705. closeData:{
  706. site:'',
  707. notifyNo:'',
  708. closeRemark:'',
  709. username:this.$store.state.user.name,
  710. },
  711. closeModalFlag:false,
  712. searchData: {
  713. page: 1,
  714. limit: 100,
  715. site:'',
  716. userName: '',
  717. notifyNo: '',
  718. status: '',
  719. pushWcsFlag: '', // rqrq - 推送WCS筛选条件
  720. loginUserName: this.$store.state.user.name,
  721. startDate: this.dayjs().format("YYYY-MM-DD"),
  722. endDate: this.dayjs().format("YYYY-MM-DD"),
  723. issueStartDate:this.dayjs().format("YYYY-MM-DD"),
  724. issueEndDate: this.dayjs().format("YYYY-MM-DD")+" 23:59:59",
  725. sql: "",
  726. orderNo: "",
  727. orderType: 'shoporder', // rqrq - 默认查询shoporder类型
  728. },
  729. notifyData:{
  730. site: '',
  731. bu: '',
  732. notifyNo: '',
  733. notifyDate: '',
  734. enteredDate: '',
  735. userName: this.$store.state.user.name,
  736. userDisplay: '',
  737. remark: '',
  738. planIssueDate: '',
  739. outWorkOrderFlag: false,
  740. },
  741. pageIndex: 1,
  742. pageSize: 100,
  743. totalPage: 0,
  744. //工单分页
  745. co_pageIndex: 1,
  746. co_pageSize: 100,
  747. co_totalPage: 0,
  748. dataListLoading: false,
  749. currentRow:'',
  750. columnList1:[
  751. {
  752. userId: this.$store.state.user.name,
  753. functionId: 701002,
  754. serialNumber: '701002Table1NotifyNo',
  755. tableId: "701002Table1",
  756. tableName: "领料申请主表",
  757. columnProp: "notifyNo",
  758. headerAlign: "center",
  759. align: "center",
  760. columnLabel: "申请单单号",
  761. columnHidden: false,
  762. columnImage: false,
  763. columnSortable: false,
  764. sortLv: 0,
  765. status: true,
  766. fixed: '',
  767. columnWidth: 100
  768. },{
  769. userId: this.$store.state.user.name,
  770. functionId: 701002,
  771. serialNumber: '701002Table1NotifyDate',
  772. tableId: "701002Table1",
  773. tableName: "领料申请主表",
  774. columnProp: "notifyDate",
  775. headerAlign: "center",
  776. align: "center",
  777. columnLabel: "申请日期",
  778. columnHidden: false,
  779. columnImage: false,
  780. columnSortable: false,
  781. sortLv: 0,
  782. status: true,
  783. fixed: '',
  784. columnWidth: 100
  785. }, {
  786. userId: this.$store.state.user.name,
  787. functionId: 701002,
  788. serialNumber: '701002Table1UserName',
  789. tableId: "701002Table1",
  790. tableName: "领料申请主表",
  791. columnProp: "username",
  792. headerAlign: "center",
  793. align: "left",
  794. columnLabel: "申请账号",
  795. columnHidden: false,
  796. columnImage: false,
  797. columnSortable: false,
  798. sortLv: 0,
  799. status: true,
  800. fixed: '',
  801. columnWidth: 100
  802. },{
  803. userId: this.$store.state.user.name,
  804. functionId: 701002,
  805. serialNumber: '701002Table1EnteredDate',
  806. tableId: "701002Table1",
  807. tableName: "领料申请主表",
  808. columnProp: "enteredDate",
  809. headerAlign: "center",
  810. align: "center",
  811. columnLabel: "录入时间",
  812. columnHidden: false,
  813. columnImage: false,
  814. columnSortable: false,
  815. sortLv: 0,
  816. status: true,
  817. fixed: '',
  818. columnWidth: 120
  819. },{
  820. userId: this.$store.state.user.name,
  821. functionId: 701002,
  822. serialNumber: '701002Table1Status',
  823. tableId: "701002Table1",
  824. tableName: "领料申请主表",
  825. columnProp: "status",
  826. headerAlign: "center",
  827. align: "left",
  828. columnLabel: "状态",
  829. columnHidden: false,
  830. columnImage: false,
  831. columnSortable: false,
  832. sortLv: 0,
  833. status: true,
  834. fixed: '',
  835. columnWidth: 80
  836. },{
  837. userId: this.$store.state.user.name,
  838. functionId: 701002,
  839. serialNumber: '701002Table1ConfirmStatus',
  840. tableId: "701002Table1",
  841. tableName: "领料申请主表",
  842. columnProp: "confirmStatus",
  843. headerAlign: "center",
  844. align: "center",
  845. columnLabel: "确认状态",
  846. columnHidden: false,
  847. columnImage: false,
  848. columnSortable: false,
  849. sortLv: 0,
  850. status: true,
  851. fixed: '',
  852. columnWidth: 80
  853. },{
  854. userId: this.$store.state.user.name,
  855. functionId: 701002,
  856. serialNumber: '701002Table1WcsPushFlag',
  857. tableId: "701002Table1",
  858. tableName: "领料申请主表",
  859. columnProp: "pushWcsFlag",
  860. headerAlign: "center",
  861. align: "left",
  862. columnLabel: "推送WCS",
  863. columnHidden: false,
  864. columnImage: false,
  865. columnSortable: false,
  866. sortLv: 0,
  867. status: true,
  868. fixed: '',
  869. columnWidth: 80
  870. },{
  871. userId: this.$store.state.user.name,
  872. functionId: 701002,
  873. serialNumber: '701002Table1Remark',
  874. tableId: "701002Table1",
  875. tableName: "领料申请主表",
  876. columnProp: "remark",
  877. headerAlign: "center",
  878. align: "left",
  879. columnLabel: "备注",
  880. columnHidden: false,
  881. columnImage: false,
  882. columnSortable: false,
  883. sortLv: 0,
  884. status: true,
  885. fixed: '',
  886. columnWidth: 200
  887. },
  888. ],
  889. columnList2:[
  890. {
  891. userId: this.$store.state.user.name,
  892. functionId: 701002,
  893. serialNumber: '701002Table2ItemNo',
  894. tableId: "701002Table2",
  895. tableName: "申请单派工单明细表",
  896. columnProp: "itemNo",
  897. headerAlign: "center",
  898. align: "right",
  899. columnLabel: "序号",
  900. columnHidden: false,
  901. columnImage: false,
  902. columnSortable: false,
  903. sortLv: 0,
  904. status: true,
  905. fixed: '',
  906. columnWidth: 40
  907. },
  908. {
  909. userId: this.$store.state.user.name,
  910. functionId: 701002,
  911. serialNumber: '701002Table2SubSite',
  912. tableId: "701002Table2",
  913. tableName: "申请单派工单明细表",
  914. columnProp: "subSite",
  915. headerAlign: "center",
  916. align: "center",
  917. columnLabel: "工厂编号",
  918. columnHidden: false,
  919. columnImage: false,
  920. columnSortable: false,
  921. sortLv: 0,
  922. status: true,
  923. fixed: '',
  924. columnWidth: 90
  925. },
  926. {
  927. userId: this.$store.state.user.name,
  928. functionId: 701002,
  929. serialNumber: '701002Table2NeedDate',
  930. tableId: "701002Table2",
  931. tableName: "领料申请派工单子表",
  932. columnProp: 'needDate',
  933. headerAlign: "center",
  934. align: "left",
  935. columnLabel: '要求发料时间',
  936. columnHidden: false,
  937. columnImage: false,
  938. columnSortable: false,
  939. sortLv: 0,
  940. status: true,
  941. fixed: '',
  942. columnWidth: 80,
  943. },
  944. {
  945. userId: this.$store.state.user.name,
  946. functionId: 701002,
  947. serialNumber: '701002Table2PushWcsTime',
  948. tableId: "701002Table2",
  949. tableName: "领料申请派工单子表",
  950. columnProp: 'pushWcsTime',
  951. headerAlign: "center",
  952. align: "center",
  953. columnLabel: '推送WCS时间',
  954. columnHidden: false,
  955. columnImage: false,
  956. columnSortable: false,
  957. sortLv: 0,
  958. status: true,
  959. fixed: '',
  960. columnWidth: 130,
  961. },
  962. {
  963. userId: this.$store.state.user.name,
  964. functionId: 701002,
  965. serialNumber: '701002Table2SOOrderNo',
  966. tableId: "701002Table2",
  967. tableName: "申请单派工单明细表",
  968. columnProp: "soorderNo",
  969. headerAlign: "center",
  970. align: "left",
  971. columnLabel: "生产订单",
  972. columnHidden: false,
  973. columnImage: false,
  974. columnSortable: false,
  975. sortLv: 0,
  976. status: true,
  977. fixed: '',
  978. columnWidth: 120
  979. }, {
  980. userId: this.$store.state.user.name,
  981. functionId: 701002,
  982. serialNumber: '701002Table2FGPartNo',
  983. tableId: "701002Table2",
  984. tableName: "申请单派工单明细表",
  985. columnProp: "fgPartNo",
  986. headerAlign: "center",
  987. align: "left",
  988. columnLabel: "工单物料",
  989. columnHidden: false,
  990. columnImage: false,
  991. columnSortable: false,
  992. sortLv: 0,
  993. status: true,
  994. fixed: '',
  995. columnWidth: 80
  996. }, {
  997. userId: this.$store.state.user.name,
  998. functionId: 701002,
  999. serialNumber: '701002Table2ReleaseNo',
  1000. tableId: "701002Table2",
  1001. tableName: "申请单派工单明细表",
  1002. columnProp: "releaseNo",
  1003. headerAlign: "center",
  1004. align: "left",
  1005. columnLabel: "发布号",
  1006. columnHidden: false,
  1007. columnImage: false,
  1008. columnSortable: false,
  1009. sortLv: 0,
  1010. status: true,
  1011. fixed: '',
  1012. columnWidth: 80
  1013. }, {
  1014. userId: this.$store.state.user.name,
  1015. functionId: 701002,
  1016. serialNumber: '701002Table2SequenceNo',
  1017. tableId: "701002Table2",
  1018. tableName: "申请单派工单明细表",
  1019. columnProp: "sequenceNo",
  1020. headerAlign: "center",
  1021. align: "left",
  1022. columnLabel: "序号",
  1023. columnHidden: false,
  1024. columnImage: false,
  1025. columnSortable: false,
  1026. sortLv: 0,
  1027. status: true,
  1028. fixed: '',
  1029. columnWidth: 80
  1030. }, {
  1031. userId: this.$store.state.user.name,
  1032. functionId: 701002,
  1033. serialNumber: '701002Table2PushWmsFlag',
  1034. tableId: "701002Table2",
  1035. tableName: "申请单派工单明细表",
  1036. columnProp: "pushWmsFlag",
  1037. headerAlign: "center",
  1038. align: "center",
  1039. columnLabel: "是否推送WCS",
  1040. columnHidden: false,
  1041. columnImage: false,
  1042. columnSortable: false,
  1043. sortLv: 0,
  1044. status: true,
  1045. fixed: '',
  1046. columnWidth: 120
  1047. }, {
  1048. userId: this.$store.state.user.name,
  1049. functionId: 701002,
  1050. serialNumber: '701002Table2TransportFlag',
  1051. tableId: "701002Table2",
  1052. tableName: "申请单派工单明细表",
  1053. columnProp: "transportFlag",
  1054. headerAlign: "center",
  1055. align: "center",
  1056. columnLabel: "立库取出",
  1057. columnHidden: false,
  1058. columnImage: false,
  1059. columnSortable: false,
  1060. sortLv: 0,
  1061. status: true,
  1062. fixed: '',
  1063. columnWidth: 80
  1064. }, {
  1065. userId: this.$store.state.user.name,
  1066. functionId: 701002,
  1067. serialNumber: '701002Table2AreaDesc',
  1068. tableId: "701002Table2",
  1069. tableName: "申请单派工单明细表",
  1070. columnProp: "areaDesc",
  1071. headerAlign: "center",
  1072. align: "left",
  1073. columnLabel: "配送区域",
  1074. columnHidden: false,
  1075. columnImage: false,
  1076. columnSortable: false,
  1077. sortLv: 0,
  1078. status: true,
  1079. fixed: '',
  1080. columnWidth: 100
  1081. }
  1082. ],
  1083. columnList3:[
  1084. {
  1085. userId: this.$store.state.user.name,
  1086. functionId: 701002,
  1087. serialNumber: '701002Table3ItemNo',
  1088. tableId: "701002Table3",
  1089. tableName: "申请单材料明细表",
  1090. columnProp: "itemNo",
  1091. headerAlign: "center",
  1092. align: "right",
  1093. columnLabel: "申请单序号",
  1094. columnHidden: false,
  1095. columnImage: false,
  1096. columnSortable: false,
  1097. sortLv: 0,
  1098. status: true,
  1099. fixed: '',
  1100. columnWidth: 80
  1101. },{
  1102. userId: this.$store.state.user.name,
  1103. functionId: 701002,
  1104. serialNumber: '701002Table3SubSite',
  1105. tableId: "701002Table3",
  1106. tableName: "申请单材料明细表",
  1107. columnProp: "subSite",
  1108. headerAlign: "center",
  1109. align: "center",
  1110. columnLabel: "工厂编号",
  1111. columnHidden: false,
  1112. columnImage: false,
  1113. columnSortable: false,
  1114. sortLv: 0,
  1115. status: true,
  1116. fixed: '',
  1117. columnWidth: 90
  1118. },{
  1119. userId: this.$store.state.user.name,
  1120. functionId: 701002,
  1121. serialNumber: '701002Table3ComponentPartNo',
  1122. tableId: "701002Table3",
  1123. tableName: "申请单材料明细表",
  1124. columnProp: "componentPartNo",
  1125. headerAlign: "center",
  1126. align: "center",
  1127. columnLabel: "材料编码",
  1128. columnHidden: false,
  1129. columnImage: false,
  1130. columnSortable: false,
  1131. sortLv: 0,
  1132. status: true,
  1133. fixed: '',
  1134. columnWidth: 100
  1135. },{
  1136. userId: this.$store.state.user.name,
  1137. functionId: 701002,
  1138. serialNumber: '701002Table3IsInWh',
  1139. tableId: "701002Table3",
  1140. tableName: "申请单材料明细表",
  1141. columnProp: "isInWh",
  1142. headerAlign: "center",
  1143. align: "center",
  1144. columnLabel: "是否进立库",
  1145. columnHidden: false,
  1146. columnImage: false,
  1147. columnSortable: false,
  1148. sortLv: 0,
  1149. status: true,
  1150. fixed: '',
  1151. columnWidth: 80
  1152. },{
  1153. userId: this.$store.state.user.name,
  1154. functionId: 701002,
  1155. serialNumber: '701002Table3NeedDate',
  1156. tableId: "701002Table3",
  1157. tableName: "申请单材料明细表",
  1158. columnProp: "needDate",
  1159. headerAlign: "center",
  1160. align: "center",
  1161. columnLabel: "需求时间",
  1162. columnHidden: false,
  1163. columnImage: false,
  1164. columnSortable: false,
  1165. sortLv: 0,
  1166. status: true,
  1167. fixed: '',
  1168. columnWidth: 110
  1169. },{
  1170. userId: this.$store.state.user.name,
  1171. functionId: 701002,
  1172. serialNumber: '701002Table3QtyToIssue',
  1173. tableId: "701002Table3",
  1174. tableName: "申请单材料明细表",
  1175. columnProp: "qtyToIssue",
  1176. headerAlign: "center",
  1177. align: "right",
  1178. columnLabel: "申请数量",
  1179. columnHidden: false,
  1180. columnImage: false,
  1181. columnSortable: false,
  1182. sortLv: 0,
  1183. status: true,
  1184. fixed: '',
  1185. columnWidth: 80
  1186. },/* {
  1187. userId: this.$store.state.user.name,
  1188. functionId: 701002,
  1189. serialNumber: '701002Table3QtyToIssueOriginal',
  1190. tableId: "701002Table3",
  1191. tableName: "申请单材料明细表",
  1192. columnProp: "qtyToIssueOriginal",
  1193. headerAlign: "center",
  1194. align: "right",
  1195. columnLabel: "已发数量",
  1196. columnHidden: false,
  1197. columnImage: false,
  1198. columnSortable: false,
  1199. sortLv: 0,
  1200. status: true,
  1201. fixed: '',
  1202. columnWidth: 80
  1203. }, */{
  1204. userId: this.$store.state.user.name,
  1205. functionId: 701002,
  1206. serialNumber: '701002Table3IssueType',
  1207. tableId: "701002Table3",
  1208. tableName: "申请单材料明细表",
  1209. columnProp: "issueType",
  1210. headerAlign: "center",
  1211. align: "right",
  1212. columnLabel: "类型",
  1213. columnHidden: false,
  1214. columnImage: false,
  1215. columnSortable: false,
  1216. sortLv: 0,
  1217. status: true,
  1218. fixed: '',
  1219. columnWidth: 80
  1220. },{
  1221. userId: this.$store.state.user.name,
  1222. functionId: 701002,
  1223. serialNumber: '701002Table3Remark',
  1224. tableId: "701002Table3",
  1225. tableName: "申请单材料明细表",
  1226. columnProp: "remark",
  1227. headerAlign: "center",
  1228. align: "left",
  1229. columnLabel: "备注",
  1230. columnHidden: false,
  1231. columnImage: false,
  1232. columnSortable: false,
  1233. sortLv: 0,
  1234. status: true,
  1235. fixed: '',
  1236. columnWidth: 160
  1237. },{
  1238. userId: this.$store.state.user.name,
  1239. functionId: 701002,
  1240. serialNumber: '701002Table3SOOrderNo',
  1241. tableId: "701002Table3",
  1242. tableName: "申请单材料明细表",
  1243. columnProp: "soorderNo",
  1244. headerAlign: "center",
  1245. align: "left",
  1246. columnLabel: "生产订单",
  1247. columnHidden: false,
  1248. columnImage: false,
  1249. columnSortable: false,
  1250. sortLv: 0,
  1251. status: true,
  1252. fixed: '',
  1253. columnWidth: 120
  1254. },{
  1255. userId: this.$store.state.user.name,
  1256. functionId: 701002,
  1257. serialNumber: '701002Table3BOMItemNo',
  1258. tableId: "701002Table3",
  1259. tableName: "申请单材料明细表",
  1260. columnProp: "bomitemNo",
  1261. headerAlign: "center",
  1262. align: "right",
  1263. columnLabel: "BOM序号",
  1264. columnHidden: false,
  1265. columnImage: false,
  1266. columnSortable: false,
  1267. sortLv: 0,
  1268. status: true,
  1269. fixed: '',
  1270. columnWidth: 80
  1271. },
  1272. ],
  1273. columnList4:[
  1274. {
  1275. userId: this.$store.state.user.name,
  1276. functionId: 701002,
  1277. serialNumber: '701002Table4IssueType',
  1278. tableId: "701002Table4",
  1279. tableName: "申请单材料明细表",
  1280. columnProp: "issueType",
  1281. headerAlign: "center",
  1282. align: "center",
  1283. columnLabel: "类型",
  1284. columnHidden: false,
  1285. columnImage: false,
  1286. columnSortable: false,
  1287. sortLv: 0,
  1288. status: true,
  1289. fixed: '',
  1290. columnWidth: 100
  1291. },
  1292. {
  1293. userId: this.$store.state.user.name,
  1294. functionId: 701002,
  1295. serialNumber: '701002Table4ComponentPartNo',
  1296. tableId: "701002Table4",
  1297. tableName: "申请单材料明细表",
  1298. columnProp: "componentPartNo",
  1299. headerAlign: "center",
  1300. align: "center",
  1301. columnLabel: "材料编码",
  1302. columnHidden: false,
  1303. columnImage: false,
  1304. columnSortable: false,
  1305. sortLv: 0,
  1306. status: true,
  1307. fixed: '',
  1308. columnWidth: 100
  1309. },{
  1310. userId: this.$store.state.user.name,
  1311. functionId: 701002,
  1312. serialNumber: '701002Table4IsInWh',
  1313. tableId: "701002Table4",
  1314. tableName: "申请单材料明细表",
  1315. columnProp: "isInWh",
  1316. headerAlign: "center",
  1317. align: "center",
  1318. columnLabel: "是否进立库",
  1319. columnHidden: false,
  1320. columnImage: false,
  1321. columnSortable: false,
  1322. sortLv: 0,
  1323. status: true,
  1324. fixed: '',
  1325. columnWidth: 80
  1326. },{
  1327. userId: this.$store.state.user.name,
  1328. functionId: 701002,
  1329. serialNumber: '701002Table4PartDesc',
  1330. tableId: "701002Table4",
  1331. tableName: "申请单材料明细表",
  1332. columnProp: "partDesc",
  1333. headerAlign: "center",
  1334. align: "left",
  1335. columnLabel: "材料名称",
  1336. columnHidden: false,
  1337. columnImage: false,
  1338. columnSortable: false,
  1339. sortLv: 0,
  1340. status: true,
  1341. fixed: '',
  1342. columnWidth: 130
  1343. },{
  1344. userId: this.$store.state.user.name,
  1345. functionId: 701002,
  1346. serialNumber: '701002Table4QtyToIssue',
  1347. tableId: "701002Table4",
  1348. tableName: "申请单材料明细表",
  1349. columnProp: "qtyToIssue",
  1350. headerAlign: "center",
  1351. align: "right",
  1352. columnLabel: "合计申请数量",
  1353. columnHidden: false,
  1354. columnImage: false,
  1355. columnSortable: false,
  1356. sortLv: 0,
  1357. status: true,
  1358. fixed: '',
  1359. columnWidth: 80
  1360. },{
  1361. userId: this.$store.state.user.name,
  1362. functionId: 701002,
  1363. serialNumber: '701002Table4QtyToIssueOriginal',
  1364. tableId: "701002Table4",
  1365. tableName: "申请单材料明细表",
  1366. columnProp: "qtyToIssueOriginal",
  1367. headerAlign: "center",
  1368. align: "right",
  1369. columnLabel: "合计已发数量",
  1370. columnHidden: false,
  1371. columnImage: false,
  1372. columnSortable: false,
  1373. sortLv: 0,
  1374. status: true,
  1375. fixed: '',
  1376. columnWidth: 80
  1377. },
  1378. ],
  1379. columnList6:[ // 预定标签清单列配置 - rqrq
  1380. {
  1381. userId: this.$store.state.user.name,
  1382. functionId: 701002,
  1383. serialNumber: '701002Table6ItemNo',
  1384. tableId: "701002Table6",
  1385. tableName: "预定标签清单表",
  1386. columnProp: "itemNo",
  1387. headerAlign: "center",
  1388. align: "right",
  1389. columnLabel: "订单序号",
  1390. columnHidden: false,
  1391. columnImage: false,
  1392. columnSortable: false,
  1393. sortLv: 0,
  1394. status: true,
  1395. fixed: '',
  1396. columnWidth: 80
  1397. },{
  1398. // 预定标签清单按标签料号展示;订单物料行号仅保留在返回数据中供业务关联 - rqrq
  1399. userId: this.$store.state.user.name,
  1400. functionId: 701002,
  1401. serialNumber: '701002Table6ComponentPartNo',
  1402. tableId: "701002Table6",
  1403. tableName: "预定标签清单表",
  1404. columnProp: "componentPartNo",
  1405. headerAlign: "center",
  1406. align: "left",
  1407. columnLabel: "料号",
  1408. columnHidden: false,
  1409. columnImage: false,
  1410. columnSortable: false,
  1411. sortLv: 0,
  1412. status: true,
  1413. fixed: '',
  1414. columnWidth: 120
  1415. },{
  1416. userId: this.$store.state.user.name,
  1417. functionId: 701002,
  1418. serialNumber: '701002Table6SerialNo',
  1419. tableId: "701002Table6",
  1420. tableName: "预定标签清单表",
  1421. columnProp: "serialNo",
  1422. headerAlign: "center",
  1423. align: "left",
  1424. columnLabel: "标签号",
  1425. columnHidden: false,
  1426. columnImage: false,
  1427. columnSortable: false,
  1428. sortLv: 0,
  1429. status: true,
  1430. fixed: '',
  1431. columnWidth: 120
  1432. },{
  1433. userId: this.$store.state.user.name,
  1434. functionId: 701002,
  1435. serialNumber: '701002Table6TaskRef',
  1436. tableId: "701002Table6",
  1437. tableName: "预定标签清单表",
  1438. columnProp: "taskRef",
  1439. headerAlign: "center",
  1440. align: "left",
  1441. columnLabel: "立库任务号",
  1442. columnHidden: false,
  1443. columnImage: false,
  1444. columnSortable: false,
  1445. sortLv: 0,
  1446. status: true,
  1447. fixed: '',
  1448. columnWidth: 120
  1449. },{
  1450. userId: this.$store.state.user.name,
  1451. functionId: 701002,
  1452. serialNumber: '701002Table6TaskItem',
  1453. tableId: "701002Table6",
  1454. tableName: "预定标签清单表",
  1455. columnProp: "taskItem",
  1456. headerAlign: "center",
  1457. align: "right",
  1458. columnLabel: "立库任务行号",
  1459. columnHidden: false,
  1460. columnImage: false,
  1461. columnSortable: false,
  1462. sortLv: 0,
  1463. status: true,
  1464. fixed: '',
  1465. columnWidth: 100
  1466. },{
  1467. userId: this.$store.state.user.name,
  1468. functionId: 701002,
  1469. serialNumber: '701002Table6OutWcsFlag',
  1470. tableId: "701002Table6",
  1471. tableName: "预定标签清单表",
  1472. columnProp: "outWcsFlag",
  1473. headerAlign: "center",
  1474. align: "center",
  1475. columnLabel: "立库取出",
  1476. columnHidden: false,
  1477. columnImage: false,
  1478. columnSortable: false,
  1479. sortLv: 0,
  1480. status: true,
  1481. fixed: '',
  1482. columnWidth: 80
  1483. },
  1484. {
  1485. userId: this.$store.state.user.name,
  1486. functionId: 701002,
  1487. serialNumber: '701002Table6OutWcsTime',
  1488. tableId: "701002Table6",
  1489. tableName: "预定标签清单表",
  1490. columnProp: "outWcsTime",
  1491. headerAlign: "center",
  1492. align: "center",
  1493. columnLabel: "取出时间",
  1494. columnHidden: false,
  1495. columnImage: false,
  1496. columnSortable: false,
  1497. sortLv: 0,
  1498. status: true,
  1499. fixed: '',
  1500. columnWidth: 140
  1501. }
  1502. ],
  1503. // 导出 start
  1504. exportData: [],
  1505. exportName: '发料申请单'+this.dayjs().format('YYYYMMDDHHmmss'),
  1506. exportHeader: ["发料申请单"],
  1507. exportFooter: [],
  1508. // 导出 end
  1509. orderDetailData:{
  1510. orderNo:'',
  1511. seqNo:'',
  1512. locationNo:'',
  1513. qtyrequired:'',
  1514. issureQty:0,
  1515. partDesc:'',
  1516. partNo:'',
  1517. resourceId:'',
  1518. resourceDesc:'',
  1519. needDate:'',
  1520. itemDesc:'',
  1521. workCenterNo:'',
  1522. itemNo:0,
  1523. materialType:'BOM物料',
  1524. },
  1525. chooseSOSModalFlag: false,
  1526. chooseSOSData: {
  1527. orderno: '',
  1528. seqno: '',
  1529. sResourceid: '',
  1530. startDate: '',
  1531. endDate: '',
  1532. },
  1533. chooseOrderModalFlag: false,
  1534. chooseOrderData: {
  1535. page: 1,
  1536. limit: 100,
  1537. orderNo: '',
  1538. status: '',
  1539. date3: '',
  1540. date4: '',
  1541. statusList: '',
  1542. },
  1543. chooseOrderList: [],
  1544. chooseOperationModalFlag: false,
  1545. chooseOperationData: {
  1546. orderNo: '',
  1547. site: '',
  1548. itemDesc: ''
  1549. },
  1550. chooseOperationList: [],
  1551. chooseResourceModalFlag: false,
  1552. chooseResourceData: {
  1553. site: '',
  1554. workCenterNo: '',
  1555. resourceID: '',
  1556. resourceDesc: '',
  1557. },
  1558. chooseResourceList: [],
  1559. chooseSOSList: [],
  1560. choosePartModalFlag: false,
  1561. choosePartData: {
  1562. site: '',
  1563. sourceBu: '',
  1564. partNo: '',
  1565. partDesc: '',
  1566. spec: '',
  1567. },
  1568. choosePartList: [],
  1569. // 预览相关数据
  1570. previewDialogVisible: false,
  1571. previewLoading: false,
  1572. pushLoading: false,
  1573. previewData: [],
  1574. previewSummary: {
  1575. totalOrderCount: 0,
  1576. completeOrderCount: 0,
  1577. pushableOrderCount: 0,
  1578. pushableOrderNos: [],
  1579. completeOrderNos: []
  1580. },
  1581. currentNotifyRow: null,
  1582. areaOptions: [],
  1583. currentProductionArea: '',
  1584. allocDetailList: [],
  1585. allocDetailLoading: false,
  1586. deleteWholeLoading: false,
  1587. noOrderAllocDialogVisible: false,
  1588. noOrderAllocLoading: false,
  1589. noOrderAllocSaving: false,
  1590. noOrderAllocForm: {
  1591. site: this.$store.state.user.site,
  1592. notifyNo: '',
  1593. itemNo: '',
  1594. bOMItemNo: '',
  1595. partNo: '',
  1596. partDesc: '',
  1597. subSite: '',
  1598. qtyToIssue: 0,
  1599. allocList: []
  1600. },
  1601. noOrderLabelPickDialogVisible: false,
  1602. noOrderLabelPickLoading: false,
  1603. noOrderLabelPickList: [],
  1604. noOrderLabelPickIndex: -1,
  1605. noOrderLabelPickMode: 'LABEL',
  1606. // 物料明细对话框相关数据
  1607. materialModalFlag: false,
  1608. sobomList: [],
  1609. sobomData: {
  1610. orderNo: '',
  1611. seqNo: '',
  1612. partNo: '',
  1613. },
  1614. bomLoadFlag: false,
  1615. // 编辑材料明细对话框相关数据
  1616. editMaterialModalFlag: false,
  1617. editMaterialData: {
  1618. itemNo: '',
  1619. componentPartNo: '',
  1620. isInWh: '',
  1621. needDate: '',
  1622. qtyToIssue: 0,
  1623. issueType: '',
  1624. remark: '',
  1625. soorderNo: '',
  1626. bomitemNo: '',
  1627. site: '',
  1628. notifyNo: '',
  1629. },
  1630. }
  1631. },
  1632. mounted () {
  1633. this.$nextTick(() => {
  1634. this.height = (window.innerHeight- 315) / 2
  1635. })
  1636. },
  1637. created () {
  1638. this.searchTable()
  1639. // 补充海安标签扩展列,确保预定标签页签能展示海安增强字段 - rqrq
  1640. this.haiAnEnsureLabelColumns()
  1641. // 推送弹窗单据目的地按haian_area名称展示,进入页面先加载区域清单 - rqrq
  1642. this.loadHaianAreaOptions(this.$store.state.user.site)
  1643. },
  1644. computed: {
  1645. /**
  1646. * 只有服务端本次匹配判定的完整订单才允许确认推送,前端不自行按标签数量推断 - rqrq
  1647. */
  1648. canPushPreview () {
  1649. return !this.previewLoading && !this.pushLoading && this.previewSummary.pushableOrderCount > 0
  1650. }
  1651. },
  1652. methods: {
  1653. // 每页数
  1654. sizeChangeHandle (val) {
  1655. this.pageSize = val
  1656. this.searchTable()
  1657. },
  1658. // 当前页
  1659. currentChangeHandle (val) {
  1660. this.pageIndex = val
  1661. this.searchTable()
  1662. },
  1663. tabClick (tab, event) {
  1664. // 刷新列表数据
  1665. this.refreshCurrentTabTable()
  1666. },
  1667. changeData(row){
  1668. this.currentRow = JSON.parse(JSON.stringify(row));
  1669. this.refreshCurrentTabTable ();
  1670. },
  1671. refreshCurrentTabTable(){
  1672. if(this.currentRow===''||this.currentRow===null){
  1673. this.currentRow={site:'',notifyNo:'',orderType:'shoporder'}
  1674. }
  1675. // rqrq - 添加orderType参数
  1676. let queryData = {
  1677. ...this.currentRow,
  1678. orderType: 'shoporder'
  1679. }
  1680. if(this.activeName==='detail'){
  1681. searchNotifyOrderListNew(queryData).then(({data}) => {
  1682. //区分请求成功和失败的状况
  1683. if (data && data.code == 0) {
  1684. this.dataList2 = data.rows
  1685. } else {
  1686. this.dataList2 = [];
  1687. }
  1688. });
  1689. }else if(this.activeName==='sub'){
  1690. searchNotifyMaterialListNew(queryData).then(({data}) => {
  1691. //区分请求成功和失败的状况
  1692. if (data && data.code == 0) {
  1693. this.dataList3 = data.rows
  1694. } else {
  1695. this.dataList3 = [];
  1696. }
  1697. });
  1698. }else if(this.activeName==='change'){
  1699. searchNotifyLogNew(queryData).then(({data}) => {
  1700. //区分请求成功和失败的状况
  1701. if (data && data.code == 0) {
  1702. this.dataList5 = data.rows
  1703. } else {
  1704. this.dataList5 = [];
  1705. }
  1706. });
  1707. }else if(this.activeName==='close'){
  1708. searchNotifyLogCloseNew(queryData).then(({data}) => {
  1709. //区分请求成功和失败的状况
  1710. if (data && data.code == 0) {
  1711. this.dataList6 = data.rows
  1712. } else {
  1713. this.dataList6 = [];
  1714. }
  1715. });
  1716. }else if(this.activeName==='labelDetail'){ // rqrq - 预定标签清单页签 - rqrq
  1717. searchMaterialListDetail(queryData).then(({data}) => {
  1718. //区分请求成功和失败的状况
  1719. if (data && data.code == 0) {
  1720. this.dataList7 = data.rows
  1721. } else {
  1722. this.dataList7 = [];
  1723. }
  1724. });
  1725. }else {
  1726. searchSumNotifyMaterialListNew(queryData).then(({data}) => {
  1727. //区分请求成功和失败的状况
  1728. if (data && data.code == 0) {
  1729. this.dataList4 = data.rows
  1730. } else {
  1731. this.dataList4 = [];
  1732. }
  1733. });
  1734. }
  1735. },
  1736. searchTable(){
  1737. this.searchData.limit = this.pageSize
  1738. this.searchData.page = this.pageIndex
  1739. searchNotifyHeaderNew(this.searchData).then(({data}) => {
  1740. //区分请求成功和失败的状况
  1741. if (data && data.code == 0) {
  1742. this.dataList = data.page.list
  1743. this.pageIndex = data.page.currPage
  1744. this.pageSize = data.page.pageSize
  1745. this.totalPage = data.page.totalCount
  1746. } else {
  1747. this.dataList = [];
  1748. }
  1749. });
  1750. },
  1751. closeNotifyModel(row){
  1752. this.closeData.site=row.site
  1753. this.closeData.notifyNo=row.notifyNo
  1754. this.closeData.closeRemark=''
  1755. this.closeModalFlag=true
  1756. },
  1757. closeNotify(){
  1758. if(this.closeData.closeRemark==null||this.closeData.closeRemark===''){
  1759. this.$alert("必须输入关闭原因", '错误', {
  1760. confirmButtonText: '确定'
  1761. })
  1762. return false;
  1763. }
  1764. let inData={
  1765. site:this.closeData.site,
  1766. notifyNo:this.closeData.notifyNo,
  1767. closeRemark:this.closeData.closeRemark,
  1768. username:this.$store.state.user.name,
  1769. status:'CLOSED',
  1770. }
  1771. updateNotifyStatusNew(inData).then(({data}) => {
  1772. if (data && data.code === 0) {
  1773. this.closeModalFlag=false
  1774. this.searchTable()
  1775. this.$message({
  1776. message: '操作成功',
  1777. type: 'success',
  1778. duration: 1500,
  1779. onClose: () => {}
  1780. })
  1781. } else {
  1782. this.$alert(data.msg, '错误', {
  1783. confirmButtonText: '确定'
  1784. })
  1785. }
  1786. })
  1787. },
  1788. openNotify(row){
  1789. this.$confirm('确认打开?', '提示', {
  1790. confirmButtonText: '确定',
  1791. cancelButtonText: '取消',
  1792. type: 'warning'
  1793. }).then(() => {
  1794. let inData={
  1795. site:row.site,
  1796. notifyNo:row.notifyNo,
  1797. status:'ISSUE',
  1798. }
  1799. updateNotifyStatusNew(inData).then(({data}) => {
  1800. if (data && data.code === 0) {
  1801. this.searchTable()
  1802. this.$message({
  1803. message: '操作成功',
  1804. type: 'success',
  1805. duration: 1500,
  1806. onClose: () => {}
  1807. })
  1808. } else {
  1809. this.$alert(data.msg, '错误', {
  1810. confirmButtonText: '确定'
  1811. })
  1812. }
  1813. })
  1814. })
  1815. },
  1816. // 预览库存匹配情况
  1817. previewInventory(row) {
  1818. this.currentRow = row // 保存当前行数据
  1819. this.previewDialogVisible = true
  1820. this.previewLoading = true
  1821. this.previewData = []
  1822. let inData = {
  1823. site: row.site,
  1824. notifyNo: row.notifyNo
  1825. }
  1826. checkIssueNotifyInventory(inData).then(({data}) => {
  1827. this.previewLoading = false
  1828. if (data && data.code === 0) {
  1829. this.previewData = data.rows || []
  1830. console.log('库存预览数据:', this.previewData)
  1831. } else {
  1832. this.$alert(data.msg, '错误', {
  1833. confirmButtonText: '确定'
  1834. })
  1835. }
  1836. }).catch(() => {
  1837. this.previewLoading = false
  1838. this.$message.error('获取库存预览失败')
  1839. })
  1840. },
  1841. // 根据订单满足状态设置行样式
  1842. getRowClassName({row}) {
  1843. if (row.orderSatisfactionStatus === 1) {
  1844. return 'success-row' // 绿色:完全立库满足
  1845. } else if (row.orderSatisfactionStatus === 2) {
  1846. return 'warning-row' // 黄色:立库+分切区满足
  1847. } else if (row.orderSatisfactionStatus === 3) {
  1848. return 'danger-row' // 红色:存在不满足
  1849. }
  1850. return ''
  1851. },
  1852. // 从预览对话框推送至WCS
  1853. pushToWCS() {
  1854. // 筛选绿色和黄色的数据(orderSatisfactionStatus = 1 或 2)
  1855. // const validData = this.previewData.filter(item =>
  1856. // item.orderSatisfactionStatus === 1 || item.orderSatisfactionStatus === 2
  1857. // )
  1858. //全部推送 后端判断
  1859. const validData = this.previewData
  1860. if (validData.length === 0) {
  1861. this.$message.warning('没有可推送的数据(只推送绿色和黄色状态的数据)')
  1862. return
  1863. }
  1864. this.$confirm(`确认推送 ${validData.length} 条数据至WCS?`, '提示', {
  1865. confirmButtonText: '确定',
  1866. cancelButtonText: '取消',
  1867. type: 'warning'
  1868. }).then(() => {
  1869. // 显示加载状态 - rqrq
  1870. this.previewLoading = true
  1871. const inData = {
  1872. site: this.currentRow.site,
  1873. notifyNo: this.currentRow.notifyNo,
  1874. inventoryList: validData
  1875. }
  1876. pushInventoryToWcs(inData).then(({data}) => {
  1877. this.previewLoading = false
  1878. if (data && data.code === 0) {
  1879. this.$message({
  1880. message: '推送WCS成功',
  1881. type: 'success',
  1882. duration: 1500
  1883. })
  1884. this.previewDialogVisible = false
  1885. this.searchTable()
  1886. } else {
  1887. this.$alert(data.msg || '推送失败', '错误', {
  1888. confirmButtonText: '确定'
  1889. })
  1890. }
  1891. }).catch((error) => {
  1892. this.previewLoading = false
  1893. this.$message.error(error.message || '推送WCS失败,请重试')
  1894. })
  1895. }).catch(() => {
  1896. // 用户取消操作 - rqrq
  1897. console.log('用户取消推送')
  1898. })
  1899. },
  1900. pushToWcs(row){
  1901. this.$confirm('确认推送到WCS?', '提示', {
  1902. confirmButtonText: '确定',
  1903. cancelButtonText: '取消',
  1904. type: 'warning'
  1905. }).then(() => {
  1906. let inData={
  1907. site: row.site,
  1908. notifyNo: row.notifyNo
  1909. }
  1910. pushNotifyToWcs(inData).then(({data}) => {
  1911. if (data && data.code === 0) {
  1912. this.searchTable()
  1913. this.$message({
  1914. message: '推送WCS成功',
  1915. type: 'success',
  1916. duration: 1500,
  1917. onClose: () => {}
  1918. })
  1919. } else {
  1920. this.$alert(data.msg, '错误', {
  1921. confirmButtonText: '确定'
  1922. })
  1923. }
  1924. })
  1925. })
  1926. },
  1927. /**
  1928. * @Description 取消下达处理方法 - rqrq
  1929. * @param row 当前行数据
  1930. */
  1931. cancelIssueNotifyHandle(row) {
  1932. // 先判断发起人是否有未下达的shoporder申请单 - rqrq
  1933. let checkData = {
  1934. site: row.site,
  1935. username: row.username
  1936. }
  1937. checkUserHasUnissueShopOrder(checkData).then(({ data }) => {
  1938. if (data && data.code === 0) {
  1939. // 如果有未下达的申请单 - rqrq
  1940. if (data.row != null) {
  1941. this.$alert('该用户有未下达的申请单,请先处理', '提示', {
  1942. confirmButtonText: '确定'
  1943. })
  1944. return
  1945. }
  1946. // 没有未下达的申请单,执行取消下达 - rqrq
  1947. this.$confirm(`确定取消下达申请单【${row.notifyNo}】吗?`, '提示', {
  1948. confirmButtonText: '确定',
  1949. cancelButtonText: '取消',
  1950. type: 'warning'
  1951. }).then(() => {
  1952. let cancelData = {
  1953. site: row.site,
  1954. notifyNo: row.notifyNo
  1955. }
  1956. cancelIssueNotify(cancelData).then(({ data }) => {
  1957. if (data && data.code === 0) {
  1958. this.$message.success('取消下达成功')
  1959. // 重新加载数据 - rqrq
  1960. this.searchTable()
  1961. } else {
  1962. this.$alert(data.msg, '错误', {
  1963. confirmButtonText: '确定'
  1964. })
  1965. }
  1966. }).catch(() => {
  1967. this.$message.error('取消下达失败')
  1968. })
  1969. }).catch(() => {
  1970. // 用户取消操作 - rqrq
  1971. })
  1972. } else {
  1973. this.$alert(data.msg, '错误', {
  1974. confirmButtonText: '确定'
  1975. })
  1976. }
  1977. }).catch(() => {
  1978. this.$message.error('检查用户申请单失败')
  1979. })
  1980. },
  1981. deleteNotifyMaterial(row){
  1982. this.$confirm('确认删除?', '提示', {
  1983. confirmButtonText: '确定',
  1984. cancelButtonText: '取消',
  1985. type: 'warning'
  1986. }).then(() => {
  1987. deleteNotifyMaterial(row).then(({data}) => {
  1988. if (data && data.code === 0) {
  1989. this.refreshCurrentTabTable()
  1990. this.$message({
  1991. message: '操作成功',
  1992. type: 'success',
  1993. duration: 1500,
  1994. onClose: () => {}
  1995. })
  1996. } else {
  1997. this.$alert(data.msg, '错误', {
  1998. confirmButtonText: '确定'
  1999. })
  2000. }
  2001. })
  2002. })
  2003. },
  2004. deleteNotifySOSPlus(row){
  2005. this.$confirm('确认删除?', '提示', {
  2006. confirmButtonText: '确定',
  2007. cancelButtonText: '取消',
  2008. type: 'warning'
  2009. }).then(() => {
  2010. deleteNotifySOSPlus(row).then(({data}) => {
  2011. if (data && data.code === 0) {
  2012. this.refreshCurrentTabTable()
  2013. this.$message({
  2014. message: '操作成功',
  2015. type: 'success',
  2016. duration: 1500,
  2017. onClose: () => {}
  2018. })
  2019. } else {
  2020. this.$alert(data.msg, '错误', {
  2021. confirmButtonText: '确定'
  2022. })
  2023. }
  2024. })
  2025. })
  2026. },
  2027. // 进入工单物料明细
  2028. enterSOSDetail(row) {
  2029. let rows = {
  2030. site: this.currentRow.site || this.$store.state.user.site,
  2031. notifyNo: this.currentRow.notifyNo,
  2032. orderNo: row.soorderNo || row.orderNo,
  2033. seqNo: row.seqNo || '',
  2034. partNo: row.fgPartNo || row.partNo,
  2035. itemNo: row.itemNo,
  2036. releaseNo: row.releaseNo,
  2037. sequenceNo: row.sequenceNo,
  2038. }
  2039. this.enterSOS(rows)
  2040. },
  2041. // 打开物料明细对话框
  2042. enterSOS(row) {
  2043. this.materialModalFlag = true
  2044. this.sobomList = []
  2045. this.sobomData = {
  2046. orderNo: row.orderNo,
  2047. seqNo: row.seqNo,
  2048. partNo: row.partNo,
  2049. }
  2050. this.bomLoadFlag = true
  2051. let inData = {
  2052. site: this.currentRow.site || this.$store.state.user.site,
  2053. notifyNo: this.currentRow.notifyNo,
  2054. orderNo: row.orderNo,
  2055. releaseNo: row.releaseNo,
  2056. sequenceNo: row.sequenceNo,
  2057. partNo: row.partNo,
  2058. itemNo: row.itemNo,
  2059. }
  2060. getSOSBOMForIssureNew(inData).then(({ data }) => {
  2061. this.bomLoadFlag = false
  2062. if (data.code === 0) {
  2063. this.sobomList = data.rows
  2064. for (let i = 0; i < this.sobomList.length; i++) {
  2065. this.sobomList[i].itemNo = inData.itemNo
  2066. }
  2067. } else {
  2068. this.$alert(data.msg, '错误', {
  2069. confirmButtonText: '确定'
  2070. })
  2071. }
  2072. }).catch(() => {
  2073. this.bomLoadFlag = false
  2074. this.$message.error('获取物料明细失败')
  2075. })
  2076. },
  2077. // 全数领料
  2078. qtyAllForBom(row) {
  2079. row.qtyToIssue = row.qtyRequired
  2080. },
  2081. // 保存物料明细
  2082. saveMaterialDetail() {
  2083. for (let i = 0; i < this.sobomList.length; i++) {
  2084. if (
  2085. this.sobomList[i].qtyToIssue === '' ||
  2086. this.sobomList[i].qtyToIssue == null
  2087. ) {
  2088. this.sobomList[i].qtyToIssue = 0
  2089. }
  2090. this.sobomList[i].notifyNo = this.currentRow.notifyNo
  2091. this.sobomList[i].site = this.currentRow.site || this.$store.state.user.site
  2092. }
  2093. let materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
  2094. if (materialList.length == 0) {
  2095. this.$alert('没有需要保存的内容!', '提示', {
  2096. confirmButtonText: '确定',
  2097. })
  2098. return false
  2099. }
  2100. saveMaterialDetail(materialList).then(({ data }) => {
  2101. if (data.code === 0) {
  2102. this.materialModalFlag = false
  2103. this.refreshCurrentTabTable()
  2104. this.$message.success('操作成功')
  2105. } else {
  2106. this.$alert(data.msg, '错误', {
  2107. confirmButtonText: '确定',
  2108. })
  2109. }
  2110. })
  2111. },
  2112. // 处理材料明细行双击事件
  2113. handleMaterialRowDblClick(row) {
  2114. if(!'未推送'.includes(this.currentRow.pushWcsFlag)){
  2115. this.$message.warning('只有未推送状态的申请单才能编辑材料明细')
  2116. return;
  2117. }
  2118. // 保存完整的行数据,以便后续保存时包含所有必要字段
  2119. this.editMaterialData = JSON.parse(JSON.stringify(row))
  2120. // 确保包含必要的字段
  2121. this.editMaterialData.site = this.currentRow.site || this.$store.state.user.site
  2122. this.editMaterialData.notifyNo = this.currentRow.notifyNo || ''
  2123. // 确保申请数量有默认值
  2124. if (this.editMaterialData.qtyToIssue === null || this.editMaterialData.qtyToIssue === undefined) {
  2125. this.editMaterialData.qtyToIssue = 0
  2126. }
  2127. this.editMaterialModalFlag = true
  2128. },
  2129. // 保存编辑的材料明细
  2130. saveEditMaterialDetail() {
  2131. if (this.editMaterialData.qtyToIssue === null || this.editMaterialData.qtyToIssue === '') {
  2132. this.$alert('申请数量不能为空!', '提示', {
  2133. confirmButtonText: '确定',
  2134. })
  2135. return false
  2136. }
  2137. if (this.editMaterialData.qtyToIssue < 0) {
  2138. this.$alert('申请数量不能小于0!', '提示', {
  2139. confirmButtonText: '确定',
  2140. })
  2141. return false
  2142. }
  2143. // 使用完整的行数据,只更新申请数量
  2144. let materialData = {
  2145. ...this.editMaterialData,
  2146. }
  2147. // 确保申请数量不为空
  2148. if (materialData.qtyToIssue === '' || materialData.qtyToIssue == null) {
  2149. materialData.qtyToIssue = 0
  2150. }
  2151. updateMaterialDetail(materialData).then(({ data }) => {
  2152. if (data.code === 0) {
  2153. this.editMaterialModalFlag = false
  2154. this.refreshCurrentTabTable()
  2155. this.$message.success('保存成功')
  2156. } else {
  2157. this.$alert(data.msg, '错误', {
  2158. confirmButtonText: '确定',
  2159. })
  2160. }
  2161. }).catch(() => {
  2162. this.$message.error('保存失败')
  2163. })
  2164. },
  2165. //导出excel - rqrq
  2166. async createExportData() {
  2167. const queryParams = {
  2168. ...this.searchData,
  2169. limit: 999999, // 设置一个很大的数字来获取全部数据 - rqrq
  2170. page: 1
  2171. }
  2172. const {data} = await searchNotifyHeaderNew(queryParams)
  2173. if (data && data.code === 0) {
  2174. return data.page.list || []
  2175. }
  2176. return []
  2177. },
  2178. startDownload() {
  2179. // this.exportData = this.dataList
  2180. },
  2181. finishDownload() {
  2182. },
  2183. fields() {
  2184. let json = "{"
  2185. this.columnList1.forEach((item, index) => {
  2186. if (index == this.columnList1.length - 1) {
  2187. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  2188. } else {
  2189. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  2190. }
  2191. })
  2192. json += "}"
  2193. let s = eval("(" + json + ")")
  2194. return s
  2195. },
  2196. tableRowClassName ({row, rowIndex}) {
  2197. if (row.qtyToIssueOriginal<row.qtyToIssue&&new Date(row.needDate)<new Date(this.dayjs().format("YYYY-MM-DD HH:mm"))) {
  2198. return 'error-row'
  2199. }
  2200. return ''
  2201. },
  2202. /**
  2203. * 统一构建海安查询入参,强制使用登录用户site避免跨站点串单 - rqrq
  2204. */
  2205. haiAnBuildQueryData (row) {
  2206. const baseRow = row || {}
  2207. return {
  2208. ...baseRow,
  2209. site: this.$store.state.user.site,
  2210. orderType: 'shoporder'
  2211. }
  2212. },
  2213. /**
  2214. * 海安标签页签补充追踪列,领料栈板固定放最后一列便于对账 - rqrq
  2215. */
  2216. haiAnEnsureLabelColumns () {
  2217. if (!Array.isArray(this.columnList6)) {
  2218. return
  2219. }
  2220. const appendColumn = (columnProp, columnLabel, columnWidth = 100, align = 'left') => {
  2221. if (this.columnList6.some(col => col.columnProp === columnProp)) {
  2222. return
  2223. }
  2224. this.columnList6.push({
  2225. userId: this.$store.state.user.name,
  2226. functionId: 701002,
  2227. serialNumber: `701002Table6${columnProp}`,
  2228. tableId: '701002Table6',
  2229. tableName: '海安预定标签清单表',
  2230. columnProp,
  2231. headerAlign: 'center',
  2232. align,
  2233. columnLabel,
  2234. columnHidden: false,
  2235. columnImage: false,
  2236. columnSortable: false,
  2237. sortLv: 0,
  2238. status: true,
  2239. fixed: '',
  2240. columnWidth
  2241. })
  2242. }
  2243. appendColumn('taskSeq', '立库任务序号', 110, 'right')
  2244. appendColumn('subSite', '工厂编号', 110, 'left')
  2245. appendColumn('allocSeq', '分配序号', 100, 'right')
  2246. // 领料栈板必须在预定标签表最后一格,已存在则改标题并挪到末尾 - rqrq
  2247. const palletIndex = this.columnList6.findIndex(col => col.columnProp === 'palletId')
  2248. let palletColumn = null
  2249. if (palletIndex >= 0) {
  2250. palletColumn = this.columnList6.splice(palletIndex, 1)[0]
  2251. palletColumn.columnLabel = '领料栈板'
  2252. palletColumn.columnWidth = 120
  2253. palletColumn.align = 'left'
  2254. } else {
  2255. palletColumn = {
  2256. userId: this.$store.state.user.name,
  2257. functionId: 701002,
  2258. serialNumber: '701002Table6palletId',
  2259. tableId: '701002Table6',
  2260. tableName: '海安预定标签清单表',
  2261. columnProp: 'palletId',
  2262. headerAlign: 'center',
  2263. align: 'left',
  2264. columnLabel: '领料栈板',
  2265. columnHidden: false,
  2266. columnImage: false,
  2267. columnSortable: false,
  2268. sortLv: 0,
  2269. status: true,
  2270. fixed: '',
  2271. columnWidth: 120
  2272. }
  2273. }
  2274. this.columnList6.push(palletColumn)
  2275. },
  2276. /**
  2277. * 海安页签刷新逻辑,四个页签均改为海安接口并保留原交互语义 - rqrq
  2278. */
  2279. refreshCurrentTabTable () {
  2280. if (this.currentRow === '' || this.currentRow === null) {
  2281. this.currentRow = { site: this.$store.state.user.site, notifyNo: '', orderType: 'shoporder' }
  2282. }
  2283. const queryData = this.haiAnBuildQueryData(this.currentRow)
  2284. if (this.activeName === 'detail') {
  2285. haiAnSearchNotifyOrderListNew(queryData).then(({ data }) => {
  2286. this.dataList2 = data && data.code === 0 ? (data.rows || []) : []
  2287. })
  2288. } else if (this.activeName === 'sub') {
  2289. // 材料明细指定权限要看本行订单是否已推送,订单行和材料行一起取 - rqrq
  2290. this.loadMaterialListWithOrderPushFlag(queryData)
  2291. } else if (this.activeName === 'change') {
  2292. haiAnSearchNotifyLogNew(queryData).then(({ data }) => {
  2293. this.dataList5 = data && data.code === 0 ? (data.rows || []) : []
  2294. })
  2295. } else if (this.activeName === 'close') {
  2296. haiAnSearchNotifyLogCloseNew(queryData).then(({ data }) => {
  2297. this.dataList6 = data && data.code === 0 ? (data.rows || []) : []
  2298. })
  2299. } else if (this.activeName === 'allocDetail') {
  2300. this.searchNoOrderMaterialAllocListByNotifyNo()
  2301. } else if (this.activeName === 'labelDetail') {
  2302. haiAnSearchMaterialListDetail(queryData).then(({ data }) => {
  2303. this.dataList7 = data && data.code === 0 ? (data.rows || []) : []
  2304. })
  2305. } else {
  2306. haiAnSearchSumNotifyMaterialListNew(queryData).then(({ data }) => {
  2307. this.dataList4 = data && data.code === 0 ? (data.rows || []) : []
  2308. })
  2309. }
  2310. },
  2311. /**
  2312. * 海安主表查询改为海安接口,固定传登录站点并保留分页语义 - rqrq
  2313. */
  2314. searchTable () {
  2315. this.searchData.limit = this.pageSize
  2316. this.searchData.page = this.pageIndex
  2317. this.searchData.site = this.$store.state.user.site
  2318. this.searchData.orderType = 'shoporder'
  2319. haiAnSearchNotifyHeaderNew(this.searchData).then(({ data }) => {
  2320. if (data && data.code === 0) {
  2321. this.dataList = data.page.list
  2322. this.pageIndex = data.page.currPage
  2323. this.pageSize = data.page.pageSize
  2324. this.totalPage = data.page.totalCount
  2325. return
  2326. }
  2327. this.dataList = []
  2328. })
  2329. },
  2330. /**
  2331. * 海安关闭申请单,保持旧页面的必填关闭原因校验与提示语义 - rqrq
  2332. */
  2333. closeNotify () {
  2334. if (this.closeData.closeRemark == null || this.closeData.closeRemark === '') {
  2335. this.$alert('必须输入关闭原因', '错误', {
  2336. confirmButtonText: '确定'
  2337. })
  2338. return false
  2339. }
  2340. const inData = {
  2341. site: this.$store.state.user.site,
  2342. notifyNo: this.closeData.notifyNo,
  2343. closeRemark: this.closeData.closeRemark,
  2344. username: this.$store.state.user.name,
  2345. status: 'CLOSED'
  2346. }
  2347. haiAnUpdateNotifyStatusNew(inData).then(({ data }) => {
  2348. if (data && data.code === 0) {
  2349. this.closeModalFlag = false
  2350. this.searchTable()
  2351. this.$message({
  2352. message: '操作成功',
  2353. type: 'success',
  2354. duration: 1500
  2355. })
  2356. return
  2357. }
  2358. this.$alert(data.msg, '错误', {
  2359. confirmButtonText: '确定'
  2360. })
  2361. })
  2362. },
  2363. /**
  2364. * 海安开启申请单,状态回写改走海安接口并保持原确认交互 - rqrq
  2365. */
  2366. openNotify (row) {
  2367. this.$confirm('确认打开?', '提示', {
  2368. confirmButtonText: '确定',
  2369. cancelButtonText: '取消',
  2370. type: 'warning'
  2371. }).then(() => {
  2372. const inData = {
  2373. site: this.$store.state.user.site,
  2374. notifyNo: row.notifyNo,
  2375. status: 'ISSUE'
  2376. }
  2377. haiAnUpdateNotifyStatusNew(inData).then(({ data }) => {
  2378. if (data && data.code === 0) {
  2379. this.searchTable()
  2380. this.$message({
  2381. message: '操作成功',
  2382. type: 'success',
  2383. duration: 1500
  2384. })
  2385. return
  2386. }
  2387. this.$alert(data.msg, '错误', {
  2388. confirmButtonText: '确定'
  2389. })
  2390. })
  2391. })
  2392. },
  2393. /**
  2394. * 海安查看页WCS预览:服务端重新执行匹配,前端只展示物料汇总和指定明细 - rqrq
  2395. * @param row 当前申请单主表行 - rqrq
  2396. */
  2397. previewInventory (row) {
  2398. if (!row || !row.notifyNo) {
  2399. this.$alert('请选择有效的海安申请单', '提示', {confirmButtonText: '确定'})
  2400. return
  2401. }
  2402. this.currentRow = row
  2403. this.currentNotifyRow = JSON.parse(JSON.stringify(row))
  2404. this.currentProductionArea = row.productionArea || ''
  2405. // 打开推送预览时按单据site再拉一次区域,避免名称映射为空回退成A10编码 - rqrq
  2406. this.loadHaianAreaOptions(row.site || this.$store.state.user.site)
  2407. this.previewData = []
  2408. this.previewSummary = {
  2409. totalOrderCount: 0,
  2410. completeOrderCount: 0,
  2411. pushableOrderCount: 0,
  2412. pushableOrderNos: [],
  2413. completeOrderNos: []
  2414. }
  2415. this.previewDialogVisible = true
  2416. this.previewLoading = true
  2417. const queryData = {
  2418. site: row.site || this.$store.state.user.site,
  2419. notifyNo: row.notifyNo
  2420. }
  2421. haiAnCheckIssueNotifyInventory(queryData)
  2422. .then(({data}) => {
  2423. if (data && data.code === 0) {
  2424. this.previewData = data.rows || []
  2425. if (!this.currentProductionArea && this.previewData.length) {
  2426. const firstAreaRow = this.previewData.find(item => item.productionArea)
  2427. this.currentProductionArea = firstAreaRow ? firstAreaRow.productionArea : ''
  2428. }
  2429. this.previewSummary = {
  2430. totalOrderCount: data.totalOrderCount || 0,
  2431. completeOrderCount: data.completeOrderCount || 0,
  2432. pushableOrderCount: data.pushableOrderCount || 0,
  2433. pushableOrderNos: data.pushableOrderNos || [],
  2434. completeOrderNos: data.completeOrderNos || []
  2435. }
  2436. if (data.placeholder) {
  2437. this.$alert(data.msg || '该海安页面暂不执行真实库存匹配', '提示', {confirmButtonText: '确定'})
  2438. } else if (!this.previewData.length || !this.previewSummary.totalOrderCount) {
  2439. this.$alert('服务端未返回有效匹配结果,本次不能推送', '提示', {confirmButtonText: '确定'})
  2440. }
  2441. } else {
  2442. this.previewData = []
  2443. this.$alert((data && data.msg) || '库存匹配失败', '错误', {confirmButtonText: '确定'})
  2444. }
  2445. })
  2446. .catch((error) => {
  2447. this.previewData = []
  2448. this.$message.error((error && error.message) || '库存匹配请求失败')
  2449. })
  2450. .finally(() => {
  2451. this.previewLoading = false
  2452. })
  2453. },
  2454. /**
  2455. * 关闭预览时清理上次匹配结果,避免不同申请单之间误用摘要 - rqrq
  2456. */
  2457. closePreviewDialog (force) {
  2458. if (!force && (this.previewLoading || this.pushLoading)) {
  2459. return
  2460. }
  2461. this.previewDialogVisible = false
  2462. this.previewData = []
  2463. this.previewSummary = {
  2464. totalOrderCount: 0,
  2465. completeOrderCount: 0,
  2466. pushableOrderCount: 0,
  2467. pushableOrderNos: [],
  2468. completeOrderNos: []
  2469. }
  2470. },
  2471. /**
  2472. * 目的地只展示haian_area名称,没有名称时回退编码,避免页面露出A10这类编码 - rqrq
  2473. */
  2474. getAreaDisplayText(areaId) {
  2475. if (!areaId) return '未设置'
  2476. const code = String(areaId).trim()
  2477. const area = (this.areaOptions || []).find(item => String(item.areaId || '').trim() === code)
  2478. if (area && area.areaDesc) {
  2479. return area.areaDesc
  2480. }
  2481. return code
  2482. },
  2483. /**
  2484. * 按工厂加载haian_area,下拉和推送目的地展示共用;提交值仍是areaId - rqrq
  2485. */
  2486. loadHaianAreaOptions(site) {
  2487. const querySite = site || this.$store.state.user.site
  2488. if (!querySite) {
  2489. this.areaOptions = []
  2490. return
  2491. }
  2492. haiAnGetAreaList({ site: querySite }).then(({ data }) => {
  2493. if (data && data.code === 0) {
  2494. this.areaOptions = data.rows || []
  2495. return
  2496. }
  2497. this.areaOptions = []
  2498. }).catch(() => {
  2499. this.areaOptions = []
  2500. })
  2501. },
  2502. /**
  2503. * 根据物料或指定明细自身的匹配结果设置颜色,失败统一标红 - rqrq
  2504. */
  2505. getRowClassName ({row}) {
  2506. const classNames = []
  2507. if (row && row.displayRowType === 'SPECIFIED') classNames.push('specified-preview-row')
  2508. if (row && row.matchStatus === 'FAILED') classNames.push('danger-row')
  2509. if (row && row.matchStatus === 'MATCHED') classNames.push('success-row')
  2510. return classNames.join(' ')
  2511. },
  2512. /**
  2513. * 数量展示去除无意义尾零,空值统一显示0 - rqrq
  2514. */
  2515. formatPreviewQty (value) {
  2516. if (value === null || value === undefined || value === '') return '0'
  2517. return String(value).replace(/(\.\d*?[1-9])0+$|\.0+$/, '$1')
  2518. },
  2519. /**
  2520. * 不可推送原因包含后端拼接的数量文本,展示时去除小数尾部无效0,避免现场误读缺料数量 - rqrq
  2521. */
  2522. formatFailureMessage (message, fallback) {
  2523. const text = message || fallback || ''
  2524. return String(text).replace(/(-?\d+\.\d*?[1-9])0+(?!\d)/g, '$1').replace(/(-?\d+)\.0+(?!\d)/g, '$1')
  2525. },
  2526. /**
  2527. * 海安查看页确认推送:只提交site和notifyNo,实际订单和标签由服务端重新匹配决定 - rqrq
  2528. */
  2529. pushToWCS () {
  2530. if (!this.canPushPreview || !this.currentNotifyRow) {
  2531. this.$message.warning('当前没有可推送的完整订单')
  2532. return
  2533. }
  2534. const orderNos = this.previewSummary.pushableOrderNos || []
  2535. const total = this.previewSummary.totalOrderCount || 0
  2536. const message = `共有${total}个订单,其中${orderNos.length}个订单完全匹配,本次只推送单据${orderNos.join('、')}`
  2537. this.$confirm(message, '确认推送', {
  2538. confirmButtonText: '确定推送',
  2539. cancelButtonText: '取消',
  2540. type: 'warning'
  2541. }).then(() => {
  2542. this.pushLoading = true
  2543. haiAnPushInventoryToWcs({
  2544. site: this.currentNotifyRow.site || this.$store.state.user.site,
  2545. notifyNo: this.currentNotifyRow.notifyNo
  2546. }).then(({data}) => {
  2547. if (data && data.code === 0) {
  2548. this.closePreviewDialog(true)
  2549. // WCS按订单部分成功也返回code=0;弹框保留全部失败及跳过原因,等待人工确认。- rqrq
  2550. showHaianWcsPushResult(this, data)
  2551. this.searchTable()
  2552. this.refreshCurrentTabTable()
  2553. } else {
  2554. this.$alert((data && data.msg) || '推送WCS失败', '错误', {confirmButtonText: '确定'})
  2555. }
  2556. }).catch((error) => {
  2557. this.$message.error((error && error.message) || '推送WCS请求失败')
  2558. }).finally(() => {
  2559. this.pushLoading = false
  2560. })
  2561. }).catch(() => {})
  2562. },
  2563. /**
  2564. * 兼容旧按钮入口,与新确认推送方法保持同一幂等防护 - rqrq
  2565. */
  2566. pushToWcs () {
  2567. return this.pushToWCS()
  2568. },
  2569. /**
  2570. * 查询当前申请单指定物料清单:按site+notifyNo拉取全部指定行,不含备注 - rqrq
  2571. */
  2572. searchNoOrderMaterialAllocListByNotifyNo() {
  2573. if (!this.currentRow || !this.currentRow.notifyNo) {
  2574. this.allocDetailList = []
  2575. return
  2576. }
  2577. this.allocDetailLoading = true
  2578. getNoOrderMaterialAllocListByNotifyNo({
  2579. site: this.currentRow.site || this.$store.state.user.site,
  2580. notifyNo: this.currentRow.notifyNo,
  2581. page: 1,
  2582. limit: 20
  2583. }).then(({ data }) => {
  2584. if (data && data.code === 0) {
  2585. this.allocDetailList = data.rows || []
  2586. } else {
  2587. this.allocDetailList = []
  2588. if (data && data.msg) {
  2589. this.$alert(data.msg, '提示', { confirmButtonText: '确定' })
  2590. }
  2591. }
  2592. }).catch((error) => {
  2593. this.allocDetailList = []
  2594. this.$message.error(error.message || '查询指定物料清单失败')
  2595. }).finally(() => {
  2596. this.allocDetailLoading = false
  2597. })
  2598. },
  2599. /**
  2600. * 材料明细和订单行一起查询。按订单序号把本行是否已推送WCS写回材料行,已推送的行不能指定物料。- rqrq
  2601. * @param queryData 当前申请单查询条件,必须带登录site和申请单号
  2602. */
  2603. loadMaterialListWithOrderPushFlag (queryData) {
  2604. const materialRequest = haiAnSearchNotifyMaterialListNew(queryData).then(({ data }) => {
  2605. return data && data.code === 0 ? (data.rows || []) : []
  2606. }).catch(() => [])
  2607. const orderRequest = haiAnSearchNotifyOrderListNew(queryData).then(({ data }) => {
  2608. return data && data.code === 0 ? (data.rows || []) : []
  2609. }).catch(() => [])
  2610. Promise.all([materialRequest, orderRequest]).then(([materialRows, orderRows]) => {
  2611. const pushFlagByItemNo = {}
  2612. orderRows.forEach(orderRow => {
  2613. pushFlagByItemNo[this.normalizeNotifyItemNo(orderRow.itemNo)] = orderRow.pushWmsFlag
  2614. })
  2615. materialRows.forEach(materialRow => {
  2616. const orderPushFlag = pushFlagByItemNo[this.normalizeNotifyItemNo(materialRow.itemNo)]
  2617. if (orderPushFlag) {
  2618. materialRow.pushWmsFlag = orderPushFlag
  2619. }
  2620. })
  2621. this.dataList2 = orderRows
  2622. this.dataList3 = materialRows
  2623. })
  2624. },
  2625. /**
  2626. * 订单序号统一成可比较文本,避免 1 和 1.0 对不上导致已推送行仍能指定。- rqrq
  2627. */
  2628. normalizeNotifyItemNo (value) {
  2629. if (value === null || value === undefined || value === '') {
  2630. return ''
  2631. }
  2632. const text = String(value).trim()
  2633. if (text === '') {
  2634. return ''
  2635. }
  2636. const numberValue = Number(text)
  2637. return Number.isNaN(numberValue) ? text : String(numberValue)
  2638. },
  2639. /**
  2640. * 取材料行所属订单的推送标记。同一申请单下按订单序号匹配申请单明细,匹配不到再用材料行自带标记。- rqrq
  2641. */
  2642. resolveMaterialOrderPushFlag (row) {
  2643. if (!row) {
  2644. return ''
  2645. }
  2646. const itemKey = this.normalizeNotifyItemNo(row.itemNo)
  2647. const orderRow = (this.dataList2 || []).find(item => this.normalizeNotifyItemNo(item.itemNo) === itemKey)
  2648. if (orderRow && orderRow.pushWmsFlag) {
  2649. return orderRow.pushWmsFlag
  2650. }
  2651. return row.pushWmsFlag || ''
  2652. },
  2653. /**
  2654. * 材料行能否指定物料:申请单已下达,且本行订单未推送WCS。- rqrq
  2655. */
  2656. canSpecifyMaterial (row) {
  2657. return !!(this.currentRow && this.currentRow.status === 'ISSUE' && this.resolveMaterialOrderPushFlag(row) !== 'Y')
  2658. },
  2659. /**
  2660. * 打开指定物料策略弹窗:以订单行itemNo+BOM行号隔离当前物料;未下达不允许指定 - rqrq
  2661. * @param row 材料明细页签中的物料行
  2662. */
  2663. openNoOrderMaterialAllocDialog (row) {
  2664. if (!this.currentRow || this.currentRow.status !== 'ISSUE') {
  2665. this.$alert('未下达申请单不允许指定物料', '提示', { confirmButtonText: '确定' })
  2666. return
  2667. }
  2668. // 本行订单已推送WCS时拒绝打开指定弹框,避免立库已接单后改分配 - rqrq
  2669. if (this.resolveMaterialOrderPushFlag(row) === 'Y') {
  2670. this.$alert('该订单行已推送WCS,不允许指定物料', '提示', { confirmButtonText: '确定' })
  2671. return
  2672. }
  2673. const parentItemNo = row.itemNo
  2674. const bomItemNo = row.bOMItemNo || row.BOMItemNo || row.bomItemNo || row.bomitemNo
  2675. if (parentItemNo == null || parentItemNo === '') {
  2676. this.$alert('当前材料行缺少订单序号,无法指定物料', '提示', { confirmButtonText: '确定' })
  2677. return
  2678. }
  2679. if (!bomItemNo) {
  2680. this.$alert('当前材料行缺少BOM行号,无法指定物料', '提示', { confirmButtonText: '确定' })
  2681. return
  2682. }
  2683. this.noOrderAllocForm = {
  2684. site: this.$store.state.user.site,
  2685. notifyNo: this.currentRow.notifyNo,
  2686. itemNo: parentItemNo,
  2687. bOMItemNo: bomItemNo,
  2688. partNo: row.partNo || row.componentPartNo || '',
  2689. partDesc: row.partDesc || row.componentPartDesc || '',
  2690. subSite: row.subSite || (this.currentRow && this.currentRow.subSite) || this.$store.state.user.site,
  2691. qtyToIssue: row.qtyToIssue == null || row.qtyToIssue === '' ? 0 : row.qtyToIssue,
  2692. allocList: []
  2693. }
  2694. this.noOrderAllocDialogVisible = true
  2695. this.noOrderAllocLoading = true
  2696. getNoOrderMaterialAllocList(this.noOrderAllocForm).then(({ data }) => {
  2697. if (data && data.code === 0) {
  2698. this.noOrderAllocForm.allocList = (data.rows || []).map((item, index) => ({
  2699. ...item,
  2700. rowNo: index + 1
  2701. }))
  2702. } else {
  2703. this.noOrderAllocForm.allocList = []
  2704. if (data && data.msg) {
  2705. this.$alert(data.msg, '提示', { confirmButtonText: '确定' })
  2706. }
  2707. }
  2708. }).catch((error) => {
  2709. this.$message.error(error.message || '查询指定策略失败')
  2710. this.noOrderAllocForm.allocList = []
  2711. }).finally(() => {
  2712. this.noOrderAllocLoading = false
  2713. })
  2714. },
  2715. /** 新增一条指定策略行:LABEL走标签指定,BATCH走批次指定 - rqrq */
  2716. addNoOrderAllocRow (allocType) {
  2717. this.noOrderAllocForm.allocList.push({
  2718. allocType,
  2719. serialNo: '',
  2720. batchNo: '',
  2721. allocQty: '',
  2722. subSite: this.noOrderAllocForm.subSite,
  2723. allocStatus: 'NEW',
  2724. remark: ''
  2725. })
  2726. this.refreshNoOrderAllocRowNo()
  2727. },
  2728. /**
  2729. * 选择标签/批次弹窗数量去尾零,空值按 0 展示,不改原始数据,排序仍按数字 qty - rqrq
  2730. */
  2731. formatNoOrderPickQty (row, column, cellValue) {
  2732. if (cellValue === null || cellValue === undefined || cellValue === '') {
  2733. return 0
  2734. }
  2735. const num = Number(cellValue)
  2736. if (isNaN(num)) {
  2737. return cellValue
  2738. }
  2739. return parseFloat(String(num))
  2740. },
  2741. openNoOrderAvailableLabelDialog (index, pickMode) {
  2742. if (!this.noOrderAllocForm.subSite) {
  2743. this.$alert('缺少子站点,无法查询在库标签', '提示', { confirmButtonText: '确定' })
  2744. return
  2745. }
  2746. if (!this.noOrderAllocForm.partNo) {
  2747. this.$alert('缺少物料号,无法查询在库标签', '提示', { confirmButtonText: '确定' })
  2748. return
  2749. }
  2750. this.noOrderLabelPickIndex = index
  2751. this.noOrderLabelPickMode = pickMode
  2752. this.noOrderLabelPickList = []
  2753. this.noOrderLabelPickDialogVisible = true
  2754. this.noOrderLabelPickLoading = true
  2755. getNoOrderAvailableInStockLabelList({
  2756. site: this.$store.state.user.site,
  2757. subSite: this.noOrderAllocForm.subSite,
  2758. partNo: this.noOrderAllocForm.partNo,
  2759. page: 1,
  2760. limit: 20
  2761. }).then(({ data }) => {
  2762. if (data && data.code === 0) {
  2763. this.noOrderLabelPickList = data.rows || []
  2764. } else {
  2765. this.noOrderLabelPickList = []
  2766. this.$alert((data && data.msg) || '查询在库可用标签失败', '提示', { confirmButtonText: '确定' })
  2767. }
  2768. }).catch((error) => {
  2769. this.noOrderLabelPickList = []
  2770. this.$message.error(error.message || '查询在库可用标签失败')
  2771. }).finally(() => {
  2772. this.noOrderLabelPickLoading = false
  2773. })
  2774. },
  2775. handleNoOrderAvailableLabelDblClick (row) {
  2776. const target = this.noOrderAllocForm.allocList[this.noOrderLabelPickIndex]
  2777. if (!target) {
  2778. this.$message.warning('未找到待回填的指定行')
  2779. return
  2780. }
  2781. const labelQty = row.qty == null || row.qty === '' ? 0 : row.qty
  2782. if (this.noOrderLabelPickMode === 'LABEL') {
  2783. if (!row.serialNo) {
  2784. this.$alert('所选行缺少标签号,无法指定', '提示', { confirmButtonText: '确定' })
  2785. return
  2786. }
  2787. target.serialNo = row.serialNo
  2788. target.batchNo = ''
  2789. target.allocQty = labelQty
  2790. } else {
  2791. if (!row.batchNo) {
  2792. this.$alert('所选标签缺少批次号,无法指定批次', '提示', { confirmButtonText: '确定' })
  2793. return
  2794. }
  2795. target.serialNo = ''
  2796. target.batchNo = row.batchNo
  2797. target.allocQty = labelQty
  2798. }
  2799. this.noOrderLabelPickDialogVisible = false
  2800. },
  2801. removeNoOrderAllocRow (index) {
  2802. this.noOrderAllocForm.allocList.splice(index, 1)
  2803. this.refreshNoOrderAllocRowNo()
  2804. },
  2805. moveNoOrderAllocRow (index, step) {
  2806. const targetIndex = index + step
  2807. if (targetIndex < 0 || targetIndex >= this.noOrderAllocForm.allocList.length) {
  2808. return
  2809. }
  2810. const rows = this.noOrderAllocForm.allocList
  2811. const current = rows.splice(index, 1)[0]
  2812. rows.splice(targetIndex, 0, current)
  2813. this.refreshNoOrderAllocRowNo()
  2814. },
  2815. refreshNoOrderAllocRowNo () {
  2816. ;(this.noOrderAllocForm.allocList || []).forEach((row, index) => {
  2817. row.rowNo = index + 1
  2818. })
  2819. },
  2820. saveNoOrderMaterialAlloc () {
  2821. if (!this.currentRow || this.currentRow.status !== 'ISSUE') {
  2822. this.$alert('未下达申请单不允许指定物料', '提示', { confirmButtonText: '确定' })
  2823. return
  2824. }
  2825. this.refreshNoOrderAllocRowNo()
  2826. const payload = JSON.parse(JSON.stringify(this.noOrderAllocForm))
  2827. payload.allocList = (payload.allocList || []).map((row) => ({
  2828. ...row,
  2829. allocQty: row.allocQty === '' || row.allocQty == null ? null : Number(row.allocQty)
  2830. }))
  2831. this.noOrderAllocSaving = true
  2832. saveNoOrderMaterialAllocList(payload).then(({ data }) => {
  2833. if (data && data.code === 0) {
  2834. this.$message.success('指定策略保存成功')
  2835. this.noOrderAllocDialogVisible = false
  2836. this.searchNoOrderMaterialAllocListByNotifyNo()
  2837. } else if (data) {
  2838. this.$alert(data.msg || '保存失败', '提示', { confirmButtonText: '确定' })
  2839. }
  2840. }).catch((error) => {
  2841. this.$message.error(error.message || '保存指定策略失败')
  2842. }).finally(() => {
  2843. this.noOrderAllocSaving = false
  2844. })
  2845. },
  2846. /**
  2847. * 海安取消下达流程:先检查未下达冲突,再执行取消并刷新列表 - rqrq
  2848. */
  2849. cancelIssueNotifyHandle (row) {
  2850. const checkData = {
  2851. site: this.$store.state.user.site,
  2852. username: row.username
  2853. }
  2854. haiAnCheckUserHasUnissueShopOrder(checkData).then(({ data }) => {
  2855. if (data && data.code === 0) {
  2856. if (data.row != null) {
  2857. this.$alert('该用户有未下达的申请单,请先处理', '提示', {
  2858. confirmButtonText: '确定'
  2859. })
  2860. return
  2861. }
  2862. this.$confirm(`确定取消下达申请单【${row.notifyNo}】吗?`, '提示', {
  2863. confirmButtonText: '确定',
  2864. cancelButtonText: '取消',
  2865. type: 'warning'
  2866. }).then(() => {
  2867. const cancelData = {
  2868. site: this.$store.state.user.site,
  2869. notifyNo: row.notifyNo
  2870. }
  2871. haiAnCancelIssueNotify(cancelData).then(({ data }) => {
  2872. if (data && data.code === 0) {
  2873. this.$message.success('取消下达成功')
  2874. this.searchTable()
  2875. return
  2876. }
  2877. this.$alert(data.msg, '错误', {
  2878. confirmButtonText: '确定'
  2879. })
  2880. }).catch(() => {
  2881. this.$message.error('取消下达失败')
  2882. })
  2883. })
  2884. return
  2885. }
  2886. this.$alert(data.msg, '错误', {
  2887. confirmButtonText: '确定'
  2888. })
  2889. }).catch(() => {
  2890. this.$message.error('检查用户申请单失败')
  2891. })
  2892. },
  2893. /**
  2894. * 未推送领料单整单删除。确认后把订单、物料、标签明细和指定物料一起删掉 - rqrq
  2895. */
  2896. deleteUnpushedNotify (row) {
  2897. if (this.deleteWholeLoading || !row || !row.notifyNo) {
  2898. return
  2899. }
  2900. this.$confirm(`确定删除领料单【${row.notifyNo}】吗?将同时删除订单、物料和指定物料,删除后不能恢复。`, '提示', {
  2901. confirmButtonText: '确定',
  2902. cancelButtonText: '取消',
  2903. type: 'warning'
  2904. }).then(() => {
  2905. this.deleteWholeLoading = true
  2906. // 只传站点、申请单号和单据类型,删除范围由后端按未推送校验后执行 - rqrq
  2907. haiAnDeleteUnpushedNotify({
  2908. site: this.$store.state.user.site,
  2909. notifyNo: row.notifyNo,
  2910. orderType: this.searchData.orderType
  2911. }).then(({ data }) => {
  2912. if (data && data.code === 0) {
  2913. this.searchTable()
  2914. if (this.currentRow && this.currentRow.notifyNo === row.notifyNo) {
  2915. this.currentRow = { site: this.$store.state.user.site, notifyNo: '', orderType: this.searchData.orderType }
  2916. this.refreshCurrentTabTable()
  2917. }
  2918. this.$message.success('删除成功')
  2919. return
  2920. }
  2921. this.$alert((data && data.msg) || '删除失败', '错误', {
  2922. confirmButtonText: '确定'
  2923. })
  2924. }).catch(() => {
  2925. this.$message.error('删除失败')
  2926. }).finally(() => {
  2927. this.deleteWholeLoading = false
  2928. })
  2929. }).catch(() => {})
  2930. },
  2931. /**
  2932. * 海安删除工单行增强接口,保留未推送状态限制并同步刷新当前页签 - rqrq
  2933. */
  2934. deleteNotifySOSPlus (row) {
  2935. this.$confirm('确认删除?', '提示', {
  2936. confirmButtonText: '确定',
  2937. cancelButtonText: '取消',
  2938. type: 'warning'
  2939. }).then(() => {
  2940. const inData = {
  2941. ...row,
  2942. site: this.$store.state.user.site,
  2943. notifyNo: this.currentRow.notifyNo
  2944. }
  2945. haiAnDeleteNotifySOSPlus(inData).then(({ data }) => {
  2946. if (data && data.code === 0) {
  2947. this.refreshCurrentTabTable()
  2948. this.$message({
  2949. message: '操作成功',
  2950. type: 'success',
  2951. duration: 1500
  2952. })
  2953. return
  2954. }
  2955. this.$alert(data.msg, '错误', {
  2956. confirmButtonText: '确定'
  2957. })
  2958. })
  2959. })
  2960. },
  2961. /**
  2962. * 海安查看页物料弹窗查询,按海安接口回显已保存数量并透传subsite - rqrq
  2963. */
  2964. enterSOS (row) {
  2965. this.materialModalFlag = true
  2966. this.sobomList = []
  2967. this.sobomData = {
  2968. orderNo: row.orderNo,
  2969. seqNo: row.seqNo,
  2970. partNo: row.partNo,
  2971. subSite: row.subSite
  2972. }
  2973. this.bomLoadFlag = true
  2974. const inData = {
  2975. site: this.$store.state.user.site,
  2976. notifyNo: this.currentRow.notifyNo,
  2977. orderNo: row.orderNo,
  2978. releaseNo: row.releaseNo,
  2979. sequenceNo: row.sequenceNo,
  2980. partNo: row.partNo,
  2981. itemNo: row.itemNo
  2982. }
  2983. haiAnGetSOSBOMForIssureNew(inData).then(({ data }) => {
  2984. this.bomLoadFlag = false
  2985. if (data && data.code === 0) {
  2986. this.sobomList = data.rows || []
  2987. for (let i = 0; i < this.sobomList.length; i++) {
  2988. this.sobomList[i].itemNo = inData.itemNo
  2989. this.sobomList[i].subSite = row.subSite
  2990. }
  2991. return
  2992. }
  2993. this.$alert(data.msg, '错误', {
  2994. confirmButtonText: '确定'
  2995. })
  2996. }).catch(() => {
  2997. this.bomLoadFlag = false
  2998. this.$message.error('获取物料明细失败')
  2999. })
  3000. },
  3001. /**
  3002. * 海安保存材料明细走海安先删后存链路,并透传subsite防止跨子站点串单 - rqrq
  3003. */
  3004. saveMaterialDetail () {
  3005. for (let i = 0; i < this.sobomList.length; i++) {
  3006. if (this.sobomList[i].qtyToIssue === '' || this.sobomList[i].qtyToIssue == null) {
  3007. this.sobomList[i].qtyToIssue = 0
  3008. }
  3009. this.sobomList[i].notifyNo = this.currentRow.notifyNo
  3010. this.sobomList[i].site = this.$store.state.user.site
  3011. this.sobomList[i].subSite = this.sobomList[i].subSite || this.sobomData.subSite || this.currentRow.subSite
  3012. }
  3013. const materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
  3014. if (materialList.length === 0) {
  3015. this.$alert('没有需要保存的内容!', '提示', {
  3016. confirmButtonText: '确定'
  3017. })
  3018. return false
  3019. }
  3020. haiAnSaveMaterialDetail(materialList).then(({ data }) => {
  3021. if (data && data.code === 0) {
  3022. this.materialModalFlag = false
  3023. this.refreshCurrentTabTable()
  3024. this.$message.success('操作成功')
  3025. return
  3026. }
  3027. this.$alert(data.msg, '错误', {
  3028. confirmButtonText: '确定'
  3029. })
  3030. })
  3031. },
  3032. /**
  3033. * 海安编辑材料数量,沿用未推送限制并改为海安更新接口 - rqrq
  3034. */
  3035. saveEditMaterialDetail () {
  3036. if (this.editMaterialData.qtyToIssue === null || this.editMaterialData.qtyToIssue === '') {
  3037. this.$alert('申请数量不能为空!', '提示', {
  3038. confirmButtonText: '确定'
  3039. })
  3040. return false
  3041. }
  3042. if (this.editMaterialData.qtyToIssue < 0) {
  3043. this.$alert('申请数量不能小于0!', '提示', {
  3044. confirmButtonText: '确定'
  3045. })
  3046. return false
  3047. }
  3048. const materialData = {
  3049. ...this.editMaterialData,
  3050. site: this.$store.state.user.site,
  3051. notifyNo: this.currentRow.notifyNo
  3052. }
  3053. if (materialData.qtyToIssue === '' || materialData.qtyToIssue == null) {
  3054. materialData.qtyToIssue = 0
  3055. }
  3056. haiAnUpdateMaterialDetail(materialData).then(({ data }) => {
  3057. if (data && data.code === 0) {
  3058. this.editMaterialModalFlag = false
  3059. this.refreshCurrentTabTable()
  3060. this.$message.success('保存成功')
  3061. return
  3062. }
  3063. this.$alert(data.msg, '错误', {
  3064. confirmButtonText: '确定'
  3065. })
  3066. }).catch(() => {
  3067. this.$message.error('保存失败')
  3068. })
  3069. },
  3070. /**
  3071. * 海安导出数据改为海安主查询接口,确保导出内容来自海安表链路 - rqrq
  3072. */
  3073. async createExportData () {
  3074. const queryParams = {
  3075. ...this.searchData,
  3076. site: this.$store.state.user.site,
  3077. orderType: 'shoporder',
  3078. limit: 999999,
  3079. page: 1
  3080. }
  3081. const { data } = await haiAnSearchNotifyHeaderNew(queryParams)
  3082. if (data && data.code === 0) {
  3083. return data.page.list || []
  3084. }
  3085. return []
  3086. }
  3087. },
  3088. }
  3089. </script>
  3090. <style scoped>
  3091. /deep/ .el-form-item--medium .el-form-item__content {
  3092. height: auto;
  3093. }
  3094. .disabled {
  3095. cursor: not-allowed !important;
  3096. color: #C0C4CC !important;
  3097. pointer-events: none;
  3098. }
  3099. .text-right >>> .el-input__inner {
  3100. text-align: right !important;
  3101. }
  3102. .text-right >>> .el-input-number__input {
  3103. text-align: right !important;
  3104. }
  3105. .yzzTable /deep/.el-table .cell {
  3106. line-height: 20px;
  3107. font-size: 12px;
  3108. height: 20px;
  3109. }
  3110. .single-line-multi-select >>> .el-select__tags {
  3111. display: flex;
  3112. flex-wrap: nowrap;
  3113. overflow: hidden;
  3114. white-space: nowrap;
  3115. max-width: 100%;
  3116. }
  3117. .single-line-multi-select >>> .el-tag {
  3118. flex-shrink: 0;
  3119. max-width: 100px;
  3120. overflow: hidden;
  3121. text-overflow: ellipsis;
  3122. white-space: nowrap;
  3123. }
  3124. .single-line-multi-select >>> .el-select__input {
  3125. flex-shrink: 0;
  3126. min-width: 30px;
  3127. }
  3128. /* 库存预览表格行颜色 */
  3129. /deep/ .el-table .success-row {
  3130. background: #f0f9ff !important;
  3131. border-left: 3px solid #67C23A;
  3132. }
  3133. /* rqrq - 匹配条码列自动换行显示 */
  3134. /deep/ .wrap-text-column .cell {
  3135. white-space: normal !important;
  3136. word-break: break-all !important;
  3137. line-height: 1.5 !important;
  3138. }
  3139. /deep/ .el-table .warning-row {
  3140. background: #fdf6ec !important;
  3141. border-left: 3px solid #E6A23C;
  3142. }
  3143. /deep/ .el-table .danger-row {
  3144. background: #fef0f0 !important;
  3145. border-left: 3px solid #F56C6C;
  3146. }
  3147. /deep/ .el-table .success-row:hover > td {
  3148. background-color: #ecf5ff !important;
  3149. }
  3150. /deep/ .el-table .warning-row:hover > td {
  3151. background-color: #faecd8 !important;
  3152. }
  3153. /deep/ .el-table .danger-row:hover > td {
  3154. background-color: #fde2e2 !important;
  3155. }
  3156. /* 指定明细使用缩进和浅色文字形成物料行下展开的视觉关系 - rqrq */
  3157. /deep/ .el-table .specified-preview-row .specified-content {
  3158. display: inline-block;
  3159. padding-left: 18px;
  3160. color: #606266;
  3161. }
  3162. /deep/ .matched-labels {
  3163. white-space: normal;
  3164. word-break: break-all;
  3165. line-height: 1.5;
  3166. }
  3167. </style>