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.

1764 lines
55 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
5 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 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()"
  9. class="yzzButtonAn">下达申请单</el-button>
  10. <el-button v-if="notifyNo!=''" type="primary" @click="deleteNotify()" class="yzzButtonAn">删除申请单</el-button>
  11. <el-button v-if="notifyNo!=''" @click="importModel()" type="primary" 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-row :gutter="10" v-if="notifyNo!=''">
  46. <el-col :span="12">
  47. <el-form-item :label="'备注'">
  48. <el-input v-model="notifyData.remark" style="width: 100%;"></el-input>
  49. </el-form-item>
  50. </el-col>
  51. </el-row>
  52. </el-form>
  53. <el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card"
  54. v-if="notifyNo!=''">
  55. <el-tab-pane label="已申请工单" name="sos">
  56. <el-table :height="height" :data="dataList" border style="width: 100%;">
  57. <el-table-column v-for="(item,index) in columnList" :key="index" :sortable="item.columnSortable"
  58. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  59. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  60. :label="item.columnLabel">
  61. <template slot-scope="scope">
  62. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  63. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  64. style="width: 100px; height: 80px" /></span>
  65. </template>
  66. </el-table-column>
  67. <el-table-column fixed="right" header-align="center" align="center" width="100" label="操作">
  68. <template slot-scope="scope">
  69. <a type="text" size="small" @click="enterSOSDetail(scope.row)">物料</a>
  70. <a type="text" size="small" @click="deleteNotifySOS(scope.row)">删除</a>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. </el-tab-pane>
  75. </el-tabs>
  76. <el-dialog title="选择工单" :close-on-click-modal="false" v-drag :visible.sync="seqNoModalFlag" width="1000px">
  77. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  78. <el-row :gutter="20">
  79. <el-col :span="4">
  80. <el-form-item :label="'Order No'">
  81. <el-input v-model="seqNoData.orderNo"></el-input>
  82. </el-form-item>
  83. </el-col>
  84. <el-col :span="4">
  85. <el-form-item :label="'Release No'">
  86. <el-input v-model="seqNoData.releaseNo"></el-input>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="4">
  90. <el-form-item :label="'Sequence No'">
  91. <el-input v-model="seqNoData.sequenceNo"></el-input>
  92. </el-form-item>
  93. </el-col>
  94. </el-row>
  95. <el-row :gutter="20">
  96. <el-col :span="6">
  97. <el-form-item>
  98. <el-button type="primary" @click="searchSOSRouting()" style="margin-top: 5px" class="">查询</el-button>
  99. </el-form-item>
  100. </el-col>
  101. </el-row>
  102. </el-form>
  103. <el-table :height="400" :data="seqNoList" border style="width: 100%;" class="choose-sos-table">
  104. <el-table-column v-for="(item,index) in columnList2" :key="index" :sortable="item.columnSortable"
  105. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  106. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  107. :label="item.columnLabel">
  108. <template slot-scope="scope">
  109. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  110. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  111. style="width: 100px; height: 80px" /></span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column fixed="left" header-align="center" align="center" width="80" label="操作">
  115. <template slot-scope="scope">
  116. <el-button type="primary" size="mini" plain class="choose-sos-btn" :loading="chooseLoading" @click="chooseSOS(scope.row)">选择</el-button>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  121. <el-button type="primary" @click="seqNoModalFlag = false">关闭</el-button>
  122. </el-footer>
  123. </el-dialog>
  124. <el-dialog title="保存工单" :close-on-click-modal="false" v-drag :visible.sync="saveSeqNoModalFlag" width="750px">
  125. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  126. <el-row :gutter="20">
  127. <el-col :span="6">
  128. <el-form-item :label="'OrderNo'">
  129. <el-input v-model="notifyOrderData.orderNo" disabled></el-input>
  130. </el-form-item>
  131. </el-col>
  132. <el-col :span="6">
  133. <el-form-item :label="'ReleaseNo'">
  134. <el-input v-model="notifyOrderData.releaseNo" disabled></el-input>
  135. </el-form-item>
  136. </el-col>
  137. <el-col :span="6">
  138. <el-form-item :label="'SequenceNo'">
  139. <el-input v-model="notifyOrderData.sequenceNo" disabled></el-input>
  140. </el-form-item>
  141. </el-col>
  142. <el-col :span="6">
  143. <el-form-item :label="'工单数量'">
  144. <el-input v-model="notifyOrderData.qtyRequired" disabled></el-input>
  145. </el-form-item>
  146. </el-col>
  147. </el-row>
  148. <el-row :gutter="20">
  149. <el-col :span="6">
  150. <el-form-item :label="'物料'">
  151. <el-input v-model="notifyOrderData.partNo" disabled></el-input>
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="18">
  155. <el-form-item :label="'物料名称'">
  156. <el-input v-model="notifyOrderData.partDesc" disabled style="width: 100%" ></el-input>
  157. </el-form-item>
  158. </el-col>
  159. </el-row>
  160. <el-row :gutter="20">
  161. <el-col :span="6">
  162. <el-form-item :label="'要求发料时间'">
  163. <el-date-picker style="width: 100%" v-model="notifyOrderData.needDate" type="datetime"
  164. value-format="yyyy-MM-dd HH:mm" placeholder="选择日期">
  165. </el-date-picker>
  166. </el-form-item>
  167. </el-col>
  168. <!-- <el-col :span="6">
  169. <el-form-item label="机台">
  170. <el-input v-model="notifyOrderData.locationNo" disabled></el-input>
  171. </el-form-item>
  172. </el-col> -->
  173. <!-- <el-col :span="6">-->
  174. <!-- <el-form-item :label="'此次领料数量'">-->
  175. <!-- &lt;!&ndash; <el-input-number v-model="notifyOrderData.issureQty" style="padding: 0px;width: 100%" :controls="false"-->
  176. <!-- :step="0" :min="0" class="text-right"></el-input-number> &ndash;&gt;-->
  177. <!-- <el-input v-model="notifyOrderData.issureQty" @input=" value=>notifyOrderData.issureQty = value.match(/0$|^[1-9]\d*/) ? value.match(/0$|^[1-9]\d*/)[0] : ''"></el-input>-->
  178. <!-- </el-form-item>-->
  179. <!-- </el-col>-->
  180. <!-- <el-col :span="6">-->
  181. <!-- <el-form-item :label="' '">-->
  182. <!-- <el-button type="primary" @click="qtyAllForSeqNo()">全数领料</el-button>-->
  183. <!-- </el-form-item>-->
  184. <!-- </el-col>-->
  185. </el-row>
  186. </el-form>
  187. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  188. <el-button type="primary" @click="saveSOS()">保存</el-button>
  189. <el-button type="primary" @click="saveSeqNoModalFlag=false">关闭</el-button>
  190. </el-footer>
  191. </el-dialog>
  192. <el-dialog title="申请明细" :close-on-click-modal="false" v-drag :visible.sync="materialModalFlag" width="900px">
  193. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  194. <el-row :gutter="20">
  195. <el-col :span="6">
  196. <el-form-item :label="'生产订单号'">
  197. <el-input v-model="sobomData.orderNo" disabled></el-input>
  198. </el-form-item>
  199. </el-col>
  200. <el-col :span="6">
  201. <el-form-item :label="'产品编码'">
  202. <el-input v-model="sobomData.partNo" disabled></el-input>
  203. </el-form-item>
  204. </el-col>
  205. </el-row>
  206. </el-form>
  207. <div class="yzzTable">
  208. <el-table :height="400" :data="sobomList" border v-loading="bomLoadFlag" style="width: 100%;">
  209. <el-table-column v-for="(item,index) in columnList3" :key="index" :sortable="item.columnSortable"
  210. :prop="item.columnProp" :header-align="item.headerAlign" :show-overflow-tooltip="item.showOverflowTooltip"
  211. :align="item.align" :fixed="item.fixed==''?false:item.fixed" :min-width="item.columnWidth"
  212. :label="item.columnLabel">
  213. <template slot-scope="scope">
  214. <div v-if="item.columnProp === 'qtyToIssue'">
  215. <el-input v-model="scope.row.qtyToIssue" type="number" style="height: 11px; width: 98%;" :step="0" :min="0"></el-input>
  216. </div>
  217. <div v-else-if="item.columnProp === 'remark'">
  218. <el-input v-model="scope.row.remark" style="padding: 0;width: 100%"></el-input>
  219. </div>
  220. <div v-else>
  221. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  222. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  223. style="width: 100px; height: 80px" /></span>
  224. </div>
  225. </template>
  226. </el-table-column>
  227. <el-table-column prop="" header-align="center" align="center" min-width="50" label="操作">
  228. <template slot-scope="scope">
  229. <el-button type="primary" @click="qtyAllForBom(scope.row)" style="width: 100%">全数领料</el-button>
  230. </template>
  231. </el-table-column>
  232. </el-table>
  233. </div>
  234. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  235. <el-button type="primary" @click="saveMaterialDetail()">保存</el-button>
  236. <el-button type="primary" @click="materialModalFlag=false">关闭</el-button>
  237. </el-footer>
  238. </el-dialog>
  239. <el-dialog title="保存物料" :close-on-click-modal="false" v-drag :visible.sync="saveOtherPartModalFlag" width="600px">
  240. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  241. <el-row :gutter="20">
  242. <el-col :span="6">
  243. <el-form-item :label="'物料编码'">
  244. <el-input v-model="otherPartData.componentPartNo" disabled></el-input>
  245. </el-form-item>
  246. </el-col>
  247. <el-col :span="18">
  248. <el-form-item :label="'物料描述'">
  249. <el-input v-model="otherPartData.partDesc" disabled></el-input>
  250. </el-form-item>
  251. </el-col>
  252. </el-row>
  253. <el-row :gutter="20">
  254. <el-col :span="6">
  255. <el-form-item :label="'计量单位'">
  256. <el-input v-model="otherPartData.umid" disabled></el-input>
  257. </el-form-item>
  258. </el-col>
  259. <el-col :span="6">
  260. <el-form-item :label="'需求数量'">
  261. <el-input-number v-model="otherPartData.qtyToIssue" style="padding: 0;width: 100%" :step="0" :min="0"
  262. :controls="false"></el-input-number>
  263. </el-form-item>
  264. </el-col>
  265. </el-row>
  266. <el-row :gutter="20">
  267. <el-col :span="24">
  268. <el-form-item :label="'备注'">
  269. <el-input v-model="otherPartData.remark"></el-input>
  270. </el-form-item>
  271. </el-col>
  272. </el-row>
  273. </el-form>
  274. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  275. <el-button type="primary" @click="saveOtherPart()">保存</el-button>
  276. <el-button type="primary" @click="saveOtherPartModalFlag=false">关闭</el-button>
  277. </el-footer>
  278. </el-dialog>
  279. <el-dialog title="选择申请类型" :close-on-click-modal="false" v-drag :visible.sync="showAddNotifyTypeDialog"
  280. width="400px">
  281. <el-form :inline="true" label-position="top" label-width="500px" style="margin-left: 7px;margin-top: -5px;">
  282. <el-row :gutter="20">
  283. <el-col :span="24">
  284. <el-form-item label="申请类型">
  285. <el-radio-group v-model="selectedNotifyType">
  286. <el-radio label="production">生产领料单</el-radio>
  287. <el-radio label="outsourced">委外领料单</el-radio>
  288. </el-radio-group>
  289. </el-form-item>
  290. </el-col>
  291. <el-col :span="24">
  292. <el-form-item label="备注" class="issueNotify">
  293. <el-input type="textarea" v-model="selectedNotifyRemark" :rows="3" placeholder="请输入内容" style="width: 100%"></el-input>
  294. </el-form-item>
  295. </el-col>
  296. </el-row>
  297. </el-form>
  298. <el-footer style="height:30px;text-align:center;">
  299. <el-button type="primary" @click="confirmAddNotify()">确认</el-button>
  300. <el-button type="primary" @click="showAddNotifyTypeDialog=false">取消</el-button>
  301. </el-footer>
  302. </el-dialog>
  303. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  304. <walUploadExcel ref="walUploadExcel" @refreshTable="searchTable" v-drag></walUploadExcel>
  305. </div>
  306. </template>
  307. <script>
  308. import {
  309. getSOScheduledRoutingListForIssure,
  310. createNotify,
  311. getUserNotifyNo,
  312. deleteNotify,
  313. getAllNotifyStatus,
  314. getNotifyNoDetail,
  315. saveSOIssueNotifyOrderList,
  316. saveMaterialDetail,
  317. deleteNotifySOS,
  318. getIFSShopOrderByOrderNo,
  319. searchNotifyMaterialList,
  320. } from '@/api/orderIssure/soIssueNotify.js'
  321. import Chooselist from '@/views/modules/common/Chooselist_eam'
  322. import walUploadExcel from './walmart_upload_excel.vue'
  323. import {
  324. getShopOrderFromIFSWithOrderNo,
  325. getSOSBOMForIssureNew,
  326. searchOtherPart,
  327. xiadaNotify
  328. } from '../../../api/orderIssure/soIssueNotify'
  329. import {getTableUserListLanguage} from '../../../api/table'
  330. export default {
  331. name: 'newSoIssueNotify',
  332. components: {
  333. Chooselist,
  334. walUploadExcel,
  335. },
  336. watch: {
  337. // notifyOrderData: {
  338. // deep: true,
  339. // handler: function (newV, oldV) {
  340. // this.notifyOrderData.locationNo = this.notifyOrderData.locationNo.toUpperCase()
  341. // }
  342. // },
  343. },
  344. data() {
  345. return {
  346. activeName: 'sos',
  347. noControlPartModelFlag: false,
  348. buList: [],
  349. partList: [],
  350. partList2: [],
  351. notifyStatusList: [],
  352. notifyNo: '',
  353. notifyData: {
  354. site: '',
  355. bu: '',
  356. notifyNo: '',
  357. notifyDate: '',
  358. enteredDate: '',
  359. userName: '',
  360. userDisplay: '',
  361. remark: '',
  362. planIssueDate: '',
  363. },
  364. dataList2: [],
  365. dataList3: [],
  366. // 是否收藏
  367. favorite: false,
  368. changeBuFlag: false,
  369. partModelFlag: false,
  370. newBu: '',
  371. // 导出 start
  372. exportData: [],
  373. exportName: '设备分组' + this.dayjs().format('YYYYMMDDHHmmss'),
  374. exportHeader: ['设备分组'],
  375. exportFooter: [],
  376. exportList: [],
  377. // 导出 end
  378. searchData: {
  379. site: this.$store.state.user.site,
  380. userName: this.$store.state.user.name,
  381. groupID: '',
  382. groupDesc: '',
  383. buDesc: '',
  384. active: 'Y',
  385. page: 1,
  386. limit: 10,
  387. },
  388. sobomData: {
  389. orderNo: '',
  390. seqno: '',
  391. partNo: '',
  392. },
  393. //申请单序号
  394. itemNo: '',
  395. notifyOrderData: {
  396. partNo: '',
  397. orderNo: '',
  398. itemNo: '',
  399. releaseNo: '',
  400. sequenceNo: '',
  401. partDesc: '',
  402. qtyrequired: '',
  403. issureQty: '',
  404. needDate: '',
  405. },
  406. seqNoData: {
  407. site: this.$store.state.user.site,
  408. seqno: '',
  409. releaseNo: '',
  410. sequenceNo: '',
  411. sResourceID: '',
  412. sWorkcenterno: '',
  413. operatorId: '',
  414. sShiftno: '',
  415. startDate: '',
  416. endDate: '',
  417. },
  418. seqNoList: [],
  419. height: 200,
  420. pageIndex: 1,
  421. pageSize: 20,
  422. totalPage: 0,
  423. dataList: [],
  424. sobomList: [],
  425. dataListSelections: [],
  426. seqNoModalFlag: false,
  427. materialModalFlag: false,
  428. modalDisableFlag: false,
  429. saveSeqNoModalFlag: false,
  430. bomLoadFlag: false,
  431. xiadaList: [],
  432. columnList4: [
  433. {
  434. userId: this.$store.state.user.name,
  435. functionId: 701001,
  436. serialNumber: '701001Table4ComponentPartNo',
  437. tableId: '701001Table4',
  438. tableName: '非BOM材料明细',
  439. columnProp: 'componentPartNo',
  440. headerAlign: 'center',
  441. align: 'center',
  442. columnLabel: '材料编码',
  443. columnHidden: false,
  444. columnImage: false,
  445. columnSortable: false,
  446. sortLv: 0,
  447. status: true,
  448. fixed: false,
  449. columnWidth: 100,
  450. },
  451. {
  452. userId: this.$store.state.user.name,
  453. functionId: 701001,
  454. serialNumber: '701001Table4PartDesc',
  455. tableId: '701001Table4',
  456. tableName: '非BOM材料明细',
  457. columnProp: 'partDesc',
  458. headerAlign: 'center',
  459. align: 'left',
  460. columnLabel: '材料名称',
  461. columnHidden: false,
  462. columnImage: false,
  463. columnSortable: false,
  464. sortLv: 0,
  465. status: true,
  466. fixed: false,
  467. columnWidth: 130,
  468. },
  469. {
  470. userId: this.$store.state.user.name,
  471. functionId: 701001,
  472. serialNumber: '701001Table4QtyToIssue',
  473. tableId: '701001Table4',
  474. tableName: '非BOM材料明细',
  475. columnProp: 'qtyToIssue',
  476. headerAlign: 'center',
  477. align: 'right',
  478. columnLabel: '申请数量',
  479. columnHidden: false,
  480. columnImage: false,
  481. columnSortable: false,
  482. sortLv: 0,
  483. status: true,
  484. fixed: false,
  485. columnWidth: 80,
  486. },
  487. {
  488. userId: this.$store.state.user.name,
  489. functionId: 701001,
  490. serialNumber: '701001Table4Remark',
  491. tableId: '701001Table4',
  492. tableName: '非BOM材料明细',
  493. columnProp: 'remark',
  494. headerAlign: 'center',
  495. align: 'left',
  496. columnLabel: '备注',
  497. columnHidden: false,
  498. columnImage: false,
  499. columnSortable: false,
  500. sortLv: 0,
  501. status: true,
  502. fixed: false,
  503. columnWidth: 200,
  504. },
  505. ],
  506. modalData: {
  507. flag: '',
  508. bu: '',
  509. site: this.$store.state.user.site,
  510. groupID: '',
  511. groupDesc: '',
  512. active: '',
  513. createBy: this.$store.state.user.name,
  514. updateBy: this.$store.state.user.name,
  515. },
  516. // 展示列集
  517. columnList: [
  518. {
  519. userId: this.$store.state.user.name,
  520. functionId: 701001,
  521. serialNumber: '701001Table1ItemNo',
  522. tableId: '701001Table1',
  523. tableName: '领料申请工单子表',
  524. columnProp: 'itemNo',
  525. headerAlign: 'center',
  526. align: 'right',
  527. columnLabel: '序号',
  528. columnHidden: false,
  529. columnImage: false,
  530. columnSortable: false,
  531. sortLv: 0,
  532. status: true,
  533. fixed: false,
  534. columnWidth: 50,
  535. },
  536. /* {
  537. userId: this.$store.state.user.name,
  538. functionId: 701001,
  539. serialNumber: '701001Table1SeqNo',
  540. tableId: '701001Table1',
  541. tableName: '领料申请派工单子表',
  542. columnProp: 'seqNo',
  543. headerAlign: 'center',
  544. align: 'center',
  545. columnLabel: '派工单号',
  546. columnHidden: false,
  547. columnImage: false,
  548. columnSortable: false,
  549. sortLv: 0,
  550. status: true,
  551. fixed: false,
  552. columnWidth: 150,
  553. }, */
  554. {
  555. userId: this.$store.state.user.name,
  556. functionId: 701001,
  557. serialNumber: '701001Table1SOOrderNo',
  558. tableId: '701001Table1',
  559. tableName: '领料申请工单子表',
  560. columnProp: 'soorderNo',
  561. headerAlign: 'center',
  562. align: 'center',
  563. columnLabel: '生产订单号',
  564. columnHidden: false,
  565. columnImage: false,
  566. columnSortable: false,
  567. sortLv: 0,
  568. status: true,
  569. fixed: false,
  570. columnWidth: 120,
  571. },
  572. {
  573. userId: this.$store.state.user.name,
  574. functionId: 701001,
  575. serialNumber: '701001Table1ReleaseNo',
  576. tableId: '701001Table1',
  577. tableName: '领料申请工单子表',
  578. columnProp: 'releaseNo',
  579. headerAlign: 'center',
  580. align: 'center',
  581. columnLabel: 'ReleaseNo',
  582. columnHidden: false,
  583. columnImage: false,
  584. columnSortable: false,
  585. sortLv: 0,
  586. status: true,
  587. fixed: false,
  588. columnWidth: 80,
  589. },
  590. {
  591. userId: this.$store.state.user.name,
  592. functionId: 701001,
  593. serialNumber: '701001Table1SequenceNo',
  594. tableId: '701001Table1',
  595. tableName: '领料申请工单子表',
  596. columnProp: 'sequenceNo',
  597. headerAlign: 'center',
  598. align: 'center',
  599. columnLabel: 'SequenceNo',
  600. columnHidden: false,
  601. columnImage: false,
  602. columnSortable: false,
  603. sortLv: 0,
  604. status: true,
  605. fixed: false,
  606. columnWidth: 80,
  607. },
  608. {
  609. userId: this.$store.state.user.name,
  610. functionId: 701001,
  611. serialNumber: '701001Table1FgPartNo',
  612. tableId: '701001Table1',
  613. tableName: '领料申请工单子表',
  614. columnProp: 'fgPartNo',
  615. headerAlign: 'center',
  616. align: 'center',
  617. columnLabel: '产成品编码',
  618. columnHidden: false,
  619. columnImage: false,
  620. columnSortable: false,
  621. sortLv: 0,
  622. status: true,
  623. fixed: false,
  624. columnWidth: 80,
  625. },
  626. {
  627. userId: this.$store.state.user.name,
  628. functionId: 701001,
  629. serialNumber: '701001Table1NeedDate',
  630. tableId: '701001Table1',
  631. tableName: '领料申请派工单子表',
  632. columnProp: 'needDate',
  633. headerAlign: 'center',
  634. align: 'left',
  635. columnLabel: '要求发料时间',
  636. columnHidden: false,
  637. columnImage: false,
  638. columnSortable: false,
  639. sortLv: 0,
  640. status: true,
  641. fixed: false,
  642. columnWidth: 80,
  643. },
  644. ],
  645. columnList2: [
  646. {
  647. userId: this.$store.state.user.name,
  648. functionId: 701001,
  649. serialNumber: '701001Table2OrderNo',
  650. tableId: '701001Table2',
  651. tableName: '查询派工单',
  652. columnProp: 'orderNo',
  653. headerAlign: 'center',
  654. align: 'center',
  655. columnLabel: 'OrderNo',
  656. columnHidden: false,
  657. columnImage: false,
  658. columnSortable: false,
  659. sortLv: 0,
  660. status: true,
  661. fixed: false,
  662. columnWidth: 130,
  663. },
  664. {
  665. userId: this.$store.state.user.name,
  666. functionId: 701001,
  667. serialNumber: '701001Table2ReleaseNo',
  668. tableId: '701001Table2',
  669. tableName: '查询派工单',
  670. columnProp: 'releaseNo',
  671. headerAlign: 'center',
  672. align: 'center',
  673. columnLabel: 'ReleaseNo',
  674. columnHidden: false,
  675. columnImage: false,
  676. columnSortable: false,
  677. sortLv: 0,
  678. status: true,
  679. fixed: false,
  680. columnWidth: 80,
  681. },
  682. {
  683. userId: this.$store.state.user.name,
  684. functionId: 701001,
  685. serialNumber: '701001Table2SequenceNo',
  686. tableId: '701001Table2',
  687. tableName: '查询派工单',
  688. columnProp: 'sequenceNo',
  689. headerAlign: 'center',
  690. align: 'center',
  691. columnLabel: 'SequenceNo',
  692. columnHidden: false,
  693. columnImage: false,
  694. columnSortable: false,
  695. sortLv: 0,
  696. status: true,
  697. fixed: false,
  698. columnWidth: 80,
  699. },
  700. {
  701. userId: this.$store.state.user.name,
  702. functionId: 701001,
  703. serialNumber: '701001Table2Status',
  704. tableId: '701001Table2',
  705. tableName: '查询派工单',
  706. columnProp: 'status',
  707. headerAlign: 'center',
  708. align: 'center',
  709. columnLabel: '状态',
  710. columnHidden: false,
  711. columnImage: false,
  712. columnSortable: false,
  713. sortLv: 0,
  714. status: true,
  715. fixed: false,
  716. columnWidth: 70,
  717. },
  718. {
  719. userId: this.$store.state.user.name,
  720. functionId: 701001,
  721. serialNumber: '701001Table2LotSize',
  722. tableId: '701001Table2',
  723. tableName: '查询派工单',
  724. columnProp: 'lotSize',
  725. headerAlign: 'center',
  726. align: 'right',
  727. columnLabel: '订单数量',
  728. columnHidden: false,
  729. columnImage: false,
  730. columnSortable: false,
  731. sortLv: 0,
  732. status: true,
  733. fixed: false,
  734. columnWidth: 100,
  735. },
  736. {
  737. userId: this.$store.state.user.name,
  738. functionId: 701001,
  739. serialNumber: '701001Table2QtyComplete',
  740. tableId: '701001Table2',
  741. tableName: '查询派工单',
  742. columnProp: 'qtyComplete',
  743. headerAlign: 'center',
  744. align: 'center',
  745. columnLabel: '完成数量',
  746. columnHidden: false,
  747. columnImage: false,
  748. columnSortable: false,
  749. sortLv: 0,
  750. status: true,
  751. fixed: false,
  752. columnWidth: 120,
  753. },
  754. {
  755. userId: this.$store.state.user.name,
  756. functionId: 701001,
  757. serialNumber: '701001Table2PartNo',
  758. tableId: '701001Table2',
  759. tableName: '查询派工单',
  760. columnProp: 'partNo',
  761. headerAlign: 'center',
  762. align: 'center',
  763. columnLabel: '物料编码',
  764. columnHidden: false,
  765. columnImage: false,
  766. columnSortable: false,
  767. sortLv: 0,
  768. status: true,
  769. fixed: false,
  770. columnWidth: 100,
  771. },
  772. {
  773. userId: this.$store.state.user.name,
  774. functionId: 701001,
  775. serialNumber: '701001Table2PartDesc',
  776. tableId: '701001Table2',
  777. tableName: '查询派工单',
  778. columnProp: 'partDesc',
  779. headerAlign: 'center',
  780. align: 'center',
  781. columnLabel: '物料描述',
  782. columnHidden: false,
  783. columnImage: false,
  784. columnSortable: false,
  785. sortLv: 0,
  786. status: true,
  787. fixed: false,
  788. columnWidth: 200,
  789. },
  790. {
  791. userId: this.$store.state.user.name,
  792. functionId: 701001,
  793. serialNumber: '701001Table2Uom',
  794. tableId: '701001Table2',
  795. tableName: '查询派工单',
  796. columnProp: 'uom',
  797. headerAlign: 'center',
  798. align: 'center',
  799. columnLabel: '单位',
  800. columnHidden: false,
  801. columnImage: false,
  802. columnSortable: false,
  803. sortLv: 0,
  804. status: true,
  805. fixed: false,
  806. columnWidth: 80,
  807. },
  808. {
  809. userId: this.$store.state.user.name,
  810. functionId: 701001,
  811. serialNumber: '701001Table2StartDate',
  812. tableId: '701001Table2',
  813. tableName: '查询派工单',
  814. columnProp: 'startDate',
  815. headerAlign: 'center',
  816. align: 'center',
  817. columnLabel: '开始生产日期',
  818. columnHidden: false,
  819. columnImage: false,
  820. columnSortable: false,
  821. sortLv: 0,
  822. status: true,
  823. fixed: false,
  824. columnWidth: 110,
  825. },
  826. {
  827. userId: this.$store.state.user.name,
  828. functionId: 701001,
  829. serialNumber: '701001Table2FinishDate',
  830. tableId: '701001Table2',
  831. tableName: '查询派工单',
  832. columnProp: 'finishDate',
  833. headerAlign: 'center',
  834. align: 'center',
  835. columnLabel: '结束生产日期',
  836. columnHidden: false,
  837. columnImage: false,
  838. columnSortable: false,
  839. sortLv: 0,
  840. status: true,
  841. fixed: false,
  842. columnWidth: 110,
  843. },
  844. {
  845. userId: this.$store.state.user.name,
  846. functionId: 701001,
  847. serialNumber: '701001Table2NeedDate',
  848. tableId: '701001Table2',
  849. tableName: '查询派工单',
  850. columnProp: 'needDate',
  851. headerAlign: 'center',
  852. align: 'center',
  853. columnLabel: '需求日期',
  854. columnHidden: false,
  855. columnImage: false,
  856. columnSortable: false,
  857. sortLv: 0,
  858. status: true,
  859. fixed: false,
  860. columnWidth: 110,
  861. },
  862. {
  863. userId: this.$store.state.user.name,
  864. functionId: 701001,
  865. serialNumber: '701001Table2Contract',
  866. tableId: '701001Table2',
  867. tableName: '查询派工单',
  868. columnProp: 'contract',
  869. headerAlign: 'center',
  870. align: 'center',
  871. columnLabel: '合同号',
  872. columnHidden: false,
  873. columnImage: false,
  874. columnSortable: false,
  875. sortLv: 0,
  876. status: true,
  877. fixed: false,
  878. columnWidth: 100,
  879. },
  880. {
  881. userId: this.$store.state.user.name,
  882. functionId: 701001,
  883. serialNumber: '701001Table2CloseCode',
  884. tableId: '701001Table2',
  885. tableName: '查询派工单',
  886. columnProp: 'closeCode',
  887. headerAlign: 'center',
  888. align: 'center',
  889. columnLabel: '关闭代码',
  890. columnHidden: false,
  891. columnImage: false,
  892. columnSortable: false,
  893. sortLv: 0,
  894. status: true,
  895. fixed: false,
  896. columnWidth: 120,
  897. },
  898. {
  899. userId: this.$store.state.user.name,
  900. functionId: 701001,
  901. serialNumber: '701001Table2Objstate',
  902. tableId: '701001Table2',
  903. tableName: '查询派工单',
  904. columnProp: 'objstate',
  905. headerAlign: 'center',
  906. align: 'center',
  907. columnLabel: 'objstate',
  908. columnHidden: false,
  909. columnImage: false,
  910. columnSortable: false,
  911. sortLv: 0,
  912. status: true,
  913. fixed: false,
  914. columnWidth: 100,
  915. }
  916. ],
  917. columnList3: [
  918. {
  919. userId: this.$store.state.user.name,
  920. functionId: 701001,
  921. serialNumber: '701001Table3ComponentPartNo',
  922. tableId: '701001Table3',
  923. tableName: '领料申请BOM子表',
  924. columnProp: 'componentPartNo',
  925. headerAlign: 'center',
  926. align: 'left',
  927. columnLabel: '物料编码',
  928. columnHidden: false,
  929. columnImage: false,
  930. columnSortable: false,
  931. sortLv: 0,
  932. status: true,
  933. fixed: false,
  934. columnWidth: 80,
  935. },
  936. {
  937. userId: this.$store.state.user.name,
  938. functionId: 701001,
  939. serialNumber: '701001Table3PartDesc',
  940. tableId: '701001Table3',
  941. tableName: '领料申请BOM子表',
  942. columnProp: 'componentPartDesc',
  943. headerAlign: 'center',
  944. align: 'left',
  945. columnLabel: '物料描述',
  946. columnHidden: false,
  947. columnImage: false,
  948. columnSortable: false,
  949. sortLv: 0,
  950. status: true,
  951. fixed: false,
  952. columnWidth: 120,
  953. },
  954. {
  955. userId: this.$store.state.user.name,
  956. functionId: 701001,
  957. serialNumber: '701001Table3QtyRequired',
  958. tableId: '701001Table3',
  959. tableName: '领料申请BOM子表',
  960. columnProp: 'qtyRequired',
  961. headerAlign: 'center',
  962. align: 'right',
  963. columnLabel: '需求数量',
  964. columnHidden: false,
  965. columnImage: false,
  966. columnSortable: false,
  967. sortLv: 0,
  968. status: true,
  969. fixed: false,
  970. columnWidth: 50,
  971. },
  972. {
  973. userId: this.$store.state.user.name,
  974. functionId: 701001,
  975. serialNumber: '701001Table3QtyToIssue',
  976. tableId: '701001Table3',
  977. tableName: '领料申请BOM子表',
  978. columnProp: 'qtyToIssue',
  979. headerAlign: 'center',
  980. align: 'right',
  981. columnLabel: '本次申请数量',
  982. columnHidden: false,
  983. columnImage: false,
  984. columnSortable: false,
  985. sortLv: 0,
  986. status: true,
  987. fixed: false,
  988. columnWidth: 60,
  989. },
  990. {
  991. userId: this.$store.state.user.name,
  992. functionId: 701001,
  993. serialNumber: '701001Table3Remark',
  994. tableId: '701001Table3',
  995. tableName: '领料申请BOM子表',
  996. columnProp: 'remark',
  997. headerAlign: 'center',
  998. align: 'left',
  999. columnLabel: '备注',
  1000. columnHidden: false,
  1001. columnImage: false,
  1002. columnSortable: false,
  1003. sortLv: 0,
  1004. status: true,
  1005. fixed: false,
  1006. columnWidth: 150,
  1007. },
  1008. ],
  1009. rules: {
  1010. groupIdType: [
  1011. {
  1012. required: true,
  1013. message: ' ',
  1014. trigger: ['blur', 'change'],
  1015. },
  1016. ],
  1017. groupDescType: [
  1018. {
  1019. required: true,
  1020. message: ' ',
  1021. trigger: ['blur', 'change'],
  1022. },
  1023. ],
  1024. activeType: [
  1025. {
  1026. required: true,
  1027. message: ' ',
  1028. trigger: ['blur', 'change'],
  1029. },
  1030. ],
  1031. bu: [
  1032. {
  1033. required: true,
  1034. message: ' ',
  1035. trigger: ['blur', 'change'],
  1036. },
  1037. ],
  1038. },
  1039. userBuList: [],
  1040. authSearch: false,
  1041. authSave: false,
  1042. authUpdate: false,
  1043. authDelete: false,
  1044. menuId: this.$route.meta.menuId,
  1045. partSearch: {
  1046. site: '',
  1047. sourceBu: '',
  1048. partNo: '',
  1049. partDesc: '',
  1050. spec: '',
  1051. },
  1052. xiadaModelFlag: false,
  1053. saveOtherPartModalFlag: false,
  1054. otherPartData: {
  1055. site: '',
  1056. notifyNo: '',
  1057. itemNo: '',
  1058. bOMItemNo: '',
  1059. componentPartNo: '',
  1060. qtyToIssue: '',
  1061. issueType: '',
  1062. partDesc: '',
  1063. umid: '',
  1064. remark: '',
  1065. },
  1066. showAddNotifyTypeDialog: false,
  1067. selectedNotifyType: 'production',
  1068. selectedNotifyRemark:'',
  1069. chooseLoading: false,
  1070. }
  1071. },
  1072. mounted() {
  1073. this.$nextTick(() => {
  1074. this.height = window.innerHeight - 300
  1075. })
  1076. },
  1077. created() {
  1078. // 按钮控制
  1079. // this.getButtonAuthData()
  1080. this.getUserNotifyNo()
  1081. },
  1082. methods: {
  1083. getBaseList(val, type) {
  1084. this.tagNo = val
  1085. let conSql = ''
  1086. this.$nextTick(() => {
  1087. let strVal = ''
  1088. if (val === 515) {
  1089. strVal = this.seqNoData.sResourceid
  1090. conSql =
  1091. " and site = '" +
  1092. this.notifyData.site +
  1093. "'" +
  1094. " and bu_no = '" +
  1095. this.notifyData.bu +
  1096. "'"
  1097. this.$refs.baseList.init(val, strVal, conSql)
  1098. }
  1099. if (val === 216) {
  1100. strVal = this.seqNoData.sWorkcenterno
  1101. conSql =
  1102. " and site = '" +
  1103. this.notifyData.site +
  1104. "'" +
  1105. " and bu_no = '" +
  1106. this.notifyData.bu +
  1107. "'"
  1108. this.$refs.baseList.init(val, strVal, conSql)
  1109. }
  1110. if (val === 215) {
  1111. strVal = this.notifyOrderData.locationNo
  1112. this.$refs.baseList.init(val, strVal)
  1113. }
  1114. })
  1115. },
  1116. tableRowClassName({ row, rowIndex }) {
  1117. if (row.qtyToIssue > row.qtyAvailable) {
  1118. return 'error-row'
  1119. }
  1120. return ''
  1121. },
  1122. // 列表方法的回调
  1123. getBaseData(val) {
  1124. if (this.tagNo === 515) {
  1125. this.seqNoData.sResourceid = val.resource_id
  1126. }
  1127. if (this.tagNo === 215) {
  1128. this.notifyOrderData.locationNo = val.location_id
  1129. }
  1130. if (this.tagNo === 216) {
  1131. this.seqNoData.sWorkcenterno = val.work_center_no
  1132. }
  1133. },
  1134. getUserNotifyNo() {
  1135. let inData = {
  1136. site: this.$store.state.user.site,
  1137. username: this.$store.state.user.name,
  1138. }
  1139. this.getAllNotifyStatus()
  1140. getUserNotifyNo(inData).then(({ data }) => {
  1141. if (data.code === 0) {
  1142. if (data.row != null) {
  1143. this.notifyNo = data.row.notifyNo
  1144. this.notifyData = data.row
  1145. this.getNotifyNoDetail()
  1146. /* this.searchOtherPart('BOM')
  1147. this.searchOtherPart('不管控物料') */
  1148. } else {
  1149. this.notifyNo = ''
  1150. this.notifyData = {
  1151. site: '',
  1152. bu: '',
  1153. notifyNo: '',
  1154. notifyDate: '',
  1155. enteredDate: '',
  1156. userName: '',
  1157. userDisplay: '',
  1158. remark: '',
  1159. planIssueDate: '',
  1160. }
  1161. this.dataList = []
  1162. }
  1163. } else {
  1164. this.notifyNo = ''
  1165. this.notifyData = {
  1166. site: '',
  1167. bu: '',
  1168. notifyNo: '',
  1169. notifyDate: '',
  1170. enteredDate: '',
  1171. userName: '',
  1172. userDisplay: '',
  1173. remark: '',
  1174. planIssueDate: '',
  1175. }
  1176. this.dataList = []
  1177. }
  1178. })
  1179. },
  1180. getNotifyNoDetail() {
  1181. let inData = {
  1182. site: this.$store.state.user.site,
  1183. notifyNo: this.notifyNo,
  1184. }
  1185. getNotifyNoDetail(inData).then(({ data }) => {
  1186. if (data.code === 0) {
  1187. this.dataList = data.rows
  1188. }
  1189. })
  1190. },
  1191. addNotify() {
  1192. //this.showAddNotifyTypeDialog = true
  1193. let inData = {
  1194. site: this.$store.state.user.site,
  1195. userName: this.$store.state.user.name,
  1196. }
  1197. createNotify(inData).then(({ data }) => {
  1198. if (data.code === 0) {
  1199. this.showAddNotifyTypeDialog = false
  1200. this.$message({
  1201. message: '操作成功',
  1202. type: 'success',
  1203. duration: 1500,
  1204. onClose: () => {},
  1205. })
  1206. this.getUserNotifyNo()
  1207. } else {
  1208. this.$alert(data.msg, '错误', {
  1209. confirmButtonText: '确定',
  1210. })
  1211. }
  1212. })
  1213. },
  1214. confirmAddNotify() {
  1215. let outWorkOrderFlag = 'N'
  1216. if (this.selectedNotifyType === 'outsourced') {
  1217. outWorkOrderFlag = 'Y'
  1218. } else {
  1219. outWorkOrderFlag = 'N'
  1220. }
  1221. let inData = {
  1222. site: this.$store.state.user.site,
  1223. userName: this.$store.state.user.name,
  1224. outWorkOrderFlag: outWorkOrderFlag,
  1225. remark: this.selectedNotifyRemark,
  1226. }
  1227. this.getAllNotifyStatus()
  1228. createNotify(inData).then(({ data }) => {
  1229. if (data.code === 0) {
  1230. this.showAddNotifyTypeDialog = false
  1231. this.$message({
  1232. message: '操作成功',
  1233. type: 'success',
  1234. duration: 1500,
  1235. onClose: () => {},
  1236. })
  1237. this.getUserNotifyNo()
  1238. } else {
  1239. this.$alert(data.msg, '错误', {
  1240. confirmButtonText: '确定',
  1241. })
  1242. }
  1243. })
  1244. },
  1245. chooseSOS(row) {
  1246. if (this.dataList.length > 0) {
  1247. //这边是有个判断的,判断派工单号不能重复
  1248. let stop = false
  1249. for (let i = 0; i < this.dataList.length; i++) {
  1250. if (this.dataList[i].orderNo == row.orderNo&&
  1251. this.dataList[i].releaseNo == row.releaseNo&&
  1252. this.dataList[i].sequenceNo == row.sequenceNo) {
  1253. stop = true
  1254. }
  1255. }
  1256. if (stop) {
  1257. this.$alert('已经选择过此工单,请返回点击明细直接操作!!', '提示', {
  1258. confirmButtonText: '确定',
  1259. })
  1260. return false
  1261. }
  1262. }
  1263. let inData = {
  1264. site: this.$store.state.user.site,
  1265. orderNo: row.orderNo,
  1266. releaseNo: row.releaseNo,
  1267. sequenceNo: row.sequenceNo,
  1268. }
  1269. this.chooseLoading = true
  1270. getShopOrderFromIFSWithOrderNo(inData).then(({ data }) => {
  1271. if (data.code === 0) {
  1272. console.log("data",data);
  1273. this.notifyOrderData.partNo = data.rows[0].partNo
  1274. this.notifyOrderData.orderNo = data.rows[0].orderNo
  1275. this.notifyOrderData.site = this.$store.state.user.site
  1276. this.notifyOrderData.partDesc = data.rows[0].partDesc
  1277. this.notifyOrderData.qtyRequired = data.rows[0].lotSize
  1278. this.notifyOrderData.releaseNo = data.rows[0].releaseNo
  1279. this.notifyOrderData.issureQty = ''
  1280. this.notifyOrderData.needDate = this.dayjs().format('YYYY-MM-DD HH:mm')
  1281. this.notifyOrderData.sequenceNo = data.rows[0].sequenceNo
  1282. this.saveSeqNoModalFlag = true
  1283. }else {
  1284. this.$meassage.error(data.msg)
  1285. return;
  1286. }
  1287. }).finally(() => {
  1288. this.chooseLoading = false
  1289. })
  1290. },
  1291. saveSOS() {
  1292. if (
  1293. this.notifyOrderData.needDate == null ||
  1294. this.notifyOrderData.needDate == ''
  1295. ) {
  1296. this.$message.warning('请选择时间!')
  1297. return false
  1298. }
  1299. // if (
  1300. // this.notifyOrderData.issureQty == null ||
  1301. // this.notifyOrderData.issureQty == '' ||
  1302. // this.notifyOrderData.issureQty < 0
  1303. // ) {
  1304. // this.$message.warning('请填写领取数量!')
  1305. // return false
  1306. // }
  1307. let row = this.notifyOrderData
  1308. console.log("row",row,this.dataList);
  1309. if (this.dataList.length > 0) {
  1310. let stop = false
  1311. for (let i = 0; i < this.dataList.length; i++) {
  1312. if (this.dataList[i].soorderNo == row.orderNo&&
  1313. this.dataList[i].releaseNo == row.releaseNo&&
  1314. this.dataList[i].sequenceNo == row.sequenceNo) {
  1315. stop = true
  1316. }
  1317. }
  1318. if (stop) {
  1319. this.$alert('已经选择过此工单,请返回点击明细直接操作!!', '提示', {
  1320. confirmButtonText: '确定',
  1321. })
  1322. return false
  1323. }
  1324. }
  1325. this.$confirm('确定选择工单' + row.orderNo + '?', '提示', {
  1326. confirmButtonText: '确定',
  1327. cancelButtonText: '取消',
  1328. type: 'warning',
  1329. }).then(() => {
  1330. let inData = {
  1331. site: this.$store.state.user.site,
  1332. notifyNo: this.notifyNo,
  1333. fgPartNo: row.partNo,
  1334. soorderNo: row.orderNo,
  1335. opsItemNo: row.itemNo,
  1336. sequenceNo: row.sequenceNo,
  1337. releaseNo: row.releaseNo,
  1338. needDate: row.needDate,
  1339. issureQty: row.issureQty,
  1340. }
  1341. saveSOIssueNotifyOrderList(inData).then(({ data }) => {
  1342. if (data.code === 0) {
  1343. this.saveSeqNoModalFlag = false
  1344. row.itemNo = data.itemNo
  1345. this.getNotifyNoDetail()
  1346. this.enterSOS(row)
  1347. } else {
  1348. this.$alert(data.msg, '错误', {
  1349. confirmButtonText: '确定',
  1350. })
  1351. }
  1352. })
  1353. })
  1354. },
  1355. qtyAllForSeqNo() {
  1356. this.notifyOrderData.issureQty = this.notifyOrderData.qtyRequired
  1357. },
  1358. qtyAllForBom(row) {
  1359. row.qtyToIssue = row.qtyRequired
  1360. },
  1361. enterSOSDetail(row) {
  1362. let rows = {
  1363. site: this.$store.state.user.site,
  1364. notifyNo: this.notifyNo,
  1365. orderNo: row.soorderNo,
  1366. seqNo: row.seqNo,
  1367. partNo: row.fgPartNo,
  1368. itemNo: row.itemNo,
  1369. releaseNo: row.releaseNo,
  1370. sequenceNo: row.sequenceNo,
  1371. }
  1372. //this.searchNotifyMaterialList(rows)
  1373. this.enterSOS(rows)
  1374. },
  1375. enterSOS(row) {
  1376. console.log("row",row);
  1377. this.seqNoModalFlag = false
  1378. this.materialModalFlag = true
  1379. this.sobomList = []
  1380. this.sobomData = {
  1381. orderNo: row.orderNo,
  1382. seqNo: row.seqNo,
  1383. partNo: row.partNo,
  1384. }
  1385. this.bomLoadFlag = true
  1386. let inData = {
  1387. site: this.$store.state.user.site,
  1388. notifyNo: this.notifyNo,
  1389. orderNo: row.orderNo,
  1390. releaseNo: row.releaseNo,
  1391. sequenceNo: row.sequenceNo,
  1392. partNo: row.partNo,
  1393. itemNo: row.itemNo,
  1394. }
  1395. getSOSBOMForIssureNew(inData).then(({ data }) => {
  1396. this.bomLoadFlag = false
  1397. if (data.code === 0) {
  1398. this.sobomList = data.rows
  1399. for (let i = 0; i < this.sobomList.length; i++) {
  1400. this.sobomList[i].itemNo = inData.itemNo
  1401. /* if(!this.sobomList[i].qtyToIssue){
  1402. this.$set(this.sobomList[i], 'qtyToIssue', this.sobomList[i].qtyRequired)
  1403. } */
  1404. }
  1405. }
  1406. })
  1407. },
  1408. chooseSOSModal() {
  1409. this.seqNoData = {
  1410. site: this.$store.state.user.site,
  1411. orderNo: '',
  1412. releaseNo: '*',
  1413. sequenceNo: '*',
  1414. seqno: '',
  1415. sResourceid: '',
  1416. sWorkcenterno: '',
  1417. operatorId: '',
  1418. sShiftno: '',
  1419. startDate: this.dayjs().format('YYYY-MM-DD'),
  1420. endDate: this.dayjs().format('YYYY-MM-DD'),
  1421. }
  1422. this.seqNoModalFlag = true
  1423. },
  1424. searchSOSRouting() {
  1425. if (this.seqNoData.orderNo == null || this.seqNoData.orderNo == '') {
  1426. this.$message.warning('请输入OrderNo!')
  1427. return false
  1428. }
  1429. if (this.seqNoData.releaseNo == null || this.seqNoData.releaseNo == '') {
  1430. this.$message.warning('请输入ReleaseNo!')
  1431. return false
  1432. }
  1433. if (this.seqNoData.sequenceNo == null || this.seqNoData.sequenceNo == '') {
  1434. this.$message.warning('请输入SequenceNo!')
  1435. return false
  1436. }
  1437. getShopOrderFromIFSWithOrderNo(this.seqNoData).then(({ data }) => {
  1438. if (data.code === 0) {
  1439. this.seqNoList = data.rows
  1440. }
  1441. })
  1442. },
  1443. saveMaterialDetail() {
  1444. for (let i = 0; i < this.sobomList.length; i++) {
  1445. if (
  1446. this.sobomList[i].applyQty === '' ||
  1447. this.sobomList[i].applyQty == null
  1448. ) {
  1449. this.sobomList[i].applyQty = 0
  1450. }
  1451. this.sobomList[i].notifyNo = this.notifyNo
  1452. this.sobomList[i].site = this.$store.state.user.site
  1453. }
  1454. let materialList = this.sobomList.filter((item) => item.qtyToIssue > 0)
  1455. if (materialList.length == 0) {
  1456. this.$alert('没有需要保存的内容!', '提示', {
  1457. confirmButtonText: '确定',
  1458. })
  1459. return false
  1460. }
  1461. console.log("this.sobomList",materialList);
  1462. saveMaterialDetail(materialList).then(({ data }) => {
  1463. if (data.code === 0) {
  1464. this.materialModalFlag = false
  1465. this.chooseSOSModal()
  1466. this.$message.success('操作成功')
  1467. } else {
  1468. this.$alert(data.msg, '错误', {
  1469. confirmButtonText: '确定',
  1470. })
  1471. }
  1472. })
  1473. },
  1474. //导出excel
  1475. async createExportData() {
  1476. this.searchData.limit = -1
  1477. this.searchData.page = 1
  1478. await eamGroupSearch(this.searchData).then(({ data }) => {
  1479. this.exportList = data.page.list
  1480. })
  1481. return this.exportList
  1482. },
  1483. startDownload() {},
  1484. finishDownload() {},
  1485. fields() {
  1486. let json = '{'
  1487. this.columnList.forEach((item, index) => {
  1488. if (index == this.columnList.length - 1) {
  1489. json +=
  1490. '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  1491. } else {
  1492. json +=
  1493. '"' +
  1494. item.columnLabel +
  1495. '"' +
  1496. ':' +
  1497. '"' +
  1498. item.columnProp +
  1499. '"' +
  1500. ','
  1501. }
  1502. })
  1503. json += '}'
  1504. let s = eval('(' + json + ')')
  1505. return s
  1506. },
  1507. xiadaNotifyModel() {
  1508. if (
  1509. this.dataList.length == 0 &&
  1510. this.dataList2.length == 0 &&
  1511. this.dataList3.length == 0
  1512. ) {
  1513. this.$alert('没有明细记录无法下达!!', '提示', {
  1514. confirmButtonText: '确定',
  1515. })
  1516. return false
  1517. }
  1518. this.xiadaModelFlag = true
  1519. },
  1520. xiadaNotify() {
  1521. this.$confirm(`确定进行下达操作?`, '提示', {
  1522. confirmButtonText: '确定',
  1523. cancelButtonText: '取消',
  1524. type: 'warning'
  1525. }).then(() => {
  1526. xiadaNotify(this.notifyData).then(({data}) => {
  1527. if (data.code === 0) {
  1528. this.xiadaModelFlag = false
  1529. this.getUserNotifyNo()
  1530. this.$message.success('操作成功')
  1531. } else {
  1532. this.$alert(data.msg, '错误', {
  1533. confirmButtonText: '确定',
  1534. })
  1535. }
  1536. })
  1537. })
  1538. },
  1539. saveOtherPart() {
  1540. // if (
  1541. // this.otherPartData.qtyToIssue == null ||
  1542. // this.otherPartData.qtyToIssue == '' ||
  1543. // this.otherPartData.qtyToIssue <= 0
  1544. // ) {
  1545. // this.$message.warning('请填写领取数量!')
  1546. // return false
  1547. // }
  1548. this.$confirm('确定保存' + '?', '提示', {
  1549. confirmButtonText: '确定',
  1550. cancelButtonText: '取消',
  1551. type: 'warning',
  1552. }).then(() => {
  1553. saveOtherPart(this.otherPartData).then(({ data }) => {
  1554. if (data.code === 0) {
  1555. this.saveOtherPartModalFlag = false
  1556. if (this.otherPartData.issueType === '非BOM物料') {
  1557. this.partModelFlag = false
  1558. this.activeName = 'noBom'
  1559. this.searchOtherPart('非BOM物料')
  1560. }
  1561. if (this.otherPartData.issueType === '不管控物料') {
  1562. this.noControlPartModelFlag = false
  1563. this.activeName = 'noControl'
  1564. this.searchOtherPart('不管控物料')
  1565. }
  1566. this.$message.success('操作成功')
  1567. } else {
  1568. this.$alert(data.msg, '错误', {
  1569. confirmButtonText: '确定',
  1570. })
  1571. }
  1572. })
  1573. })
  1574. },
  1575. deleteNotify() {
  1576. if (this.dataList.length > 0) {
  1577. this.$alert('请先删除已经申请的明细记录!!', '提示', {
  1578. confirmButtonText: '确定',
  1579. })
  1580. return false
  1581. }
  1582. deleteNotify(this.notifyData).then(({ data }) => {
  1583. if (data.code === 0) {
  1584. this.getUserNotifyNo()
  1585. this.$message.success(data.msg)
  1586. } else {
  1587. this.$alert(data.msg, '错误', {
  1588. confirmButtonText: '确定',
  1589. })
  1590. }
  1591. })
  1592. },
  1593. searchOtherPart(type) {
  1594. let inData = {
  1595. site: this.notifyData.site,
  1596. notifyNo: this.notifyData.notifyNo,
  1597. issueType: type,
  1598. }
  1599. searchOtherPart(inData).then(({ data }) => {
  1600. if (data && data.code === 0) {
  1601. if (type === '非BOM物料') {
  1602. this.dataList2 = data.rows
  1603. }
  1604. if (type === '不管控物料') {
  1605. this.dataList3 = data.rows
  1606. }
  1607. }
  1608. })
  1609. },
  1610. importModel() {
  1611. if(this.dataList.length>0){
  1612. this.$alert('有已申请工单明细无法导入!!', '提示', {
  1613. confirmButtonText: '确定',
  1614. })
  1615. return
  1616. }
  1617. let data={
  1618. site: this.notifyData.site,
  1619. notifyNo: this.notifyData.notifyNo
  1620. }
  1621. this.$nextTick(() => {
  1622. this.$refs.walUploadExcel.init(data)
  1623. })
  1624. },
  1625. // 删除
  1626. deleteNotifySOS(row) {
  1627. this.$confirm(`是否删除这个工单的申请信息?`, '提示', {
  1628. confirmButtonText: '确定',
  1629. cancelButtonText: '取消',
  1630. type: 'warning',
  1631. })
  1632. .then(() => {
  1633. deleteNotifySOS(row).then(({ data }) => {
  1634. if (data && data.code === 0) {
  1635. this.getNotifyNoDetail()
  1636. this.$message({
  1637. message: '操作成功',
  1638. type: 'success',
  1639. duration: 1500,
  1640. onClose: () => {},
  1641. })
  1642. } else {
  1643. this.$alert(data.msg, '错误', {
  1644. confirmButtonText: '确定',
  1645. })
  1646. }
  1647. })
  1648. })
  1649. .catch(() => {})
  1650. },
  1651. //获取按钮的权限数据
  1652. getButtonAuthData() {
  1653. let searchFlag = this.isAuth(this.menuId + ':search')
  1654. let saveFlag = this.isAuth(this.menuId + ':save')
  1655. let updateFlag = this.isAuth(this.menuId + ':update')
  1656. let deleteFlag = this.isAuth(this.menuId + ':delete')
  1657. //处理页面的权限数据
  1658. this.authSearch = !searchFlag
  1659. this.authSave = !saveFlag
  1660. this.authUpdate = !updateFlag
  1661. this.authDelete = !deleteFlag
  1662. },
  1663. searchTable() {},
  1664. getAllNotifyStatus() {
  1665. let inData = {
  1666. site: this.$store.state.user.site,
  1667. listName: 'ISSUENOTIFYHEADER_STATUS',
  1668. locale: this.$i18n.locale,
  1669. }
  1670. getAllNotifyStatus(inData).then(({ data }) => {
  1671. this.notifyStatusList = data
  1672. console.log('notifyStatusList', this.notifyStatusList)
  1673. })
  1674. },
  1675. },
  1676. }
  1677. </script>
  1678. <style scoped>
  1679. .board666 .el-table .error-row {
  1680. background: #f86868;
  1681. }
  1682. /* 在 <style scoped> 下,使用深度选择器作用到 ElementUI 内部结构 */
  1683. .issueNotify {
  1684. width: 100%;
  1685. height: auto;
  1686. }
  1687. .issueNotify /deep/ .el-form-item__content {
  1688. display: inline !important;
  1689. }
  1690. .site-content > .el-tabs > .el-tabs__content > .site-tabs__tools {
  1691. top: 35px;
  1692. height: 40px;
  1693. font-size: 16px;
  1694. line-height: 40px;
  1695. }
  1696. .text-right /deep/ .el-input__inner {
  1697. text-align: right !important;
  1698. }
  1699. .text-right /deep/ .el-input-number__input {
  1700. text-align: right !important;
  1701. }
  1702. .yzzTable /deep/.el-table .cell {
  1703. line-height: 20px;
  1704. font-size: 12px;
  1705. height: 20px;
  1706. }
  1707. </style>
  1708. <style scoped>
  1709. /* 选择工单弹窗:紧凑表格与按钮样式 */
  1710. .choose-sos-btn {
  1711. height: 14px;
  1712. box-sizing: border-box;
  1713. padding: 0 6px;
  1714. line-height: 12px;
  1715. font-size: 12px;
  1716. display: inline-flex;
  1717. align-items: center;
  1718. justify-content: center;
  1719. }
  1720. </style>