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.

4165 lines
145 KiB

5 months ago
5 months ago
2 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  4. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  5. <el-form-item :label="'申请单号'">
  6. <el-input v-model="searchData.notifyNo" style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'申请账号'">
  9. <el-input v-model="searchData.userName" style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item label="状态" >
  12. <el-select v-model="searchData.status" clearable placeholder="请选择" style="width: 120px">
  13. <el-option label="草稿" value="草稿"></el-option>
  14. <el-option label="待确认" value="待确认"></el-option>
  15. <el-option label="待检验" value="待检验"></el-option>
  16. <el-option label="编辑中" value="编辑中"></el-option>
  17. <el-option label="待出库" value="待出库"></el-option>
  18. <el-option label="已完成" value="已完成"></el-option>
  19. <el-option label="已关闭" value="已关闭"></el-option>
  20. <el-option label="已归档" value="已归档"></el-option>
  21. </el-select>
  22. </el-form-item>
  23. <el-form-item :label="'申请单日期'">
  24. <el-date-picker
  25. style="width: 120px"
  26. v-model="searchData.startDate"
  27. type="date"
  28. value-format="yyyy-MM-dd"
  29. placeholder="选择日期">
  30. </el-date-picker>
  31. </el-form-item>
  32. <el-form-item style="margin-top: 23px;">
  33. <label style="margin-left: 0px;font-size: 19px">&#10142</label>
  34. </el-form-item>
  35. <el-form-item :label="' '">
  36. <el-date-picker
  37. style="width: 120px"
  38. v-model="searchData.endDate"
  39. type="date"
  40. value-format="yyyy-MM-dd"
  41. placeholder="选择日期">
  42. </el-date-picker>
  43. </el-form-item>
  44. </el-form>
  45. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  46. <el-form-item label="是否领料" >
  47. <el-select v-model="searchData.issueFlag" placeholder="请选择" style="width: 120px">
  48. <el-option label="全部" value=""></el-option>
  49. <el-option label="Y" value="Y"></el-option>
  50. <el-option label="N" value="N"></el-option>
  51. </el-select>
  52. </el-form-item>
  53. <el-form-item label="领料结果" >
  54. <el-select v-model="searchData.issueResult" placeholder="请选择" style="width: 120px">
  55. <el-option label="全部" value=""></el-option>
  56. <el-option label="部分发料" value="部分发料"></el-option>
  57. <el-option label="全部发料" value="全部发料"></el-option>
  58. </el-select>
  59. </el-form-item>
  60. <el-form-item label="车间">
  61. <el-select v-model="searchData.workCenterNoList" multiple collapse-tags clearable placeholder="请选择" style="width: 280px">
  62. <el-option
  63. v-for="i in workCenterList"
  64. :key="i.workCenterNo"
  65. :label="i.workCenterDesc"
  66. :value="i.workCenterNo">
  67. </el-option>
  68. </el-select>
  69. </el-form-item>
  70. <el-form-item :label="' '">
  71. <el-button type="primary" @click="searchTable()">查询</el-button>
  72. <el-button type="primary" @click="createNotifyModal()">新增</el-button>
  73. <download-excel
  74. :fields="fields()"
  75. :data="exportData"
  76. type="xls"
  77. :name="exportName"
  78. :header="exportHeader"
  79. :footer="exportFooter"
  80. :fetch="createExportData"
  81. :before-generate="startDownload"
  82. :before-finish="finishDownload"
  83. worksheet="导出信息"
  84. class="el-button el-button--primary el-button--medium">
  85. {{ '导出' }}
  86. </download-excel>
  87. </el-form-item>
  88. </el-form>
  89. </el-form>
  90. <el-table
  91. :data="dataList"
  92. @row-click="changeData"
  93. :height="height"
  94. border
  95. highlight-current-row
  96. ref="mainTable"
  97. v-loading="dataListLoading"
  98. style="width: 100%; ">
  99. <el-table-column
  100. v-for="(item,index) in columnList1" :key="index"
  101. :sortable="item.columnSortable"
  102. :prop="item.columnProp"
  103. :header-align="item.headerAlign"
  104. :show-overflow-tooltip="item.showOverflowTooltip"
  105. :align="item.align"
  106. :fixed="item.fixed==''?false:item.fixed"
  107. :min-width="item.columnWidth"
  108. :label="item.columnLabel">
  109. <template slot-scope="scope">
  110. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  111. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column
  115. header-align="center"
  116. align="center"
  117. width="140"
  118. label="操作">
  119. <template slot-scope="scope">
  120. <el-link style="cursor: pointer" v-if="scope.row.status==='草稿'" @click="submitNotifyModel(scope.row)">提交</el-link>
  121. <span v-if="scope.row.status==='草稿'"> | </span>
  122. <el-link style="cursor: pointer" v-if="scope.row.status==='待确认' || scope.row.status==='编辑中'" @click="xiadaNotifyModel(scope.row)">下达</el-link>
  123. <el-link style="cursor: pointer" v-if="scope.row.status==='待出库'" @click="editNotifyMaterialFun(scope.row)">编辑</el-link>
  124. <el-link style="cursor: pointer" v-if="scope.row.status!=='已完成' && scope.row.status!=='已关闭' && scope.row.status!=='待出库'" @click="closeNotifyModel(scope.row)">关闭</el-link>
  125. <span v-if="scope.row.status==='草稿'"> | </span>
  126. <el-link style="cursor: pointer" v-if="scope.row.status==='草稿' " @click="deleteNotifyConfirm(scope.row)">删除</el-link>
  127. <!-- <a type="text" size="small" v-if="scope.row.status==='已关闭'" @click="openNotify(scope.row)">开启</a>-->
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. <el-pagination
  132. @size-change="sizeChangeHandle"
  133. @current-change="currentChangeHandle"
  134. :current-page="pageIndex"
  135. :page-sizes="[20, 50, 100, 1000]"
  136. :page-size="pageSize"
  137. :total="totalPage"
  138. layout="total, sizes, prev, pager, next, jumper">
  139. </el-pagination>
  140. <el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
  141. <el-tab-pane label="申请单明细" name="detail">
  142. <el-form :inline="true" label-position="top" label-width="100px">
  143. <el-button @click="createOrderDetail()" type="primary" style="margin-left: 10px" :disabled="(currentRow.status !== '草稿' && currentRow.status !== '编辑中' && currentRow.status !== '待确认')">{{'新增'}}</el-button>
  144. </el-form>
  145. <el-table
  146. :data="dataList2"
  147. :height="height"
  148. border
  149. v-loading="dataListLoading"
  150. style="width: 100%; ">
  151. <el-table-column
  152. header-align="center"
  153. align="center"
  154. width="60"
  155. label="操作">
  156. <template slot-scope="scope">
  157. <el-link style="cursor: pointer" @click="deleteNotifySOSPlus(scope.row)" :class="{ 'disabled-link': currentRow.status !== '草稿' && currentRow.status !== '编辑中' && currentRow.status !== '待确认' }">删除</el-link>
  158. </template>
  159. </el-table-column>
  160. <el-table-column
  161. v-for="(item,index) in columnList2" :key="index"
  162. :sortable="item.columnSortable"
  163. :prop="item.columnProp"
  164. :header-align="item.headerAlign"
  165. :show-overflow-tooltip="item.showOverflowTooltip"
  166. :align="item.align"
  167. :fixed="item.fixed==''?false:item.fixed"
  168. :min-width="item.columnWidth"
  169. :label="item.columnLabel">
  170. <template slot-scope="scope">
  171. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  172. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  173. </template>
  174. </el-table-column>
  175. </el-table>
  176. </el-tab-pane>
  177. <el-tab-pane label="材料明细" name="sub">
  178. <el-form label-position="top" style="margin-left: 2px;">
  179. <el-button v-if="!editBatchVisible" type="primary" @click="editBatchModel">批量编辑</el-button>
  180. <el-button v-if="!editBatchVisible" type="success" @click="addMaterialModal">新增</el-button>
  181. <el-button v-if="editBatchVisible" type="primary" @click="batchModel" :loading="saveLoading">批量保存</el-button>
  182. <el-button v-if="editBatchVisible" type="info" @click="editBatchVisible = false">取消编辑</el-button>
  183. </el-form>
  184. <el-table
  185. :data="dataList3"
  186. :height="height"
  187. border
  188. :row-class-name="tableRowClassName"
  189. v-loading="dataListLoading"
  190. style="width: 100%; ">
  191. <el-table-column
  192. v-for="(item,index) in columnList3" :key="index"
  193. :sortable="item.columnSortable"
  194. :prop="item.columnProp"
  195. :header-align="item.headerAlign"
  196. :show-overflow-tooltip="item.showOverflowTooltip"
  197. :align="item.align"
  198. :fixed="item.fixed==''?false:item.fixed"
  199. :min-width="item.columnWidth"
  200. :label="item.columnLabel">
  201. <template slot-scope="scope">
  202. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  203. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column
  207. prop="componentScrap"
  208. header-align="center"
  209. align="right"
  210. min-width="100"
  211. label="调机用量">
  212. <template slot-scope="scope">
  213. <span v-if="editBatchVisible">
  214. <el-input :controls="false" v-model="scope.row.componentScrap"
  215. @input="value => { scope.row.componentScrap = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''; updateQtyToIssue(scope.row); }"
  216. style="height: 11px; width: 98%;">
  217. </el-input>
  218. </span>
  219. <span v-else>
  220. <span>{{scope.row.componentScrap}}</span>
  221. </span>
  222. </template>
  223. </el-table-column>
  224. <el-table-column
  225. prop="firstInspectionQty"
  226. header-align="center"
  227. align="right"
  228. min-width="100"
  229. label="首检用量">
  230. <template slot-scope="scope">
  231. <span v-if="editBatchVisible">
  232. <el-input :controls="false" v-model="scope.row.firstInspectionQty"
  233. @input="value => { scope.row.firstInspectionQty = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''; updateQtyToIssue(scope.row); }"
  234. style="height: 11px; width: 98%;">
  235. </el-input>
  236. </span>
  237. <span v-else>
  238. <span>{{scope.row.firstInspectionQty}}</span>
  239. </span>
  240. </template>
  241. </el-table-column>
  242. <el-table-column
  243. prop="standardDosage"
  244. header-align="center"
  245. align="right"
  246. min-width="100"
  247. label="标准用量">
  248. <template slot-scope="scope">
  249. <span v-if="editBatchVisible">
  250. <el-input :controls="false" v-model="scope.row.standardDosage"
  251. @input="value => { scope.row.standardDosage = value.match(/^(\d+\.?\d*|\.\d+)$/) ? value : ''; updateQtyToIssue(scope.row); }"
  252. style="height: 11px; width: 98%;">
  253. </el-input>
  254. </span>
  255. <span v-else>
  256. <span>{{scope.row.standardDosage}}</span>
  257. </span>
  258. </template>
  259. </el-table-column>
  260. <el-table-column
  261. prop="warehouseName"
  262. header-align="center"
  263. align="left"
  264. min-width="180"
  265. label="领料仓库">
  266. <template slot-scope="scope">
  267. <span v-if="editBatchVisible">
  268. <el-button type="text" @click="chooseWareHouse(scope.row)" style="width:18%;padding: 3px 0px">选择</el-button>
  269. <el-input v-model="scope.row.warehouseName" readonly style="width:77%"></el-input>
  270. </span>
  271. <span v-else>
  272. <span>{{scope.row.warehouseName}}</span>
  273. </span>
  274. </template>
  275. </el-table-column>
  276. <el-table-column
  277. v-for="(item,index) in columnList3s" :key="index"
  278. :sortable="item.columnSortable"
  279. :prop="item.columnProp"
  280. :header-align="item.headerAlign"
  281. :show-overflow-tooltip="item.showOverflowTooltip"
  282. :align="item.align"
  283. :fixed="item.fixed==''?false:item.fixed"
  284. :min-width="item.columnWidth"
  285. :label="item.columnLabel">
  286. <template slot-scope="scope">
  287. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  288. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  289. </template>
  290. </el-table-column>
  291. <el-table-column
  292. fixed="right"
  293. header-align="center"
  294. align="center"
  295. width="100"
  296. label="操作">
  297. <template slot-scope="scope">
  298. <el-link style="cursor: pointer" @click="getAlternativePart(scope.row)">替代料</el-link>
  299. <el-link style="cursor: pointer;margin-left: 5px;" type="danger" @click="deleteNotifyMaterial(scope.row)">删除</el-link>
  300. </template>
  301. </el-table-column>
  302. </el-table>
  303. </el-tab-pane>
  304. <el-tab-pane label="材料汇总" name="sum">
  305. <el-table
  306. ref="sum"
  307. :data="dataList4"
  308. :height="height+20"
  309. border
  310. v-loading="dataListLoading"
  311. style="width: 100%; ">
  312. <el-table-column
  313. v-for="(item,index) in columnList4" :key="index"
  314. :sortable="item.columnSortable"
  315. :prop="item.columnProp"
  316. :header-align="item.headerAlign"
  317. :show-overflow-tooltip="item.showOverflowTooltip"
  318. :align="item.align"
  319. :fixed="item.fixed==''?false:item.fixed"
  320. :min-width="item.columnWidth"
  321. :label="item.columnLabel">
  322. <template slot-scope="scope">
  323. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  324. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  325. </template>
  326. </el-table-column>
  327. <el-table-column
  328. fixed="right"
  329. header-align="center"
  330. align="center"
  331. width="100"
  332. label="操作">
  333. <template slot-scope="scope">
  334. <el-link style="cursor: pointer;" @click="outboundDetailModal(scope.row)">出库明细</el-link>
  335. </template>
  336. </el-table-column>
  337. </el-table>
  338. </el-tab-pane>
  339. <!-- <el-tab-pane label="删除记录" name="change">-->
  340. <!-- <el-table-->
  341. <!-- :data="dataList5"-->
  342. <!-- :height="height"-->
  343. <!-- border-->
  344. <!-- v-loading="dataListLoading"-->
  345. <!-- style="width: 100%; ">-->
  346. <!-- &lt;!&ndash; <el-table-column&ndash;&gt;-->
  347. <!-- &lt;!&ndash; header-align="center"&ndash;&gt;-->
  348. <!-- &lt;!&ndash; align="center"&ndash;&gt;-->
  349. <!-- &lt;!&ndash; width="80"&ndash;&gt;-->
  350. <!-- &lt;!&ndash; fixed="left"&ndash;&gt;-->
  351. <!-- &lt;!&ndash; label="操作">&ndash;&gt;-->
  352. <!-- &lt;!&ndash; <template slot-scope="scope">&ndash;&gt;-->
  353. <!-- &lt;!&ndash; <a type="text" size="small" @click="printLabel(scope.row)">打印标签</a>&ndash;&gt;-->
  354. <!-- &lt;!&ndash; </template>&ndash;&gt;-->
  355. <!-- &lt;!&ndash; </el-table-column>&ndash;&gt;-->
  356. <!-- <el-table-column-->
  357. <!-- v-for="(item,index) in columnList5" :key="index"-->
  358. <!-- :sortable="item.columnSortable"-->
  359. <!-- :prop="item.columnProp"-->
  360. <!-- :header-align="item.headerAlign"-->
  361. <!-- :show-overflow-tooltip="item.showOverflowTooltip"-->
  362. <!-- :align="item.align"-->
  363. <!-- :fixed="item.fixed==''?false:item.fixed"-->
  364. <!-- :min-width="item.columnWidth"-->
  365. <!-- :label="item.columnLabel">-->
  366. <!-- <template slot-scope="scope">-->
  367. <!-- <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>-->
  368. <!-- <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"-->
  369. <!-- style="width: 100px; height: 80px"/></span>-->
  370. <!-- </template>-->
  371. <!-- </el-table-column>-->
  372. <!-- </el-table>-->
  373. <!-- </el-tab-pane>-->
  374. <!-- <el-tab-pane label="关闭记录" name="close">-->
  375. <!-- <el-table-->
  376. <!-- :data="dataList6"-->
  377. <!-- :height="height"-->
  378. <!-- border-->
  379. <!-- v-loading="dataListLoading"-->
  380. <!-- style="width: 100%; ">-->
  381. <!-- &lt;!&ndash; <el-table-column&ndash;&gt;-->
  382. <!-- &lt;!&ndash; header-align="center"&ndash;&gt;-->
  383. <!-- &lt;!&ndash; align="center"&ndash;&gt;-->
  384. <!-- &lt;!&ndash; width="80"&ndash;&gt;-->
  385. <!-- &lt;!&ndash; fixed="left"&ndash;&gt;-->
  386. <!-- &lt;!&ndash; label="操作">&ndash;&gt;-->
  387. <!-- &lt;!&ndash; <template slot-scope="scope">&ndash;&gt;-->
  388. <!-- &lt;!&ndash; <a type="text" size="small" @click="printLabel(scope.row)">打印标签</a>&ndash;&gt;-->
  389. <!-- &lt;!&ndash; </template>&ndash;&gt;-->
  390. <!-- &lt;!&ndash; </el-table-column>&ndash;&gt;-->
  391. <!-- <el-table-column-->
  392. <!-- v-for="(item,index) in columnList6" :key="index"-->
  393. <!-- :sortable="item.columnSortable"-->
  394. <!-- :prop="item.columnProp"-->
  395. <!-- :header-align="item.headerAlign"-->
  396. <!-- :show-overflow-tooltip="item.showOverflowTooltip"-->
  397. <!-- :align="item.align"-->
  398. <!-- :fixed="item.fixed==''?false:item.fixed"-->
  399. <!-- :min-width="item.columnWidth"-->
  400. <!-- :label="item.columnLabel">-->
  401. <!-- <template slot-scope="scope">-->
  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. <!-- </template>-->
  406. <!-- </el-table-column>-->
  407. <!-- </el-table>-->
  408. <!-- </el-tab-pane>-->
  409. </el-tabs>
  410. <el-dialog title="关闭原因" :close-on-click-modal="false" v-drag :visible.sync="closeModalFlag" width="450px">
  411. <el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
  412. <el-row :gutter="20">
  413. <el-col :span="24">
  414. <el-form-item >
  415. <el-input
  416. type="textarea"
  417. v-model="closeData.closeRemark "
  418. :rows="3"
  419. resize='none'
  420. maxlength="200"
  421. show-word-limit
  422. style="height: 60px" >
  423. </el-input>
  424. </el-form-item>
  425. </el-col>
  426. </el-row>
  427. </el-form>
  428. <el-footer style="height:40px;margin-top: 60px;text-align:center">
  429. <el-button type="primary" @click="closeNotify()">保存</el-button>
  430. <el-button type="primary" @click="closeModalFlag=false">关闭</el-button>
  431. </el-footer>
  432. </el-dialog>
  433. <el-dialog title="新建领料申请单" :close-on-click-modal="false" v-drag :visible.sync="createNotifyFlag" width="500px">
  434. <el-form :inline="true" :model="notifyData" :rules="notifyRules" ref="notifyForm" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  435. <el-row :gutter="20">
  436. <el-col :span="8">
  437. <el-form-item :label="'工厂_BU'" prop="bu" style="width: 97%">
  438. <el-select v-model="notifyData.bu" placeholder="请选择" style="width: 100%">
  439. <el-option
  440. v-for = "i in userBuList"
  441. :key = "i.buNo"
  442. :label = "i.sitename"
  443. :value = "i.buNo">
  444. <span style="float: left;width: 100px">{{ i.sitename }}</span>
  445. <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
  446. {{ i.buDesc }}
  447. </span>
  448. </el-option>
  449. </el-select>
  450. </el-form-item>
  451. </el-col>
  452. <el-col :span="8">
  453. <el-form-item :label="'车间'" prop="workCenterNo">
  454. <el-select v-model="notifyData.workCenterNo" clearable placeholder="请选择" style="width: 100%">
  455. <el-option
  456. v-for = "i in workCenterList"
  457. :key = "i.workCenterNo"
  458. :label = "i.workCenterDesc"
  459. :value = "i.workCenterNo">
  460. </el-option>
  461. </el-select>
  462. </el-form-item>
  463. </el-col>
  464. <el-col :span="8">
  465. <el-form-item :label="'出库类别'">
  466. <el-select v-model="notifyData.category" clearable placeholder="请选择" style="width: 100%">
  467. <el-option
  468. v-for="item in categoryList"
  469. :key="item.crdcode"
  470. :label="item.crdcode + '-' + item.crdname"
  471. :value="item.crdcode">
  472. </el-option>
  473. </el-select>
  474. </el-form-item>
  475. </el-col>
  476. </el-row>
  477. <el-row :gutter="20">
  478. <el-col :span="24">
  479. <el-form-item :label="'备注'" style="width: 98%">
  480. <el-input
  481. type="textarea"
  482. :rows="3"
  483. v-model="notifyData.remark"
  484. style="width: 100%;">
  485. </el-input>
  486. <!-- <el-input type="textarea" v-model="notifyData.remark" style="width: 100%"></el-input>-->
  487. </el-form-item>
  488. </el-col>
  489. </el-row>
  490. </el-form>
  491. <el-footer style="height:35px;margin-top: 55px;text-align:center">
  492. <el-button type="primary" @click="saveNotify()">保存</el-button>
  493. <el-button type="primary" @click="createNotifyFlag=false">关闭</el-button>
  494. </el-footer>
  495. </el-dialog>
  496. <!-- 选择物料模态框 -->
  497. <el-dialog width="1000px"
  498. title="选择物料"
  499. :close-on-click-modal="false"
  500. :visible.sync="choosePartModalFlag">
  501. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  502. <el-row :gutter="20">
  503. <el-col :span="6">
  504. <el-form-item :label="'物料编码'" >
  505. <el-input v-model="choosePartData.partNo"></el-input>
  506. </el-form-item>
  507. </el-col>
  508. <el-col :span="6">
  509. <el-form-item :label="'物料名称'" >
  510. <el-input v-model="choosePartData.partDesc"></el-input>
  511. </el-form-item>
  512. </el-col>
  513. <el-col :span="6">
  514. <el-form-item :label="'规格型号'" >
  515. <el-input v-model="choosePartData.spec"></el-input>
  516. </el-form-item>
  517. </el-col>
  518. <el-col :span="6">
  519. <el-form-item >
  520. <el-button type="primary" @click="searchPartModel" style="margin-top: 5px" class="">查询</el-button>
  521. </el-form-item>
  522. </el-col>
  523. </el-row>
  524. </el-form>
  525. <el-table
  526. :height="400"
  527. :data="choosePartList"
  528. border
  529. style="width: 100%;">
  530. <el-table-column
  531. prop="partNo"
  532. header-align="center"
  533. align="left"
  534. min-width="80"
  535. label="物料编码">
  536. </el-table-column>
  537. <el-table-column
  538. prop="partDesc"
  539. header-align="center"
  540. align="left"
  541. min-width="120"
  542. label="物料描述">
  543. </el-table-column>
  544. <el-table-column
  545. prop="spec"
  546. header-align="center"
  547. align="left"
  548. min-width="120"
  549. label="规格型号">
  550. </el-table-column>
  551. <el-table-column
  552. prop="sku"
  553. header-align="center"
  554. align="left"
  555. min-width="80"
  556. label="SKU">
  557. </el-table-column>
  558. <el-table-column
  559. prop="umid"
  560. header-align="center"
  561. align="left"
  562. min-width="60"
  563. label="计量单位">
  564. </el-table-column>
  565. <el-table-column
  566. fixed="left"
  567. header-align="center"
  568. align="center"
  569. width="60"
  570. label="操作">
  571. <template slot-scope="scope">
  572. <a type="text" size="small" @click="choosePart(scope.row)">选择</a>
  573. </template>
  574. </el-table-column>
  575. </el-table>
  576. <el-pagination
  577. @size-change="pp_sizeChangeHandle"
  578. @current-change="pp_currentChangeHandle"
  579. :current-page="pp_pageIndex"
  580. :page-sizes="[20, 50, 100, 1000]"
  581. :page-size="pp_pageSize"
  582. :total="pp_totalPage"
  583. layout="total, sizes, prev, pager, next, jumper">
  584. </el-pagination>
  585. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  586. <el-button type="primary" @click="choosePartModalFlag=false">关闭</el-button>
  587. </el-footer>
  588. </el-dialog>
  589. <el-dialog title="选择派工单" :close-on-click-modal="false" v-drag :visible.sync="chooseSOSModalFlag" width="1000px">
  590. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  591. <el-row :gutter="20">
  592. <el-col :span="4">
  593. <el-form-item :label="'生产订单'" >
  594. <el-input v-model="chooseSOSData.orderno" ></el-input>
  595. </el-form-item>
  596. </el-col>
  597. <el-col :span="4">
  598. <el-form-item :label="'派工单号'" >
  599. <el-input v-model="chooseSOSData.seqno" ></el-input>
  600. </el-form-item>
  601. </el-col>
  602. <el-col :span="4">
  603. <el-form-item :label="'机台'" >
  604. <el-input v-model="chooseSOSData.sResourceid" ></el-input>
  605. </el-form-item>
  606. </el-col>
  607. <el-col :span="4">
  608. <el-form-item :label="'派工日期'" >
  609. <el-date-picker
  610. style="width: 100%"
  611. v-model="chooseSOSData.startDate"
  612. type="date"
  613. value-format="yyyy-MM-dd"
  614. placeholder="选择日期">
  615. </el-date-picker>
  616. </el-form-item>
  617. </el-col>
  618. <el-col :span="4">
  619. <el-form-item :label="'到'" >
  620. <el-date-picker
  621. style="width: 100%"
  622. v-model="chooseSOSData.endDate"
  623. type="date"
  624. value-format="yyyy-MM-dd"
  625. placeholder="选择日期">
  626. </el-date-picker>
  627. </el-form-item>
  628. </el-col>
  629. </el-row>
  630. <el-row :gutter="20">
  631. <el-col :span="6">
  632. <el-form-item >
  633. <el-button type="primary" @click="searchSOSRouting()" style="margin-top: 5px" class="">查询</el-button>
  634. </el-form-item>
  635. </el-col>
  636. </el-row>
  637. </el-form>
  638. <el-table
  639. :height="400"
  640. :data="chooseSOSList"
  641. border
  642. style="width: 100%;">
  643. <el-table-column
  644. v-for="(item,index) in chooseSOSColumnList" :key="index"
  645. :sortable="item.columnSortable"
  646. :prop="item.columnProp"
  647. :header-align="item.headerAlign"
  648. :show-overflow-tooltip="item.showOverflowTooltip"
  649. :align="item.align"
  650. :fixed="item.fixed==''?false:item.fixed"
  651. :min-width="item.columnWidth"
  652. :label="item.columnLabel">
  653. <template slot-scope="scope">
  654. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  655. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  656. </template>
  657. </el-table-column>
  658. <el-table-column
  659. fixed="left"
  660. header-align="center"
  661. align="center"
  662. width="60"
  663. label="操作">
  664. <template slot-scope="scope">
  665. <a type="text" size="small" @click="chooseSOS(scope.row)">选择</a>
  666. </template>
  667. </el-table-column>
  668. </el-table>
  669. <el-pagination
  670. @size-change="ss_sizeChangeHandle"
  671. @current-change="ss_currentChangeHandle"
  672. :current-page="ss_pageIndex"
  673. :page-sizes="[20, 50, 100, 1000]"
  674. :page-size="ss_pageSize"
  675. :total="ss_totalPage"
  676. layout="total, sizes, prev, pager, next, jumper">
  677. </el-pagination>
  678. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  679. <el-button type="primary" @click="chooseSOSModalFlag = false">关闭</el-button>
  680. </el-footer>
  681. </el-dialog>
  682. <el-dialog title="选择工单" :close-on-click-modal="false" v-drag :visible.sync="chooseOrderModalFlag" width="1000px">
  683. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  684. <el-row :gutter="20">
  685. <el-col :span="6">
  686. <el-form-item :label="'生产订单'" >
  687. <el-input v-model="chooseOrderData.orderNo"></el-input>
  688. </el-form-item>
  689. </el-col>
  690. <el-col :span="6">
  691. <el-form-item :label="'工单状态'" >
  692. <el-select multiple collapse-tags v-model="chooseOrderData.statusList" clearable style="width: 220px">
  693. <el-option label="全部" value=""></el-option>
  694. <el-option label="已停工" value="已停工"></el-option>
  695. <el-option label="已开工" value="已开工"></el-option>
  696. <el-option label="已取消" value="已取消"></el-option>
  697. <el-option label="已计划" value="已计划"></el-option>
  698. <el-option label="已排产" value="已排产"></el-option>
  699. <el-option label="已下达" value="已下达"></el-option>
  700. <el-option label="已关闭" value="已关闭"></el-option>
  701. </el-select>
  702. </el-form-item>
  703. </el-col>
  704. <el-col :span="6">
  705. <el-form-item :label="'开始日期'" >
  706. <el-date-picker
  707. style="width: 100%"
  708. v-model="chooseOrderData.date3"
  709. type="date"
  710. value-format="yyyy-MM-dd"
  711. placeholder="选择日期">
  712. </el-date-picker>
  713. </el-form-item>
  714. </el-col>
  715. <el-col :span="6">
  716. <el-form-item :label="'结束日期'" >
  717. <el-date-picker
  718. style="width: 100%"
  719. v-model="chooseOrderData.date4"
  720. type="date"
  721. value-format="yyyy-MM-dd"
  722. placeholder="选择日期">
  723. </el-date-picker>
  724. </el-form-item>
  725. </el-col>
  726. </el-row>
  727. <el-row :gutter="20">
  728. <el-col :span="6">
  729. <el-form-item >
  730. <el-button type="primary" @click="searchOrder()" style="margin-top: 5px" class="">查询</el-button>
  731. </el-form-item>
  732. </el-col>
  733. </el-row>
  734. </el-form>
  735. <el-table
  736. :height="400"
  737. :data="chooseOrderList"
  738. border
  739. style="width: 100%;">
  740. <el-table-column
  741. v-for="(item,index) in chooseOrderColumnList" :key="index"
  742. :sortable="item.columnSortable"
  743. :prop="item.columnProp"
  744. :header-align="item.headerAlign"
  745. :show-overflow-tooltip="item.showOverflowTooltip"
  746. :align="item.align"
  747. :fixed="item.fixed==''?false:item.fixed"
  748. :min-width="item.columnWidth"
  749. :label="item.columnLabel">
  750. <template slot-scope="scope">
  751. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  752. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  753. </template>
  754. </el-table-column>
  755. <el-table-column
  756. fixed="left"
  757. header-align="center"
  758. align="center"
  759. width="60"
  760. label="操作">
  761. <template slot-scope="scope">
  762. <a type="text" size="small" @click="chooseOrder(scope.row)">选择</a>
  763. </template>
  764. </el-table-column>
  765. </el-table>
  766. <el-pagination
  767. @size-change="co_sizeChangeHandle"
  768. @current-change="co_currentChangeHandle"
  769. :current-page="co_pageIndex"
  770. :page-sizes="[20, 50, 100, 1000]"
  771. :page-size="co_pageSize"
  772. :total="co_totalPage"
  773. layout="total, sizes, prev, pager, next, jumper">
  774. </el-pagination>
  775. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  776. <el-button type="primary" @click="chooseOrderModalFlag = false">关闭</el-button>
  777. </el-footer>
  778. </el-dialog>
  779. <el-dialog title="选择工序" :close-on-click-modal="false" v-drag :visible.sync="chooseOperationModalFlag" width="800px">
  780. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  781. <el-row :gutter="20">
  782. <el-col :span="6">
  783. <el-form-item :label="'工序名称'" >
  784. <el-input v-model="chooseOperationData.itemDesc"></el-input>
  785. </el-form-item>
  786. </el-col>
  787. <el-col :span="6">
  788. <el-form-item >
  789. <el-button type="primary" @click="searchOperation()" style="margin-top: 5px" class="">查询</el-button>
  790. </el-form-item>
  791. </el-col>
  792. </el-row>
  793. </el-form>
  794. <el-table
  795. :height="400"
  796. :data="chooseOperationList"
  797. border
  798. style="width: 100%;">
  799. <el-table-column
  800. v-for="(item,index) in chooseOperationColumnList" :key="index"
  801. :sortable="item.columnSortable"
  802. :prop="item.columnProp"
  803. :header-align="item.headerAlign"
  804. :show-overflow-tooltip="item.showOverflowTooltip"
  805. :align="item.align"
  806. :fixed="item.fixed==''?false:item.fixed"
  807. :min-width="item.columnWidth"
  808. :label="item.columnLabel">
  809. <template slot-scope="scope">
  810. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  811. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  812. </template>
  813. </el-table-column>
  814. <el-table-column
  815. fixed="left"
  816. header-align="center"
  817. align="center"
  818. width="60"
  819. label="操作">
  820. <template slot-scope="scope">
  821. <a type="text" size="small" @click="chooseOperation(scope.row)">选择</a>
  822. </template>
  823. </el-table-column>
  824. </el-table>
  825. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  826. <el-button type="primary" @click="chooseOperationModalFlag = false">关闭</el-button>
  827. </el-footer>
  828. </el-dialog>
  829. <el-dialog title="选择机台" :close-on-click-modal="false" v-drag :visible.sync="chooseResourceModalFlag" width="800px">
  830. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  831. <el-row :gutter="20">
  832. <el-col :span="6">
  833. <el-form-item :label="'机台编号'" >
  834. <el-input v-model="chooseResourceData.resourceId"></el-input>
  835. </el-form-item>
  836. </el-col>
  837. <el-col :span="6">
  838. <el-form-item :label="'机台描述'" >
  839. <el-input v-model="chooseResourceData.resourceDesc"></el-input>
  840. </el-form-item>
  841. </el-col>
  842. <el-col :span="6">
  843. <el-form-item >
  844. <el-button type="primary" @click="searchResource()" style="margin-top: 5px" class="">查询</el-button>
  845. </el-form-item>
  846. </el-col>
  847. </el-row>
  848. </el-form>
  849. <el-table
  850. :height="400"
  851. :data="chooseResourceList"
  852. border
  853. style="width: 100%;">
  854. <el-table-column
  855. v-for="(item,index) in chooseResourceColumnList" :key="index"
  856. :sortable="item.columnSortable"
  857. :prop="item.columnProp"
  858. :header-align="item.headerAlign"
  859. :show-overflow-tooltip="item.showOverflowTooltip"
  860. :align="item.align"
  861. :fixed="item.fixed==''?false:item.fixed"
  862. :min-width="item.columnWidth"
  863. :label="item.columnLabel">
  864. <template slot-scope="scope">
  865. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  866. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  867. </template>
  868. </el-table-column>
  869. <el-table-column
  870. fixed="left"
  871. header-align="center"
  872. align="center"
  873. width="60"
  874. label="操作">
  875. <template slot-scope="scope">
  876. <a type="text" size="small" @click="chooseResource(scope.row)">选择</a>
  877. </template>
  878. </el-table-column>
  879. </el-table>
  880. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  881. <el-button type="primary" @click="chooseResourceModalFlag = false">关闭</el-button>
  882. </el-footer>
  883. </el-dialog>
  884. <el-dialog title="申请单明细" :close-on-click-modal="false" v-drag :visible.sync="saveOrderDetailFlag" width="750px">
  885. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  886. <!-- BOM物料和非BOM物料选择 -->
  887. <el-row :gutter="20" style="margin-bottom: 15px;">
  888. <el-col :span="24">
  889. <el-form-item :label="'物料类型'" style="display: none;">
  890. <el-radio-group v-model="orderDetailData.materialType" @change="onMaterialTypeChange">
  891. <el-radio label="BOM物料">BOM物料</el-radio>
  892. <el-radio label="非BOM物料">非BOM物料</el-radio>
  893. </el-radio-group>
  894. </el-form-item>
  895. </el-col>
  896. </el-row>
  897. <el-row :gutter="20">
  898. <el-col :span="6">
  899. <el-form-item>
  900. <template slot="label">
  901. <span v-if="orderDetailData.materialType === '非BOM物料'" slot="label">生产订单</span>
  902. <span v-else style="cursor: pointer" slot="label" @click="openChooseOrderModal"><a>生产订单</a></span>
  903. </template>
  904. <el-input v-model="orderDetailData.orderNo" disabled placeholder="请选择生产订单"></el-input>
  905. </el-form-item>
  906. </el-col>
  907. <el-col :span="6">
  908. <el-form-item>
  909. <template slot="label">
  910. <span v-if="orderDetailData.materialType === '非BOM物料'" slot="label">派工单号</span>
  911. <span v-else style="cursor: pointer" slot="label" @click="openChooseSOSModal"><a>派工单号</a></span>
  912. </template>
  913. <el-input v-model="orderDetailData.seqNo" disabled></el-input>
  914. </el-form-item>
  915. </el-col>
  916. <el-col :span="6">
  917. <el-form-item>
  918. <template slot="label">
  919. <span v-if="orderDetailData.orderNo && !orderDetailData.seqNo" style="cursor: pointer" slot="label" @click="openChooseOperationModal"><a>工序名称</a></span>
  920. <span v-else slot="label">工序名称</span>
  921. </template>
  922. <el-input v-model="orderDetailData.itemDesc" disabled placeholder="请选择工序"></el-input>
  923. </el-form-item>
  924. </el-col>
  925. <el-col :span="6">
  926. <el-form-item>
  927. <template slot="label">
  928. <span v-if="orderDetailData.orderNo && !orderDetailData.seqNo" style="cursor: pointer" slot="label" @click="openChooseResourceModal"><a>机台</a></span>
  929. <span v-else slot="label">机台</span>
  930. </template>
  931. <el-input v-model="orderDetailData.resourceDesc" disabled placeholder="请选择机台"></el-input>
  932. </el-form-item>
  933. </el-col>
  934. </el-row>
  935. <el-row :gutter="20">
  936. <el-col :span="6">
  937. <el-form-item>
  938. <template slot="label">
  939. <span v-if="orderDetailData.materialType === 'BOM物料'" slot="label">物料编码</span>
  940. <span v-else style="cursor: pointer" slot="label" @click="openChoosePartModal"><a>物料编码</a></span>
  941. </template>
  942. <el-input v-model="orderDetailData.partNo" disabled></el-input>
  943. </el-form-item>
  944. </el-col>
  945. <el-col :span="18">
  946. <el-form-item :label="'物料描述'" style="display: block">
  947. <el-input v-model="orderDetailData.partDesc" disabled></el-input>
  948. </el-form-item>
  949. </el-col>
  950. </el-row>
  951. <el-row :gutter="20">
  952. <el-col :span="4">
  953. <el-form-item :label="'工单/派工数量'">
  954. <el-input v-model="orderDetailData.qtyRequired" disabled style="text-align: right"
  955. class="text-right"></el-input>
  956. </el-form-item>
  957. </el-col>
  958. <el-col :span="4">
  959. <el-form-item :label="'此次领料数量'">
  960. <el-input-number v-model="orderDetailData.issureQty" style="line-height: 20px;padding: 0;width: 100%"
  961. :controls="false" :step="0" :min="0" class="text-right"></el-input-number>
  962. </el-form-item>
  963. </el-col>
  964. <el-col :span="6">
  965. <el-form-item :label="'要求发料时间'">
  966. <el-date-picker
  967. style="width: 100%"
  968. v-model="orderDetailData.needDate"
  969. type="datetime"
  970. value-format="yyyy-MM-dd HH:mm:ss"
  971. placeholder="选择日期">
  972. </el-date-picker>
  973. </el-form-item>
  974. </el-col>
  975. <el-col :span="10">
  976. <el-form-item style="margin-top: 17px">
  977. <span style="line-height: 32px;font-size: 12px;">
  978. 已排产未开工机台数<span style="color: rgb(38, 92, 147);font-weight: bold;">{{ orderDetailData.notYetStartedResourceTotal || 0 }}</span>
  979. <span style="margin-left: 15px;">已排产机台总数<span style="color: rgb(38, 92, 147);font-weight: bold;">{{ orderDetailData.apsResourceTotal || 0 }}</span></span>
  980. </span>
  981. </el-form-item>
  982. </el-col>
  983. </el-row>
  984. </el-form>
  985. <el-footer style="height:40px;margin-top: 10px;text-align:center">
  986. <el-button type="primary" @click="saveIssueNoOrderDetail()">保存</el-button>
  987. <el-button type="primary" @click="saveOrderDetailFlag=false">关闭</el-button>
  988. </el-footer>
  989. </el-dialog>
  990. <!-- 出库明细 -->
  991. <el-dialog title="出库明细" :close-on-click-modal="false" v-drag :visible.sync="detailModal2" width="900px">
  992. <el-table
  993. height="400px"
  994. :data="detailList2"
  995. border
  996. style="width: 100%;">
  997. <el-table-column
  998. v-for="(item,index) in columnDetailList2" :key="index"
  999. :sortable="item.columnSortable"
  1000. :prop="item.columnProp"
  1001. :header-align="item.headerAlign"
  1002. :show-overflow-tooltip="item.showOverflowTooltip"
  1003. :align="item.align"
  1004. :fixed="item.fixed===''?false:item.fixed"
  1005. :min-width="item.columnWidth"
  1006. :label="item.columnLabel">
  1007. </el-table-column>
  1008. </el-table>
  1009. <el-footer style="height:35px;margin-top: 15px;text-align:center">
  1010. <el-button type="primary" @click="detailModal2 = false">关闭</el-button>
  1011. </el-footer>
  1012. </el-dialog>
  1013. <!-- 新增材料模态框 -->
  1014. <el-dialog title="新增材料明细" :close-on-click-modal="false" v-drag :visible.sync="addMaterialModalFlag" width="525px">
  1015. <el-form :inline="true" label-position="top" :model="newMaterialData" style="margin-left: 7px;margin-top: -5px;">
  1016. <el-form-item>
  1017. <span style="cursor: pointer" slot="label" @click="getBaseList(508)"><a href="#">物料信息</a></span>
  1018. <el-input v-model="newMaterialData.componentPartNo" @change="partBlur(508)" style="width: 120px"></el-input>
  1019. <el-input v-model="newMaterialData.partDesc" disabled style="width: 362px"></el-input>
  1020. </el-form-item>
  1021. </el-form>
  1022. <el-form :inline="true" label-position="top" :model="newMaterialData" style="margin-left: 7px">
  1023. <el-form-item label="生产订单">
  1024. <el-select v-model="newMaterialData.orderNo" @change="onOrderNoChange" placeholder="请选择生产订单" style="width: 215px">
  1025. <el-option
  1026. v-for="item in orderOptions"
  1027. :key="item.orderNo"
  1028. :label="item.orderNo"
  1029. :value="item.orderNo">
  1030. </el-option>
  1031. </el-select>
  1032. </el-form-item>
  1033. <el-form-item label="申请单序号">
  1034. <el-input v-model="newMaterialData.itemNo" disabled style="width: 122px"></el-input>
  1035. </el-form-item>
  1036. <el-form-item label="类型">
  1037. <el-input v-model="newMaterialData.issueType" value="替代料" disabled style="width: 122px"></el-input>
  1038. </el-form-item>
  1039. </el-form>
  1040. <el-form :inline="true" label-position="top" :model="newMaterialData" style="margin-left: 7px">
  1041. <el-form-item label="调机量">
  1042. <el-input-number :controls="false" :step="0" v-model="newMaterialData.componentScrap" :min="0" style="width: 152px"></el-input-number>
  1043. </el-form-item>
  1044. <el-form-item label="首检量">
  1045. <el-input-number :controls="false" :step="0" v-model="newMaterialData.firstInspectionQty" :min="0" style="width: 152px"></el-input-number>
  1046. </el-form-item>
  1047. <el-form-item label="标准用量">
  1048. <el-input-number :controls="false" :step="0" v-model="newMaterialData.standardDosage" :min="0" style="width: 152px"></el-input-number>
  1049. </el-form-item>
  1050. </el-form>
  1051. <el-form :inline="true" label-position="top" style="margin-left: 7px">
  1052. <el-form-item :label="'备注'">
  1053. <el-input type="textarea" v-model="newMaterialData.remark" :rows="3" resize='none' show-word-limit style="width: 485px;height: 20px"></el-input>
  1054. </el-form-item>
  1055. </el-form>
  1056. <el-footer style="height:35px;margin-top: 55px;text-align:center">
  1057. <el-button type="primary" @click="saveNewMaterial">保存</el-button>
  1058. <el-button type="primary" @click="addMaterialModalFlag=false">取消</el-button>
  1059. </el-footer>
  1060. </el-dialog>
  1061. <!-- 替代料模态框 -->
  1062. <el-dialog title="替代料列表" :close-on-click-modal="false" v-drag :visible.sync="alternativePartsModalFlag" width="900px">
  1063. <el-table
  1064. :data="alternativePartsList"
  1065. border
  1066. v-loading="alternativePartsLoading"
  1067. style="width: 100%;"
  1068. height="400">
  1069. <!-- <el-table-column prop="partNo" label="母件编码" align="center" min-width="120"></el-table-column>-->
  1070. <!-- <el-table-column prop="partDesc" label="母件名称" align="left" min-width="150" show-overflow-tooltip></el-table-column>-->
  1071. <!-- <el-table-column prop="componentPartNo" label="子件编码" align="center" min-width="120"></el-table-column>-->
  1072. <!-- <el-table-column prop="componentPartDesc" label="子件名称" align="left" min-width="150" show-overflow-tooltip></el-table-column>-->
  1073. <el-table-column prop="alternativePartNo" label="替代料编码" align="left" min-width="120"></el-table-column>
  1074. <el-table-column prop="alternativePartDesc" label="替代料名称" align="left" min-width="150" show-overflow-tooltip></el-table-column>
  1075. <el-table-column prop="replacementRatio" label="替代比例" align="right" min-width="100"></el-table-column>
  1076. <el-table-column prop="priority" label="优先级" align="right" min-width="80"></el-table-column>
  1077. </el-table>
  1078. <span slot="footer" class="dialog-footer">
  1079. <el-button @click="alternativePartsModalFlag = false">关闭</el-button>
  1080. </span>
  1081. </el-dialog>
  1082. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  1083. </div>
  1084. </template>
  1085. <script>
  1086. import {
  1087. searchNotifyHeader
  1088. , searchNotifyOrderList
  1089. , searchNotifyMaterialList
  1090. , searchSumNotifyMaterialList
  1091. , deleteNotifySOSPlus
  1092. , updateNotifyStatus
  1093. , deleteNotifyMaterial
  1094. , searchNotifyLog
  1095. , searchNotifyLogClose
  1096. , getSiteAndBuByUserName
  1097. , createNotify
  1098. , getSOScheduledRoutingListForIssureByPaging
  1099. , getPartListByPaging
  1100. , xiadaNotify
  1101. , editNotifyMaterial
  1102. , deleteNotify,
  1103. updateNotifyDetail,
  1104. saveSOIssueNotifyOrderMateria,
  1105. getBomAlternativeParts,
  1106. getWorkCenterList
  1107. } from "@/api/orderIssure/soIssueNotify.js"
  1108. import {
  1109. searchShopOrderByPaging
  1110. , getRouteInShopOrder
  1111. } from "@/api/shopOrder/shopOrder.js"
  1112. import {
  1113. searchAllResource
  1114. } from "@/api/base/site.js"
  1115. import {
  1116. getTableDefaultListLanguage,
  1117. getTableUserListLanguage,
  1118. } from "@/api/table.js"
  1119. import {saveIssueNoOrderDetail} from "../../../../api/orderIssure/soIssueNotify";
  1120. import {
  1121. getOutboundDetail2, // 获取出库明细
  1122. getOutboundCategoryList, // 查询出库类别列表
  1123. } from "@/api/qc/outbound_notification.js"
  1124. import Chooselist from '@/views/modules/common/Chooselist_eam'
  1125. import {verifyData} from "@/api/chooselist/chooselist.js"
  1126. export default {
  1127. components: {
  1128. Chooselist,
  1129. },
  1130. data() {
  1131. return {
  1132. height:200,
  1133. activeName: 'detail',
  1134. dataList: [],
  1135. dataList2: [],
  1136. dataList3: [],
  1137. dataList4: [],
  1138. dataList5: [],
  1139. dataList6: [],
  1140. userBuList:[],
  1141. workCenterList: [],
  1142. createNotifyFlag: false,
  1143. saveOrderDetailFlag: false,
  1144. // 新建领料申请单表单验证规则
  1145. notifyRules: {
  1146. bu: [
  1147. { required: true, message: '请选择工厂_BU', trigger: 'change' }
  1148. ],
  1149. workCenterNo: [
  1150. { required: true, message: '请选择车间', trigger: 'change' }
  1151. ]
  1152. },
  1153. closeData:{
  1154. site:'',
  1155. notifyNo:'',
  1156. closeRemark:'',
  1157. username:this.$store.state.user.name,
  1158. },
  1159. closeModalFlag:false,
  1160. addMaterialModalFlag: false,
  1161. newMaterialData: {
  1162. componentPartNo: '',
  1163. partDesc: '',
  1164. issueType: '替代料',
  1165. orderNo: '',
  1166. itemNo: '',
  1167. remark: '',
  1168. componentScrap: 0,
  1169. firstInspectionQty: 0,
  1170. standardDosage: 0,
  1171. bomSeqNo: '',
  1172. warehouseId: '',
  1173. qtyToIssueOriginal: ''
  1174. },
  1175. alternativePartsModalFlag: false,
  1176. alternativePartsList: [],
  1177. alternativePartsLoading: false,
  1178. orderOptions: [],
  1179. searchData: {
  1180. page: 1,
  1181. limit: 100,
  1182. site: '',
  1183. userName: '',
  1184. notifyNo: '',
  1185. status: '草稿',
  1186. issueFlag: '',
  1187. loginUserName: this.$store.state.user.name,
  1188. issueResult: '',
  1189. workCenterNoList: [],
  1190. startDate: '',
  1191. endDate: '',
  1192. sql: "",
  1193. },
  1194. notifyData:{
  1195. site: '',
  1196. bu: '',
  1197. notifyNo: '',
  1198. notifyDate: '',
  1199. enteredDate: '',
  1200. userName: this.$store.state.user.name,
  1201. userDisplay: '',
  1202. remark: '',
  1203. planIssueDate: '',
  1204. workCenterNo: '',
  1205. category: '' // 出库类别
  1206. },
  1207. categoryList: [], // 出库类别列表
  1208. pageIndex: 1,
  1209. pageSize: 100,
  1210. totalPage: 0,
  1211. //工单分页
  1212. co_pageIndex: 1,
  1213. co_pageSize: 100,
  1214. co_totalPage: 0,
  1215. //派工单分页
  1216. ss_pageIndex: 1,
  1217. ss_pageSize: 100,
  1218. ss_totalPage: 0,
  1219. //非BOM物料分页
  1220. pp_pageIndex: 1,
  1221. pp_pageSize: 100,
  1222. pp_totalPage: 0,
  1223. dataListLoading: false,
  1224. currentRow:'',
  1225. columnList1:[
  1226. {
  1227. userId: this.$store.state.user.name,
  1228. functionId: 701002,
  1229. serialNumber: '701002Table1NotifyNo',
  1230. tableId: "701002Table1",
  1231. tableName: "领料申请主表",
  1232. columnProp: "notifyNo",
  1233. headerAlign: "center",
  1234. align: "center",
  1235. columnLabel: "申请单单号",
  1236. columnHidden: false,
  1237. columnImage: false,
  1238. columnSortable: false,
  1239. sortLv: 0,
  1240. status: true,
  1241. fixed: '',
  1242. columnWidth: 100
  1243. },{
  1244. userId: this.$store.state.user.name,
  1245. functionId: 701002,
  1246. serialNumber: '701002Table1Bu',
  1247. tableId: "701002Table1",
  1248. tableName: "领料申请主表",
  1249. columnProp: "bu",
  1250. headerAlign: "center",
  1251. align: "center",
  1252. columnLabel: "BU",
  1253. columnHidden: false,
  1254. columnImage: false,
  1255. columnSortable: false,
  1256. sortLv: 0,
  1257. status: true,
  1258. fixed: '',
  1259. columnWidth: 100
  1260. },{
  1261. userId: this.$store.state.user.name,
  1262. functionId: 701002,
  1263. serialNumber: '701002Table1NotifyDate',
  1264. tableId: "701002Table1",
  1265. tableName: "领料申请主表",
  1266. columnProp: "notifyDate",
  1267. headerAlign: "center",
  1268. align: "center",
  1269. columnLabel: "申请日期",
  1270. columnHidden: false,
  1271. columnImage: false,
  1272. columnSortable: false,
  1273. sortLv: 0,
  1274. status: true,
  1275. fixed: '',
  1276. columnWidth: 100
  1277. },{
  1278. userId: this.$store.state.user.name,
  1279. functionId: 701002,
  1280. serialNumber: '701002Table1UserName',
  1281. tableId: "701002Table1",
  1282. tableName: "领料申请主表",
  1283. columnProp: "userName",
  1284. headerAlign: "center",
  1285. align: "left",
  1286. columnLabel: "申请账号",
  1287. columnHidden: false,
  1288. columnImage: false,
  1289. columnSortable: false,
  1290. sortLv: 0,
  1291. status: true,
  1292. fixed: '',
  1293. columnWidth: 100
  1294. },{
  1295. userId: this.$store.state.user.name,
  1296. functionId: 701002,
  1297. serialNumber: '701002Table1UserDisplay',
  1298. tableId: "701002Table1",
  1299. tableName: "领料申请主表",
  1300. columnProp: "userDisplay",
  1301. headerAlign: "center",
  1302. align: "left",
  1303. columnLabel: "申请人姓名",
  1304. columnHidden: false,
  1305. columnImage: false,
  1306. columnSortable: false,
  1307. sortLv: 0,
  1308. status: true,
  1309. fixed: '',
  1310. columnWidth: 100
  1311. },{
  1312. userId: this.$store.state.user.name,
  1313. functionId: 701002,
  1314. serialNumber: '701002Table1IssueFlag',
  1315. tableId: "701002Table1",
  1316. tableName: "领料申请主表",
  1317. columnProp: "issueFlag",
  1318. headerAlign: "center",
  1319. align: "center",
  1320. columnLabel: "是否领料",
  1321. columnHidden: false,
  1322. columnImage: false,
  1323. columnSortable: false,
  1324. sortLv: 0,
  1325. status: true,
  1326. fixed: '',
  1327. columnWidth: 60
  1328. },{
  1329. userId: this.$store.state.user.name,
  1330. functionId: 701002,
  1331. serialNumber: '701002Table1IssueResult',
  1332. tableId: "701002Table1",
  1333. tableName: "领料申请主表",
  1334. columnProp: "issueResult",
  1335. headerAlign: "center",
  1336. align: "left",
  1337. columnLabel: "领料结果",
  1338. columnHidden: false,
  1339. columnImage: false,
  1340. columnSortable: false,
  1341. sortLv: 0,
  1342. status: true,
  1343. fixed: '',
  1344. columnWidth: 120
  1345. }, {
  1346. userId: this.$store.state.user.name,
  1347. functionId: 701002,
  1348. serialNumber: '701002Table1Status',
  1349. tableId: "701002Table1",
  1350. tableName: "领料申请主表",
  1351. columnProp: "status",
  1352. headerAlign: "center",
  1353. align: "left",
  1354. columnLabel: "状态",
  1355. columnHidden: false,
  1356. columnImage: false,
  1357. columnSortable: false,
  1358. sortLv: 0,
  1359. status: true,
  1360. fixed: '',
  1361. columnWidth: 80
  1362. },{
  1363. userId: this.$store.state.user.name,
  1364. functionId: 701002,
  1365. serialNumber: '701002Table1Category',
  1366. tableId: "701002Table1",
  1367. tableName: "领料申请主表",
  1368. columnProp: "category",
  1369. headerAlign: "center",
  1370. align: "center",
  1371. columnLabel: "出库类别",
  1372. columnHidden: false,
  1373. columnImage: false,
  1374. columnSortable: false,
  1375. sortLv: 0,
  1376. status: true,
  1377. fixed: '',
  1378. columnWidth: 100
  1379. },{
  1380. userId: this.$store.state.user.name,
  1381. functionId: 701002,
  1382. serialNumber: '701002Table1WorkCenterDesc',
  1383. tableId: "701002Table1",
  1384. tableName: "领料申请主表",
  1385. columnProp: "workCenterDesc",
  1386. headerAlign: "center",
  1387. align: "left",
  1388. columnLabel: "车间",
  1389. columnHidden: false,
  1390. columnImage: false,
  1391. columnSortable: false,
  1392. sortLv: 0,
  1393. status: true,
  1394. fixed: '',
  1395. columnWidth: 120
  1396. },{
  1397. userId: this.$store.state.user.name,
  1398. functionId: 701002,
  1399. serialNumber: '701002Table1Remark',
  1400. tableId: "701002Table1",
  1401. tableName: "领料申请主表",
  1402. columnProp: "remark",
  1403. headerAlign: "center",
  1404. align: "left",
  1405. columnLabel: "备注",
  1406. columnHidden: false,
  1407. columnImage: false,
  1408. columnSortable: false,
  1409. sortLv: 0,
  1410. status: true,
  1411. fixed: '',
  1412. columnWidth: 200
  1413. },
  1414. ],
  1415. columnList2:[
  1416. {
  1417. userId: this.$store.state.user.name,
  1418. functionId: 701002,
  1419. serialNumber: '701002Table2ItemNo',
  1420. tableId: "701002Table2",
  1421. tableName: "申请单工单信息明细表",
  1422. columnProp: "itemNo",
  1423. headerAlign: "center",
  1424. align: "right",
  1425. columnLabel: "序号",
  1426. columnHidden: false,
  1427. columnImage: false,
  1428. columnSortable: false,
  1429. sortLv: 0,
  1430. status: true,
  1431. fixed: '',
  1432. columnWidth: 40
  1433. },
  1434. {
  1435. userId: this.$store.state.user.name,
  1436. functionId: 701002,
  1437. serialNumber: '701002Table2NeedDate',
  1438. tableId: "701002Table2",
  1439. tableName: "申请单工单信息明细表",
  1440. columnProp: 'needDate',
  1441. headerAlign: "center",
  1442. align: "center",
  1443. columnLabel: '要求发料日期',
  1444. columnHidden: false,
  1445. columnImage: false,
  1446. columnSortable: false,
  1447. sortLv: 0,
  1448. status: true,
  1449. fixed: '',
  1450. columnWidth: 100,
  1451. },{
  1452. userId: this.$store.state.user.name,
  1453. functionId: 701002,
  1454. serialNumber: '701002Table2SOOrderNo',
  1455. tableId: "701002Table2",
  1456. tableName: "申请单工单信息明细表",
  1457. columnProp: "sOOrderNo",
  1458. headerAlign: "center",
  1459. align: "left",
  1460. columnLabel: "生产订单",
  1461. columnHidden: false,
  1462. columnImage: false,
  1463. columnSortable: false,
  1464. sortLv: 0,
  1465. status: true,
  1466. fixed: '',
  1467. columnWidth: 120
  1468. },{
  1469. userId: this.$store.state.user.name,
  1470. functionId: 701002,
  1471. serialNumber: '701002Table2OpsItemNo',
  1472. tableId: "701002Table2",
  1473. tableName: "申请单工单信息明细表",
  1474. columnProp: "opsItemNo",
  1475. headerAlign: "center",
  1476. align: "right",
  1477. columnLabel: "工序",
  1478. columnHidden: false,
  1479. columnImage: false,
  1480. columnSortable: false,
  1481. sortLv: 0,
  1482. status: true,
  1483. fixed: '',
  1484. columnWidth: 50
  1485. },{
  1486. userId: this.$store.state.user.name,
  1487. functionId: 701002,
  1488. serialNumber: '701002Table2ItemDesc',
  1489. tableId: "701002Table2",
  1490. tableName: "申请单工单信息明细表",
  1491. columnProp: "itemDesc",
  1492. headerAlign: "center",
  1493. align: "left",
  1494. columnLabel: "工序名称",
  1495. columnHidden: false,
  1496. columnImage: false,
  1497. columnSortable: false,
  1498. sortLv: 0,
  1499. status: true,
  1500. fixed: '',
  1501. columnWidth: 120
  1502. },{
  1503. userId: this.$store.state.user.name,
  1504. functionId: 701002,
  1505. serialNumber: '701002Table2SeqNo',
  1506. tableId: "701002Table2",
  1507. tableName: "申请单工单信息明细表",
  1508. columnProp: "seqNo",
  1509. headerAlign: "center",
  1510. align: "left",
  1511. columnLabel: "派工单号",
  1512. columnHidden: false,
  1513. columnImage: false,
  1514. columnSortable: false,
  1515. sortLv: 0,
  1516. status: true,
  1517. fixed: '',
  1518. columnWidth: 150
  1519. }, {
  1520. userId: this.$store.state.user.name,
  1521. functionId: 701002,
  1522. serialNumber: '701002Table2FGPartNo',
  1523. tableId: "701002Table2",
  1524. tableName: "申请单工单信息明细表",
  1525. columnProp: "fGPartNo",
  1526. headerAlign: "center",
  1527. align: "left",
  1528. columnLabel: "派工单物料",
  1529. columnHidden: false,
  1530. columnImage: false,
  1531. columnSortable: false,
  1532. sortLv: 0,
  1533. status: true,
  1534. fixed: '',
  1535. columnWidth: 120
  1536. }, {
  1537. userId: this.$store.state.user.name,
  1538. functionId: 701002,
  1539. serialNumber: '701002Table2PartDesc',
  1540. tableId: "701002Table2",
  1541. tableName: "申请单工单信息明细表",
  1542. columnProp: "partDesc",
  1543. headerAlign: "center",
  1544. align: "left",
  1545. columnLabel: "物料名称",
  1546. columnHidden: false,
  1547. columnImage: false,
  1548. columnSortable: false,
  1549. sortLv: 0,
  1550. status: true,
  1551. fixed: '',
  1552. columnWidth: 300
  1553. },
  1554. {
  1555. userId: this.$store.state.user.name,
  1556. functionId: 701002,
  1557. serialNumber: '701002Table2ResourceId',
  1558. tableId: "701002Table2",
  1559. tableName: "申请单工单信息明细表",
  1560. columnProp: 'resourceId',
  1561. headerAlign: "center",
  1562. align: "left",
  1563. columnLabel: '机台',
  1564. columnHidden: false,
  1565. columnImage: false,
  1566. columnSortable: false,
  1567. sortLv: 0,
  1568. status: true,
  1569. fixed: '',
  1570. columnWidth: 80,
  1571. },
  1572. {
  1573. userId: this.$store.state.user.name,
  1574. functionId: 701002,
  1575. serialNumber: '701002Table2NotYetStartedResourceTotal',
  1576. tableId: "701002Table2",
  1577. tableName: "申请单工单信息明细表",
  1578. columnProp: 'notYetStartedResourceTotal',
  1579. headerAlign: "center",
  1580. align: "right",
  1581. columnLabel: '已排产未开工机台数',
  1582. columnHidden: false,
  1583. columnImage: false,
  1584. columnSortable: false,
  1585. sortLv: 0,
  1586. status: true,
  1587. fixed: '',
  1588. columnWidth: 120,
  1589. },
  1590. {
  1591. userId: this.$store.state.user.name,
  1592. functionId: 701002,
  1593. serialNumber: '701002Table2ApsResourceTotal',
  1594. tableId: "701002Table2",
  1595. tableName: "申请单工单信息明细表",
  1596. columnProp: 'apsResourceTotal',
  1597. headerAlign: "center",
  1598. align: "right",
  1599. columnLabel: '已排产机台总数',
  1600. columnHidden: false,
  1601. columnImage: false,
  1602. columnSortable: false,
  1603. sortLv: 0,
  1604. status: true,
  1605. fixed: '',
  1606. columnWidth: 120,
  1607. },
  1608. {
  1609. userId: this.$store.state.user.name,
  1610. functionId: 701002,
  1611. serialNumber: '701002Table2IssureQty',
  1612. tableId: "701002Table2",
  1613. tableName: "申请单工单信息明细表",
  1614. columnProp: "issureQty",
  1615. headerAlign: "center",
  1616. align: "right",
  1617. columnLabel: "发料数量",
  1618. columnHidden: false,
  1619. columnImage: false,
  1620. columnSortable: false,
  1621. sortLv: 0,
  1622. status: true,
  1623. fixed: '',
  1624. columnWidth: 80
  1625. },
  1626. ],
  1627. columnList3:[
  1628. {
  1629. userId: this.$store.state.user.name,
  1630. functionId: 701002,
  1631. serialNumber: '701002Table3OrderNo',
  1632. tableId: "701002Table3",
  1633. tableName: "申请单材料明细表",
  1634. columnProp: "orderNo",
  1635. headerAlign: "center",
  1636. align: "left",
  1637. columnLabel: "生产订单号",
  1638. columnHidden: false,
  1639. columnImage: false,
  1640. columnSortable: false,
  1641. sortLv: 0,
  1642. status: true,
  1643. fixed: '',
  1644. columnWidth: 130
  1645. },
  1646. {
  1647. userId: this.$store.state.user.name,
  1648. functionId: 701002,
  1649. serialNumber: '701002Table3BOMItemNo',
  1650. tableId: "701002Table3",
  1651. tableName: "申请单材料明细表",
  1652. columnProp: "bOMItemNo",
  1653. headerAlign: "center",
  1654. align: "right",
  1655. columnLabel: "BOM序号",
  1656. columnHidden: false,
  1657. columnImage: false,
  1658. columnSortable: false,
  1659. sortLv: 0,
  1660. status: true,
  1661. fixed: '',
  1662. columnWidth: 80
  1663. },{
  1664. userId: this.$store.state.user.name,
  1665. functionId: 701002,
  1666. serialNumber: '701002Table3ComponentPartNo',
  1667. tableId: "701002Table3",
  1668. tableName: "申请单材料明细表",
  1669. columnProp: "componentPartNo",
  1670. headerAlign: "center",
  1671. align: "center",
  1672. columnLabel: "材料编码",
  1673. columnHidden: false,
  1674. columnImage: false,
  1675. columnSortable: false,
  1676. sortLv: 0,
  1677. status: true,
  1678. fixed: '',
  1679. columnWidth: 130
  1680. },
  1681. {
  1682. userId: this.$store.state.user.name,
  1683. functionId: 701002,
  1684. serialNumber: '701002Table3PartDesc',
  1685. tableId: "701002Table3",
  1686. tableName: "申请单材料明细表",
  1687. columnProp: "partDesc",
  1688. headerAlign: "center",
  1689. align: "left",
  1690. columnLabel: "材料名称",
  1691. columnHidden: false,
  1692. columnImage: false,
  1693. columnSortable: false,
  1694. sortLv: 0,
  1695. status: true,
  1696. fixed: '',
  1697. columnWidth: 300
  1698. },
  1699. {
  1700. userId: this.$store.state.user.name,
  1701. functionId: 701002,
  1702. serialNumber: '701002Table3UmName',
  1703. tableId: "701002Table3",
  1704. tableName: "申请单材料明细表",
  1705. columnProp: "umName",
  1706. headerAlign: "center",
  1707. align: "center",
  1708. columnLabel: "单位",
  1709. columnHidden: false,
  1710. columnImage: false,
  1711. columnSortable: false,
  1712. sortLv: 0,
  1713. status: true,
  1714. fixed: '',
  1715. columnWidth: 100
  1716. },
  1717. {
  1718. userId: this.$store.state.user.name,
  1719. functionId: 701002,
  1720. serialNumber: '701002Table3IssueMethod',
  1721. tableId: "701002Table3",
  1722. tableName: "申请单材料明细表",
  1723. columnProp: "issueMethod",
  1724. headerAlign: "center",
  1725. align: "left",
  1726. columnLabel: "领料方式",
  1727. columnHidden: false,
  1728. columnImage: false,
  1729. columnSortable: false,
  1730. sortLv: 0,
  1731. status: true,
  1732. fixed: '',
  1733. columnWidth: 100
  1734. },
  1735. {
  1736. userId: this.$store.state.user.name,
  1737. functionId: 701002,
  1738. serialNumber: '701002Table3IssueType',
  1739. tableId: "701002Table3",
  1740. tableName: "申请单材料明细表",
  1741. columnProp: "issueType",
  1742. headerAlign: "center",
  1743. align: "left",
  1744. columnLabel: "类型",
  1745. columnHidden: false,
  1746. columnImage: false,
  1747. columnSortable: false,
  1748. sortLv: 0,
  1749. status: true,
  1750. fixed: '',
  1751. columnWidth: 80
  1752. },
  1753. ],
  1754. columnList3s:[
  1755. {
  1756. userId: this.$store.state.user.name,
  1757. functionId: 701002,
  1758. serialNumber: '701002Table3QtyToIssue',
  1759. tableId: "701002Table3",
  1760. tableName: "申请单材料明细表",
  1761. columnProp: "qtyToIssue",
  1762. headerAlign: "center",
  1763. align: "right",
  1764. columnLabel: "申请数量",
  1765. columnHidden: false,
  1766. columnImage: false,
  1767. columnSortable: false,
  1768. sortLv: 0,
  1769. status: true,
  1770. fixed: '',
  1771. columnWidth: 80
  1772. },
  1773. // {
  1774. // userId: this.$store.state.user.name,
  1775. // functionId: 701002,
  1776. // serialNumber: '701002Table3Remark',
  1777. // tableId: "701002Table3",
  1778. // tableName: "申请单材料明细表",
  1779. // columnProp: "remark",
  1780. // headerAlign: "center",
  1781. // align: "left",
  1782. // columnLabel: "备注",
  1783. // columnHidden: false,
  1784. // columnImage: false,
  1785. // columnSortable: false,
  1786. // sortLv: 0,
  1787. // status: true,
  1788. // fixed: '',
  1789. // columnWidth: 160
  1790. // },
  1791. {
  1792. userId: this.$store.state.user.name,
  1793. functionId: 701002,
  1794. serialNumber: '701002Table3OpsItemNo',
  1795. tableId: "701002Table3",
  1796. tableName: "申请单材料明细表",
  1797. columnProp: "opsItemNo",
  1798. headerAlign: "center",
  1799. align: "right",
  1800. columnLabel: "领料工序",
  1801. columnHidden: false,
  1802. columnImage: false,
  1803. columnSortable: false,
  1804. sortLv: 0,
  1805. status: true,
  1806. fixed: '',
  1807. columnWidth: 80
  1808. },{
  1809. userId: this.$store.state.user.name,
  1810. functionId: 701002,
  1811. serialNumber: '701002Table3LocationNo',
  1812. tableId: "701002Table3",
  1813. tableName: "申请单材料明细表",
  1814. columnProp: "locationNo",
  1815. headerAlign: "center",
  1816. align: "left",
  1817. columnLabel: "领料机台",
  1818. columnHidden: false,
  1819. columnImage: false,
  1820. columnSortable: false,
  1821. sortLv: 0,
  1822. status: true,
  1823. fixed: '',
  1824. columnWidth: 80
  1825. },{
  1826. userId: this.$store.state.user.name,
  1827. functionId: 701002,
  1828. serialNumber: '701002Table3SeqNo',
  1829. tableId: "701002Table3",
  1830. tableName: "申请单材料明细表",
  1831. columnProp: "seqNo",
  1832. headerAlign: "center",
  1833. align: "left",
  1834. columnLabel: "派工单号",
  1835. columnHidden: false,
  1836. columnImage: false,
  1837. columnSortable: false,
  1838. sortLv: 0,
  1839. status: true,
  1840. fixed: '',
  1841. columnWidth: 150
  1842. },
  1843. ],
  1844. columnList4:[
  1845. {
  1846. userId: this.$store.state.user.name,
  1847. functionId: 701002,
  1848. serialNumber: '701002Table4IssueType',
  1849. tableId: "701002Table4",
  1850. tableName: "申请单材料明细表",
  1851. columnProp: "issueType",
  1852. headerAlign: "center",
  1853. align: "left",
  1854. columnLabel: "类型",
  1855. columnHidden: false,
  1856. columnImage: false,
  1857. columnSortable: false,
  1858. sortLv: 0,
  1859. status: true,
  1860. fixed: '',
  1861. columnWidth: 80
  1862. },
  1863. {
  1864. userId: this.$store.state.user.name,
  1865. functionId: 701002,
  1866. serialNumber: '701002Table4ComponentPartNo',
  1867. tableId: "701002Table4",
  1868. tableName: "申请单材料明细表",
  1869. columnProp: "componentPartNo",
  1870. headerAlign: "center",
  1871. align: "left",
  1872. columnLabel: "材料编码",
  1873. columnHidden: false,
  1874. columnImage: false,
  1875. columnSortable: false,
  1876. sortLv: 0,
  1877. status: true,
  1878. fixed: '',
  1879. columnWidth: 100
  1880. },{
  1881. userId: this.$store.state.user.name,
  1882. functionId: 701002,
  1883. serialNumber: '701002Table4PartDesc',
  1884. tableId: "701002Table4",
  1885. tableName: "申请单材料明细表",
  1886. columnProp: "partDesc",
  1887. headerAlign: "center",
  1888. align: "left",
  1889. columnLabel: "材料名称",
  1890. columnHidden: false,
  1891. columnImage: false,
  1892. columnSortable: false,
  1893. sortLv: 0,
  1894. status: true,
  1895. fixed: '',
  1896. columnWidth: 200
  1897. },
  1898. {
  1899. userId: this.$store.state.user.name,
  1900. functionId: 701002,
  1901. serialNumber: '701002Table4PartDesc',
  1902. tableId: "701002Table4",
  1903. tableName: "申请单材料明细表",
  1904. columnProp: "warehouseName",
  1905. headerAlign: "center",
  1906. align: "left",
  1907. columnLabel: "领料仓库",
  1908. columnHidden: false,
  1909. columnImage: false,
  1910. columnSortable: false,
  1911. sortLv: 0,
  1912. status: true,
  1913. fixed: '',
  1914. columnWidth: 100
  1915. },
  1916. {
  1917. userId: this.$store.state.user.name,
  1918. functionId: 701002,
  1919. serialNumber: '701002Table4QtyToIssue',
  1920. tableId: "701002Table4",
  1921. tableName: "申请单材料明细表",
  1922. columnProp: "qtyToIssue",
  1923. headerAlign: "center",
  1924. align: "right",
  1925. columnLabel: "合计申请数量",
  1926. columnHidden: false,
  1927. columnImage: false,
  1928. columnSortable: false,
  1929. sortLv: 0,
  1930. status: true,
  1931. fixed: '',
  1932. columnWidth: 80
  1933. },{
  1934. userId: this.$store.state.user.name,
  1935. functionId: 701002,
  1936. serialNumber: '701002Table4QtyToIssueOriginal',
  1937. tableId: "701002Table4",
  1938. tableName: "申请单材料明细表",
  1939. columnProp: "qtyToIssueOriginal",
  1940. headerAlign: "center",
  1941. align: "right",
  1942. columnLabel: "合计已发数量",
  1943. columnHidden: false,
  1944. columnImage: false,
  1945. columnSortable: false,
  1946. sortLv: 0,
  1947. status: true,
  1948. fixed: '',
  1949. columnWidth: 80
  1950. },
  1951. ],
  1952. columnList5:[
  1953. {
  1954. userId: this.$store.state.user.name,
  1955. functionId: 701002,
  1956. serialNumber: '701002Table5UpdateType',
  1957. tableId: "701002Table5",
  1958. tableName: "申请单材料删除记录表",
  1959. columnProp: "updateType",
  1960. headerAlign: "center",
  1961. align: "center",
  1962. columnLabel: "删除类型",
  1963. columnHidden: false,
  1964. columnImage: false,
  1965. columnSortable: false,
  1966. sortLv: 0,
  1967. status: true,
  1968. fixed: '',
  1969. columnWidth: 100
  1970. },
  1971. {
  1972. userId: this.$store.state.user.name,
  1973. functionId: 701002,
  1974. serialNumber: '701002Table5ItemNo',
  1975. tableId: "701002Table5",
  1976. tableName: "申请单材料删除记录表",
  1977. columnProp: "itemNo",
  1978. headerAlign: "center",
  1979. align: "right",
  1980. columnLabel: "领料单序号",
  1981. columnHidden: false,
  1982. columnImage: false,
  1983. columnSortable: false,
  1984. sortLv: 0,
  1985. status: true,
  1986. fixed: '',
  1987. columnWidth: 80
  1988. },
  1989. {
  1990. userId: this.$store.state.user.name,
  1991. functionId: 701002,
  1992. serialNumber: '701002Table5SOOrderNo',
  1993. tableId: "701002Table5",
  1994. tableName: "申请单材料删除记录表",
  1995. columnProp: "sOOrderNo",
  1996. headerAlign: "center",
  1997. align: "left",
  1998. columnLabel: "生产订单",
  1999. columnHidden: false,
  2000. columnImage: false,
  2001. columnSortable: false,
  2002. sortLv: 0,
  2003. status: true,
  2004. fixed: '',
  2005. columnWidth: 80
  2006. },
  2007. {
  2008. userId: this.$store.state.user.name,
  2009. functionId: 701002,
  2010. serialNumber: '701002Table5SeqNo',
  2011. tableId: "701002Table5",
  2012. tableName: "申请单材料删除记录表",
  2013. columnProp: "seqNo",
  2014. headerAlign: "center",
  2015. align: "left",
  2016. columnLabel: "派工单",
  2017. columnHidden: false,
  2018. columnImage: false,
  2019. columnSortable: false,
  2020. sortLv: 0,
  2021. status: true,
  2022. fixed: '',
  2023. columnWidth: 120
  2024. },
  2025. {
  2026. userId: this.$store.state.user.name,
  2027. functionId: 701002,
  2028. serialNumber: '701002Table5ComponentPartNo',
  2029. tableId: "701002Table5",
  2030. tableName: "申请单材料删除记录表",
  2031. columnProp: "componentPartNo",
  2032. headerAlign: "center",
  2033. align: "left",
  2034. columnLabel: "材料物料编码",
  2035. columnHidden: false,
  2036. columnImage: false,
  2037. columnSortable: false,
  2038. sortLv: 0,
  2039. status: true,
  2040. fixed: '',
  2041. columnWidth: 100
  2042. },
  2043. {
  2044. userId: this.$store.state.user.name,
  2045. functionId: 701002,
  2046. serialNumber: '701002Table5IssueType',
  2047. tableId: "701002Table5",
  2048. tableName: "申请单材料删除记录表",
  2049. columnProp: "issueType",
  2050. headerAlign: "center",
  2051. align: "left",
  2052. columnLabel: "材料类型",
  2053. columnHidden: false,
  2054. columnImage: false,
  2055. columnSortable: false,
  2056. sortLv: 0,
  2057. status: true,
  2058. fixed: '',
  2059. columnWidth: 100
  2060. },
  2061. {
  2062. userId: this.$store.state.user.name,
  2063. functionId: 701002,
  2064. serialNumber: '701002Table5QtyToIssue',
  2065. tableId: "701002Table5",
  2066. tableName: "申请单材料删除记录表",
  2067. columnProp: "qtyToIssue",
  2068. headerAlign: "center",
  2069. align: "right",
  2070. columnLabel: "要求领料数量",
  2071. columnHidden: false,
  2072. columnImage: false,
  2073. columnSortable: false,
  2074. sortLv: 0,
  2075. status: true,
  2076. fixed: '',
  2077. columnWidth: 100
  2078. },
  2079. {
  2080. userId: this.$store.state.user.name,
  2081. functionId: 701002,
  2082. serialNumber: '701002Table5UpdateBy',
  2083. tableId: "701002Table5",
  2084. tableName: "申请单材料删除记录表",
  2085. columnProp: "updateBy",
  2086. headerAlign: "center",
  2087. align: "left",
  2088. columnLabel: "删除账号",
  2089. columnHidden: false,
  2090. columnImage: false,
  2091. columnSortable: false,
  2092. sortLv: 0,
  2093. status: true,
  2094. fixed: '',
  2095. columnWidth: 100
  2096. },
  2097. {
  2098. userId: this.$store.state.user.name,
  2099. functionId: 701002,
  2100. serialNumber: '701002Table5UpdateDate',
  2101. tableId: "701002Table5",
  2102. tableName: "申请单材料删除记录表",
  2103. columnProp: "updateDate",
  2104. headerAlign: "center",
  2105. align: "center",
  2106. columnLabel: "删除时间",
  2107. columnHidden: false,
  2108. columnImage: false,
  2109. columnSortable: false,
  2110. sortLv: 0,
  2111. status: true,
  2112. fixed: '',
  2113. columnWidth: 120
  2114. },
  2115. ],
  2116. columnList6:[
  2117. {
  2118. userId: this.$store.state.user.name,
  2119. functionId: 701002,
  2120. serialNumber: '701002Table6UserDisplay',
  2121. tableId: "701002Table6",
  2122. tableName: "申请单材料关闭明细",
  2123. columnProp: "userDisplay",
  2124. headerAlign: "center",
  2125. align: "left",
  2126. columnLabel: "操作人",
  2127. columnHidden: false,
  2128. columnImage: false,
  2129. columnSortable: false,
  2130. sortLv: 0,
  2131. status: true,
  2132. fixed: '',
  2133. columnWidth: 100
  2134. },
  2135. {
  2136. userId: this.$store.state.user.name,
  2137. functionId: 701002,
  2138. serialNumber: '701002Table6ActionTime',
  2139. tableId: "701002Table6",
  2140. tableName: "申请单材料关闭明细",
  2141. columnProp: "actionTime",
  2142. headerAlign: "center",
  2143. align: "left",
  2144. columnLabel: "操作时间",
  2145. columnHidden: false,
  2146. columnImage: false,
  2147. columnSortable: false,
  2148. sortLv: 0,
  2149. status: true,
  2150. fixed: '',
  2151. columnWidth: 130
  2152. },
  2153. {
  2154. userId: this.$store.state.user.name,
  2155. functionId: 701002,
  2156. serialNumber: '701002Table6ActionRemark',
  2157. tableId: "701002Table6",
  2158. tableName: "申请单材料关闭明细",
  2159. columnProp: "actionRemark",
  2160. headerAlign: "center",
  2161. align: "left",
  2162. columnLabel: "关闭原因",
  2163. columnHidden: false,
  2164. columnImage: false,
  2165. columnSortable: false,
  2166. sortLv: 0,
  2167. status: true,
  2168. fixed: '',
  2169. columnWidth: 300
  2170. },
  2171. ],
  2172. // 导出 start
  2173. exportData: [],
  2174. exportName: '发料申请单'+this.dayjs().format('YYYYMMDDHHmmss'),
  2175. exportHeader: ["发料申请单"],
  2176. exportFooter: [],
  2177. // 导出 end
  2178. orderDetailData:{
  2179. orderNo:'',
  2180. seqNo:'',
  2181. locationNo:'',
  2182. qtyrequired:'',
  2183. issureQty:0,
  2184. partDesc:'',
  2185. partNo:'',
  2186. resourceId:'',
  2187. resourceDesc:'',
  2188. needDate:'',
  2189. itemDesc:'',
  2190. workCenterNo:'',
  2191. itemNo:0,
  2192. materialType:'BOM物料',
  2193. alreadyApplyTotal: 0,
  2194. apsResourceTotal: 0,
  2195. notYetStartedResourceTotal: 0
  2196. },
  2197. chooseSOSModalFlag: false,
  2198. chooseSOSData: {
  2199. page: 1,
  2200. limit: 100,
  2201. orderno: '',
  2202. seqno: '',
  2203. sResourceid: '',
  2204. startDate: '',
  2205. endDate: '',
  2206. },
  2207. chooseOrderModalFlag: false,
  2208. chooseOrderData: {
  2209. page: 1,
  2210. limit: 100,
  2211. orderNo: '',
  2212. status: '',
  2213. date3: '',
  2214. date4: '',
  2215. statusList: '',
  2216. },
  2217. chooseOrderList: [],
  2218. chooseOperationModalFlag: false,
  2219. chooseOperationData: {
  2220. orderNo: '',
  2221. site: '',
  2222. itemDesc: ''
  2223. },
  2224. chooseOperationList: [],
  2225. chooseResourceModalFlag: false,
  2226. chooseResourceData: {
  2227. site: '',
  2228. workCenterNo: '',
  2229. resourceID: '',
  2230. resourceDesc: '',
  2231. },
  2232. chooseResourceList: [],
  2233. chooseSOSList: [],
  2234. choosePartModalFlag: false,
  2235. choosePartData: {
  2236. page: 1,
  2237. limit: 100,
  2238. site: '',
  2239. sourceBu: '',
  2240. partNo: '',
  2241. partDesc: '',
  2242. spec: '',
  2243. },
  2244. choosePartList: [],
  2245. chooseSOSColumnList: [
  2246. {
  2247. userId: this.$store.state.user.name,
  2248. functionId: 701001,
  2249. serialNumber: '701001Table2Orderno',
  2250. tableId: "701001Table2",
  2251. tableName: "查询派工单",
  2252. columnProp: 'orderno',
  2253. headerAlign: "center",
  2254. align: "center",
  2255. columnLabel: '生产订单',
  2256. columnHidden: false,
  2257. columnImage: false,
  2258. columnSortable: false,
  2259. sortLv: 0,
  2260. status: true,
  2261. fixed: '',
  2262. columnWidth: 120,
  2263. },
  2264. {
  2265. userId: this.$store.state.user.name,
  2266. functionId: 701001,
  2267. serialNumber: '701001Table2Seqno',
  2268. tableId: "701001Table2",
  2269. tableName: "查询派工单",
  2270. columnProp: 'seqno',
  2271. headerAlign: "center",
  2272. align: "center",
  2273. columnLabel: '派工单号',
  2274. columnHidden: false,
  2275. columnImage: false,
  2276. columnSortable: false,
  2277. sortLv: 0,
  2278. status: true,
  2279. fixed: '',
  2280. columnWidth: 150,
  2281. },
  2282. {
  2283. userId: this.$store.state.user.name,
  2284. functionId: 701001,
  2285. serialNumber: '701001Table2PartNo',
  2286. tableId: "701001Table2",
  2287. tableName: "查询派工单",
  2288. columnProp: 'partNo',
  2289. headerAlign: "center",
  2290. align: "left",
  2291. columnLabel: '物料编码',
  2292. columnHidden: false,
  2293. columnImage: false,
  2294. columnSortable: false,
  2295. sortLv: 0,
  2296. status: true,
  2297. fixed: '',
  2298. columnWidth: 80,
  2299. },
  2300. {
  2301. userId: this.$store.state.user.name,
  2302. functionId: 701001,
  2303. serialNumber: '701001Table2PartDesc',
  2304. tableId: "701001Table2",
  2305. tableName: "查询派工单",
  2306. columnProp: 'partDesc',
  2307. headerAlign: "center",
  2308. align: "left",
  2309. columnLabel: '物料描述',
  2310. columnHidden: false,
  2311. columnImage: false,
  2312. columnSortable: false,
  2313. sortLv: 0,
  2314. status: true,
  2315. fixed: '',
  2316. columnWidth: 120,
  2317. },
  2318. {
  2319. userId: this.$store.state.user.name,
  2320. functionId: 701001,
  2321. serialNumber: '701001Table2Qtyrequired',
  2322. tableId: "701001Table2",
  2323. tableName: "查询派工单",
  2324. columnProp: 'qtyrequired',
  2325. headerAlign: "center",
  2326. align: "right",
  2327. columnLabel: '派工数量',
  2328. columnHidden: false,
  2329. columnImage: false,
  2330. columnSortable: false,
  2331. sortLv: 0,
  2332. status: true,
  2333. fixed: '',
  2334. columnWidth: 80,
  2335. },
  2336. {
  2337. userId: this.$store.state.user.name,
  2338. functionId: 701001,
  2339. serialNumber: '701001Table2SResourceid',
  2340. tableId: "701001Table2",
  2341. tableName: "查询派工单",
  2342. columnProp: 'sResourceid',
  2343. headerAlign: "center",
  2344. align: "left",
  2345. columnLabel: '机台编码',
  2346. columnHidden: false,
  2347. columnImage: false,
  2348. columnSortable: false,
  2349. sortLv: 0,
  2350. status: true,
  2351. fixed: '',
  2352. columnWidth: 60,
  2353. },
  2354. {
  2355. userId: this.$store.state.user.name,
  2356. functionId: 701001,
  2357. serialNumber: '701001Table2ResourceDesc',
  2358. tableId: "701001Table2",
  2359. tableName: "查询派工单",
  2360. columnProp: 'resourceDesc',
  2361. headerAlign: "center",
  2362. align: "left",
  2363. columnLabel: '机台名称',
  2364. columnHidden: false,
  2365. columnImage: false,
  2366. columnSortable: false,
  2367. sortLv: 0,
  2368. status: true,
  2369. fixed: '',
  2370. columnWidth: 100,
  2371. },
  2372. {
  2373. userId: this.$store.state.user.name,
  2374. functionId: 701001,
  2375. serialNumber: '701001Table2StartDate',
  2376. tableId: "701001Table2",
  2377. tableName: "查询派工单",
  2378. columnProp: 'startDate',
  2379. headerAlign: "center",
  2380. align: "left",
  2381. columnLabel: '开始日期',
  2382. columnHidden: false,
  2383. columnImage: false,
  2384. columnSortable: false,
  2385. sortLv: 0,
  2386. status: true,
  2387. fixed: '',
  2388. columnWidth: 100,
  2389. },
  2390. ],
  2391. chooseOrderColumnList: [
  2392. {
  2393. userId: this.$store.state.user.name,
  2394. functionId: 701001,
  2395. serialNumber: '701001Table2Orderno',
  2396. tableId: "701001Table2",
  2397. tableName: "查询工单",
  2398. columnProp: 'orderNo',
  2399. headerAlign: "center",
  2400. align: "center",
  2401. columnLabel: '工单号',
  2402. columnHidden: false,
  2403. columnImage: false,
  2404. columnSortable: false,
  2405. sortLv: 0,
  2406. status: true,
  2407. fixed: '',
  2408. columnWidth: 120,
  2409. },
  2410. {
  2411. userId: this.$store.state.user.name,
  2412. functionId: 701001,
  2413. serialNumber: '701001Table2PartNo',
  2414. tableId: "701001Table2",
  2415. tableName: "查询工单",
  2416. columnProp: 'partNo',
  2417. headerAlign: "center",
  2418. align: "left",
  2419. columnLabel: '物料编码',
  2420. columnHidden: false,
  2421. columnImage: false,
  2422. columnSortable: false,
  2423. sortLv: 0,
  2424. status: true,
  2425. fixed: '',
  2426. columnWidth: 120,
  2427. },
  2428. {
  2429. userId: this.$store.state.user.name,
  2430. functionId: 701001,
  2431. serialNumber: '701001Table2PartDescription',
  2432. tableId: "701001Table2",
  2433. tableName: "查询工单",
  2434. columnProp: 'partDescription',
  2435. headerAlign: "center",
  2436. align: "left",
  2437. columnLabel: '物料描述',
  2438. columnHidden: false,
  2439. columnImage: false,
  2440. columnSortable: false,
  2441. sortLv: 0,
  2442. status: true,
  2443. fixed: '',
  2444. columnWidth: 150,
  2445. },
  2446. {
  2447. userId: this.$store.state.user.name,
  2448. functionId: 701001,
  2449. serialNumber: '701001Table2LotSize',
  2450. tableId: "701001Table2",
  2451. tableName: "查询工单",
  2452. columnProp: 'lotSize',
  2453. headerAlign: "center",
  2454. align: "right",
  2455. columnLabel: '工单数量',
  2456. columnHidden: false,
  2457. columnImage: false,
  2458. columnSortable: false,
  2459. sortLv: 0,
  2460. status: true,
  2461. fixed: '',
  2462. columnWidth: 100,
  2463. },
  2464. {
  2465. userId: this.$store.state.user.name,
  2466. functionId: 701001,
  2467. serialNumber: '701001Table2Status',
  2468. tableId: "701001Table2",
  2469. tableName: "查询工单",
  2470. columnProp: 'status',
  2471. headerAlign: "center",
  2472. align: "center",
  2473. columnLabel: '状态',
  2474. columnHidden: false,
  2475. columnImage: false,
  2476. columnSortable: false,
  2477. sortLv: 0,
  2478. status: true,
  2479. fixed: '',
  2480. columnWidth: 80,
  2481. },
  2482. ],
  2483. chooseOperationColumnList: [
  2484. {
  2485. userId: this.$store.state.user.name,
  2486. functionId: 701001,
  2487. serialNumber: '701001Table2ItemNo',
  2488. tableId: "701001Table2",
  2489. tableName: "查询工序",
  2490. columnProp: 'itemNo',
  2491. headerAlign: "center",
  2492. align: "center",
  2493. columnLabel: '工序号',
  2494. columnHidden: false,
  2495. columnImage: false,
  2496. columnSortable: false,
  2497. sortLv: 0,
  2498. status: true,
  2499. fixed: '',
  2500. columnWidth: 80,
  2501. },
  2502. {
  2503. userId: this.$store.state.user.name,
  2504. functionId: 701001,
  2505. serialNumber: '701001Table2OperationDesc',
  2506. tableId: "701001Table2",
  2507. tableName: "查询工序",
  2508. columnProp: 'operationDesc',
  2509. headerAlign: "center",
  2510. align: "left",
  2511. columnLabel: '工序名称',
  2512. columnHidden: false,
  2513. columnImage: false,
  2514. columnSortable: false,
  2515. sortLv: 0,
  2516. status: true,
  2517. fixed: '',
  2518. columnWidth: 120,
  2519. }
  2520. ],
  2521. chooseResourceColumnList: [
  2522. {
  2523. userId: this.$store.state.user.name,
  2524. functionId: 701001,
  2525. serialNumber: '701001Table2ResourceID',
  2526. tableId: "701001Table2",
  2527. tableName: "查询机台",
  2528. columnProp: 'resourceID',
  2529. headerAlign: "center",
  2530. align: "left",
  2531. columnLabel: '机台编码',
  2532. columnHidden: false,
  2533. columnImage: false,
  2534. columnSortable: false,
  2535. sortLv: 0,
  2536. status: true,
  2537. fixed: '',
  2538. columnWidth: 100,
  2539. },
  2540. {
  2541. userId: this.$store.state.user.name,
  2542. functionId: 701001,
  2543. serialNumber: '701001Table2ResourceDesc',
  2544. tableId: "701001Table2",
  2545. tableName: "查询机台",
  2546. columnProp: 'resourceDesc',
  2547. headerAlign: "center",
  2548. align: "left",
  2549. columnLabel: '机台描述',
  2550. columnHidden: false,
  2551. columnImage: false,
  2552. columnSortable: false,
  2553. sortLv: 0,
  2554. status: true,
  2555. fixed: '',
  2556. columnWidth: 150,
  2557. },
  2558. ],
  2559. detailModal2: false,
  2560. detailList2: [],
  2561. columnDetailList2: [
  2562. {
  2563. columnProp: 'subNo',
  2564. headerAlign: "center",
  2565. align: "left",
  2566. columnLabel: '标签条码',
  2567. columnHidden: false,
  2568. columnImage: false,
  2569. columnSortable: false,
  2570. sortLv: 0,
  2571. status: true,
  2572. fixed: '',
  2573. columnWidth: 100,
  2574. },
  2575. {
  2576. columnProp: 'subQty',
  2577. headerAlign: "center",
  2578. align: "right",
  2579. columnLabel: '出库数量',
  2580. columnHidden: false,
  2581. columnImage: false,
  2582. columnSortable: false,
  2583. sortLv: 0,
  2584. status: true,
  2585. fixed: '',
  2586. columnWidth: 100,
  2587. },
  2588. {
  2589. columnProp: 'orderRef4',
  2590. headerAlign: "center",
  2591. align: "left",
  2592. columnLabel: '出库仓库',
  2593. columnHidden: false,
  2594. columnImage: false,
  2595. columnSortable: false,
  2596. sortLv: 0,
  2597. status: true,
  2598. fixed: '',
  2599. columnWidth: 150,
  2600. },
  2601. {
  2602. columnProp: 'orderRef5',
  2603. headerAlign: "center",
  2604. align: "left",
  2605. columnLabel: '出库库位',
  2606. columnHidden: false,
  2607. columnImage: false,
  2608. columnSortable: false,
  2609. sortLv: 0,
  2610. status: true,
  2611. fixed: '',
  2612. columnWidth: 150,
  2613. },
  2614. {
  2615. columnProp: 'userName',
  2616. headerAlign: "center",
  2617. align: "left",
  2618. columnLabel: '操作员',
  2619. columnHidden: false,
  2620. columnImage: false,
  2621. columnSortable: false,
  2622. sortLv: 0,
  2623. status: true,
  2624. fixed: '',
  2625. columnWidth: 100,
  2626. },
  2627. {
  2628. columnProp: 'transDate',
  2629. headerAlign: "center",
  2630. align: "center",
  2631. columnLabel: '操作时间',
  2632. columnHidden: false,
  2633. columnImage: false,
  2634. columnSortable: false,
  2635. sortLv: 0,
  2636. status: true,
  2637. fixed: '',
  2638. columnWidth: 170,
  2639. },
  2640. ],
  2641. editBatchVisible: false,
  2642. saveLoading: false,
  2643. tempWareHouseRow: {}, // 临时存储编辑仓库的行
  2644. }
  2645. },
  2646. computed: {
  2647. // 计算属性:判断当前状态是否可编辑
  2648. isEditableStatusComputed() {
  2649. if (!this.currentRow || !this.currentRow.status) {
  2650. return false;
  2651. }
  2652. return this.currentRow.status === '草稿' || this.currentRow.status === '编辑中' || this.currentRow.status === '待确认';
  2653. }
  2654. },
  2655. mounted () {
  2656. this.$nextTick(() => {
  2657. this.height = (window.innerHeight- 315) / 2
  2658. })
  2659. },
  2660. created () {
  2661. this.getSiteAndBuByUserName()
  2662. this.searchTable()
  2663. },
  2664. methods: {
  2665. // 批量编辑模态框
  2666. editBatchModel() {
  2667. if (this.currentRow.status !== '草稿' && this.currentRow.status !== '编辑中' && this.currentRow.status !== '待确认') {
  2668. this.$message.warning('该类型单据不能编辑!')
  2669. return
  2670. }
  2671. if (this.editBatchVisible) {
  2672. this.editBatchVisible = false
  2673. } else {
  2674. this.editBatchVisible = true
  2675. }
  2676. },
  2677. // 批量保存
  2678. batchModel() {
  2679. let params = []
  2680. params = this.dataList3
  2681. this.saveLoading = true
  2682. updateNotifyDetail(params).then(({data}) => {
  2683. if (data && data.code === 0) {
  2684. this.getNotifyMaterialList()
  2685. this.$message.success(data.msg)
  2686. this.editBatchVisible = false
  2687. } else {
  2688. this.$message.error(data.msg)
  2689. }
  2690. }).finally(() => {
  2691. this.saveLoading = false
  2692. })
  2693. },
  2694. // 出库明细
  2695. outboundDetailModal (row) {
  2696. let tempData = {
  2697. site: row.site,
  2698. buNo: row.bu,
  2699. orderNo: row.notifyNo,
  2700. partNo: row.componentPartNo,
  2701. orderType: '生产领料'
  2702. }
  2703. getOutboundDetail2(tempData).then(({data}) => {
  2704. if (data && data.code === 0) {
  2705. this.detailList2 = data.rows
  2706. } else {
  2707. this.detailList2 = []
  2708. }
  2709. })
  2710. this.detailModal2 = true
  2711. },
  2712. // 动态列开始 获取 用户保存的 格式列
  2713. async getTableUserColumn(tableId, columnId) {
  2714. let queryTableUser = {
  2715. userId: this.$store.state.user.name,
  2716. functionId: this.$route.meta.menuId,
  2717. tableId: tableId,
  2718. status: true,
  2719. languageCode: this.$i18n.locale
  2720. }
  2721. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  2722. if (data.rows.length > 0) {
  2723. //this.columnList1 = []
  2724. switch (columnId) {
  2725. case 1:
  2726. this.columnList1 = data.rows
  2727. break;
  2728. case 2:
  2729. this.columnList2 = data.rows
  2730. break;
  2731. case 3:
  2732. this.columnList3 = data.rows
  2733. break;
  2734. case 4:
  2735. this.columnList4 = data.rows
  2736. break;
  2737. case 5:
  2738. this.columnList5 = data.rows
  2739. break;
  2740. case 6:
  2741. this.columnList6 = data.rows
  2742. break;
  2743. }
  2744. } else {
  2745. this.getColumnList(tableId, columnId)
  2746. }
  2747. })
  2748. },
  2749. // 获取 tableDefault 列
  2750. async getColumnList (tableId, columnId) {
  2751. let queryTable= {
  2752. functionId: this.$route.meta.menuId,
  2753. tableId: tableId,
  2754. languageCode: this.$i18n.locale
  2755. }
  2756. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  2757. if (!data.rows.length == 0) {
  2758. switch (columnId) {
  2759. case 1:
  2760. this.columnList1 = data.rows
  2761. break;
  2762. case 2:
  2763. this.columnList2 = data.rows
  2764. break;
  2765. case 3:
  2766. this.columnList3 = data.rows
  2767. break;
  2768. case 4:
  2769. this.columnList4 = data.rows
  2770. break;
  2771. case 5:
  2772. this.columnList5 = data.rows
  2773. break;
  2774. case 6:
  2775. this.columnList6 = data.rows
  2776. break;
  2777. }
  2778. } else {
  2779. // this.showDefault = true.
  2780. }
  2781. })
  2782. },
  2783. // 每页数
  2784. sizeChangeHandle (val) {
  2785. this.pageSize = val
  2786. this.pageIndex = 1
  2787. this.searchTable()
  2788. },
  2789. // 当前页
  2790. currentChangeHandle (val) {
  2791. this.pageIndex = val
  2792. this.searchTable()
  2793. },
  2794. tabClick (tab, event) {
  2795. // 刷新列表数据
  2796. this.refreshCurrentTabTable()
  2797. },
  2798. changeData(row){
  2799. this.currentRow = JSON.parse(JSON.stringify(row));
  2800. this.refreshCurrentTabTable ();
  2801. },
  2802. refreshCurrentTabTable(){
  2803. if(this.currentRow===''||this.currentRow===null){
  2804. this.currentRow={site:'',notifyNo:''}
  2805. }
  2806. if(this.activeName==='detail'){
  2807. searchNotifyOrderList(this.currentRow).then(({data}) => {
  2808. //区分请求成功和失败的状况
  2809. if (data && data.code == 0) {
  2810. this.dataList2 = data.rows
  2811. } else {
  2812. this.dataList2 = [];
  2813. }
  2814. });
  2815. }else if(this.activeName==='sub'){
  2816. searchNotifyMaterialList(this.currentRow).then(({data}) => {
  2817. //区分请求成功和失败的状况
  2818. if (data && data.code == 0) {
  2819. this.dataList3 = data.rows
  2820. } else {
  2821. this.dataList3 = [];
  2822. }
  2823. });
  2824. }
  2825. // else if(this.activeName==='change'){
  2826. // searchNotifyLog(this.currentRow).then(({data}) => {
  2827. // //区分请求成功和失败的状况
  2828. // if (data && data.code == 0) {
  2829. // this.dataList5 = data.rows
  2830. //
  2831. // } else {
  2832. // this.dataList5 = [];
  2833. // }
  2834. // });
  2835. // }
  2836. // else if(this.activeName==='close'){
  2837. // searchNotifyLogClose(this.currentRow).then(({data}) => {
  2838. // //区分请求成功和失败的状况
  2839. // if (data && data.code == 0) {
  2840. // this.dataList6 = data.rows
  2841. //
  2842. // } else {
  2843. // this.dataList6 = [];
  2844. // }
  2845. // });
  2846. // }
  2847. else {
  2848. searchSumNotifyMaterialList(this.currentRow).then(({data}) => {
  2849. //区分请求成功和失败的状况
  2850. if (data && data.code == 0) {
  2851. this.dataList4 = data.rows
  2852. } else {
  2853. this.dataList4 = [];
  2854. }
  2855. this.$nextTick(() => {
  2856. this.$refs.sum.doLayout(); // 重新计算布局
  2857. });
  2858. });
  2859. }
  2860. },
  2861. getNotifyMaterialList () {
  2862. searchNotifyMaterialList(this.currentRow).then(({data}) => {
  2863. //区分请求成功和失败的状况
  2864. if (data && data.code == 0) {
  2865. this.dataList3 = data.rows
  2866. } else {
  2867. this.dataList3 = []
  2868. }
  2869. })
  2870. },
  2871. searchTable(){
  2872. this.searchData.limit = this.pageSize
  2873. this.searchData.page = this.pageIndex
  2874. // 返回 Promise,让外部可以等它完成
  2875. return new Promise((resolve, reject) => {
  2876. searchNotifyHeader(this.searchData).then(({ data }) => {
  2877. if (data && data.code == 0) {
  2878. this.dataList = data.page.list;
  2879. this.pageIndex = data.page.currPage;
  2880. this.pageSize = data.page.pageSize;
  2881. this.totalPage = data.page.totalCount;
  2882. resolve(); // 请求成功,执行 resolve
  2883. } else {
  2884. this.dataList = [];
  2885. reject(new Error(data ? data.msg : '请求失败'));
  2886. }
  2887. }).catch(err => {
  2888. this.dataList = [];
  2889. reject(err); // 请求出错
  2890. });
  2891. });
  2892. },
  2893. closeNotifyModel(row){
  2894. this.closeData.site=row.site
  2895. this.closeData.notifyNo=row.notifyNo
  2896. this.closeData.closeRemark=''
  2897. this.closeModalFlag=true
  2898. },
  2899. closeNotify(){
  2900. if(this.closeData.closeRemark==null||this.closeData.closeRemark===''){
  2901. this.$alert("必须输入关闭原因", '错误', {
  2902. confirmButtonText: '确定'
  2903. })
  2904. return false;
  2905. }
  2906. let inData={
  2907. site:this.closeData.site,
  2908. notifyNo:this.closeData.notifyNo,
  2909. closeRemark:this.closeData.closeRemark,
  2910. username:this.$store.state.user.name,
  2911. status:'已关闭',
  2912. }
  2913. updateNotifyStatus(inData).then(({data}) => {
  2914. if (data && data.code === 0) {
  2915. this.closeModalFlag=false
  2916. this.searchTable()
  2917. this.$message({
  2918. message: '操作成功',
  2919. type: 'success',
  2920. duration: 1500,
  2921. onClose: () => {}
  2922. })
  2923. } else {
  2924. this.$alert(data.msg, '错误', {
  2925. confirmButtonText: '确定'
  2926. })
  2927. }
  2928. })
  2929. },
  2930. deleteNotifyConfirm(row){
  2931. this.$confirm('确认删除?', '提示', {
  2932. confirmButtonText: '确定',
  2933. cancelButtonText: '取消',
  2934. type: 'warning'
  2935. }).then(() => {
  2936. let inData={
  2937. site:row.site,
  2938. notifyNo:row.notifyNo
  2939. }
  2940. deleteNotify(inData).then(({data}) => {
  2941. if (data && data.code === 0) {
  2942. this.searchTable()
  2943. this.$message({
  2944. message: '操作成功',
  2945. type: 'success',
  2946. duration: 1500,
  2947. onClose: () => {}
  2948. })
  2949. } else {
  2950. this.$alert(data.msg, '错误', {
  2951. confirmButtonText: '确定'
  2952. })
  2953. }
  2954. })
  2955. })
  2956. },
  2957. openNotify(row){
  2958. this.$confirm('确认打开?', '提示', {
  2959. confirmButtonText: '确定',
  2960. cancelButtonText: '取消',
  2961. type: 'warning'
  2962. }).then(() => {
  2963. let inData={
  2964. site:row.site,
  2965. notifyNo:row.notifyNo,
  2966. status:'已下达',
  2967. }
  2968. updateNotifyStatus(inData).then(({data}) => {
  2969. if (data && data.code === 0) {
  2970. this.searchTable()
  2971. this.$message({
  2972. message: '操作成功',
  2973. type: 'success',
  2974. duration: 1500,
  2975. onClose: () => {}
  2976. })
  2977. } else {
  2978. this.$alert(data.msg, '错误', {
  2979. confirmButtonText: '确定'
  2980. })
  2981. }
  2982. })
  2983. })
  2984. },
  2985. deleteNotifyMaterial(row){
  2986. this.$confirm('确认删除?', '提示', {
  2987. confirmButtonText: '确定',
  2988. cancelButtonText: '取消',
  2989. type: 'warning'
  2990. }).then(() => {
  2991. deleteNotifyMaterial(row).then(({data}) => {
  2992. if (data && data.code === 0) {
  2993. this.refreshCurrentTabTable()
  2994. this.$message({
  2995. message: '操作成功',
  2996. type: 'success',
  2997. duration: 1500,
  2998. onClose: () => {}
  2999. })
  3000. } else {
  3001. this.$alert(data.msg, '错误', {
  3002. confirmButtonText: '确定'
  3003. })
  3004. }
  3005. })
  3006. })
  3007. },
  3008. deleteNotifySOSPlus(row){
  3009. // 检查当前状态是否允许编辑
  3010. if (!this.isEditableStatusComputed) {
  3011. this.$alert('当前状态不允许编辑!只有草稿、编辑中或待确认状态才能删除明细。', '提示', {
  3012. confirmButtonText: '确定'
  3013. })
  3014. return false
  3015. }
  3016. this.$confirm('确认删除?', '提示', {
  3017. confirmButtonText: '确定',
  3018. cancelButtonText: '取消',
  3019. type: 'warning'
  3020. }).then(() => {
  3021. deleteNotifySOSPlus(row).then(({data}) => {
  3022. if (data && data.code === 0) {
  3023. this.refreshCurrentTabTable()
  3024. this.$message({
  3025. message: '操作成功',
  3026. type: 'success',
  3027. duration: 1500,
  3028. onClose: () => {}
  3029. })
  3030. } else {
  3031. this.$alert(data.msg, '错误', {
  3032. confirmButtonText: '确定'
  3033. })
  3034. }
  3035. })
  3036. })
  3037. },
  3038. //申请单主表新增方法
  3039. //新增领料申请单模态框
  3040. createNotifyModal(){
  3041. this.notifyData = {
  3042. site: '',
  3043. bu: this.userBuList[0].buNo,
  3044. notifyNo: '',
  3045. notifyDate: '',
  3046. enteredDate: '',
  3047. userName: this.$store.state.user.name,
  3048. userDisplay: '',
  3049. remark: '',
  3050. planIssueDate: '',
  3051. workCenterNo: '',
  3052. category: '' // 出库类别
  3053. }
  3054. this.loadCategoryList() // 加载出库类别列表
  3055. this.createNotifyFlag = true
  3056. },
  3057. getSiteAndBuByUserName() {
  3058. let inData = {
  3059. username: this.$store.state.user.name
  3060. }
  3061. getSiteAndBuByUserName(inData).then(({data}) =>{
  3062. if (data && data.code === 0) {
  3063. this.userBuList = data.rows
  3064. if (this.userBuList.length > 0) {
  3065. this.getWorkCenterList()
  3066. }
  3067. }
  3068. })
  3069. },
  3070. // 查加工中心
  3071. getWorkCenterList() {
  3072. let inData = {
  3073. username: this.$store.state.user.name
  3074. }
  3075. getWorkCenterList(inData).then(({data}) =>{
  3076. if (data && data.code === 0) {
  3077. this.workCenterList = data.rows
  3078. }
  3079. })
  3080. },
  3081. //保存领料申请单
  3082. saveNotify() {
  3083. // 验证表单
  3084. this.$refs.notifyForm.validate((valid) => {
  3085. if (!valid) {
  3086. this.$message.warning('请填写必填项');
  3087. return false;
  3088. }
  3089. let buValue = this.notifyData.bu
  3090. let site = buValue.split('_')[0]
  3091. let bu = buValue.split('_')[1]
  3092. let inData = {
  3093. site: site,
  3094. bu: bu,
  3095. userName: this.$store.state.user.name,
  3096. remark: this.notifyData.remark,
  3097. workCenterNo: this.notifyData.workCenterNo,
  3098. category: this.notifyData.category, // 出库类别
  3099. }
  3100. createNotify(inData).then(({data})=>{
  3101. if (data.code === 0) {
  3102. const newNotifyNo = data.notifyNo // 获取新创建的单据号
  3103. this.$message({
  3104. message: '操作成功',
  3105. type: 'success',
  3106. duration: 1500,
  3107. onClose: () => {}
  3108. })
  3109. this.createNotifyFlag = false
  3110. // 清空搜索条件中的单据号,设置为新单据号以便精确查询
  3111. this.searchData.notifyNo = newNotifyNo
  3112. // 刷新主表数据并定位到新单据
  3113. this.searchTable().then(() => {
  3114. const foundRow = this.dataList.find(item => item.notifyNo === newNotifyNo)
  3115. if (foundRow) {
  3116. this.currentRow = JSON.parse(JSON.stringify(foundRow))
  3117. this.$nextTick(() => {
  3118. this.$refs.mainTable.setCurrentRow(foundRow)
  3119. // 刷新子表数据
  3120. this.refreshCurrentTabTable()
  3121. })
  3122. }
  3123. // 清空搜索条件中的单据号,恢复正常查询
  3124. this.searchData.notifyNo = ''
  3125. })
  3126. }else {
  3127. this.$alert(data.msg, '错误', {
  3128. confirmButtonText: '确定'
  3129. })
  3130. }
  3131. })
  3132. });
  3133. },
  3134. //新增派工单明细
  3135. createOrderDetail(){
  3136. // 检查是否选择了主表行
  3137. if (!this.currentRow || !this.currentRow.notifyNo) {
  3138. this.$alert('请先选择一条主表记录!', '提示', {
  3139. confirmButtonText: '确定'
  3140. })
  3141. return false
  3142. }
  3143. // 检查当前状态是否允许编辑
  3144. if (!this.isEditableStatusComputed) {
  3145. this.$alert('当前状态不允许编辑!只有草稿、编辑中或待确认状态才能新增明细。', '提示', {
  3146. confirmButtonText: '确定'
  3147. })
  3148. return false
  3149. }
  3150. // 清除所有数据,设置默认值
  3151. this.orderDetailData = {
  3152. orderNo: '',
  3153. seqNo: '',
  3154. operationNo: '',
  3155. locationNo: '',
  3156. qtyRequired: '',
  3157. issureQty: 0,
  3158. partDesc: '',
  3159. partNo: '',
  3160. resourceId: '',
  3161. resourceDesc: '',
  3162. itemDesc: '',
  3163. itemNo: 0,
  3164. workCenterNo: '',
  3165. needDate: '',
  3166. materialType: 'BOM物料',
  3167. alreadyApplyTotal: 0,
  3168. apsResourceTotal: 0,
  3169. notYetStartedResourceTotal: 0
  3170. }
  3171. this.saveOrderDetailFlag = true
  3172. },
  3173. saveIssueNoOrderDetail(){
  3174. // 数据验证
  3175. // 非BOM物料时,只校验领取数量和要求发料时间
  3176. if (this.orderDetailData.materialType === 'BOM物料') {
  3177. if (!this.orderDetailData.orderNo ) {
  3178. this.$message.error('请选择工单或者派工单');
  3179. return false
  3180. }
  3181. if (!this.orderDetailData.itemNo) {
  3182. this.$message.error('请选择工序');
  3183. return false
  3184. }
  3185. /*//校验如果是BOM物料的话领料数量不能大于工单数量
  3186. if (this.orderDetailData.issureQty > this.orderDetailData.qtyRequired){
  3187. this.$message.error('领取数量不可大于工单/派工数量!');
  3188. return false
  3189. }
  3190. //校验如果是BOM物料的话,领料数量不能大于工单数量
  3191. if ((this.orderDetailData.issureQty + this.orderDetailData.alreadyApplyTotal) > this.orderDetailData.qtyRequired){
  3192. this.$message.error('申请总和不可超出工单/派工数量!');
  3193. return false
  3194. }*/
  3195. }
  3196. if (!this.orderDetailData.needDate) {
  3197. this.$message.error('请选择要求发料时间');
  3198. return false
  3199. }
  3200. if (!this.orderDetailData.issureQty || this.orderDetailData.issureQty <= 0) {
  3201. this.$message.error('请填写领取数量');
  3202. return false
  3203. }
  3204. // 构建API请求参数
  3205. let inData = {
  3206. site: this.currentRow.site,
  3207. bu: this.currentRow.bu,
  3208. notifyNo: this.currentRow.notifyNo,
  3209. materialType: this.orderDetailData.materialType,
  3210. sOOrderNo: this.orderDetailData.orderNo,
  3211. seqNo: this.orderDetailData.seqNo,
  3212. fGPartNo: this.orderDetailData.partNo,
  3213. opsItemNo: this.orderDetailData.itemNo,
  3214. issureQty: this.orderDetailData.issureQty,
  3215. needDate: this.orderDetailData.needDate,
  3216. outWorkOrderFlag: 'N',
  3217. username: this.$store.state.user.name,
  3218. // 扩展字段
  3219. itemDesc: this.orderDetailData.itemDesc,
  3220. partDesc: this.orderDetailData.partDesc,
  3221. resourceDesc: this.orderDetailData.resourceDesc,
  3222. resourceId: this.orderDetailData.resourceId,
  3223. workCenterNo: this.orderDetailData.workCenterNo,
  3224. qtyrequired: this.orderDetailData.qtyRequired,
  3225. apsResourceTotal: this.orderDetailData.apsResourceTotal,
  3226. notYetStartedResourceTotal: this.orderDetailData.notYetStartedResourceTotal
  3227. }
  3228. // 调用API保存派工单数据
  3229. saveIssueNoOrderDetail(inData).then(({data}) => {
  3230. if (data && data.code === 0) {
  3231. this.$message({
  3232. message: '保存成功',
  3233. type: 'success',
  3234. duration: 1500,
  3235. onClose: () => {}
  3236. })
  3237. // 关闭模态框
  3238. this.saveOrderDetailFlag = false
  3239. // 刷新当前标签页数据
  3240. this.refreshCurrentTabTable()
  3241. // 清空表单数据
  3242. this.orderDetailData = {
  3243. orderNo: '',
  3244. seqNo: '',
  3245. operationNo: '',
  3246. locationNo: '',
  3247. qtyRequired: '',
  3248. issureQty: 0,
  3249. partDesc: '',
  3250. partNo: '',
  3251. resourceId: '',
  3252. resourceDesc: '',
  3253. itemDesc: '',
  3254. itemNo: 0,
  3255. workCenterNo: '',
  3256. needDate: '',
  3257. materialType: 'BOM物料',
  3258. alreadyApplyTotal: 0,
  3259. apsResourceTotal: 0,
  3260. notYetStartedResourceTotal: 0
  3261. }
  3262. } else {
  3263. this.$alert(data.msg || '保存失败', '错误', {
  3264. confirmButtonText: '确定'
  3265. })
  3266. }
  3267. }).catch(error => {
  3268. console.error('保存派工单明细失败:', error)
  3269. this.$alert('保存失败,请稍后重试', '错误', {
  3270. confirmButtonText: '确定'
  3271. })
  3272. })
  3273. },
  3274. //导出excel
  3275. async createExportData() {
  3276. this.searchData.limit = -1
  3277. this.searchData.page = 1
  3278. const {data} = await searchNotifyHeader(this.searchData)
  3279. return data.page.list;
  3280. },
  3281. startDownload() {
  3282. // this.exportData = this.dataList
  3283. },
  3284. finishDownload() {
  3285. },
  3286. fields() {
  3287. let json = "{"
  3288. this.columnList1.forEach((item, index) => {
  3289. if (index == this.columnList1.length - 1) {
  3290. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  3291. } else {
  3292. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  3293. }
  3294. })
  3295. json += "}"
  3296. let s = eval("(" + json + ")")
  3297. return s
  3298. },
  3299. tableRowClassName ({row, rowIndex}) {
  3300. if (row.qtyToIssueOriginal<row.qtyToIssue&&new Date(row.needDate)<new Date(this.dayjs().format("YYYY-MM-DD HH:mm"))) {
  3301. return 'error-row'
  3302. }
  3303. return ''
  3304. },
  3305. onMaterialTypeChange(value) {
  3306. // 清空相关字段
  3307. this.orderDetailData.orderNo = '';
  3308. this.orderDetailData.seqNo = '';
  3309. this.orderDetailData.operationNo = '';
  3310. this.orderDetailData.partNo = '';
  3311. this.orderDetailData.partDesc = '';
  3312. this.orderDetailData.locationNo = '';
  3313. this.orderDetailData.resourceId = '';
  3314. this.orderDetailData.resourceDesc = '';
  3315. this.orderDetailData.qtyRequired = '';
  3316. this.orderDetailData.itemDesc = '';
  3317. this.orderDetailData.itemNo = '';
  3318. this.orderDetailData.workCenterNo = '';
  3319. this.orderDetailData.issureQty = 0;
  3320. this.orderDetailData.alreadyApplyTotal = 0;
  3321. },
  3322. //派工单选择部分
  3323. openChooseSOSModal() {
  3324. // 检查是否选择了主表行
  3325. if (!this.currentRow || !this.currentRow.notifyNo) {
  3326. this.$alert('请先选择一条主表记录!', '提示', {
  3327. confirmButtonText: '确定'
  3328. })
  3329. return false
  3330. }
  3331. this.ss_totalPage= 0;
  3332. // 初始化选择派工单数据
  3333. this.chooseSOSData = {
  3334. page: 1,
  3335. limit: 100,
  3336. site: this.currentRow.site,
  3337. bu: this.currentRow.bu,
  3338. orderNo: '',
  3339. seqNo: '',
  3340. sResourceid: '',
  3341. startDate: this.dayjs().format('YYYY-MM-DD'),
  3342. endDate: this.dayjs().format('YYYY-MM-DD'),
  3343. }
  3344. // 清空选择列表
  3345. this.chooseSOSList = []
  3346. // 打开选择模态框
  3347. this.chooseSOSModalFlag = true
  3348. },
  3349. searchSOSRouting() {
  3350. this.chooseSOSData.limit = this.ss_pageSize
  3351. this.chooseSOSData.page = this.ss_pageIndex
  3352. // 调用API查询派工单信息
  3353. getSOScheduledRoutingListForIssureByPaging(this.chooseSOSData).then(({data}) => {
  3354. if (data.code === 0) {
  3355. this.chooseSOSList = data.page.list;
  3356. if (this.chooseSOSList.length === 0) {
  3357. this.$message.warning('未查询到符合条件的派工单');
  3358. }
  3359. this.ss_pageIndex = data.page.currPage
  3360. this.ss_pageSize = data.page.pageSize
  3361. this.ss_totalPage = data.page.totalCount
  3362. } else {
  3363. // 清空选择列表
  3364. this.chooseSOSList = []
  3365. this.$message.error(data.msg || '查询失败');
  3366. }
  3367. }).catch(error => {
  3368. // 清空选择列表
  3369. this.chooseSOSList = []
  3370. console.error('查询派工单失败:', error);
  3371. this.$message.error('查询失败,请稍后重试');
  3372. });
  3373. },
  3374. // 每页数 工单分页信息
  3375. ss_sizeChangeHandle(val) {
  3376. this.ss_pageSize = val
  3377. this.ss_pageIndex = 1
  3378. this.searchSOSRouting()
  3379. },
  3380. // 当前页 工单分页信息
  3381. ss_currentChangeHandle(val) {
  3382. this.ss_pageIndex = val
  3383. this.searchSOSRouting()
  3384. },
  3385. chooseSOS(row) {
  3386. // 关闭选择模态框
  3387. this.chooseSOSModalFlag = false
  3388. // 将选择的数据填入到保存派工单模态框中
  3389. this.orderDetailData.orderNo = row.orderno || '';
  3390. this.orderDetailData.seqNo = row.seqno || '';
  3391. this.orderDetailData.itemNo = row.itemno || '';
  3392. this.orderDetailData.itemDesc = row.itemDesc || '';
  3393. this.orderDetailData.resourceId = row.sResourceid || '';
  3394. this.orderDetailData.resourceDesc = row.resourceDesc || '';
  3395. this.orderDetailData.qtyRequired = row.qtyrequired || '';
  3396. this.orderDetailData.partDesc = row.partDesc || '';
  3397. this.orderDetailData.partNo = row.partNo || '';
  3398. this.orderDetailData.workCenterNo = row.sWorkcenterno || '';
  3399. this.orderDetailData.alreadyApplyTotal = row.alreadyApplyTotal || 0;
  3400. this.orderDetailData.needDate = this.dayjs().format('YYYY-MM-DD HH:mm:ss');
  3401. // 根据物料类型设置
  3402. if (row.issueType === '非BOM物料') {
  3403. this.orderDetailData.materialType = '非BOM物料';
  3404. } else {
  3405. this.orderDetailData.materialType = 'BOM物料';
  3406. }
  3407. this.$message.success('选择派工单成功,数据已填入表单');
  3408. },
  3409. //工单选择部分
  3410. // 打开选择工单模态框
  3411. openChooseOrderModal() {
  3412. // 检查是否选择了主表行
  3413. if (!this.currentRow || !this.currentRow.notifyNo) {
  3414. this.$alert('请先选择一条主表记录!', '提示', {
  3415. confirmButtonText: '确定'
  3416. })
  3417. return false
  3418. }
  3419. this.co_totalPage= 0;
  3420. // 初始化选择工单数据
  3421. this.chooseOrderData = {
  3422. page: 1,
  3423. limit: 100,
  3424. site: this.currentRow.site,
  3425. buNo: this.currentRow.bu,
  3426. user: this.$store.state.user.name,
  3427. orderNo: '',
  3428. statusList: ['已下达', '已计划', '已排产'],
  3429. date3: this.dayjs().format('YYYY-MM-DD'),
  3430. date4: this.dayjs().format('YYYY-MM-DD'),
  3431. }
  3432. // 清空选择列表
  3433. this.chooseOrderList = []
  3434. // 打开选择模态框
  3435. this.chooseOrderModalFlag = true
  3436. },
  3437. // 查询工单信息
  3438. searchOrder() {
  3439. this.chooseOrderData.limit = this.co_pageSize
  3440. this.chooseOrderData.page = this.co_pageIndex
  3441. searchShopOrderByPaging(this.chooseOrderData).then(({data}) => {
  3442. if (data.code === 0) {
  3443. this.chooseOrderList = data.page.list;
  3444. if (this.chooseOrderList.length === 0) {
  3445. this.$message.warning('未查询到符合条件的工单');
  3446. }
  3447. this.co_pageIndex = data.page.currPage
  3448. this.co_pageSize = data.page.pageSize
  3449. this.co_totalPage = data.page.totalCount
  3450. } else {
  3451. this.chooseOrderList = [];
  3452. this.$message.error(data.msg || '查询失败');
  3453. }
  3454. }).catch(error => {
  3455. this.chooseOrderList = [];
  3456. console.error('查询工单失败:', error);
  3457. this.$message.error('查询失败,请稍后重试');
  3458. });
  3459. },
  3460. // 每页数 工单分页信息
  3461. co_sizeChangeHandle(val) {
  3462. this.co_pageSize = val
  3463. this.co_pageIndex = 1
  3464. this.searchOrder()
  3465. },
  3466. // 当前页 工单分页信息
  3467. co_currentChangeHandle(val) {
  3468. this.co_pageIndex = val
  3469. this.searchOrder()
  3470. },
  3471. // 选择工单
  3472. chooseOrder(row) {
  3473. // 关闭选择模态框
  3474. this.chooseOrderModalFlag = false
  3475. // 将选择的数据填入到保存派工单模态框中
  3476. this.orderDetailData.orderNo = row.orderNo || '';
  3477. this.orderDetailData.partNo = row.partNo || '';
  3478. this.orderDetailData.partDesc = row.partDescription || '';
  3479. this.orderDetailData.qtyRequired = row.lotSize || '';
  3480. this.orderDetailData.alreadyApplyTotal = row.alreadyApplyTotal || 0;
  3481. this.orderDetailData.apsResourceTotal = row.apsResourceTotal || 0;
  3482. this.orderDetailData.notYetStartedResourceTotal = row.notYetStartedResourceTotal || 0;
  3483. // 清空相关字段
  3484. this.orderDetailData.seqNo = '';
  3485. this.orderDetailData.operationNo = '';
  3486. this.orderDetailData.locationNo = '';
  3487. },
  3488. //工序选择部分
  3489. // 打开选择工序模态框
  3490. openChooseOperationModal() {
  3491. // 检查是否选择了工单
  3492. if (!this.orderDetailData.orderNo) {
  3493. this.$alert('请先选择工单!', '提示', {
  3494. confirmButtonText: '确定'
  3495. })
  3496. return false
  3497. }
  3498. // 初始化选择工序数据
  3499. this.chooseOperationData = {
  3500. orderNo: this.orderDetailData.orderNo,
  3501. site: this.currentRow.site,
  3502. }
  3503. // 清空选择列表
  3504. this.chooseOperationList = []
  3505. //
  3506. this.searchOperation();
  3507. // 打开选择模态框
  3508. this.chooseOperationModalFlag = true
  3509. },
  3510. // 查询工序信息
  3511. searchOperation() {
  3512. // 调用API查询工序信息
  3513. getRouteInShopOrder(this.chooseOperationData).then(({data}) => {
  3514. if (data.code === 0) {
  3515. this.chooseOperationList = data.dataList;
  3516. if (this.chooseOperationList.length === 0) {
  3517. this.$message.warning('未查询到符合条件的工序');
  3518. }
  3519. } else {
  3520. // 清空选择列表
  3521. this.chooseOperationList = [];
  3522. this.$message.error(data.msg || '查询失败');
  3523. }
  3524. }).catch(error => {
  3525. // 清空选择列表
  3526. this.chooseOperationList = [];
  3527. console.error('查询工序失败:', error);
  3528. this.$message.error('查询失败,请稍后重试');
  3529. });
  3530. },
  3531. // 选择工序
  3532. chooseOperation(row) {
  3533. // 关闭选择模态框
  3534. this.chooseOperationModalFlag = false
  3535. // 将选择的数据填入到保存派工单模态框中
  3536. this.orderDetailData.itemDesc = row.operationDesc || '';
  3537. this.orderDetailData.itemNo = row.itemNo || '';
  3538. this.orderDetailData.workCenterNo = row.workCenterNo || '';
  3539. this.$message.success('操作成功');
  3540. },
  3541. //机台选择部分
  3542. // 打开选择机台模态框
  3543. openChooseResourceModal() {
  3544. // 检查是否选择了工单
  3545. if (!this.orderDetailData.orderNo) {
  3546. this.$alert('请先选择工单!', '提示', {
  3547. confirmButtonText: '确定'
  3548. })
  3549. return false
  3550. }
  3551. // 初始化选择机台数据
  3552. this.chooseResourceData = {
  3553. site: this.currentRow.site,
  3554. workCenterNo: this.orderDetailData.workCenterNo,
  3555. resourceID: '',
  3556. resourceDesc: '',
  3557. }
  3558. // 清空选择列表
  3559. this.chooseResourceList = []
  3560. this.searchResource();
  3561. // 打开选择模态框
  3562. this.chooseResourceModalFlag = true
  3563. },
  3564. // 查询机台信息
  3565. searchResource() {
  3566. // 调用API查询机台信息
  3567. searchAllResource(this.chooseResourceData).then(({data}) => {
  3568. if (data.code === 0) {
  3569. this.chooseResourceList = data.rows;
  3570. if (this.chooseResourceList.length === 0) {
  3571. this.$message.warning('未查询到符合条件的机台');
  3572. }
  3573. } else {
  3574. // 清空选择列表
  3575. this.chooseResourceList = [];
  3576. this.$message.error(data.msg || '查询失败');
  3577. }
  3578. }).catch(error => {
  3579. // 清空选择列表
  3580. this.chooseResourceList = [];
  3581. console.error('查询机台失败:', error);
  3582. this.$message.error('查询失败,请稍后重试');
  3583. });
  3584. },
  3585. // 选择机台
  3586. chooseResource(row) {
  3587. // 关闭选择模态框
  3588. this.chooseResourceModalFlag = false
  3589. // 将选择的数据填入到保存派工单模态框中
  3590. this.orderDetailData.resourceId = row.resourceId || '';
  3591. this.orderDetailData.resourceDesc = row.resourceDesc || '';
  3592. this.$message.success('操作成功');
  3593. },
  3594. //非BOM物料选择部分
  3595. // 打开选择物料模态框
  3596. openChoosePartModal() {
  3597. // 检查是否选择了主表行
  3598. if (!this.currentRow || !this.currentRow.notifyNo) {
  3599. this.$alert('请先选择一条主表记录!', '提示', {
  3600. confirmButtonText: '确定'
  3601. })
  3602. return false
  3603. }
  3604. // 初始化选择物料数据
  3605. this.choosePartData = {
  3606. site: this.currentRow.site,
  3607. sourceBu: this.currentRow.bu,
  3608. partNo: '',
  3609. partDesc: '',
  3610. spec: '',
  3611. }
  3612. // 清空选择列表
  3613. this.choosePartList = []
  3614. // 打开选择模态框
  3615. this.choosePartModalFlag = true
  3616. this.searchPartModel()
  3617. },
  3618. // 查询物料信息
  3619. searchPartModel() {
  3620. this.choosePartData.limit = this.pp_pageSize
  3621. this.choosePartData.page = this.pp_pageIndex
  3622. // 调用API查询物料信息
  3623. getPartListByPaging(this.choosePartData).then(({data}) => {
  3624. if (data.code === 0) {
  3625. this.choosePartList = data.page.list;
  3626. if (this.choosePartList.length === 0) {
  3627. this.$message.warning('未查询到符合条件的物料');
  3628. }
  3629. this.pp_pageIndex = data.page.currPage
  3630. this.pp_pageSize = data.page.pageSize
  3631. this.pp_totalPage = data.page.totalCount
  3632. } else {
  3633. // 清空选择列表
  3634. this.choosePartList = []
  3635. this.$message.error(data.msg || '查询失败');
  3636. }
  3637. }).catch(error => {
  3638. // 清空选择列表
  3639. this.choosePartList = []
  3640. console.error('查询物料失败:', error);
  3641. this.$message.error('查询失败,请稍后重试');
  3642. });
  3643. },
  3644. // 每页数 工单分页信息
  3645. pp_sizeChangeHandle(val) {
  3646. this.pp_pageSize = val
  3647. this.pp_pageIndex = 1
  3648. this.searchPartModel()
  3649. },
  3650. // 当前页 工单分页信息
  3651. pp_currentChangeHandle(val) {
  3652. this.pp_pageIndex = val
  3653. this.searchPartModel()
  3654. },
  3655. // 选择物料
  3656. choosePart(row) {
  3657. // 关闭选择模态框
  3658. this.choosePartModalFlag = false
  3659. // 将选择的数据填入到保存派工单模态框中
  3660. this.orderDetailData.partNo = row.partNo || '';
  3661. this.orderDetailData.partDesc = row.partDesc || '';
  3662. this.orderDetailData.materialType = '非BOM物料';
  3663. this.$message.success('选择物料成功,数据已填入表单');
  3664. },
  3665. //提交申请单方法
  3666. async submitNotifyModel(row){
  3667. // 设置当前行为要提交的行
  3668. this.currentRow = JSON.parse(JSON.stringify(row));
  3669. // 先刷新子表数据,确保获取最新数据
  3670. await this.refreshAllSubTables();
  3671. console.log('申请单明细数据:', this.dataList2);
  3672. console.log('材料明细数据:', this.dataList3);
  3673. if(this.dataList2.length==0 || this.dataList3.length==0){
  3674. this.$alert('没有明细记录无法提交!', '提示', {
  3675. confirmButtonText: '确定'
  3676. })
  3677. return false
  3678. }
  3679. // 调用更新状态接口,将状态改为"待确认"
  3680. let inData = {
  3681. site: row.site,
  3682. notifyNo: row.notifyNo,
  3683. status: '待确认',
  3684. }
  3685. updateNotifyStatus(inData).then(({data})=>{
  3686. if (data.code === 0) {
  3687. //刷新主表数据
  3688. this.searchTable().then(() => { // 等刷新完成
  3689. const foundRow = this.dataList.find(item => item.notifyNo === row.notifyNo);
  3690. if (foundRow) {
  3691. this.currentRow = JSON.parse(JSON.stringify(foundRow));
  3692. this.$nextTick(() => {
  3693. this.$refs.mainTable.setCurrentRow(foundRow);
  3694. });
  3695. }
  3696. });
  3697. this.$message.success('提交成功')
  3698. }else {
  3699. this.$alert(data.msg, '错误', {
  3700. confirmButtonText: '确定'
  3701. })
  3702. }
  3703. })
  3704. },
  3705. //下达申请单方法
  3706. async xiadaNotifyModel(row){
  3707. // 设置当前行为要下达的行
  3708. this.currentRow = JSON.parse(JSON.stringify(row));
  3709. // 先刷新子表数据,确保获取最新数据
  3710. await this.refreshAllSubTables();
  3711. console.log('申请单明细数据:', this.dataList2);
  3712. console.log('材料明细数据:', this.dataList3);
  3713. if(this.dataList2.length==0 || this.dataList3.length==0){
  3714. this.$alert('没有明细记录无法下达!!', '提示', {
  3715. confirmButtonText: '确定'
  3716. })
  3717. return false
  3718. }
  3719. xiadaNotify(row).then(({data})=>{
  3720. if (data.code === 0) {
  3721. //刷新主表数据
  3722. this.searchTable().then(() => { // 等刷新完成
  3723. const foundRow = this.dataList.find(item => item.notifyNo === row.notifyNo);
  3724. if (foundRow) {
  3725. this.currentRow = JSON.parse(JSON.stringify(foundRow));
  3726. this.$nextTick(() => {
  3727. this.$refs.mainTable.setCurrentRow(foundRow);
  3728. });
  3729. }
  3730. });
  3731. this.$message.success( '操作成功')
  3732. }else {
  3733. this.$alert(data.msg, '错误', {
  3734. confirmButtonText: '确定'
  3735. })
  3736. }
  3737. })
  3738. },
  3739. // 刷新所有子表数据
  3740. async refreshAllSubTables() {
  3741. if(!this.currentRow || !this.currentRow.notifyNo) {
  3742. console.warn('当前行数据为空,无法刷新子表数据');
  3743. return;
  3744. }
  3745. try {
  3746. // 并行请求所有子表数据
  3747. const [detailData, materialData] = await Promise.all([
  3748. searchNotifyOrderList(this.currentRow),
  3749. searchNotifyMaterialList(this.currentRow)
  3750. ]);
  3751. // 更新申请单明细数据
  3752. if (detailData.data && detailData.data.code == 0) {
  3753. this.dataList2 = detailData.data.rows;
  3754. } else {
  3755. this.dataList2 = [];
  3756. }
  3757. // 更新材料明细数据
  3758. if (materialData.data && materialData.data.code == 0) {
  3759. this.dataList3 = materialData.data.rows;
  3760. } else {
  3761. this.dataList3 = [];
  3762. }
  3763. } catch (error) {
  3764. console.error('刷新子表数据失败:', error);
  3765. this.$message.error('刷新子表数据失败,请稍后重试');
  3766. }
  3767. },
  3768. editNotifyMaterialFun(row){
  3769. // 设置当前行为要编辑的行
  3770. this.currentRow = JSON.parse(JSON.stringify(row));
  3771. editNotifyMaterial(row).then(({data})=>{
  3772. if (data.code === 0) {
  3773. //刷新主表数据
  3774. this.searchTable().then(() => { // 等刷新完成
  3775. const foundRow = this.dataList.find(item => item.notifyNo === row.notifyNo);
  3776. if (foundRow) {
  3777. this.currentRow = JSON.parse(JSON.stringify(foundRow));
  3778. this.$nextTick(() => {
  3779. this.$refs.mainTable.setCurrentRow(foundRow);
  3780. });
  3781. }
  3782. });
  3783. this.$message.success( '操作成功')
  3784. }else {
  3785. this.$alert(data.msg, '错误', {
  3786. confirmButtonText: '确定'
  3787. })
  3788. }
  3789. })
  3790. },
  3791. // 判断当前状态是否可编辑
  3792. isEditableStatus() {
  3793. if (!this.currentRow || !this.currentRow.status) {
  3794. return false;
  3795. }
  3796. return this.currentRow.status === '草稿' || this.currentRow.status === '编辑中' || this.currentRow.status === '待确认';
  3797. },
  3798. // 计算申请数量
  3799. calculateQtyToIssue(row) {
  3800. const componentScrap = parseFloat(row.componentScrap) || 0;
  3801. const firstInspectionQty = parseFloat(row.firstInspectionQty) || 0;
  3802. const standardDosage = parseFloat(row.standardDosage) || 0;
  3803. return (componentScrap + firstInspectionQty + standardDosage).toFixed(2);
  3804. },
  3805. // 更新申请数量
  3806. updateQtyToIssue(row) {
  3807. const componentScrap = parseFloat(row.componentScrap) || 0;
  3808. const firstInspectionQty = parseFloat(row.firstInspectionQty) || 0;
  3809. const standardDosage = parseFloat(row.standardDosage) || 0;
  3810. // 使用 $set 确保响应式更新
  3811. this.$set(row, 'qtyToIssue', (componentScrap + firstInspectionQty + standardDosage).toFixed(2));
  3812. },
  3813. // 打开新增材料模态框
  3814. addMaterialModal() {
  3815. if (!this.currentRow || !this.currentRow.notifyNo) {
  3816. this.$alert('请先选择一条主表记录!', '提示', {
  3817. confirmButtonText: '确定'
  3818. });
  3819. return false;
  3820. }
  3821. if (!this.isEditableStatus()) {
  3822. this.$alert('当前状态不允许编辑!只有草稿、编辑中或待确认状态才能新增材料。', '提示', {
  3823. confirmButtonText: '确定'
  3824. });
  3825. return false;
  3826. }
  3827. // 重置表单数据
  3828. this.newMaterialData = {
  3829. componentPartNo: '',
  3830. partDesc: '',
  3831. issueType: '替代料',
  3832. orderNo: '',
  3833. itemNo: '', // 申请单序号,将在选择生产订单时自动填充
  3834. remark: '',
  3835. componentScrap: 0,
  3836. firstInspectionQty: 0,
  3837. standardDosage: 0,
  3838. bomSeqNo: '',
  3839. warehouseId: '',
  3840. qtyToIssueOriginal: 0
  3841. };
  3842. // 加载生产订单选项
  3843. this.loadOrderOptions();
  3844. this.addMaterialModalFlag = true;
  3845. },
  3846. // 加载生产订单选项
  3847. loadOrderOptions() {
  3848. // 从申请单明细中获取生产订单列表
  3849. this.orderOptions = this.dataList2.map(item => ({
  3850. orderNo: item.sOOrderNo,
  3851. itemNo: item.itemNo // 添加申请单序号
  3852. }));
  3853. },
  3854. // 生产订单选择变化时的处理
  3855. onOrderNoChange(selectedOrderNo) {
  3856. if (selectedOrderNo) {
  3857. // 根据选择的生产订单,从申请单明细中找到对应的申请单序号
  3858. const selectedOrder = this.dataList2.find(item => item.sOOrderNo === selectedOrderNo);
  3859. if (selectedOrder) {
  3860. this.newMaterialData.itemNo = selectedOrder.itemNo;
  3861. }
  3862. } else {
  3863. this.newMaterialData.itemNo = '';
  3864. }
  3865. },
  3866. // 保存新增材料
  3867. saveNewMaterial() {
  3868. // 验证必填字段
  3869. if (!this.newMaterialData.componentPartNo) {
  3870. this.$message.error('请选择材料编码')
  3871. return;
  3872. }
  3873. if (!this.newMaterialData.orderNo) {
  3874. this.$message.error('请选择生产订单')
  3875. return;
  3876. }
  3877. // 计算申请数量
  3878. const qtyToIssue = this.calculateQtyToIssue(this.newMaterialData)
  3879. // 构建保存数据
  3880. const saveData = {
  3881. ...this.newMaterialData,
  3882. site: this.currentRow.site,
  3883. notifyNo: this.currentRow.notifyNo,
  3884. qtyToIssue: qtyToIssue,
  3885. }
  3886. saveSOIssueNotifyOrderMateria(saveData).then(({data}) => {
  3887. if (data && data.code === 0) {
  3888. // 刷新材料明细列表
  3889. this.getNotifyMaterialList();
  3890. this.addMaterialModalFlag = false
  3891. this.$message.success('操作成功')
  3892. } else {
  3893. this.$message.error(data.msg)
  3894. }
  3895. })
  3896. },
  3897. // 查询替代料
  3898. getAlternativePart(row) {
  3899. if (!this.currentRow || !this.currentRow.notifyNo) {
  3900. this.$message.warning('请先选择一条申请单记录!');
  3901. return;
  3902. }
  3903. if (!row.orderNo) {
  3904. this.$message.warning('该记录没有关联工单,无法查询替代料!');
  3905. return;
  3906. }
  3907. const params = {
  3908. site: row.site,
  3909. notifyNo: row.notifyNo,
  3910. orderNo: row.orderNo,
  3911. componentPart: row.componentPartNo
  3912. };
  3913. this.alternativePartsLoading = true;
  3914. this.alternativePartsModalFlag = true;
  3915. getBomAlternativeParts(params).then(({data}) => {
  3916. if (data && data.code === 0) {
  3917. this.alternativePartsList = data.rows || []
  3918. } else {
  3919. this.$message.error(data.msg || '查询替代料失败');
  3920. this.alternativePartsList = [];
  3921. }
  3922. }).finally(() => {
  3923. this.alternativePartsLoading = false;
  3924. });
  3925. },
  3926. // 选择仓库
  3927. chooseWareHouse (row) {
  3928. this.tempWareHouseRow = row
  3929. this.getBaseList(20)
  3930. },
  3931. // 获取基础数据列表S
  3932. getBaseList (val, type) {
  3933. this.tagNo = val
  3934. this.tagType = type
  3935. this.$nextTick(() => {
  3936. let strVal = ''
  3937. if (val === 508) {
  3938. strVal = this.newMaterialData.componentPartNo
  3939. this.$refs.baseList.init(val, strVal)
  3940. }
  3941. if (val === 20) {
  3942. strVal = this.tempWareHouseRow.warehouseId
  3943. this.$refs.baseList.init(val, strVal)
  3944. }
  3945. })
  3946. },
  3947. // 列表方法的回调
  3948. getBaseData (val) {
  3949. if (this.tagNo === 508) {
  3950. this.newMaterialData.componentPartNo = val.PartNo
  3951. this.newMaterialData.partDesc = val.PartDescription
  3952. this.newMaterialData.warehouseId = val.outbound_warehouse_id
  3953. }
  3954. if (this.tagNo === 20) {
  3955. this.tempWareHouseRow.warehouseId = val.WareHouseID
  3956. this.tempWareHouseRow.warehouseName = val.WareHouseName
  3957. }
  3958. },
  3959. // 加载出库类别列表
  3960. loadCategoryList () {
  3961. getOutboundCategoryList({}).then(({data}) => {
  3962. if (data && data.code === 0) {
  3963. this.categoryList = data.rows || []
  3964. }
  3965. })
  3966. },
  3967. // 输入校验
  3968. partBlur (tagNo) {
  3969. let tempData = {
  3970. tagno: tagNo,
  3971. conditionSql: " and PartNo = '" + this.newMaterialData.componentPartNo + "'" + " and site = '" + this.newMaterialData.site + "'"
  3972. }
  3973. verifyData(tempData).then(({data}) => {
  3974. if (data && data.code === 0) {
  3975. if (data.baseListData.length > 0) {
  3976. this.newMaterialData.componentPartNo = data.baseListData[0].PartNo
  3977. this.newMaterialData.partDesc = data.baseListData[0].PartDescription
  3978. } else {
  3979. this.newMaterialData.partDesc = ''
  3980. }
  3981. }
  3982. })
  3983. },
  3984. },
  3985. }
  3986. </script>
  3987. <style scoped>
  3988. /deep/ .customer-tab .el-tabs__content {
  3989. padding: 5px !important;
  3990. }
  3991. .disabled {
  3992. cursor: not-allowed !important;
  3993. color: #C0C4CC !important;
  3994. pointer-events: none;
  3995. }
  3996. .text-right >>> .el-input__inner {
  3997. text-align: right !important;
  3998. }
  3999. .text-right >>> .el-input-number__input {
  4000. text-align: right !important;
  4001. }
  4002. .single-line-multi-select >>> .el-select__tags {
  4003. display: flex;
  4004. flex-wrap: nowrap;
  4005. overflow: hidden;
  4006. white-space: nowrap;
  4007. max-width: 100%;
  4008. }
  4009. .single-line-multi-select >>> .el-tag {
  4010. flex-shrink: 0;
  4011. max-width: 100px;
  4012. overflow: hidden;
  4013. text-overflow: ellipsis;
  4014. white-space: nowrap;
  4015. }
  4016. .single-line-multi-select >>> .el-select__input {
  4017. flex-shrink: 0;
  4018. min-width: 30px;
  4019. }
  4020. .disabled-link {
  4021. cursor: not-allowed !important;
  4022. color: #C0C4CC !important;
  4023. pointer-events: none;
  4024. }
  4025. .disabled-text {
  4026. color: #C0C4CC !important;
  4027. cursor: not-allowed !important;
  4028. }
  4029. .el-table /deep/ .cell{
  4030. height: auto;
  4031. line-height: 1.5;
  4032. }
  4033. </style>