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.

2280 lines
78 KiB

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