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.

2351 lines
77 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <div>
  3. <el-form label-position="top" style="margin-top: -0px">
  4. <el-row :gutter="20">
  5. <el-col :span="20">
  6. <el-button v-if="notifyNo===''" @click="addNotify()" type="primary" class="yzzButtonAn">新建申请单</el-button>
  7. <el-button v-if="notifyNo!=''" type="primary" @click="chooseSOSModal()" class="yzzButtonAn">选择委外单</el-button>
  8. <el-button v-if="notifyNo!=''" type="primary" @click="xiadaNotify()" class="yzzButtonAn">下达申请单</el-button>
  9. <el-button v-if="notifyNo!=''" type="primary" @click="deleteNotify()" class="yzzButtonAn">删除申请单</el-button>
  10. <!-- <el-button v-if="notifyNo!=''" @click="importModel()" type="primary"
  11. style="margin-left: 2px;margin-top: 0px">{{'导入'}}</el-button> -->
  12. </el-col>
  13. </el-row>
  14. <el-row :gutter="10" v-if="notifyNo!=''">
  15. <el-col :span="3">
  16. <el-form-item :label="'工厂编码'">
  17. <el-input v-model="notifyData.site" disabled></el-input>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="3">
  21. <el-form-item :label="'申请单号'">
  22. <el-input v-model="notifyData.notifyNo" disabled style="width: 100%;"></el-input>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="3">
  26. <el-form-item :label="'申请账号'">
  27. <el-input v-model="notifyData.username" disabled></el-input>
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="3">
  31. <el-form-item :label="'申请时间'">
  32. <el-input v-model="notifyData.notifyDate" disabled></el-input>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="3">
  36. <el-form-item :label="'状态'">
  37. <el-select v-model="notifyData.status" style="width: 100%" disabled>
  38. <el-option label="全部" value=""></el-option>
  39. <el-option v-for="item in notifyStatusList" :key="item.listValue" :label="item.listDesc"
  40. :value="item.listValue"></el-option>
  41. </el-select>
  42. </el-form-item>
  43. </el-col>
  44. </el-row>
  45. </el-form>
  46. <el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card"
  47. v-if="notifyNo!=''" @tab-click="tabClick">
  48. <el-tab-pane label="已申请工单" name="sos">
  49. <el-table :height="height" :data="dataList" border style="width: 100%;" @row-click="changeData">
  50. <el-table-column v-for="(item,index) in columnList" :key="index" :sortable="item.columnSortable"
  51. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  52. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  53. :label="item.columnLabel">
  54. <template slot-scope="scope">
  55. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  56. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  57. style="width: 100px; height: 80px" /></span>
  58. </template>
  59. </el-table-column>
  60. <el-table-column fixed="right" header-align="center" align="center" width="100" label="操作">
  61. <template slot-scope="scope">
  62. <a type="text" size="small" @click="enterSOSDetail(scope.row)">物料</a>
  63. <a type="text" size="small" @click="deleteNotifySOS(scope.row)">删除</a>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. </el-tab-pane>
  68. <el-tab-pane label="材料明细" name="sub">
  69. <el-table :data="materialDetailList" :height="height" border :row-class-name="materialDetailTableRowClassName"
  70. v-loading="dataListLoading" style="width: 100%; ">
  71. <el-table-column v-for="(item,index) in materialDetailColumnList" :key="index" :sortable="item.columnSortable"
  72. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  73. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  74. :label="item.columnLabel">
  75. <template slot-scope="scope">
  76. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  77. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  78. style="width: 100px; height: 80px" /></span>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. </el-tab-pane>
  83. </el-tabs>
  84. <el-dialog title="选择委外单物料" :close-on-click-modal="false" v-drag :visible.sync="seqNoModalFlag" width="1200px">
  85. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  86. <el-row :gutter="20">
  87. <el-col :span="4">
  88. <el-form-item :label="'PurchaseOrder No'">
  89. <el-input v-model="seqNoData.orderNo" @keyup.enter.native="searchSOSRouting()"></el-input>
  90. </el-form-item>
  91. </el-col>
  92. <el-col :span="6">
  93. <el-form-item label=" ">
  94. <el-button type="primary" @click="searchSOSRouting()" class="" :loading="seqNoModalLoading">添加</el-button>
  95. <el-button type="danger" @click="deleteSeqNoByOrderNo()" class="">删除</el-button>
  96. </el-form-item>
  97. </el-col>
  98. </el-row>
  99. </el-form>
  100. <el-table :height="400" :data="seqNoList" border style="width: 100%;" class="choose-sos-table">
  101. <el-table-column v-for="(item,index) in columnList2" :key="index" :sortable="item.columnSortable"
  102. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  103. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  104. :label="item.columnLabel">
  105. <template slot-scope="scope">
  106. <div v-if="item.columnProp === 'applyQty'">
  107. <el-input class="applyQtyClass" v-model="scope.row.applyQty" style="height: 11px; width: 98%;"></el-input>
  108. </div>
  109. <span v-else-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  110. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  111. style="width: 100px; height: 80px" /></span>
  112. </template>
  113. </el-table-column>
  114. </el-table>
  115. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  116. <el-button type="primary" @click="saveNewSoIssueNotify" :loading="saveNewLoading">保存</el-button>
  117. <el-button type="primary" @click="seqNoModalFlag = false">关闭</el-button>
  118. </el-footer>
  119. </el-dialog>
  120. <el-dialog title="保存工单" :close-on-click-modal="false" v-drag :visible.sync="saveSeqNoModalFlag" width="750px">
  121. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  122. <el-row :gutter="20">
  123. <el-col :span="6">
  124. <el-form-item :label="'OrderNo'">
  125. <el-input v-model="notifyOrderData.orderNo" disabled></el-input>
  126. </el-form-item>
  127. </el-col>
  128. <el-col :span="6">
  129. <el-form-item :label="'ReleaseNo'">
  130. <el-input v-model="notifyOrderData.releaseNo" disabled></el-input>
  131. </el-form-item>
  132. </el-col>
  133. <el-col :span="6">
  134. <el-form-item :label="'SequenceNo'">
  135. <el-input v-model="notifyOrderData.sequenceNo" disabled></el-input>
  136. </el-form-item>
  137. </el-col>
  138. <el-col :span="6">
  139. <el-form-item :label="'工单数量'">
  140. <el-input v-model="notifyOrderData.qtyRequired" disabled></el-input>
  141. </el-form-item>
  142. </el-col>
  143. </el-row>
  144. <el-row :gutter="20">
  145. <el-col :span="6">
  146. <el-form-item :label="'物料'">
  147. <el-input v-model="notifyOrderData.partNo" disabled></el-input>
  148. </el-form-item>
  149. </el-col>
  150. <el-col :span="18">
  151. <el-form-item :label="'物料名称'">
  152. <el-input v-model="notifyOrderData.partDesc" disabled style="width: 100%"></el-input>
  153. </el-form-item>
  154. </el-col>
  155. </el-row>
  156. <el-row :gutter="20">
  157. <el-col :span="6">
  158. <el-form-item :label="'要求发料时间'">
  159. <el-date-picker style="width: 100%" v-model="notifyOrderData.needDate" type="datetime"
  160. value-format="yyyy-MM-dd HH:mm" placeholder="选择日期">
  161. </el-date-picker>
  162. </el-form-item>
  163. </el-col>
  164. </el-row>
  165. </el-form>
  166. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  167. <el-button type="primary" @click="saveSOS()">保存</el-button>
  168. <el-button type="primary" @click="saveSeqNoModalFlag=false">关闭</el-button>
  169. </el-footer>
  170. </el-dialog>
  171. <el-dialog title="申请明细" :close-on-click-modal="false" v-drag :visible.sync="materialModalFlag" width="900px">
  172. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  173. <el-row :gutter="20">
  174. <el-col :span="6">
  175. <el-form-item :label="'生产订单号'">
  176. <el-input v-model="sobomData.orderNo" disabled></el-input>
  177. </el-form-item>
  178. </el-col>
  179. <el-col :span="6">
  180. <el-form-item :label="'产品编码'">
  181. <el-input v-model="sobomData.partNo" disabled></el-input>
  182. </el-form-item>
  183. </el-col>
  184. </el-row>
  185. </el-form>
  186. <div class="yzzTable">
  187. <el-table :height="400" :data="sobomList" border v-loading="bomLoadFlag" style="width: 100%;">
  188. <el-table-column v-for="(item,index) in columnList3" :key="index" :sortable="item.columnSortable"
  189. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  190. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  191. :label="item.columnLabel">
  192. <template slot-scope="scope">
  193. <div v-if="item.columnProp === 'qtyToIssue'">
  194. <el-input v-model="scope.row.qtyToIssue" type="number" style="height: 11px; width: 98%;" :step="0"
  195. :min="0"></el-input>
  196. </div>
  197. <div v-else-if="item.columnProp === 'remark'">
  198. <el-input v-model="scope.row.remark" style="padding: 0;width: 100%"></el-input>
  199. </div>
  200. <div v-else>
  201. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  202. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  203. style="width: 100px; height: 80px" /></span>
  204. </div>
  205. </template>
  206. </el-table-column>
  207. <el-table-column prop="" header-align="center" align="center" min-width="50" label="操作">
  208. <template slot-scope="scope">
  209. <el-button type="primary" @click="qtyAllForBom(scope.row)" style="width: 100%">全数领料</el-button>
  210. </template>
  211. </el-table-column>
  212. </el-table>
  213. </div>
  214. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  215. <el-button type="primary" @click="saveMaterialDetail()">保存</el-button>
  216. <el-button type="primary" @click="materialModalFlag=false">关闭</el-button>
  217. </el-footer>
  218. </el-dialog>
  219. <el-dialog title="保存物料" :close-on-click-modal="false" v-drag :visible.sync="saveOtherPartModalFlag" width="600px">
  220. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  221. <el-row :gutter="20">
  222. <el-col :span="6">
  223. <el-form-item :label="'物料编码'">
  224. <el-input v-model="otherPartData.componentPartNo" disabled></el-input>
  225. </el-form-item>
  226. </el-col>
  227. <el-col :span="18">
  228. <el-form-item :label="'物料描述'">
  229. <el-input v-model="otherPartData.partDesc" disabled></el-input>
  230. </el-form-item>
  231. </el-col>
  232. </el-row>
  233. <el-row :gutter="20">
  234. <el-col :span="6">
  235. <el-form-item :label="'计量单位'">
  236. <el-input v-model="otherPartData.umid" disabled></el-input>
  237. </el-form-item>
  238. </el-col>
  239. <el-col :span="6">
  240. <el-form-item :label="'需求数量'">
  241. <el-input-number v-model="otherPartData.qtyToIssue" style="padding: 0;width: 100%" :step="0" :min="0"
  242. :controls="false"></el-input-number>
  243. </el-form-item>
  244. </el-col>
  245. </el-row>
  246. <el-row :gutter="20">
  247. <el-col :span="24">
  248. <el-form-item :label="'备注'">
  249. <el-input v-model="otherPartData.remark"></el-input>
  250. </el-form-item>
  251. </el-col>
  252. </el-row>
  253. </el-form>
  254. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  255. <el-button type="primary" @click="saveOtherPart()">保存</el-button>
  256. <el-button type="primary" @click="saveOtherPartModalFlag=false">关闭</el-button>
  257. </el-footer>
  258. </el-dialog>
  259. <el-dialog title="下达申请单" :close-on-click-modal="false" v-drag :visible.sync="showXiadaNotifyDialog" width="400px">
  260. <el-form :inline="true" label-position="top" label-width="500px" style="margin-left: 7px;margin-top: -5px;">
  261. <el-row :gutter="20">
  262. <el-col :span="24">
  263. <el-form-item label="要求发料时间">
  264. <el-date-picker v-model="xiadaNotifyData.planIssueDate" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
  265. format="yyyy-MM-dd HH:mm:ss" placeholder="选择日期时间" style="width: 100%">
  266. </el-date-picker>
  267. </el-form-item>
  268. </el-col>
  269. <el-col :span="24">
  270. <el-form-item label="备注" class="issueNotify">
  271. <el-input type="textarea" v-model="xiadaNotifyData.remark" :rows="3" placeholder="请输入内容"
  272. style="width: 100%"></el-input>
  273. </el-form-item>
  274. </el-col>
  275. </el-row>
  276. </el-form>
  277. <el-footer style="height:30px;text-align:center;">
  278. <el-button type="primary" @click="confirmXiadaNotify()">下达</el-button>
  279. <el-button type="primary" @click="showXiadaNotifyDialog=false">取消</el-button>
  280. </el-footer>
  281. </el-dialog>
  282. <el-dialog title="选择申请类型" :close-on-click-modal="false" v-drag :visible.sync="showAddNotifyTypeDialog"
  283. width="400px">
  284. <el-form :inline="true" label-position="top" label-width="500px" style="margin-left: 7px;margin-top: -5px;">
  285. <el-row :gutter="20">
  286. <el-col :span="24">
  287. <el-form-item label="申请类型">
  288. <el-radio-group v-model="selectedNotifyType">
  289. <el-radio label="production">生产领料单</el-radio>
  290. <el-radio label="outsourced">委外领料单</el-radio>
  291. </el-radio-group>
  292. </el-form-item>
  293. </el-col>
  294. <el-col :span="24">
  295. <el-form-item label="备注" class="issueNotify">
  296. <el-input type="textarea" v-model="selectedNotifyRemark" :rows="3" placeholder="请输入内容"
  297. style="width: 100%"></el-input>
  298. </el-form-item>
  299. </el-col>
  300. </el-row>
  301. </el-form>
  302. <el-footer style="height:30px;text-align:center;">
  303. <el-button type="primary" @click="confirmAddNotify()">确认</el-button>
  304. <el-button type="primary" @click="showAddNotifyTypeDialog=false">取消</el-button>
  305. </el-footer>
  306. </el-dialog>
  307. <el-dialog title="选择PurchaseOrder站点" :close-on-click-modal="false" v-drag :visible.sync="poSiteSelectModalFlag" width="780px">
  308. <div style="margin-bottom: 8px;color:#606266;">同一单号命中多个站点,请选择要添加的PurchaseOrder</div>
  309. <el-table
  310. :data="poSiteSelectList"
  311. border
  312. highlight-current-row
  313. height="320"
  314. style="width: 100%;"
  315. @current-change="handlePoSiteSelectChange">
  316. <el-table-column type="index" width="50" label="#" align="center"></el-table-column>
  317. <el-table-column prop="site" label="Site" min-width="100" align="center" show-overflow-tooltip></el-table-column>
  318. <el-table-column prop="orderNo" label="OrderNo" min-width="120" align="center" show-overflow-tooltip></el-table-column>
  319. <el-table-column prop="supplierNo" label="供应商编号" min-width="110" align="center" show-overflow-tooltip></el-table-column>
  320. <el-table-column prop="supplierName" label="供应商名称" min-width="160" align="left" show-overflow-tooltip></el-table-column>
  321. <el-table-column prop="status" label="状态" min-width="100" align="center" show-overflow-tooltip></el-table-column>
  322. </el-table>
  323. <el-footer style="height:40px;margin-top: 12px;text-align:center">
  324. <el-button type="primary" @click="confirmPoSiteSelect()" :loading="seqNoModalLoading">确认</el-button>
  325. <el-button type="primary" @click="poSiteSelectModalFlag=false">取消</el-button>
  326. </el-footer>
  327. </el-dialog>
  328. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  329. </div>
  330. </template>
  331. <script>
  332. import {
  333. haiAnGetUserNotifyNo,
  334. haiAnCreateNotify,
  335. haiAnGetNotifyNoDetail,
  336. haiAnGetPoOrderAndMaterialByOrderNo,
  337. haiAnGetPoOrderMaterialForIssure,
  338. haiAnSaveSOIssueNotifyOrderList,
  339. haiAnSaveMaterialDetail,
  340. haiAnSaveNewSoIssueNotify,
  341. haiAnDeleteNotifySOS,
  342. haiAnDeleteNotify,
  343. haiAnXiadaNotify,
  344. haiAnSearchNotifyMaterialListNew,
  345. getAllNotifyStatus
  346. } from '@/api/haianWarehouse/poOrderIssueNotify.js'
  347. import Chooselist from '@/views/modules/common/Chooselist_eam'
  348. import { getTableUserListLanguage } from '@/api/table.js'
  349. export default {
  350. name: 'newPoIssueNotify54',
  351. components: {
  352. Chooselist,
  353. },
  354. watch: {},
  355. data() {
  356. return {
  357. activeName: 'sos',
  358. noControlPartModelFlag: false,
  359. buList: [],
  360. partList: [],
  361. partList2: [],
  362. notifyStatusList: [],
  363. notifyNo: '',
  364. notifyData: {
  365. site: '',
  366. bu: '',
  367. notifyNo: '',
  368. notifyDate: '',
  369. enteredDate: '',
  370. userName: '',
  371. userDisplay: '',
  372. remark: '',
  373. planIssueDate: '',
  374. },
  375. dataList2: [],
  376. dataList3: [],
  377. materialDetailList: [],
  378. currentRow: '',
  379. dataListLoading: false,
  380. // 是否收藏
  381. favorite: false,
  382. changeBuFlag: false,
  383. partModelFlag: false,
  384. newBu: '',
  385. // 导出 start
  386. exportData: [],
  387. exportName: '设备分组' + this.dayjs().format('YYYYMMDDHHmmss'),
  388. exportHeader: ['设备分组'],
  389. exportFooter: [],
  390. exportList: [],
  391. // 导出 end
  392. searchData: {
  393. site: this.$store.state.user.site,
  394. userName: this.$store.state.user.name,
  395. groupID: '',
  396. groupDesc: '',
  397. buDesc: '',
  398. active: 'Y',
  399. page: 1,
  400. limit: 10,
  401. },
  402. sobomData: {
  403. orderNo: '',
  404. seqno: '',
  405. partNo: '',
  406. },
  407. //申请单序号
  408. itemNo: '',
  409. notifyOrderData: {
  410. partNo: '',
  411. orderNo: '',
  412. itemNo: '',
  413. releaseNo: '',
  414. sequenceNo: '',
  415. partDesc: '',
  416. qtyrequired: '',
  417. issureQty: '',
  418. needDate: '',
  419. },
  420. seqNoData: {
  421. site: this.$store.state.user.site,
  422. seqno: '',
  423. sResourceID: '',
  424. sWorkcenterno: '',
  425. operatorId: '',
  426. sShiftno: '',
  427. startDate: '',
  428. endDate: '',
  429. },
  430. seqNoList: [],
  431. height: 200,
  432. pageIndex: 1,
  433. pageSize: 20,
  434. totalPage: 0,
  435. dataList: [],
  436. sobomList: [],
  437. dataListSelections: [],
  438. seqNoModalFlag: false,
  439. materialModalFlag: false,
  440. modalDisableFlag: false,
  441. saveSeqNoModalFlag: false,
  442. bomLoadFlag: false,
  443. xiadaList: [],
  444. columnList4: [
  445. {
  446. userId: this.$store.state.user.name,
  447. functionId: 555001,
  448. serialNumber: '555001Table4ComponentPartNo',
  449. tableId: '555001Table4',
  450. tableName: '非BOM材料明细',
  451. columnProp: 'componentPartNo',
  452. headerAlign: 'center',
  453. align: 'center',
  454. columnLabel: '材料编码',
  455. columnHidden: false,
  456. columnImage: false,
  457. columnSortable: false,
  458. sortLv: 0,
  459. status: true,
  460. fixed: false,
  461. columnWidth: 100,
  462. },
  463. {
  464. userId: this.$store.state.user.name,
  465. functionId: 555001,
  466. serialNumber: '555001Table4PartDesc',
  467. tableId: '555001Table4',
  468. tableName: '非BOM材料明细',
  469. columnProp: 'partDesc',
  470. headerAlign: 'center',
  471. align: 'left',
  472. columnLabel: '材料名称',
  473. columnHidden: false,
  474. columnImage: false,
  475. columnSortable: false,
  476. sortLv: 0,
  477. status: true,
  478. fixed: false,
  479. columnWidth: 130,
  480. },
  481. {
  482. userId: this.$store.state.user.name,
  483. functionId: 555001,
  484. serialNumber: '555001Table4QtyToIssue',
  485. tableId: '555001Table4',
  486. tableName: '非BOM材料明细',
  487. columnProp: 'qtyToIssue',
  488. headerAlign: 'center',
  489. align: 'right',
  490. columnLabel: '申请数量',
  491. columnHidden: false,
  492. columnImage: false,
  493. columnSortable: false,
  494. sortLv: 0,
  495. status: true,
  496. fixed: false,
  497. columnWidth: 80,
  498. },
  499. {
  500. userId: this.$store.state.user.name,
  501. functionId: 555001,
  502. serialNumber: '555001Table4Remark',
  503. tableId: '555001Table4',
  504. tableName: '非BOM材料明细',
  505. columnProp: 'remark',
  506. headerAlign: 'center',
  507. align: 'left',
  508. columnLabel: '备注',
  509. columnHidden: false,
  510. columnImage: false,
  511. columnSortable: false,
  512. sortLv: 0,
  513. status: true,
  514. fixed: false,
  515. columnWidth: 200,
  516. },
  517. ],
  518. modalData: {
  519. flag: '',
  520. bu: '',
  521. site: this.$store.state.user.site,
  522. groupID: '',
  523. groupDesc: '',
  524. active: '',
  525. createBy: this.$store.state.user.name,
  526. updateBy: this.$store.state.user.name,
  527. },
  528. // 展示列集
  529. columnList: [
  530. {
  531. userId: this.$store.state.user.name,
  532. functionId: 555001,
  533. serialNumber: '555001Table1ItemNo',
  534. tableId: '555001Table1',
  535. tableName: '领料申请工单子表',
  536. columnProp: 'itemNo',
  537. headerAlign: 'center',
  538. align: 'right',
  539. columnLabel: '序号',
  540. columnHidden: false,
  541. columnImage: false,
  542. columnSortable: false,
  543. sortLv: 0,
  544. status: true,
  545. fixed: false,
  546. columnWidth: 50,
  547. },
  548. {
  549. userId: this.$store.state.user.name,
  550. functionId: 555001,
  551. serialNumber: '555001Table1SubSite',
  552. tableId: '555001Table1',
  553. tableName: '领料申请工单子表',
  554. columnProp: 'subSite',
  555. headerAlign: 'center',
  556. align: 'center',
  557. columnLabel: '工厂编号',
  558. columnHidden: false,
  559. columnImage: false,
  560. columnSortable: false,
  561. sortLv: 0,
  562. status: true,
  563. fixed: false,
  564. columnWidth: 90,
  565. },
  566. {
  567. userId: this.$store.state.user.name,
  568. functionId: 555001,
  569. serialNumber: '555001Table1SOOrderNo',
  570. tableId: '555001Table1',
  571. tableName: '领料申请工单子表',
  572. columnProp: 'soorderNo',
  573. headerAlign: 'center',
  574. align: 'center',
  575. columnLabel: '委外单号',
  576. columnHidden: false,
  577. columnImage: false,
  578. columnSortable: false,
  579. sortLv: 0,
  580. status: true,
  581. fixed: false,
  582. columnWidth: 120,
  583. },
  584. /* {
  585. userId: this.$store.state.user.name,
  586. functionId: 555001,
  587. serialNumber: '555001Table1ReleaseNo',
  588. tableId: '555001Table1',
  589. tableName: '领料申请工单子表',
  590. columnProp: 'releaseNo',
  591. headerAlign: 'center',
  592. align: 'center',
  593. columnLabel: 'ReleaseNo',
  594. columnHidden: false,
  595. columnImage: false,
  596. columnSortable: false,
  597. sortLv: 0,
  598. status: true,
  599. fixed: false,
  600. columnWidth: 80,
  601. },
  602. {
  603. userId: this.$store.state.user.name,
  604. functionId: 555001,
  605. serialNumber: '555001Table1SequenceNo',
  606. tableId: '555001Table1',
  607. tableName: '领料申请工单子表',
  608. columnProp: 'sequenceNo',
  609. headerAlign: 'center',
  610. align: 'center',
  611. columnLabel: 'SequenceNo',
  612. columnHidden: false,
  613. columnImage: false,
  614. columnSortable: false,
  615. sortLv: 0,
  616. status: true,
  617. fixed: false,
  618. columnWidth: 80,
  619. }, */
  620. {
  621. userId: this.$store.state.user.name,
  622. functionId: 555001,
  623. serialNumber: '555001Table1FgPartNo',
  624. tableId: '555001Table1',
  625. tableName: '领料申请工单子表',
  626. columnProp: 'fgPartNo',
  627. headerAlign: 'center',
  628. align: 'center',
  629. columnLabel: '产成品编码',
  630. columnHidden: false,
  631. columnImage: false,
  632. columnSortable: false,
  633. sortLv: 0,
  634. status: true,
  635. fixed: false,
  636. columnWidth: 80,
  637. },
  638. {
  639. userId: this.$store.state.user.name,
  640. functionId: 555001,
  641. serialNumber: '555001Table1NeedDate',
  642. tableId: '555001Table1',
  643. tableName: '领料申请派工单子表',
  644. columnProp: 'needDate',
  645. headerAlign: 'center',
  646. align: 'left',
  647. columnLabel: '要求发料时间',
  648. columnHidden: false,
  649. columnImage: false,
  650. columnSortable: false,
  651. sortLv: 0,
  652. status: true,
  653. fixed: false,
  654. columnWidth: 80,
  655. },
  656. ],
  657. columnList2: [
  658. {
  659. userId: this.$store.state.user.name,
  660. functionId: 555001,
  661. serialNumber: '555001Table2OrderNo',
  662. tableId: '555001Table2',
  663. tableName: '查询工单及物料',
  664. columnProp: 'orderNo',
  665. headerAlign: 'center',
  666. align: 'center',
  667. columnLabel: 'OrderNo',
  668. columnHidden: false,
  669. columnImage: false,
  670. columnSortable: false,
  671. sortLv: 0,
  672. status: true,
  673. fixed: false,
  674. columnWidth: 70,
  675. },
  676. /* {
  677. userId: this.$store.state.user.name,
  678. functionId: 555001,
  679. serialNumber: '555001Table2ReleaseNo',
  680. tableId: '555001Table2',
  681. tableName: '查询工单及物料',
  682. columnProp: 'releaseNo',
  683. headerAlign: 'center',
  684. align: 'center',
  685. columnLabel: 'ReleaseNo',
  686. columnHidden: false,
  687. columnImage: false,
  688. columnSortable: false,
  689. sortLv: 0,
  690. status: true,
  691. fixed: false,
  692. columnWidth: 100,
  693. },
  694. {
  695. userId: this.$store.state.user.name,
  696. functionId: 555001,
  697. serialNumber: '555001Table2SequenceNo',
  698. tableId: '555001Table2',
  699. tableName: '查询工单及物料',
  700. columnProp: 'sequenceNo',
  701. headerAlign: 'center',
  702. align: 'center',
  703. columnLabel: 'SequenceNo',
  704. columnHidden: false,
  705. columnImage: false,
  706. columnSortable: false,
  707. sortLv: 0,
  708. status: true,
  709. fixed: false,
  710. columnWidth: 80,
  711. }, */
  712. {
  713. userId: this.$store.state.user.name,
  714. functionId: 555001,
  715. serialNumber: '555001Table2LineItemNo',
  716. tableId: '555001Table2',
  717. tableName: '查询工单及物料',
  718. columnProp: 'lineItemNo',
  719. headerAlign: 'center',
  720. align: 'right',
  721. columnLabel: '行号',
  722. columnHidden: false,
  723. columnImage: false,
  724. columnSortable: false,
  725. sortLv: 0,
  726. status: true,
  727. fixed: false,
  728. columnWidth: 40,
  729. },
  730. /* {
  731. userId: this.$store.state.user.name,
  732. functionId: 555001,
  733. serialNumber: '555001Table2MaterialLineStatus',
  734. tableId: '555001Table2',
  735. tableName: '查询工单及物料',
  736. columnProp: 'materialLineStatus',
  737. headerAlign: 'center',
  738. align: 'left',
  739. columnLabel: '物料行状态',
  740. columnHidden: false,
  741. columnImage: false,
  742. columnSortable: false,
  743. sortLv: 0,
  744. status: true,
  745. fixed: false,
  746. columnWidth: 100,
  747. }, */
  748. {
  749. userId: this.$store.state.user.name,
  750. functionId: 555001,
  751. serialNumber: '555001Table2ComponentPartNo',
  752. tableId: '555001Table2',
  753. tableName: '查询工单及物料',
  754. columnProp: 'componentPartNo',
  755. headerAlign: 'center',
  756. align: 'left',
  757. columnLabel: '物料号',
  758. columnHidden: false,
  759. columnImage: false,
  760. columnSortable: false,
  761. sortLv: 0,
  762. status: true,
  763. fixed: false,
  764. columnWidth: 120,
  765. },
  766. {
  767. userId: this.$store.state.user.name,
  768. functionId: 555001,
  769. serialNumber: '555001Table2IsInWh',
  770. tableId: '555001Table2',
  771. tableName: '查询工单及物料',
  772. columnProp: 'isInWh',
  773. headerAlign: 'center',
  774. align: 'left',
  775. columnLabel: '在立库',
  776. columnHidden: false,
  777. columnImage: false,
  778. columnSortable: false,
  779. sortLv: 0,
  780. status: true,
  781. fixed: false,
  782. columnWidth: 50,
  783. },
  784. {
  785. userId: this.$store.state.user.name,
  786. functionId: 555001,
  787. serialNumber: '555001Table2ApplyQty',
  788. tableId: '555001Table2',
  789. tableName: '查询工单及物料',
  790. columnProp: 'applyQty',
  791. headerAlign: 'center',
  792. align: 'right',
  793. columnLabel: '本次申请数量',
  794. columnHidden: false,
  795. columnImage: false,
  796. columnSortable: false,
  797. sortLv: 0,
  798. status: true,
  799. fixed: false,
  800. columnWidth: 80,
  801. },
  802. {
  803. userId: this.$store.state.user.name,
  804. functionId: 555001,
  805. serialNumber: '555001Table2QtyIssued',
  806. tableId: '555001Table2',
  807. tableName: '查询工单及物料',
  808. columnProp: 'qtyIssued',
  809. headerAlign: 'center',
  810. align: 'right',
  811. columnLabel: '已发数量',
  812. columnHidden: false,
  813. columnImage: false,
  814. columnSortable: false,
  815. sortLv: 0,
  816. status: true,
  817. fixed: false,
  818. columnWidth: 80,
  819. },
  820. {
  821. userId: this.$store.state.user.name,
  822. functionId: 555001,
  823. serialNumber: '555001Table2QtyRequired',
  824. tableId: '555001Table2',
  825. tableName: '查询工单及物料',
  826. columnProp: 'qtyRequired',
  827. headerAlign: 'center',
  828. align: 'right',
  829. columnLabel: '需求数量',
  830. columnHidden: false,
  831. columnImage: false,
  832. columnSortable: false,
  833. sortLv: 0,
  834. status: true,
  835. fixed: false,
  836. columnWidth: 80,
  837. },
  838. {
  839. userId: this.$store.state.user.name,
  840. functionId: 555001,
  841. serialNumber: '555001Table2QtyReserved',
  842. tableId: '555001Table2',
  843. tableName: '查询工单及物料',
  844. columnProp: 'reservedQty',
  845. headerAlign: 'center',
  846. align: 'right',
  847. columnLabel: '预留数量',
  848. columnHidden: false,
  849. columnImage: false,
  850. columnSortable: false,
  851. sortLv: 0,
  852. status: true,
  853. fixed: false,
  854. columnWidth: 80,
  855. },
  856. {
  857. userId: this.$store.state.user.name,
  858. functionId: 555001,
  859. serialNumber: '555001Table2ComponentPartDesc',
  860. tableId: '555001Table2',
  861. tableName: '查询工单及物料',
  862. columnProp: 'componentPartDescription',
  863. headerAlign: 'center',
  864. align: 'left',
  865. columnLabel: '物料描述',
  866. columnHidden: false,
  867. columnImage: false,
  868. columnSortable: false,
  869. sortLv: 0,
  870. status: true,
  871. fixed: false,
  872. columnWidth: 180,
  873. showOverflowTooltip: true,
  874. },
  875. {
  876. userId: this.$store.state.user.name,
  877. functionId: 555001,
  878. serialNumber: '555001Table2Uom',
  879. tableId: '555001Table2',
  880. tableName: '查询工单及物料',
  881. columnProp: 'uom',
  882. headerAlign: 'center',
  883. align: 'center',
  884. columnLabel: '单位',
  885. columnHidden: false,
  886. columnImage: false,
  887. columnSortable: false,
  888. sortLv: 0,
  889. status: true,
  890. fixed: false,
  891. columnWidth: 80,
  892. },
  893. {
  894. userId: this.$store.state.user.name,
  895. functionId: 555001,
  896. serialNumber: '555001Table2PartNo',
  897. tableId: '555001Table2',
  898. tableName: '查询工单及物料',
  899. columnProp: 'partNo',
  900. headerAlign: 'center',
  901. align: 'center',
  902. columnLabel: '产品编码',
  903. columnHidden: false,
  904. columnImage: false,
  905. columnSortable: false,
  906. sortLv: 0,
  907. status: true,
  908. fixed: false,
  909. columnWidth: 120,
  910. },
  911. {
  912. userId: this.$store.state.user.name,
  913. functionId: 555001,
  914. serialNumber: '555001Table2PartDesc',
  915. tableId: '555001Table2',
  916. tableName: '查询工单及物料',
  917. columnProp: 'description',
  918. headerAlign: 'center',
  919. align: 'left',
  920. columnLabel: '产品名称',
  921. columnHidden: false,
  922. columnImage: false,
  923. columnSortable: false,
  924. sortLv: 0,
  925. status: true,
  926. fixed: false,
  927. columnWidth: 180,
  928. showOverflowTooltip: true,
  929. },
  930. {
  931. userId: this.$store.state.user.name,
  932. functionId: 555001,
  933. serialNumber: '555001Table2StartDate',
  934. tableId: '555001Table2',
  935. tableName: '查询工单及物料',
  936. columnProp: 'supplierName',
  937. headerAlign: 'center',
  938. align: 'center',
  939. columnLabel: '委外商',
  940. columnHidden: false,
  941. columnImage: false,
  942. columnSortable: false,
  943. sortLv: 0,
  944. status: true,
  945. fixed: false,
  946. columnWidth: 110,
  947. },
  948. {
  949. userId: this.$store.state.user.name,
  950. functionId: 555001,
  951. serialNumber: '555001Table2FinishDate',
  952. tableId: '555001Table2',
  953. tableName: '查询工单及物料',
  954. columnProp: 'receiptDate',
  955. headerAlign: 'center',
  956. align: 'center',
  957. columnLabel: '接收日期',
  958. columnHidden: false,
  959. columnImage: false,
  960. columnSortable: false,
  961. sortLv: 0,
  962. status: true,
  963. fixed: false,
  964. columnWidth: 110,
  965. },
  966. /* {
  967. userId: this.$store.state.user.name,
  968. functionId: 555001,
  969. serialNumber: '555001Table2NeedDate',
  970. tableId: '555001Table2',
  971. tableName: '查询工单及物料',
  972. columnProp: 'needDate',
  973. headerAlign: 'center',
  974. align: 'center',
  975. columnLabel: '需求日期',
  976. columnHidden: false,
  977. columnImage: false,
  978. columnSortable: false,
  979. sortLv: 0,
  980. status: true,
  981. fixed: false,
  982. columnWidth: 110,
  983. }, */
  984. ],
  985. columnList3: [
  986. {
  987. userId: this.$store.state.user.name,
  988. functionId: 555001,
  989. serialNumber: '555001Table3ComponentPartNo',
  990. tableId: '555001Table3',
  991. tableName: '领料申请BOM子表',
  992. columnProp: 'componentPartNo',
  993. headerAlign: 'center',
  994. align: 'left',
  995. columnLabel: '物料编码',
  996. columnHidden: false,
  997. columnImage: false,
  998. columnSortable: true,
  999. sortLv: 0,
  1000. status: true,
  1001. fixed: false,
  1002. columnWidth: 80,
  1003. },
  1004. {
  1005. userId: this.$store.state.user.name,
  1006. functionId: 555001,
  1007. serialNumber: '555001Table3IsInWh',
  1008. tableId: '555001Table3',
  1009. tableName: '查询工单及物料',
  1010. columnProp: 'isInWh',
  1011. headerAlign: 'center',
  1012. align: 'left',
  1013. columnLabel: '是否在立库',
  1014. columnHidden: false,
  1015. columnImage: false,
  1016. columnSortable: false,
  1017. sortLv: 0,
  1018. status: true,
  1019. fixed: false,
  1020. columnWidth: 100,
  1021. },
  1022. {
  1023. userId: this.$store.state.user.name,
  1024. functionId: 555001,
  1025. serialNumber: '555001Table3PartDesc',
  1026. tableId: '555001Table3',
  1027. tableName: '领料申请BOM子表',
  1028. columnProp: 'componentPartDesc',
  1029. headerAlign: 'center',
  1030. align: 'left',
  1031. columnLabel: '物料描述',
  1032. columnHidden: false,
  1033. columnImage: false,
  1034. columnSortable: false,
  1035. sortLv: 0,
  1036. status: true,
  1037. fixed: false,
  1038. columnWidth: 120,
  1039. },
  1040. {
  1041. userId: this.$store.state.user.name,
  1042. functionId: 555001,
  1043. serialNumber: '555001Table3QtyRequired',
  1044. tableId: '555001Table3',
  1045. tableName: '领料申请BOM子表',
  1046. columnProp: 'qtyRequired',
  1047. headerAlign: 'center',
  1048. align: 'right',
  1049. columnLabel: '需求数量',
  1050. columnHidden: false,
  1051. columnImage: false,
  1052. columnSortable: false,
  1053. sortLv: 0,
  1054. status: true,
  1055. fixed: false,
  1056. columnWidth: 50,
  1057. },
  1058. {
  1059. userId: this.$store.state.user.name,
  1060. functionId: 555001,
  1061. serialNumber: '555001Table3QtyToIssue',
  1062. tableId: '555001Table3',
  1063. tableName: '领料申请BOM子表',
  1064. columnProp: 'qtyToIssue',
  1065. headerAlign: 'center',
  1066. align: 'right',
  1067. columnLabel: '本次申请数量',
  1068. columnHidden: false,
  1069. columnImage: false,
  1070. columnSortable: false,
  1071. sortLv: 0,
  1072. status: true,
  1073. fixed: false,
  1074. columnWidth: 60,
  1075. },
  1076. {
  1077. userId: this.$store.state.user.name,
  1078. functionId: 555001,
  1079. serialNumber: '555001Table3Remark',
  1080. tableId: '555001Table3',
  1081. tableName: '领料申请BOM子表',
  1082. columnProp: 'remark',
  1083. headerAlign: 'center',
  1084. align: 'left',
  1085. columnLabel: '备注',
  1086. columnHidden: false,
  1087. columnImage: false,
  1088. columnSortable: false,
  1089. sortLv: 0,
  1090. status: true,
  1091. fixed: false,
  1092. columnWidth: 150,
  1093. },
  1094. ],
  1095. materialDetailColumnList: [
  1096. {
  1097. userId: this.$store.state.user.name,
  1098. functionId: 701002,
  1099. serialNumber: '701002Table3ItemNo',
  1100. tableId: '701002Table3',
  1101. tableName: '申请单材料明细表',
  1102. columnProp: 'itemNo',
  1103. headerAlign: 'center',
  1104. align: 'right',
  1105. columnLabel: '申请单序号',
  1106. columnHidden: false,
  1107. columnImage: false,
  1108. columnSortable: false,
  1109. sortLv: 0,
  1110. status: true,
  1111. fixed: '',
  1112. columnWidth: 80,
  1113. },
  1114. {
  1115. userId: this.$store.state.user.name,
  1116. functionId: 701002,
  1117. serialNumber: '701002Table3SubSite',
  1118. tableId: '701002Table3',
  1119. tableName: '申请单材料明细表',
  1120. columnProp: 'subSite',
  1121. headerAlign: 'center',
  1122. align: 'center',
  1123. columnLabel: '工厂编号',
  1124. columnHidden: false,
  1125. columnImage: false,
  1126. columnSortable: false,
  1127. sortLv: 0,
  1128. status: true,
  1129. fixed: '',
  1130. columnWidth: 90,
  1131. },
  1132. {
  1133. userId: this.$store.state.user.name,
  1134. functionId: 701002,
  1135. serialNumber: '701002Table3ComponentPartNo',
  1136. tableId: '701002Table3',
  1137. tableName: '申请单材料明细表',
  1138. columnProp: 'componentPartNo',
  1139. headerAlign: 'center',
  1140. align: 'center',
  1141. columnLabel: '材料编码',
  1142. columnHidden: false,
  1143. columnImage: false,
  1144. columnSortable: false,
  1145. sortLv: 0,
  1146. status: true,
  1147. fixed: '',
  1148. columnWidth: 100,
  1149. },
  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. {
  1169. userId: this.$store.state.user.name,
  1170. functionId: 701002,
  1171. serialNumber: '701002Table3QtyToIssue',
  1172. tableId: '701002Table3',
  1173. tableName: '申请单材料明细表',
  1174. columnProp: 'qtyToIssue',
  1175. headerAlign: 'center',
  1176. align: 'right',
  1177. columnLabel: '申请数量',
  1178. columnHidden: false,
  1179. columnImage: false,
  1180. columnSortable: false,
  1181. sortLv: 0,
  1182. status: true,
  1183. fixed: '',
  1184. columnWidth: 80,
  1185. },
  1186. {
  1187. userId: this.$store.state.user.name,
  1188. functionId: 701002,
  1189. serialNumber: '701002Table3QtyToIssueOriginal',
  1190. tableId: '701002Table3',
  1191. tableName: '申请单材料明细表',
  1192. columnProp: 'qtyToIssueOriginal',
  1193. headerAlign: 'center',
  1194. align: 'right',
  1195. columnLabel: '已发数量',
  1196. columnHidden: false,
  1197. columnImage: false,
  1198. columnSortable: false,
  1199. sortLv: 0,
  1200. status: true,
  1201. fixed: '',
  1202. columnWidth: 80,
  1203. },
  1204. {
  1205. userId: this.$store.state.user.name,
  1206. functionId: 701002,
  1207. serialNumber: '701002Table3IssueType',
  1208. tableId: '701002Table3',
  1209. tableName: '申请单材料明细表',
  1210. columnProp: 'issueType',
  1211. headerAlign: 'center',
  1212. align: 'right',
  1213. columnLabel: '类型',
  1214. columnHidden: false,
  1215. columnImage: false,
  1216. columnSortable: false,
  1217. sortLv: 0,
  1218. status: true,
  1219. fixed: '',
  1220. columnWidth: 80,
  1221. },
  1222. {
  1223. userId: this.$store.state.user.name,
  1224. functionId: 701002,
  1225. serialNumber: '701002Table3Remark',
  1226. tableId: '701002Table3',
  1227. tableName: '申请单材料明细表',
  1228. columnProp: 'remark',
  1229. headerAlign: 'center',
  1230. align: 'left',
  1231. columnLabel: '备注',
  1232. columnHidden: false,
  1233. columnImage: false,
  1234. columnSortable: false,
  1235. sortLv: 0,
  1236. status: true,
  1237. fixed: '',
  1238. columnWidth: 160,
  1239. },
  1240. {
  1241. userId: this.$store.state.user.name,
  1242. functionId: 701002,
  1243. serialNumber: '701002Table3SOOrderNo',
  1244. tableId: '701002Table3',
  1245. tableName: '申请单材料明细表',
  1246. columnProp: 'soorderNo',
  1247. headerAlign: 'center',
  1248. align: 'left',
  1249. columnLabel: '生产订单',
  1250. columnHidden: false,
  1251. columnImage: false,
  1252. columnSortable: false,
  1253. sortLv: 0,
  1254. status: true,
  1255. fixed: '',
  1256. columnWidth: 120,
  1257. },
  1258. {
  1259. userId: this.$store.state.user.name,
  1260. functionId: 701002,
  1261. serialNumber: '701002Table3BOMItemNo',
  1262. tableId: '701002Table3',
  1263. tableName: '申请单材料明细表',
  1264. columnProp: 'bomitemNo',
  1265. headerAlign: 'center',
  1266. align: 'right',
  1267. columnLabel: 'BOM序号',
  1268. columnHidden: false,
  1269. columnImage: false,
  1270. columnSortable: false,
  1271. sortLv: 0,
  1272. status: true,
  1273. fixed: '',
  1274. columnWidth: 80,
  1275. },
  1276. ],
  1277. rules: {
  1278. groupIdType: [
  1279. {
  1280. required: true,
  1281. message: ' ',
  1282. trigger: ['blur', 'change'],
  1283. },
  1284. ],
  1285. groupDescType: [
  1286. {
  1287. required: true,
  1288. message: ' ',
  1289. trigger: ['blur', 'change'],
  1290. },
  1291. ],
  1292. activeType: [
  1293. {
  1294. required: true,
  1295. message: ' ',
  1296. trigger: ['blur', 'change'],
  1297. },
  1298. ],
  1299. bu: [
  1300. {
  1301. required: true,
  1302. message: ' ',
  1303. trigger: ['blur', 'change'],
  1304. },
  1305. ],
  1306. },
  1307. userBuList: [],
  1308. authSearch: false,
  1309. authSave: false,
  1310. authUpdate: false,
  1311. authDelete: false,
  1312. menuId: this.$route.meta.menuId,
  1313. partSearch: {
  1314. site: '',
  1315. sourceBu: '',
  1316. partNo: '',
  1317. partDesc: '',
  1318. spec: '',
  1319. },
  1320. xiadaModelFlag: false,
  1321. saveOtherPartModalFlag: false,
  1322. otherPartData: {
  1323. site: '',
  1324. notifyNo: '',
  1325. itemNo: '',
  1326. bOMItemNo: '',
  1327. componentPartNo: '',
  1328. qtyToIssue: '',
  1329. issueType: '',
  1330. partDesc: '',
  1331. umid: '',
  1332. remark: '',
  1333. },
  1334. showAddNotifyTypeDialog: false,
  1335. selectedNotifyType: 'production',
  1336. selectedNotifyRemark: '',
  1337. showXiadaNotifyDialog: false,
  1338. xiadaNotifyData: {
  1339. planIssueDate: '',
  1340. remark: '',
  1341. },
  1342. chooseLoading: false,
  1343. seqNoModalLoading: false,
  1344. saveNewLoading: false,
  1345. poSiteSelectModalFlag: false,
  1346. poSiteSelectList: [],
  1347. poSiteSelectedRow: null,
  1348. }
  1349. },
  1350. mounted() {
  1351. this.$nextTick(() => {
  1352. this.height = window.innerHeight - 220
  1353. })
  1354. },
  1355. created () {
  1356. // 按钮控制
  1357. // this.getButtonAuthData()
  1358. //this.getTableUserColumn(this.$route.meta.menuId+'Table2',2)
  1359. this.getUserNotifyNo()
  1360. },
  1361. methods: {
  1362. tabClick(tab, event) {
  1363. // 刷新当前标签页的表格数据
  1364. this.refreshCurrentTabTable()
  1365. },
  1366. materialDetailTableRowClassName({ row, rowIndex }) {
  1367. if (
  1368. row.qtyToIssueOriginal < row.qtyToIssue &&
  1369. new Date(row.needDate) <
  1370. new Date(this.dayjs().format('YYYY-MM-DD HH:mm'))
  1371. ) {
  1372. return 'error-row'
  1373. }
  1374. return ''
  1375. },
  1376. changeData(row) {
  1377. this.currentRow = JSON.parse(JSON.stringify(row))
  1378. this.refreshCurrentTabTable()
  1379. },
  1380. getBaseList(val, type) {
  1381. this.tagNo = val
  1382. let conSql = ''
  1383. this.$nextTick(() => {
  1384. let strVal = ''
  1385. if (val === 515) {
  1386. strVal = this.seqNoData.sResourceid
  1387. conSql =
  1388. " and site = '" +
  1389. this.notifyData.site +
  1390. "'" +
  1391. " and bu_no = '" +
  1392. this.notifyData.bu +
  1393. "'"
  1394. this.$refs.baseList.init(val, strVal, conSql)
  1395. }
  1396. if (val === 216) {
  1397. strVal = this.seqNoData.sWorkcenterno
  1398. conSql =
  1399. " and site = '" +
  1400. this.notifyData.site +
  1401. "'" +
  1402. " and bu_no = '" +
  1403. this.notifyData.bu +
  1404. "'"
  1405. this.$refs.baseList.init(val, strVal, conSql)
  1406. }
  1407. if (val === 215) {
  1408. strVal = this.notifyOrderData.locationNo
  1409. this.$refs.baseList.init(val, strVal)
  1410. }
  1411. })
  1412. },
  1413. tableRowClassName({ row, rowIndex }) {
  1414. if (row.qtyToIssue > row.qtyAvailable) {
  1415. return 'error-row'
  1416. }
  1417. return ''
  1418. },
  1419. // 列表方法的回调
  1420. getBaseData(val) {
  1421. if (this.tagNo === 515) {
  1422. this.seqNoData.sResourceid = val.resource_id
  1423. }
  1424. if (this.tagNo === 215) {
  1425. this.notifyOrderData.locationNo = val.location_id
  1426. }
  1427. if (this.tagNo === 216) {
  1428. this.seqNoData.sWorkcenterno = val.work_center_no
  1429. }
  1430. },
  1431. chooseSOS(row) {
  1432. if (this.dataList.length > 0) {
  1433. //这边是有个判断的,判断派工单号不能重复
  1434. let stop = false
  1435. for (let i = 0; i < this.dataList.length; i++) {
  1436. if (
  1437. this.dataList[i].orderNo == row.orderNo &&
  1438. this.dataList[i].releaseNo == row.releaseNo &&
  1439. this.dataList[i].sequenceNo == row.sequenceNo
  1440. ) {
  1441. stop = true
  1442. }
  1443. }
  1444. if (stop) {
  1445. this.$alert('已经选择过此工单,请返回点击明细直接操作!!', '提示', {
  1446. confirmButtonText: '确定',
  1447. })
  1448. return false
  1449. }
  1450. }
  1451. let inData = {
  1452. site: this.$store.state.user.site,
  1453. orderNo: row.orderNo,
  1454. releaseNo: row.releaseNo,
  1455. sequenceNo: row.sequenceNo,
  1456. }
  1457. this.chooseLoading = true
  1458. getShopOrderFromIFSWithOrderNo(inData)
  1459. .then(({ data }) => {
  1460. if (data.code === 0) {
  1461. console.log('data', data)
  1462. this.notifyOrderData.partNo = data.rows[0].partNo
  1463. this.notifyOrderData.orderNo = data.rows[0].orderNo
  1464. this.notifyOrderData.site = this.$store.state.user.site
  1465. this.notifyOrderData.partDesc = data.rows[0].partDesc
  1466. this.notifyOrderData.qtyRequired = data.rows[0].lotSize
  1467. this.notifyOrderData.releaseNo = data.rows[0].releaseNo
  1468. this.notifyOrderData.issureQty = ''
  1469. this.notifyOrderData.needDate =
  1470. this.dayjs().format('YYYY-MM-DD HH:mm')
  1471. this.notifyOrderData.sequenceNo = data.rows[0].sequenceNo
  1472. this.saveSeqNoModalFlag = true
  1473. } else {
  1474. this.$meassage.error(data.msg)
  1475. return
  1476. }
  1477. })
  1478. .finally(() => {
  1479. this.chooseLoading = false
  1480. })
  1481. },
  1482. qtyAllForSeqNo() {
  1483. this.notifyOrderData.issureQty = this.notifyOrderData.qtyRequired
  1484. },
  1485. qtyAllForBom(row) {
  1486. row.qtyToIssue = row.qtyRequired
  1487. },
  1488. chooseSOSModal() {
  1489. this.seqNoData = {
  1490. site: this.$store.state.user.site,
  1491. orderNo: '',
  1492. releaseNo: '*',
  1493. sequenceNo: '*',
  1494. seqno: '',
  1495. sResourceid: '',
  1496. sWorkcenterno: '',
  1497. operatorId: '',
  1498. sShiftno: '',
  1499. startDate: this.dayjs().format('YYYY-MM-DD'),
  1500. endDate: this.dayjs().format('YYYY-MM-DD'),
  1501. }
  1502. this.seqNoList = []
  1503. this.seqNoModalFlag = true
  1504. },
  1505. deleteSeqNoByOrderNo() {
  1506. if (this.seqNoData.orderNo == null || this.seqNoData.orderNo == '') {
  1507. this.$message.warning('请输入OrderNo!')
  1508. return false
  1509. }
  1510. if (this.seqNoList.length === 0) {
  1511. this.$message.warning('没有可删除的数据!')
  1512. return false
  1513. }
  1514. // 统计要删除的行数
  1515. const deleteCount = this.seqNoList.filter(
  1516. (row) => row.orderNo === this.seqNoData.orderNo
  1517. ).length
  1518. if (deleteCount === 0) {
  1519. this.$message.warning('未找到匹配的OrderNo数据!')
  1520. return false
  1521. }
  1522. this.$confirm(
  1523. `确定要删除OrderNo为 ${this.seqNoData.orderNo} 的 ${deleteCount} 条数据吗?`,
  1524. '提示',
  1525. {
  1526. confirmButtonText: '确定',
  1527. cancelButtonText: '取消',
  1528. type: 'warning',
  1529. }
  1530. )
  1531. .then(() => {
  1532. // 删除所有匹配的orderNo行
  1533. this.seqNoList = this.seqNoList.filter(
  1534. (row) => row.orderNo !== this.seqNoData.orderNo
  1535. )
  1536. this.$message.success(`成功删除 ${deleteCount} 条数据`)
  1537. })
  1538. .catch(() => {
  1539. // 用户取消删除
  1540. })
  1541. },
  1542. //导出excel
  1543. async createExportData() {
  1544. this.searchData.limit = -1
  1545. this.searchData.page = 1
  1546. await eamGroupSearch(this.searchData).then(({ data }) => {
  1547. this.exportList = data.page.list
  1548. })
  1549. return this.exportList
  1550. },
  1551. startDownload() {},
  1552. finishDownload() {},
  1553. fields() {
  1554. let json = '{'
  1555. this.columnList.forEach((item, index) => {
  1556. if (index == this.columnList.length - 1) {
  1557. json +=
  1558. '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  1559. } else {
  1560. json +=
  1561. '"' +
  1562. item.columnLabel +
  1563. '"' +
  1564. ':' +
  1565. '"' +
  1566. item.columnProp +
  1567. '"' +
  1568. ','
  1569. }
  1570. })
  1571. json += '}'
  1572. let s = eval('(' + json + ')')
  1573. return s
  1574. },
  1575. xiadaNotifyModel() {
  1576. if (
  1577. this.dataList.length == 0 &&
  1578. this.dataList2.length == 0 &&
  1579. this.dataList3.length == 0
  1580. ) {
  1581. this.$alert('没有明细记录无法下达!!', '提示', {
  1582. confirmButtonText: '确定',
  1583. })
  1584. return false
  1585. }
  1586. this.xiadaModelFlag = true
  1587. },
  1588. xiadaNotify() {
  1589. // 检查是否有明细记录
  1590. if (this.dataList.length == 0) {
  1591. this.$alert('没有明细记录无法下达!!', '提示', {
  1592. confirmButtonText: '确定',
  1593. })
  1594. return false
  1595. }
  1596. // 初始化弹框数据
  1597. this.xiadaNotifyData = {
  1598. planIssueDate:
  1599. this.notifyData.planIssueDate ||
  1600. this.dayjs().format('YYYY-MM-DD HH:mm:ss'),
  1601. remark: this.notifyData.remark || '',
  1602. }
  1603. // 打开弹框
  1604. this.showXiadaNotifyDialog = true
  1605. },
  1606. saveOtherPart() {
  1607. // if (
  1608. // this.otherPartData.qtyToIssue == null ||
  1609. // this.otherPartData.qtyToIssue == '' ||
  1610. // this.otherPartData.qtyToIssue <= 0
  1611. // ) {
  1612. // this.$message.warning('请填写领取数量!')
  1613. // return false
  1614. // }
  1615. this.$confirm('确定保存' + '?', '提示', {
  1616. confirmButtonText: '确定',
  1617. cancelButtonText: '取消',
  1618. type: 'warning',
  1619. }).then(() => {
  1620. saveOtherPart(this.otherPartData).then(({ data }) => {
  1621. if (data.code === 0) {
  1622. this.saveOtherPartModalFlag = false
  1623. if (this.otherPartData.issueType === '非BOM物料') {
  1624. this.partModelFlag = false
  1625. this.activeName = 'noBom'
  1626. this.searchOtherPart('非BOM物料')
  1627. }
  1628. if (this.otherPartData.issueType === '不管控物料') {
  1629. this.noControlPartModelFlag = false
  1630. this.activeName = 'noControl'
  1631. this.searchOtherPart('不管控物料')
  1632. }
  1633. this.$message.success('操作成功')
  1634. } else {
  1635. this.$alert(data.msg, '错误', {
  1636. confirmButtonText: '确定',
  1637. })
  1638. }
  1639. })
  1640. })
  1641. },
  1642. searchOtherPart(type) {
  1643. let inData = {
  1644. site: this.notifyData.site,
  1645. notifyNo: this.notifyData.notifyNo,
  1646. issueType: type,
  1647. }
  1648. searchOtherPart(inData).then(({ data }) => {
  1649. if (data && data.code === 0) {
  1650. if (type === '非BOM物料') {
  1651. this.dataList2 = data.rows
  1652. }
  1653. if (type === '不管控物料') {
  1654. this.dataList3 = data.rows
  1655. }
  1656. }
  1657. })
  1658. },
  1659. importModel() {
  1660. if (this.dataList.length > 0) {
  1661. this.$alert('有已申请工单明细无法导入!!', '提示', {
  1662. confirmButtonText: '确定',
  1663. })
  1664. return
  1665. }
  1666. let data = {
  1667. site: this.notifyData.site,
  1668. notifyNo: this.notifyData.notifyNo,
  1669. }
  1670. this.$nextTick(() => {
  1671. this.$refs.walUploadExcel.init(data)
  1672. })
  1673. },
  1674. //获取按钮的权限数据
  1675. getButtonAuthData() {
  1676. let searchFlag = this.isAuth(this.menuId + ':search')
  1677. let saveFlag = this.isAuth(this.menuId + ':save')
  1678. let updateFlag = this.isAuth(this.menuId + ':update')
  1679. let deleteFlag = this.isAuth(this.menuId + ':delete')
  1680. //处理页面的权限数据
  1681. this.authSearch = !searchFlag
  1682. this.authSave = !saveFlag
  1683. this.authUpdate = !updateFlag
  1684. this.authDelete = !deleteFlag
  1685. },
  1686. searchTable() {},
  1687. async getTableUserColumn(tableId, columnId) {
  1688. let queryTableUser = {
  1689. userId: this.$store.state.user.name,
  1690. functionId: this.$route.meta.menuId,
  1691. tableId: tableId,
  1692. status: true,
  1693. languageCode: this.$i18n.locale,
  1694. }
  1695. await getTableUserListLanguage(queryTableUser).then(({ data }) => {
  1696. if (data.rows.length > 0) {
  1697. //this.columnList1 = []
  1698. switch (columnId) {
  1699. case 1:
  1700. this.columnList1 = data.rows
  1701. break
  1702. case 2:
  1703. this.columnList2 = data.rows
  1704. break
  1705. case 3:
  1706. this.columnList3 = data.rows
  1707. break
  1708. case 4:
  1709. this.columnList4 = data.rows
  1710. break
  1711. }
  1712. }
  1713. })
  1714. },
  1715. // 获取 tableDefault 列
  1716. async getColumnList(tableId, columnId) {
  1717. let queryTable = {
  1718. functionId: this.$route.meta.menuId,
  1719. tableId: tableId,
  1720. languageCode: this.$i18n.locale,
  1721. }
  1722. await getTableDefaultListLanguage(queryTable).then(({ data }) => {
  1723. if (data.rows && data.rows.length > 0) {
  1724. switch (columnId) {
  1725. case 1:
  1726. this.columnList1 = data.rows
  1727. break
  1728. case 2:
  1729. this.columnList2 = data.rows
  1730. break
  1731. case 3:
  1732. this.columnList3 = data.rows
  1733. break
  1734. case 4:
  1735. this.columnList4 = data.rows
  1736. break
  1737. }
  1738. } else {
  1739. // this.showDefault = true.
  1740. }
  1741. })
  1742. },
  1743. /**
  1744. * 海安委外页签刷新:材料明细固定按poorder查询,避免落回shoporder链路 - rqrq
  1745. */
  1746. refreshCurrentTabTable () {
  1747. if (this.notifyNo === '' || !this.notifyNo) {
  1748. return
  1749. }
  1750. if (this.activeName === 'sub') {
  1751. let queryData = {
  1752. site: this.notifyData.site || this.$store.state.user.site,
  1753. notifyNo: this.notifyNo,
  1754. orderType: 'poorder'
  1755. }
  1756. if (this.currentRow && this.currentRow !== '' && this.currentRow.notifyNo) {
  1757. queryData = {
  1758. ...this.currentRow,
  1759. site: this.notifyData.site || this.$store.state.user.site,
  1760. orderType: 'poorder'
  1761. }
  1762. }
  1763. this.dataListLoading = true
  1764. haiAnSearchNotifyMaterialListNew(queryData).then(({ data }) => {
  1765. this.dataListLoading = false
  1766. if (data && data.code === 0) {
  1767. this.materialDetailList = data.rows || []
  1768. } else {
  1769. this.materialDetailList = []
  1770. }
  1771. }).catch(() => {
  1772. this.dataListLoading = false
  1773. this.materialDetailList = []
  1774. })
  1775. }
  1776. },
  1777. /**
  1778. * 海安委外初始化:只查询当前用户poorder未下达主单 - rqrq
  1779. */
  1780. getUserNotifyNo () {
  1781. const inData = {
  1782. site: this.$store.state.user.site,
  1783. username: this.$store.state.user.name,
  1784. orderType: 'poorder'
  1785. }
  1786. this.getAllNotifyStatus()
  1787. haiAnGetUserNotifyNo(inData).then(({ data }) => {
  1788. if (data && data.code === 0) {
  1789. if (data.row != null) {
  1790. this.notifyNo = data.row.notifyNo
  1791. this.notifyData = data.row
  1792. this.getNotifyPoDetail()
  1793. } else {
  1794. this.notifyNo = ''
  1795. this.notifyData = {
  1796. site: '',
  1797. bu: '',
  1798. notifyNo: '',
  1799. notifyDate: '',
  1800. enteredDate: '',
  1801. userName: '',
  1802. userDisplay: '',
  1803. remark: '',
  1804. planIssueDate: ''
  1805. }
  1806. this.dataList = []
  1807. this.materialDetailList = []
  1808. }
  1809. return
  1810. }
  1811. this.notifyNo = ''
  1812. this.dataList = []
  1813. this.materialDetailList = []
  1814. })
  1815. },
  1816. /**
  1817. * 海安委外父行查询:固定orderType=poorder读取haian_SOIssueNotifyOrderList - rqrq
  1818. */
  1819. getNotifyPoDetail () {
  1820. const inData = {
  1821. site: this.$store.state.user.site,
  1822. notifyNo: this.notifyNo,
  1823. orderType: 'poorder'
  1824. }
  1825. haiAnGetNotifyNoDetail(inData).then(({ data }) => {
  1826. if (data && data.code === 0) {
  1827. this.dataList = data.rows || []
  1828. } else {
  1829. this.dataList = []
  1830. }
  1831. })
  1832. },
  1833. /**
  1834. * 海安委外新建主单:主记录site使用当前登录大site,orderType固定poorder - rqrq
  1835. */
  1836. addNotify () {
  1837. const inData = {
  1838. site: this.$store.state.user.site,
  1839. userName: this.$store.state.user.name,
  1840. orderType: 'poorder'
  1841. }
  1842. haiAnCreateNotify(inData).then(({ data }) => {
  1843. if (data && data.code === 0) {
  1844. this.showAddNotifyTypeDialog = false
  1845. this.$message.success('操作成功')
  1846. this.getUserNotifyNo()
  1847. } else if (data) {
  1848. this.$alert(data.msg, '错误', {
  1849. confirmButtonText: '确定'
  1850. })
  1851. }
  1852. })
  1853. },
  1854. /**
  1855. * 海安委外新建主单(带备注):沿用老交互并固定orderType=poorder - rqrq
  1856. */
  1857. confirmAddNotify () {
  1858. const outWorkOrderFlag = this.selectedNotifyType === 'outsourced' ? 'Y' : 'N'
  1859. const inData = {
  1860. site: this.$store.state.user.site,
  1861. userName: this.$store.state.user.name,
  1862. outWorkOrderFlag,
  1863. remark: this.selectedNotifyRemark,
  1864. orderType: 'poorder'
  1865. }
  1866. this.getAllNotifyStatus()
  1867. haiAnCreateNotify(inData).then(({ data }) => {
  1868. if (data && data.code === 0) {
  1869. this.showAddNotifyTypeDialog = false
  1870. this.$message.success('操作成功')
  1871. this.getUserNotifyNo()
  1872. } else if (data) {
  1873. this.$alert(data.msg, '错误', {
  1874. confirmButtonText: '确定'
  1875. })
  1876. }
  1877. })
  1878. },
  1879. /**
  1880. * 委外单查询:PurchaseOrder头site按大site+'%'模糊;单条直接拉行/物料,多条先弹窗选site - rqrq
  1881. */
  1882. searchSOSRouting () {
  1883. if (this.seqNoData.orderNo == null || this.seqNoData.orderNo === '') {
  1884. this.$message.warning('请输入OrderNo!')
  1885. return false
  1886. }
  1887. if (!this.seqNoList) {
  1888. this.seqNoList = []
  1889. }
  1890. const orderNoExists = this.seqNoList.some((row) => row.orderNo === this.seqNoData.orderNo)
  1891. if (orderNoExists) {
  1892. this.$message.warning('该OrderNo的数据已存在,请先删除再添加!')
  1893. return false
  1894. }
  1895. const dataListExists = this.dataList.some((row) => row.soorderNo === this.seqNoData.orderNo)
  1896. if (dataListExists) {
  1897. this.$message.warning('该OrderNo的数据已添加过,请先删除再添加!')
  1898. return false
  1899. }
  1900. if (this.seqNoModalLoading) {
  1901. return
  1902. }
  1903. this.seqNoModalLoading = true
  1904. // IFS PurchaseOrder头查询site需模糊:大site+'%';多site时后端不自动拉行/物料 - rqrq
  1905. const params = {
  1906. site: (this.$store.state.user.site || '') + '%',
  1907. outsourcingNo: this.seqNoData.orderNo
  1908. }
  1909. haiAnGetPoOrderAndMaterialByOrderNo(params).then(({ data }) => {
  1910. if (!(data && data.code === 0)) {
  1911. if (data) {
  1912. this.$message.error(data.msg)
  1913. }
  1914. return
  1915. }
  1916. if (data.needSelectSite) {
  1917. this.poSiteSelectList = data.purchaseOrders || []
  1918. this.poSiteSelectedRow = null
  1919. if (this.poSiteSelectList.length === 0) {
  1920. this.$message.warning('未查询到数据!')
  1921. return
  1922. }
  1923. this.poSiteSelectModalFlag = true
  1924. return
  1925. }
  1926. this.appendPoOrderMaterialRows(data.rows || [])
  1927. }).catch((e) => {
  1928. this.$message.error((e && e.msg) || '查询失败')
  1929. }).finally(() => {
  1930. this.seqNoModalLoading = false
  1931. })
  1932. },
  1933. handlePoSiteSelectChange (row) {
  1934. this.poSiteSelectedRow = row
  1935. },
  1936. /**
  1937. * 多site确认后:按选定site二次查询PurchaseOrderLine/POLineSupplierMaterial - rqrq
  1938. */
  1939. confirmPoSiteSelect () {
  1940. if (!this.poSiteSelectedRow || !this.poSiteSelectedRow.site) {
  1941. this.$message.warning('请先选择一条PurchaseOrder!')
  1942. return
  1943. }
  1944. if (this.seqNoModalLoading) {
  1945. return
  1946. }
  1947. this.seqNoModalLoading = true
  1948. const params = {
  1949. site: this.$store.state.user.site,
  1950. outsourcingNo: this.seqNoData.orderNo,
  1951. selectedSite: this.poSiteSelectedRow.site
  1952. }
  1953. haiAnGetPoOrderAndMaterialByOrderNo(params).then(({ data }) => {
  1954. if (data && data.code === 0) {
  1955. this.poSiteSelectModalFlag = false
  1956. this.appendPoOrderMaterialRows(data.rows || [])
  1957. return
  1958. }
  1959. if (data) {
  1960. this.$message.error(data.msg)
  1961. }
  1962. }).catch((e) => {
  1963. this.$message.error((e && e.msg) || '查询失败')
  1964. }).finally(() => {
  1965. this.seqNoModalLoading = false
  1966. })
  1967. },
  1968. appendPoOrderMaterialRows (rows) {
  1969. if (!rows || rows.length === 0) {
  1970. this.$message.warning('未查询到数据!')
  1971. return
  1972. }
  1973. rows.forEach((newRow) => {
  1974. const qtyRequired = parseFloat(newRow.qtyRequired) || 0
  1975. const qtyIssued = parseFloat(newRow.qtyIssued) || 0
  1976. const reservedQty = parseFloat(newRow.reservedQty) || 0
  1977. const applyQty = qtyRequired - qtyIssued - reservedQty
  1978. this.$set(newRow, 'applyQty', applyQty > 0 ? applyQty : 0)
  1979. // 委外IFS返回lineItemNo作为海安sequenceNo保存,contract/site作为subsite保存 - rqrq
  1980. newRow.sequenceNo = newRow.sequenceNo || newRow.lineItemNo || '*'
  1981. newRow.releaseNo = newRow.releaseNo || '*'
  1982. newRow.subSite = newRow.subSite || newRow.contract || newRow.site || this.$store.state.user.site
  1983. this.seqNoList.push(newRow)
  1984. })
  1985. this.$message.success(`成功添加 ${rows.length} 条数据`)
  1986. },
  1987. /**
  1988. * 海安委外批量保存:主单site=大site,明细subsite取IFS回传工厂编码 - rqrq
  1989. */
  1990. saveNewSoIssueNotify () {
  1991. this.seqNoList.forEach((item) => {
  1992. if (item.applyQty === '' || item.applyQty == null) {
  1993. item.applyQty = 0
  1994. }
  1995. item.notifyNo = this.notifyNo
  1996. item.site = this.$store.state.user.site
  1997. item.subSite = item.subSite || item.contract || item.site || this.$store.state.user.site
  1998. item.releaseNo = item.releaseNo || '*'
  1999. item.sequenceNo = item.sequenceNo || item.lineItemNo || '*'
  2000. })
  2001. const materialList = this.seqNoList.filter((item) => item.applyQty > 0)
  2002. if (materialList.length === 0) {
  2003. this.$alert('没有需要保存的内容!', '提示', {
  2004. confirmButtonText: '确定'
  2005. })
  2006. return false
  2007. }
  2008. const saveNotify = {
  2009. site: this.$store.state.user.site,
  2010. notifyNo: this.notifyNo,
  2011. userName: this.$store.state.user.name,
  2012. orderType: 'poorder',
  2013. materialList
  2014. }
  2015. this.saveNewLoading = true
  2016. haiAnSaveNewSoIssueNotify(saveNotify).then(({ data }) => {
  2017. if (data && data.code === 0) {
  2018. this.seqNoModalFlag = false
  2019. this.getUserNotifyNo()
  2020. this.$message.success('操作成功')
  2021. } else if (data) {
  2022. this.$message.error(data.msg)
  2023. }
  2024. }).finally(() => {
  2025. this.saveNewLoading = false
  2026. })
  2027. },
  2028. /**
  2029. * 委外明细入口:直接走海安poorder物料查询并回填itemNo/subsite - rqrq
  2030. */
  2031. enterSOSDetail (row) {
  2032. const rows = {
  2033. site: this.$store.state.user.site,
  2034. notifyNo: this.notifyNo,
  2035. orderNo: row.soorderNo || row.orderNo,
  2036. seqNo: row.seqNo,
  2037. partNo: row.fgPartNo || row.partNo,
  2038. itemNo: row.itemNo,
  2039. releaseNo: row.releaseNo,
  2040. sequenceNo: row.sequenceNo || row.seqNo,
  2041. subSite: row.subSite
  2042. }
  2043. this.enterSOS(rows)
  2044. },
  2045. /**
  2046. * 委外物料弹窗:后端先模糊查PurchaseOrder头,再按返回site拉物料并映射subsite回显 - rqrq
  2047. */
  2048. enterSOS (row) {
  2049. this.seqNoModalFlag = false
  2050. this.materialModalFlag = true
  2051. this.sobomList = []
  2052. this.sobomData = {
  2053. orderNo: row.orderNo,
  2054. seqNo: row.sequenceNo || row.seqNo,
  2055. partNo: row.partNo,
  2056. subSite: row.subSite
  2057. }
  2058. this.bomLoadFlag = true
  2059. const inData = {
  2060. site: this.$store.state.user.site,
  2061. notifyNo: this.notifyNo,
  2062. orderNo: row.orderNo,
  2063. releaseNo: row.releaseNo,
  2064. sequenceNo: row.sequenceNo || row.seqNo,
  2065. partNo: row.partNo,
  2066. itemNo: row.itemNo
  2067. }
  2068. haiAnGetPoOrderMaterialForIssure(inData).then(({ data }) => {
  2069. this.bomLoadFlag = false
  2070. if (data && data.code === 0) {
  2071. this.sobomList = data.rows || []
  2072. for (let i = 0; i < this.sobomList.length; i++) {
  2073. this.sobomList[i].itemNo = inData.itemNo
  2074. this.sobomList[i].subSite = this.sobomList[i].subSite || row.subSite || this.$store.state.user.site
  2075. }
  2076. }
  2077. }).catch(() => {
  2078. this.bomLoadFlag = false
  2079. })
  2080. },
  2081. /**
  2082. * 海安委外明细保存:统一补齐notifyNo/site/subsite并写入haian_明细表 - rqrq
  2083. */
  2084. saveMaterialDetail () {
  2085. for (let i = 0; i < this.sobomList.length; i++) {
  2086. if (this.sobomList[i].qtyToIssue === '' || this.sobomList[i].qtyToIssue == null) {
  2087. this.sobomList[i].qtyToIssue = 0
  2088. }
  2089. this.sobomList[i].notifyNo = this.notifyNo
  2090. this.sobomList[i].site = this.$store.state.user.site
  2091. this.sobomList[i].subSite = this.sobomList[i].subSite || this.sobomData.subSite || this.$store.state.user.site
  2092. }
  2093. const materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
  2094. if (materialList.length === 0) {
  2095. this.$alert('没有需要保存的内容!', '提示', {
  2096. confirmButtonText: '确定'
  2097. })
  2098. return false
  2099. }
  2100. haiAnSaveMaterialDetail(materialList).then(({ data }) => {
  2101. if (data && data.code === 0) {
  2102. this.materialModalFlag = false
  2103. this.$message.success('操作成功')
  2104. } else if (data) {
  2105. this.$alert(data.msg, '错误', {
  2106. confirmButtonText: '确定'
  2107. })
  2108. }
  2109. })
  2110. },
  2111. /**
  2112. * 兼容老“单行保存父行”入口:补齐poorder+subsite后走海安父行保存接口 - rqrq
  2113. */
  2114. saveSOS () {
  2115. if (this.notifyOrderData.needDate == null || this.notifyOrderData.needDate === '') {
  2116. this.$message.warning('请选择时间!')
  2117. return false
  2118. }
  2119. const row = this.notifyOrderData
  2120. if (this.dataList.length > 0) {
  2121. let stop = false
  2122. for (let i = 0; i < this.dataList.length; i++) {
  2123. if (this.dataList[i].soorderNo === row.orderNo &&
  2124. this.dataList[i].releaseNo === row.releaseNo &&
  2125. this.dataList[i].sequenceNo === row.sequenceNo) {
  2126. stop = true
  2127. break
  2128. }
  2129. }
  2130. if (stop) {
  2131. this.$alert('已经选择过此工单,请返回点击明细直接操作!!', '提示', {
  2132. confirmButtonText: '确定'
  2133. })
  2134. return false
  2135. }
  2136. }
  2137. this.$confirm('确定选择工单' + row.orderNo + '?', '提示', {
  2138. confirmButtonText: '确定',
  2139. cancelButtonText: '取消',
  2140. type: 'warning'
  2141. }).then(() => {
  2142. const inData = {
  2143. site: this.$store.state.user.site,
  2144. notifyNo: this.notifyNo,
  2145. fgPartNo: row.partNo,
  2146. soorderNo: row.orderNo,
  2147. opsItemNo: row.itemNo,
  2148. sequenceNo: row.sequenceNo || row.lineItemNo || '*',
  2149. releaseNo: row.releaseNo || '*',
  2150. needDate: row.needDate,
  2151. issureQty: row.issureQty,
  2152. subSite: row.subSite || row.contract || row.site || this.$store.state.user.site,
  2153. orderType: 'poorder'
  2154. }
  2155. haiAnSaveSOIssueNotifyOrderList(inData).then(({ data }) => {
  2156. if (data && data.code === 0) {
  2157. this.saveSeqNoModalFlag = false
  2158. row.itemNo = data.itemNo
  2159. row.subSite = inData.subSite
  2160. this.getNotifyPoDetail()
  2161. this.enterSOS(row)
  2162. } else if (data) {
  2163. this.$alert(data.msg, '错误', {
  2164. confirmButtonText: '确定'
  2165. })
  2166. }
  2167. })
  2168. })
  2169. },
  2170. /**
  2171. * 海安委外下达:调用海安下达接口,WCS推送由后续链路接管 - rqrq
  2172. */
  2173. confirmXiadaNotify () {
  2174. if (this.dataList.length === 0) {
  2175. this.$alert('没有明细记录无法下达!!', '提示', {
  2176. confirmButtonText: '确定'
  2177. })
  2178. return false
  2179. }
  2180. if (!this.xiadaNotifyData.planIssueDate || this.xiadaNotifyData.planIssueDate === '') {
  2181. this.$message.warning('请选择要求发料时间!')
  2182. return false
  2183. }
  2184. const notifyData = {
  2185. ...this.notifyData,
  2186. site: this.$store.state.user.site,
  2187. planIssueDate: this.xiadaNotifyData.planIssueDate,
  2188. remark: this.xiadaNotifyData.remark,
  2189. orderType: 'poorder'
  2190. }
  2191. haiAnXiadaNotify(notifyData).then(({ data }) => {
  2192. if (data && data.code === 0) {
  2193. this.showXiadaNotifyDialog = false
  2194. this.xiadaModelFlag = false
  2195. this.getUserNotifyNo()
  2196. this.$message.success('操作成功')
  2197. } else if (data) {
  2198. this.$alert(data.msg, '错误', {
  2199. confirmButtonText: '确定'
  2200. })
  2201. }
  2202. })
  2203. },
  2204. /**
  2205. * 海安委外删除主单:仅允许未下达且无明细时删除,落海安主表删除链路 - rqrq
  2206. */
  2207. deleteNotify () {
  2208. if (this.dataList.length > 0) {
  2209. this.$alert('请先删除已经申请的明细记录!!', '提示', {
  2210. confirmButtonText: '确定'
  2211. })
  2212. return false
  2213. }
  2214. const data = {
  2215. ...this.notifyData,
  2216. site: this.$store.state.user.site,
  2217. orderType: 'poorder'
  2218. }
  2219. haiAnDeleteNotify(data).then(({ data }) => {
  2220. if (data && data.code === 0) {
  2221. this.getUserNotifyNo()
  2222. this.$message.success(data.msg || '操作成功')
  2223. } else if (data) {
  2224. this.$alert(data.msg, '错误', {
  2225. confirmButtonText: '确定'
  2226. })
  2227. }
  2228. })
  2229. },
  2230. /**
  2231. * 海安委外删除父行:按notifyNo+itemNo+orderType删除对应父子明细 - rqrq
  2232. */
  2233. deleteNotifySOS (row) {
  2234. this.$confirm('是否删除这个工单的申请信息?', '提示', {
  2235. confirmButtonText: '确定',
  2236. cancelButtonText: '取消',
  2237. type: 'warning'
  2238. }).then(() => {
  2239. const inData = {
  2240. ...row,
  2241. site: this.$store.state.user.site,
  2242. notifyNo: this.notifyNo,
  2243. orderType: 'poorder'
  2244. }
  2245. haiAnDeleteNotifySOS(inData).then(({ data }) => {
  2246. if (data && data.code === 0) {
  2247. this.getNotifyPoDetail()
  2248. this.$message.success('操作成功')
  2249. } else if (data) {
  2250. this.$alert(data.msg, '错误', {
  2251. confirmButtonText: '确定'
  2252. })
  2253. }
  2254. })
  2255. }).catch(() => {})
  2256. },
  2257. /**
  2258. * 海安委外状态字典:沿用公共枚举接口,避免前端硬编码状态值 - rqrq
  2259. */
  2260. getAllNotifyStatus () {
  2261. const inData = {
  2262. site: this.$store.state.user.site,
  2263. listName: 'ISSUENOTIFYHEADER_STATUS',
  2264. locale: this.$i18n.locale
  2265. }
  2266. getAllNotifyStatus(inData).then(({ data }) => {
  2267. this.notifyStatusList = data
  2268. })
  2269. }
  2270. },
  2271. }
  2272. </script>
  2273. <style scoped>
  2274. .board666 .el-table .error-row {
  2275. background: #f86868;
  2276. }
  2277. /deep/ .el-table .error-row {
  2278. background: #f86868 !important;
  2279. }
  2280. /* 在 <style scoped> 下,使用深度选择器作用到 ElementUI 内部结构 */
  2281. .issueNotify {
  2282. width: 100%;
  2283. height: auto;
  2284. }
  2285. .issueNotify /deep/ .el-form-item__content {
  2286. display: inline !important;
  2287. }
  2288. .site-content > .el-tabs > .el-tabs__content > .site-tabs__tools {
  2289. top: 35px;
  2290. height: 40px;
  2291. font-size: 16px;
  2292. line-height: 40px;
  2293. }
  2294. .text-right /deep/ .el-input__inner {
  2295. text-align: right !important;
  2296. }
  2297. .text-right /deep/ .el-input-number__input {
  2298. text-align: right !important;
  2299. }
  2300. .yzzTable /deep/.el-table .cell {
  2301. line-height: 20px;
  2302. font-size: 12px;
  2303. height: 20px;
  2304. }
  2305. .applyQtyClass /deep/.el-input__inner {
  2306. height: 14px !important;
  2307. }
  2308. /* 选择工单弹窗:紧凑表格与按钮样式 */
  2309. .choose-sos-btn {
  2310. height: 14px;
  2311. box-sizing: border-box;
  2312. padding: 0 6px;
  2313. line-height: 12px;
  2314. font-size: 12px;
  2315. display: inline-flex;
  2316. align-items: center;
  2317. justify-content: center;
  2318. }
  2319. </style>