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.

2421 lines
78 KiB

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