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.

2304 lines
77 KiB

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