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.

2347 lines
77 KiB

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