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.

3288 lines
117 KiB

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