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.

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