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.

4329 lines
151 KiB

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