plm前端
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.

2215 lines
77 KiB

2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
1 year ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
  1. <template>
  2. <div class="mod-config">
  3. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;">
  4. <el-form-item :label="'申请单号'">
  5. <el-input v-model="searchData.applyNo" style="width: 160px"></el-input>
  6. </el-form-item>
  7. <el-form-item label="申请日期">
  8. <el-date-picker
  9. value-format="yyyy-MM-dd"
  10. style="width: 100%"
  11. v-model="searchData.startDate"
  12. type="date"
  13. placeholder="开始日期">
  14. </el-date-picker>
  15. </el-form-item>
  16. <el-form-item label="到">
  17. <el-date-picker
  18. value-format="yyyy-MM-dd"
  19. style="width: 100%"
  20. v-model="searchData.endDate"
  21. type="date"
  22. placeholder="结束日期">
  23. </el-date-picker>
  24. </el-form-item>
  25. <el-form-item :label="'状态'">
  26. <el-select v-model="searchData.status" clearable style="width: 80px">
  27. <el-option label="全部" value=""></el-option>
  28. <el-option label="草稿" value="草稿"></el-option>
  29. <el-option label="审批中" value="审批中"></el-option>
  30. <el-option label="下达" value="下达"></el-option>
  31. </el-select>
  32. </el-form-item>
  33. <el-form-item label=" ">
  34. <el-button @click="search()" type="primary" style="margin-left: 2px;margin-top:0px">查询</el-button>
  35. <!-- <el-button @click="addOrUpdateHandle('save')" type="primary" style="margin-left: 2px;margin-top: 0px">新增</el-button>-->
  36. <download-excel
  37. :fields="fields()"
  38. :data="exportData"
  39. type="xls"
  40. :name="exportName"
  41. :header="exportHeader"
  42. :footer="exportFooter"
  43. :fetch="createExportData"
  44. :before-generate="startDownload"
  45. :before-finish="finishDownload"
  46. worksheet="导出信息"
  47. class="el-button el-button--primary el-button--medium">
  48. {{ '导出' }}
  49. </download-excel>
  50. </el-form-item>
  51. </el-form>
  52. <el-table
  53. :height="height"
  54. :data="dataList1"
  55. border
  56. ref="mainTable"
  57. @row-click="changeData"
  58. highlight-current-row
  59. v-loading="dataListLoading"
  60. style="width: 100%;">
  61. <el-table-column
  62. header-align="center"
  63. align="center"
  64. width="150"
  65. fixed="right"
  66. label="操作">
  67. <template slot-scope="scope">
  68. <template v-if="isAuth('106002:issued')">
  69. <a type="text" size="small" v-if="scope.row.status==='草稿'" @click="comfirmApply(scope.row)">下达</a>
  70. </template>
  71. <template v-if="isAuth('106002:update')">
  72. <a type="text" size="small" v-if="scope.row.status==='草稿'" @click="editModalU(scope.row)">修改</a>
  73. </template>
  74. <template v-if="isAuth('106002:approval')">
  75. <a type="text" size="small" v-if="scope.row.status==='审批中'" @click="editModal(scope.row)">审批</a>
  76. </template>
  77. <template v-if="isAuth('106002:remove')">
  78. <a type="text" size="small" v-if="scope.row.status==='草稿'" @click="cancelApply(scope.row)">删除</a>
  79. </template>
  80. </template>
  81. </el-table-column>
  82. <el-table-column
  83. v-for="(item,index) in columnList1" :key="index"
  84. :sortable="item.columnSortable"
  85. :prop="item.columnProp"
  86. :header-align="item.headerAlign"
  87. :show-overflow-tooltip="item.showOverflowTooltip"
  88. :align="item.align"
  89. :fixed="item.fixed==''?false:item.fixed"
  90. :min-width="item.columnWidth"
  91. :label="item.columnLabel">
  92. <template slot-scope="scope">
  93. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  94. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  95. style="width: 100px; height: 80px"/></span>
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. <el-pagination
  100. @size-change="sizeChangeHandle"
  101. @current-change="currentChangeHandle"
  102. :current-page="pageIndex"
  103. :page-sizes="[20, 50, 100, 1000]"
  104. :page-size="pageSize"
  105. :total="totalPage"
  106. layout="total, sizes, prev, pager, next, jumper">
  107. </el-pagination>
  108. <el-tabs style="font-size: 12px;min-height: 330px" class="customer-tab" v-model="activeName" type="border-card"
  109. @tab-click="tabClick">
  110. <el-tab-pane label="基本信息" name="attribute">
  111. <order-attribute ref="dialogAttribute" :order-no="currentRow.applyNo" :code-no="'toolApply'"
  112. :function-type="'TL_Receipt'"></order-attribute>
  113. </el-tab-pane>
  114. <el-tab-pane label="工具明细" name="detail">
  115. <el-table
  116. :data="detailList"
  117. height="240"
  118. border
  119. v-loading="dataListLoading"
  120. style="width: 100%; ">
  121. <el-table-column
  122. v-for="(item,index) in columnList2" :key="index"
  123. :sortable="item.columnSortable"
  124. :prop="item.columnProp"
  125. :header-align="item.headerAlign"
  126. :show-overflow-tooltip="item.showOverflowTooltip"
  127. :align="item.align"
  128. :fixed="item.fixed==''?false:item.fixed"
  129. :min-width="item.columnWidth"
  130. :label="item.columnLabel">
  131. <template slot-scope="scope">
  132. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  133. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  134. style="width: 100px; height: 80px"/></span>
  135. </template>
  136. </el-table-column>
  137. <el-table-column
  138. header-align="center"
  139. align="center"
  140. width="120"
  141. fixed="right"
  142. label="操作">
  143. <template slot-scope="scope">
  144. <a type="text" size="small" @click="jumpBM(scope.row)">跳转BenchMark</a>
  145. </template>
  146. </el-table-column>
  147. <!-- <el-table-column-->
  148. <!-- fixed="right"-->
  149. <!-- header-align="center"-->
  150. <!-- align="center"-->
  151. <!-- width="100"-->
  152. <!-- label="操作">-->
  153. <!-- <template slot-scope="scope">-->
  154. <!-- &lt;!&ndash; <a :href="'http://192.168.1.130:80/file/'+scope.row.url" :download="scope.row.fileName">下载</a>&ndash;&gt;-->
  155. <!-- <a @click="downloadFile(scope.row)" >下载</a>-->
  156. <!-- <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>-->
  157. <!-- </template>-->
  158. <!-- </el-table-column>-->
  159. </el-table>
  160. </el-tab-pane>
  161. <el-tab-pane label="处理信息" name="tab4">
  162. <el-form :inline="true" label-position="top" style="margin-top: 0px">
  163. <!-- <el-button type="primary" :disabled="!(currentRow.statusCode==='50'||currentRow.statusCode==='60')" @click="openMassageModel()">申请信息录入</el-button>-->
  164. <!-- <el-button type="primary" @click="openMassageModel()">申请信息录入</el-button>-->
  165. </el-form>
  166. <el-form label-position="top" :model="currentRow">
  167. <el-row :gutter="15">
  168. <el-col :span="6">
  169. <el-form-item label="IFS PR编号">
  170. <el-input v-model="currentRow.prNo" readonly></el-input>
  171. </el-form-item>
  172. </el-col>
  173. <el-col :span="18">
  174. <el-form-item label="备注">
  175. <el-input v-model="currentRow.remark1" readonly></el-input>
  176. </el-form-item>
  177. </el-col>
  178. </el-row>
  179. <el-row :gutter="15" style="margin-top: 20px">
  180. <el-col :span="6">
  181. <el-form-item label="采购订单号">
  182. <el-input v-model="currentRow.poNo" readonly></el-input>
  183. </el-form-item>
  184. </el-col>
  185. <el-col :span="6">
  186. <el-form-item label="厂商名称">
  187. <el-input v-model="currentRow.supplierName" readonly></el-input>
  188. </el-form-item>
  189. </el-col>
  190. <el-col :span="6">
  191. <el-form-item label="总成本(元)">
  192. <el-input v-if="accessField('10601001')" v-model="currentRow.allCost" readonly></el-input>
  193. <el-input v-if="!accessField('10601001')" v-model="valueNull" style="width: 130px" disabled></el-input>
  194. </el-form-item>
  195. </el-col>
  196. </el-row>
  197. <el-row :gutter="15" style="margin-top: 0px">
  198. <el-col :span="24">
  199. <el-form-item label="备注">
  200. <el-input v-model="currentRow.remark2" readonly></el-input>
  201. </el-form-item>
  202. </el-col>
  203. </el-row>
  204. </el-form>
  205. </el-tab-pane>
  206. <el-tab-pane label="附件信息" name="down">
  207. <oss-components height="25vh" label="附件" :columns="ossColumns" :order-ref1="currentRow.site"
  208. :order-ref2="currentRow.applyNo"></oss-components>
  209. </el-tab-pane>
  210. <!-- 审批信息 -->
  211. <el-tab-pane label="审批信息" name="approvalInformation">
  212. <approval-information ref="approvalTable" v-model:data-list="approvalList" :height="240"></approval-information>
  213. </el-tab-pane>
  214. </el-tabs>
  215. <el-dialog
  216. width="800px" v-drag
  217. :title="'刀模申请修改'"
  218. :close-on-click-modal="false"
  219. :visible.sync="visibleU">
  220. <el-form :inline="true" label-position="top" label-width="100px">
  221. <el-form-item :label="'申请编号'">
  222. <el-input v-model="dataForm.applyNo" style="width: 130px" disabled></el-input>
  223. </el-form-item>
  224. <el-form-item :label="'申请总数'">
  225. <el-input v-model="dataForm.applySumQty" style="width: 130px" disabled></el-input>
  226. </el-form-item>
  227. <el-form-item :label="'总成本'">
  228. <el-input v-if="accessField('10601001')" v-model="dataForm.totalCost" style="width: 130px"
  229. disabled></el-input>
  230. <el-input v-if="!accessField('10601001')" v-model="valueNull" style="width: 130px" disabled></el-input>
  231. </el-form-item>
  232. <el-form-item :label="'申请人'" required="required">
  233. <el-input v-model="dataForm.applyBy" style="width: 130px" disabled></el-input>
  234. </el-form-item>
  235. <el-form-item :label="'申请日期'" required="required">
  236. <el-date-picker
  237. value-format="yyyy-MM-dd"
  238. style="width: 100%"
  239. v-model="dataForm.applyDate"
  240. type="date"
  241. disabled
  242. placeholder="结束日期">
  243. </el-date-picker>
  244. </el-form-item>
  245. <el-form-item label="部门" required="required">
  246. <dict-data-select :site="$store.state.user.site" v-model="dataForm.department"
  247. dict-type="tool_application_department" disabled style="width: 130px"></dict-data-select>
  248. </el-form-item>
  249. <el-form-item required="required">
  250. <span slot="label" style="" @click="getBaseList(2002,1)"><a herf="#">报价员</a></span>
  251. <el-input v-model="dataForm.quoterName" ref="quoterName" placeholder="请选择人员" readonly
  252. style="width: 130px"></el-input>
  253. </el-form-item>
  254. <el-form-item required="required">
  255. <span slot="label" style="" @click="getBaseList(2042,2)"><a herf="#">TP</a></span>
  256. <el-input v-model="dataForm.tpName" ref="tpName" placeholder="请选择人员" readonly
  257. style="width: 130px"></el-input>
  258. </el-form-item>
  259. <el-form-item required="required">
  260. <span slot="label" style="" @click="getBaseList(2000,3)"><a herf="#">采购员</a></span>
  261. <el-input v-model="dataForm.purchaserName" ref="purchaserName" placeholder="请选择人员" readonly
  262. style="width: 130px"></el-input>
  263. </el-form-item>
  264. </el-form>
  265. <el-form :inline="true" label-position="top" label-width="100px">
  266. <el-form-item :label="'申请原因'">
  267. <el-input type="textarea" style="width: 770px" resize="none" :autosize="{minRows: 3, maxRows: 3}"
  268. v-model="dataForm.applyReason"/>
  269. </el-form-item>
  270. </el-form>
  271. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 60px">
  272. <el-form-item :label="'备注'">
  273. <el-input type="textarea" style="width: 770px" resize="none" :autosize="{minRows: 3, maxRows: 3}"
  274. v-model="dataForm.remark"/>
  275. </el-form-item>
  276. </el-form>
  277. <el-tabs style="font-size: 12px;min-height: 330px;margin-top: 60px" class="customer-tab" v-model="activeModelName"
  278. type="border-card">
  279. <el-tab-pane label="工具明细" name="detail">
  280. <div class="rq">
  281. <el-table
  282. height="250"
  283. :data="toolData"
  284. border
  285. ref="toolTable"
  286. v-loading="dataListLoading"
  287. style="width: 100%;">
  288. <el-table-column
  289. v-for="(item,index) in columnList2" :key="index"
  290. :sortable="item.columnSortable"
  291. :prop="item.columnProp"
  292. :header-align="item.headerAlign"
  293. :show-overflow-tooltip="item.showOverflowTooltip"
  294. :align="item.align"
  295. :fixed="item.fixed==''?false:item.fixed"
  296. :min-width="item.columnWidth"
  297. :label="item.columnLabel">
  298. <template slot-scope="scope">
  299. <div v-if="(item.columnProp !== 'applyQty')&& (item.columnProp !== 'standardCost')">
  300. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  301. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  302. style="width: 100px; height: 80px"/></span>
  303. </div>
  304. <div v-else-if=" (item.columnProp === 'standardCost')">
  305. <el-input v-if="accessField('10601001')" v-model="scope.row.standardCost" type="number"
  306. @change="changeSum(scope.row)" placeholder="请输入成本"
  307. style="width:98%"></el-input>
  308. </div>
  309. <div v-else>
  310. <el-input v-model="scope.row.applyQty" type="number" @change="changeSum(scope.row)"
  311. placeholder="请输入数量" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
  312. style="width:98%"></el-input>
  313. </div>
  314. </template>
  315. </el-table-column>
  316. </el-table>
  317. </div>
  318. </el-tab-pane>
  319. <el-tab-pane label="TP处理结果" name="tp">
  320. <el-form label-position="top">
  321. <el-row :gutter="15">
  322. <el-col :span="6">
  323. <el-form-item label="IFS PR编号">
  324. <el-input v-model="modelData.prNo" :disabled="$store.state.user.name!==dataForm.tp"></el-input>
  325. </el-form-item>
  326. </el-col>
  327. <el-col :span="24">
  328. <el-form-item label="备注" style="height: 80px">
  329. <el-input type="textarea" v-model="modelData.remark1" :rows="3" style="height: 60px"
  330. :disabled="$store.state.user.name!==dataForm.tp"></el-input>
  331. </el-form-item>
  332. </el-col>
  333. </el-row>
  334. </el-form>
  335. </el-tab-pane>
  336. <el-tab-pane label="采购处理结果" name="caigou">
  337. <el-form label-position="top">
  338. <el-row :gutter="15" style="margin-top: 0px">
  339. <el-col :span="6">
  340. <el-form-item label="采购订单号">
  341. <el-input v-model="modelData.poNo" :disabled="$store.state.user.name!==dataForm.purchaser"></el-input>
  342. </el-form-item>
  343. </el-col>
  344. <el-col :span="6">
  345. <el-form-item label="厂商名称">
  346. <el-input v-model="modelData.supplierName"
  347. :disabled="$store.state.user.name!==dataForm.purchaser"></el-input>
  348. </el-form-item>
  349. </el-col>
  350. <el-col :span="6">
  351. <el-form-item label="总成本(元)">
  352. <el-input v-model="modelData.allCost" type="number"
  353. :disabled="$store.state.user.name!==dataForm.purchaser"></el-input>
  354. </el-form-item>
  355. </el-col>
  356. </el-row>
  357. <el-row :gutter="15" style="margin-top: 0px">
  358. <el-col :span="24">
  359. <el-form-item label="备注" style="height: 80px">
  360. <el-input type="textarea" v-model="modelData.remark2" :rows="3" style="height: 60px"
  361. :disabled="$store.state.user.name!==dataForm.purchaser"></el-input>
  362. </el-form-item>
  363. </el-col>
  364. </el-row>
  365. </el-form>
  366. </el-tab-pane>
  367. </el-tabs>
  368. <span slot="footer" class="dialog-footer" style="height: 40px">
  369. <el-button type="primary" @click="saveData()" class="bigButton">{{ '保存' }}</el-button>
  370. <el-button type="primary" @click="visibleU = false" class="bigButton">{{ '取消' }}</el-button>
  371. </span>
  372. </el-dialog>
  373. <el-dialog
  374. width="800px" v-drag
  375. :title="'刀模申请审批'"
  376. :close-on-click-modal="false"
  377. :visible.sync="visible">
  378. <el-form :inline="true" label-position="top" label-width="100px">
  379. <el-form-item :label="'申请编号'">
  380. <el-input v-model="dataForm.applyNo" style="width: 130px" disabled></el-input>
  381. </el-form-item>
  382. <el-form-item :label="'申请总数'">
  383. <el-input v-model="dataForm.applySumQty" style="width: 130px" disabled></el-input>
  384. </el-form-item>
  385. <el-form-item :label="'总成本'">
  386. <el-input v-if="accessField('10601001')" v-model="dataForm.totalCost" style="width: 130px"
  387. disabled></el-input>
  388. <el-input v-if="!accessField('10601001')" v-model="valueNull" style="width: 130px" disabled></el-input>
  389. </el-form-item>
  390. <el-form-item :label="'申请人'" required="required">
  391. <el-input v-model="dataForm.applyBy" style="width: 130px" disabled></el-input>
  392. </el-form-item>
  393. <el-form-item :label="'申请日期'" required="required">
  394. <el-date-picker
  395. value-format="yyyy-MM-dd"
  396. style="width: 100%"
  397. v-model="dataForm.applyDate"
  398. type="date"
  399. disabled
  400. placeholder="结束日期">
  401. </el-date-picker>
  402. </el-form-item>
  403. <el-form-item label="部门" required="required">
  404. <dict-data-select :site="$store.state.user.site" v-model="dataForm.department"
  405. dict-type="tool_application_department" disabled style="width: 130px"></dict-data-select>
  406. </el-form-item>
  407. <el-form-item required="required">
  408. <span slot="label" style="" @click="getBaseList(2002,1)"><a herf="#">报价员</a></span>
  409. <el-input v-model="dataForm.quoterName" ref="quoterName" placeholder="请选择人员" readonly
  410. style="width: 130px"></el-input>
  411. </el-form-item>
  412. <el-form-item required="required">
  413. <span slot="label" style="" @click="getBaseList(2042,2)"><a herf="#">TP</a></span>
  414. <el-input v-model="dataForm.tpName" ref="tpName" placeholder="请选择人员" readonly
  415. style="width: 130px"></el-input>
  416. </el-form-item>
  417. <el-form-item required="required">
  418. <span slot="label" style="" @click="getBaseList(2000,3)"><a herf="#">采购员</a></span>
  419. <el-input v-model="dataForm.purchaserName" ref="purchaserName" placeholder="请选择人员" readonly
  420. style="width: 130px"></el-input>
  421. </el-form-item>
  422. </el-form>
  423. <el-form :inline="true" label-position="top" label-width="100px">
  424. <el-form-item :label="'申请原因'">
  425. <el-input type="textarea" style="width: 770px" resize="none" :autosize="{minRows: 3, maxRows: 3}"
  426. v-model="dataForm.applyReason"/>
  427. </el-form-item>
  428. </el-form>
  429. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 60px">
  430. <el-form-item :label="'备注'">
  431. <el-input type="textarea" style="width: 770px" resize="none" :autosize="{minRows: 3, maxRows: 3}"
  432. v-model="dataForm.remark"/>
  433. </el-form-item>
  434. </el-form>
  435. <el-tabs style="font-size: 12px;min-height: 330px;margin-top: 60px" class="customer-tab" v-model="activeModelName"
  436. type="border-card">
  437. <el-tab-pane label="工具明细" name="detail">
  438. <div class="rq" style="margin-top: 0px">
  439. <el-table
  440. height="250"
  441. :data="toolData"
  442. border
  443. ref="toolTable"
  444. v-loading="dataListLoading"
  445. style="width: 100%;">
  446. <el-table-column
  447. v-for="(item,index) in columnList2" :key="index"
  448. :sortable="item.columnSortable"
  449. :prop="item.columnProp"
  450. :header-align="item.headerAlign"
  451. :show-overflow-tooltip="item.showOverflowTooltip"
  452. :align="item.align"
  453. :fixed="item.fixed==''?false:item.fixed"
  454. :min-width="item.columnWidth"
  455. :label="item.columnLabel">
  456. <template slot-scope="scope">
  457. <div v-if="(item.columnProp !== 'applyQty')&& (item.columnProp !== 'standardCost')">
  458. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  459. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  460. style="width: 100px; height: 80px"/></span>
  461. </div>
  462. <div v-else-if=" (item.columnProp === 'standardCost')">
  463. <el-input v-if="accessField('10601001')" v-model="scope.row.standardCost" type="number"
  464. @change="changeSum(scope.row)" placeholder="请输入成本"
  465. style="width:98%"></el-input>
  466. </div>
  467. <div v-else>
  468. <el-input v-model="scope.row.applyQty" type="number" @change="changeSum(scope.row)"
  469. :disabled="changeApplyDetailFlag('applyQty') === 'N'" placeholder="请输入数量"
  470. onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
  471. style="width:98%"></el-input>
  472. </div>
  473. </template>
  474. </el-table-column>
  475. </el-table>
  476. </div>
  477. </el-tab-pane>
  478. <el-tab-pane label="TP处理结果" name="tp">
  479. <el-form label-position="top">
  480. <el-row :gutter="15">
  481. <el-col :span="6">
  482. <el-form-item label="IFS PR编号">
  483. <el-input v-model="modelData.prNo" :disabled="$store.state.user.name!==dataForm.tp"></el-input>
  484. </el-form-item>
  485. </el-col>
  486. <el-col :span="24">
  487. <el-form-item label="备注" style="height: 80px">
  488. <el-input type="textarea" v-model="modelData.remark1" :rows="3" style="height: 60px"
  489. :disabled="$store.state.user.name!==dataForm.tp"></el-input>
  490. </el-form-item>
  491. </el-col>
  492. </el-row>
  493. </el-form>
  494. </el-tab-pane>
  495. <el-tab-pane label="采购处理结果" name="caigou">
  496. <el-form label-position="top">
  497. <el-row :gutter="15" style="margin-top: 0px">
  498. <el-col :span="6">
  499. <el-form-item label="采购订单号">
  500. <el-input v-model="modelData.poNo" :disabled="$store.state.user.name!==dataForm.purchaser"></el-input>
  501. </el-form-item>
  502. </el-col>
  503. <el-col :span="6">
  504. <el-form-item label="厂商名称">
  505. <el-input v-model="modelData.supplierName"
  506. :disabled="$store.state.user.name!==dataForm.purchaser"></el-input>
  507. </el-form-item>
  508. </el-col>
  509. <el-col :span="6">
  510. <el-form-item label="总成本(元)">
  511. <el-input v-if="accessField('10601001')" v-model="modelData.allCost" type="number"
  512. :disabled="$store.state.user.name!==dataForm.purchaser"></el-input>
  513. <el-input v-if="!accessField('10601001')" v-model="valueNull" style="width: 130px"
  514. disabled></el-input>
  515. </el-form-item>
  516. </el-col>
  517. </el-row>
  518. <el-row :gutter="15" style="margin-top: 0px">
  519. <el-col :span="24">
  520. <el-form-item label="备注" style="height: 80px">
  521. <el-input type="textarea" v-model="modelData.remark2" :rows="3" style="height: 60px"
  522. :disabled="$store.state.user.name!==dataForm.purchaser"></el-input>
  523. </el-form-item>
  524. </el-col>
  525. </el-row>
  526. </el-form>
  527. </el-tab-pane>
  528. </el-tabs>
  529. <span slot="footer" class="dialog-footer" style="height: 40px">
  530. <!-- <el-button type="primary" @click="saveData()">{{'保存'}}</el-button>-->
  531. <el-button type="primary" @click="visible = false" class="bigButton">{{ '取消' }}</el-button>
  532. <el-button type="primary" @click="saveData" class="bigButton">保存</el-button>
  533. <el-button v-if="dataForm.status === '审批中'" type="primary" @click="agreeSubmit" class="bigButton">同意</el-button>
  534. <el-button v-if="dataForm.status === '审批中' && dataForm.isReject === 'Y'" type="primary" @click="submitDataModal" class="bigButton">驳回</el-button>
  535. </span>
  536. </el-dialog>
  537. <el-dialog
  538. width="600px" v-drag
  539. :title="'处理信息'"
  540. :close-on-click-modal="false"
  541. :visible.sync="modelFlag">
  542. <el-form label-position="top">
  543. <el-row :gutter="15">
  544. <el-col :span="6">
  545. <el-form-item label="IFS PR编号">
  546. <el-input v-model="modelData.prNo"></el-input>
  547. </el-form-item>
  548. </el-col>
  549. <el-col :span="18">
  550. <el-form-item label="备注">
  551. <el-input v-model="modelData.remark1"></el-input>
  552. </el-form-item>
  553. </el-col>
  554. </el-row>
  555. <el-row :gutter="15" style="margin-top: 20px">
  556. <el-col :span="6">
  557. <el-form-item label="采购订单号">
  558. <el-input v-model="modelData.poNo"></el-input>
  559. </el-form-item>
  560. </el-col>
  561. <el-col :span="6">
  562. <el-form-item label="厂商名称">
  563. <el-input v-model="modelData.supplierName"></el-input>
  564. </el-form-item>
  565. </el-col>
  566. <el-col :span="6">
  567. <el-form-item label="总成本(元)">
  568. <el-input v-if="accessField('10601001')" v-model="modelData.allCost" type="number"></el-input>
  569. <el-input v-if="!accessField('10601001')" v-model="valueNull" style="width: 130px" disabled></el-input>
  570. </el-form-item>
  571. </el-col>
  572. </el-row>
  573. <el-row :gutter="15" style="margin-top: 0px">
  574. <el-col :span="24">
  575. <el-form-item label="备注">
  576. <el-input v-model="modelData.remark2"></el-input>
  577. </el-form-item>
  578. </el-col>
  579. </el-row>
  580. </el-form>
  581. <span slot="footer" class="dialog-footer">
  582. <el-button type="primary" @click="saveHeaderMessage()">{{ '保存' }}</el-button>
  583. <el-button type="primary" @click="modelFlag = false">{{ '取消' }}</el-button>
  584. </span>
  585. </el-dialog>
  586. <!-- 提交 -->
  587. <el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="submitModalFlag"
  588. width="500px">
  589. <el-form :inline="true" label-position="top">
  590. <el-form-item :label="'驳回意见'">
  591. <el-input type="textarea" v-model="rejectOpinion" :rows="3" resize='none' show-word-limit
  592. style="width: 479px;height: 30px"></el-input>
  593. </el-form-item>
  594. </el-form>
  595. <el-footer style="height:30px;margin-top: 50px;text-align:center">
  596. <el-button type="primary" @click="rejectSubmit">确定</el-button>
  597. <el-button type="primary" @click="submitModalFlag = false">取消</el-button>
  598. </el-footer>
  599. </el-dialog>
  600. <!-- 上传文件的modal -->
  601. <projectUploadFile ref="projectUploadFile" @refreshPageTables="getFileContentData()" v-drag></projectUploadFile>
  602. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  603. </div>
  604. </template>
  605. <script>
  606. import {
  607. customerInformationSearch, // 客户信息列表查询`
  608. } from '@/api/customer/customerInformation.js'
  609. import projectUploadFile from "./com_tool_upload_file";/*上传文件的組件*/
  610. import Chooselist from '@/views/modules/common/Chooselist'
  611. import {
  612. searchProjectToolApplyHeader,
  613. searchProjectToolApplyDetail,
  614. comfirmProjectToolApply,
  615. cancelProjectToolApply,
  616. saveProjectHeaderMessage,
  617. editToolApplication,
  618. submitChange
  619. } from "@/api/tool/toolApply.js"
  620. import {
  621. deleteProjectFile,
  622. getFileContentList,
  623. downLoadProjectFile,
  624. getProjectPartNowBm,
  625. } from "@/api/project/project.js"
  626. import {
  627. getNodeAuthority, // 获取节点权限
  628. getApprovalList, // 查询审批信息
  629. } from '@/api/changeManagement/changeManagement.js'
  630. import ApprovalInformation from "../changeManagement/approvalInformation.vue";
  631. import OssComponents from "../oss/ossComponents";
  632. import DictDataSelect from "../sys/dict-data-select.vue"
  633. import orderAttribute from "../demoComponents/orderProperties"
  634. /*組件*/
  635. export default {
  636. components: {
  637. ApprovalInformation,
  638. OssComponents,
  639. Chooselist,
  640. projectUploadFile,
  641. DictDataSelect,
  642. orderAttribute,
  643. },
  644. computed: {
  645. changeApplyHeaderFlag() {
  646. return (value) => {
  647. if (!this.plmChangeApplyHeaderArr) {
  648. return 'N'
  649. }
  650. let arr = this.plmChangeApplyHeaderArr.filter(a => a.fieldId === value)
  651. if (arr.length > 0) {
  652. return arr[0].updateFlag
  653. }
  654. return 'N'
  655. }
  656. },
  657. changeApplyDetailFlag() {
  658. return (value) => {
  659. if (!this.plmChangeApplyDetailArr) {
  660. return 'N'
  661. }
  662. let arr = this.plmChangeApplyDetailArr.filter(a => a.fieldId === value)
  663. if (arr.length > 0) {
  664. return arr[0].updateFlag
  665. }
  666. return 'N'
  667. }
  668. },
  669. },
  670. name: "null",
  671. data() {
  672. return {
  673. visible: false,
  674. fileContentList: [],
  675. activeName: 'detail',
  676. activeModelName: 'detail',
  677. searchData: {
  678. page: 1,
  679. limit: 100,
  680. site: this.$store.state.user.site,
  681. applyNo: '',
  682. startDate: '',
  683. endDate: '',
  684. status: '',
  685. },
  686. toolData: [],
  687. visibleU: false,
  688. plmChangeApplyHeaderArr: [],
  689. plmChangeApplyDetailArr: [],
  690. dataForm: {
  691. site: '',
  692. applyNo: '',
  693. applyBy: '',
  694. applyDate: '',
  695. applySumQty: '',
  696. applyReason: '',
  697. remark: '',
  698. createBy: '',
  699. detailList: [],
  700. status: '',
  701. rejectOpinion: '',
  702. nodeConclusion: '',
  703. quoter: '',
  704. quoterName: '',
  705. tp: '',
  706. tpName: '',
  707. purchaser: '',
  708. purchaserName: '',
  709. totalCost: '',
  710. menuId: this.$route.meta.menuId,
  711. userName: this.$store.state.user.name,
  712. nodeId: ''
  713. },
  714. valueNull: '******',
  715. modelData: {
  716. site: '',
  717. applyNo: '',
  718. prNo: '',
  719. remark1: '',
  720. poNo: '',
  721. supplierName: '',
  722. allCost: '',
  723. remark2: '',
  724. },
  725. modelFlag: false,
  726. currentRow: {},
  727. currentRow2: {},
  728. height: 200,
  729. dataList1: [],
  730. detailList: [],
  731. dataListLoading: false,
  732. // 导出 start
  733. exportData: [],
  734. exportName: "项目清单" + this.dayjs().format('YYYYMMDDHHmmss'),
  735. exportHeader: ["项目清单"],
  736. exportFooter: [],
  737. exportList: [],
  738. // 导出 start
  739. exportData2: [],
  740. exportName2: "项目客户联系人" + this.dayjs().format('YYYYMMDDHHmmss'),
  741. exportHeader2: ["项目客户联系人"],
  742. exportFooter2: [],
  743. exportList2: [],
  744. tagNo: '',
  745. tagNo2: '',
  746. pageIndex: 1,
  747. pageSize: 100,
  748. totalPage: 0,
  749. ossColumns: [
  750. {
  751. userId: this.$store.state.user.name,
  752. functionId: 103001,
  753. serialNumber: '103001Table2FileName',
  754. tableId: '103001Table2',
  755. tableName: '文件信息表',
  756. columnProp: 'fileName',
  757. headerAlign: 'center',
  758. align: 'center',
  759. columnLabel: '文件名称',
  760. columnHidden: false,
  761. columnImage: false,
  762. columnSortable: false,
  763. sortLv: 0,
  764. status: true,
  765. fixed: '',
  766. columnWidth: 140
  767. },
  768. {
  769. userId: this.$store.state.user.name,
  770. functionId: 103001,
  771. serialNumber: '103001Table2FileRemark',
  772. tableId: '103001Table2',
  773. tableName: '文件信息表',
  774. columnProp: 'fileRemark',
  775. headerAlign: 'center',
  776. align: 'center',
  777. columnLabel: '备注',
  778. columnHidden: false,
  779. columnImage: false,
  780. columnSortable: false,
  781. sortLv: 0,
  782. status: true,
  783. fixed: '',
  784. columnWidth: 240
  785. },
  786. // {
  787. // userId: this.$store.state.user.name,
  788. // functionId: 103001,
  789. // serialNumber: '103001Table2OrderRef3',
  790. // tableId: '103001Table2',
  791. // tableName: '文件信息表',
  792. // columnProp: 'orderRef3',
  793. // headerAlign: 'center',
  794. // align: 'center',
  795. // columnLabel: '文件描述',
  796. // columnHidden: false,
  797. // columnImage: false,
  798. // columnSortable: false,
  799. // sortLv: 0,
  800. // status: true,
  801. // fixed: '',
  802. // columnWidth: 120
  803. // },
  804. {
  805. userId: this.$store.state.user.name,
  806. functionId: 103001,
  807. serialNumber: '103001Table2CreateDate',
  808. tableId: '103001Table2',
  809. tableName: '文件信息表',
  810. columnProp: 'createDate',
  811. headerAlign: 'center',
  812. align: 'center',
  813. columnLabel: '上传时间',
  814. columnHidden: false,
  815. columnImage: false,
  816. columnSortable: false,
  817. sortLv: 0,
  818. status: true,
  819. fixed: '',
  820. columnWidth: 140
  821. },
  822. {
  823. userId: this.$store.state.user.name,
  824. functionId: 103001,
  825. serialNumber: '103001Table2CreatedBy',
  826. tableId: '103001Table2',
  827. tableName: '文件信息表',
  828. columnProp: 'createBy',
  829. headerAlign: 'center',
  830. align: 'center',
  831. columnLabel: '上传人',
  832. columnHidden: false,
  833. columnImage: false,
  834. columnSortable: false,
  835. sortLv: 0,
  836. status: true,
  837. fixed: '',
  838. columnWidth: 140
  839. }
  840. ],
  841. // 导出 end
  842. columnList1: [
  843. {
  844. userId: this.$store.state.user.name,
  845. functionId: 106002,
  846. serialNumber: '106002Table1Site',
  847. tableId: "106002Table1",
  848. tableName: "刀具申请主表",
  849. columnProp: "site",
  850. headerAlign: "center",
  851. align: "left",
  852. columnLabel: "工厂编码",
  853. columnHidden: false,
  854. columnImage: false,
  855. columnSortable: false,
  856. sortLv: 0,
  857. status: true,
  858. fixed: '',
  859. columnWidth: 70
  860. },
  861. {
  862. userId: this.$store.state.user.name,
  863. functionId: 106002,
  864. serialNumber: '106002Table1DepartmentDesc',
  865. tableId: "106002Table1",
  866. tableName: "刀具申请主表",
  867. columnProp: "departmentDesc",
  868. headerAlign: "center",
  869. align: "left",
  870. columnLabel: "部门",
  871. columnHidden: false,
  872. columnImage: false,
  873. columnSortable: false,
  874. sortLv: 0,
  875. status: true,
  876. fixed: '',
  877. columnWidth: 70
  878. },
  879. {
  880. userId: this.$store.state.user.name,
  881. functionId: 106002,
  882. serialNumber: '106002Table1ApplyNo',
  883. tableId: "106002Table1",
  884. tableName: "刀具申请主表",
  885. columnProp: "applyNo",
  886. headerAlign: "center",
  887. align: "left",
  888. columnLabel: "申请单号",
  889. columnHidden: false,
  890. columnImage: false,
  891. columnSortable: false,
  892. sortLv: 0,
  893. status: true,
  894. fixed: '',
  895. columnWidth: 80
  896. },
  897. {
  898. userId: this.$store.state.user.name,
  899. functionId: 106002,
  900. serialNumber: '106002Table1ApplyBy',
  901. tableId: "106002Table1",
  902. tableName: "刀具申请主表",
  903. columnProp: "applyBy",
  904. headerAlign: "center",
  905. align: "left",
  906. columnLabel: "申请人",
  907. columnHidden: false,
  908. columnImage: false,
  909. columnSortable: false,
  910. sortLv: 0,
  911. status: true,
  912. fixed: '',
  913. columnWidth: 60
  914. },
  915. {
  916. userId: this.$store.state.user.name,
  917. functionId: 106002,
  918. serialNumber: '106002Table1Status',
  919. tableId: "106002Table1",
  920. tableName: "刀具申请主表",
  921. columnProp: "status",
  922. headerAlign: "center",
  923. align: "left",
  924. columnLabel: "状态",
  925. columnHidden: false,
  926. columnImage: false,
  927. columnSortable: false,
  928. sortLv: 0,
  929. status: true,
  930. fixed: '',
  931. columnWidth: 60
  932. },
  933. {
  934. userId: this.$store.state.user.name,
  935. functionId: 106002,
  936. serialNumber: '106002Table1NodeId',
  937. tableId: "106002Table1",
  938. tableName: "刀具申请主表",
  939. columnProp: "nodeId",
  940. headerAlign: "center",
  941. align: "left",
  942. columnLabel: "当前节点",
  943. columnHidden: false,
  944. columnImage: false,
  945. columnSortable: false,
  946. sortLv: 0,
  947. status: true,
  948. fixed: '',
  949. columnWidth: 60
  950. },
  951. {
  952. userId: this.$store.state.user.name,
  953. functionId: 106002,
  954. serialNumber: '106002Table1SP',
  955. tableId: "106002Table1",
  956. tableName: "刀具申请主表",
  957. columnProp: "sp",
  958. headerAlign: "center",
  959. align: "left",
  960. columnLabel: "当前节点审批人",
  961. columnHidden: false,
  962. columnImage: false,
  963. columnSortable: false,
  964. sortLv: 0,
  965. status: true,
  966. fixed: '',
  967. columnWidth: 90
  968. },
  969. {
  970. userId: this.$store.state.user.name,
  971. functionId: 106002,
  972. serialNumber: '106002Table1NodeName',
  973. tableId: "106002Table1",
  974. tableName: "刀具申请主表",
  975. columnProp: "nodeName",
  976. headerAlign: "center",
  977. align: "left",
  978. columnLabel: "节点名称",
  979. columnHidden: false,
  980. columnImage: false,
  981. columnSortable: false,
  982. sortLv: 0,
  983. status: true,
  984. fixed: '',
  985. columnWidth: 120
  986. },
  987. {
  988. userId: this.$store.state.user.name,
  989. functionId: 106002,
  990. serialNumber: '106002Table1ApplySumQty',
  991. tableId: "106002Table1",
  992. tableName: "刀具申请主表",
  993. columnProp: "applySumQty",
  994. headerAlign: "center",
  995. align: "right",
  996. columnLabel: "申请数量",
  997. columnHidden: false,
  998. columnImage: false,
  999. columnSortable: false,
  1000. sortLv: 0,
  1001. status: true,
  1002. fixed: '',
  1003. columnWidth: 60
  1004. },
  1005. {
  1006. userId: this.$store.state.user.name,
  1007. functionId: 106002,
  1008. serialNumber: '106002Table1TotalCost',
  1009. tableId: "106002Table1",
  1010. tableName: "刀具申请主表",
  1011. columnProp: "totalCost",
  1012. headerAlign: "center",
  1013. align: "right",
  1014. columnLabel: "总成本",
  1015. columnHidden: false,
  1016. columnImage: false,
  1017. columnSortable: false,
  1018. sortLv: 0,
  1019. status: true,
  1020. fixed: '',
  1021. columnWidth: 60
  1022. },
  1023. {
  1024. userId: this.$store.state.user.name,
  1025. functionId: 106002,
  1026. serialNumber: '106002Table1QuoterName',
  1027. tableId: "106002Table1",
  1028. tableName: "刀具申请主表",
  1029. columnProp: "quoterName",
  1030. headerAlign: "center",
  1031. align: "left",
  1032. columnLabel: "报价员",
  1033. columnHidden: false,
  1034. columnImage: false,
  1035. columnSortable: false,
  1036. sortLv: 0,
  1037. status: true,
  1038. fixed: '',
  1039. columnWidth: 60
  1040. },
  1041. {
  1042. userId: this.$store.state.user.name,
  1043. functionId: 106002,
  1044. serialNumber: '106002Table1TpName',
  1045. tableId: "106002Table1",
  1046. tableName: "刀具申请主表",
  1047. columnProp: "tpName",
  1048. headerAlign: "center",
  1049. align: "left",
  1050. columnLabel: "TP",
  1051. columnHidden: false,
  1052. columnImage: false,
  1053. columnSortable: false,
  1054. sortLv: 0,
  1055. status: true,
  1056. fixed: '',
  1057. columnWidth: 60
  1058. },
  1059. {
  1060. userId: this.$store.state.user.name,
  1061. functionId: 106002,
  1062. serialNumber: '106002Table1PurchaserName',
  1063. tableId: "106002Table1",
  1064. tableName: "刀具申请主表",
  1065. columnProp: "purchaserName",
  1066. headerAlign: "center",
  1067. align: "left",
  1068. columnLabel: "采购员",
  1069. columnHidden: false,
  1070. columnImage: false,
  1071. columnSortable: false,
  1072. sortLv: 0,
  1073. status: true,
  1074. fixed: '',
  1075. columnWidth: 60
  1076. },
  1077. {
  1078. userId: this.$store.state.user.name,
  1079. functionId: 106002,
  1080. serialNumber: '106002Table1ApplyDate',
  1081. tableId: "106002Table1",
  1082. tableName: "刀具申请主表",
  1083. columnProp: "applyDate",
  1084. headerAlign: "center",
  1085. align: "left",
  1086. columnLabel: "申请日期",
  1087. columnHidden: false,
  1088. columnImage: false,
  1089. columnSortable: false,
  1090. sortLv: 0,
  1091. status: true,
  1092. fixed: '',
  1093. columnWidth: 80
  1094. },
  1095. {
  1096. userId: this.$store.state.user.name,
  1097. functionId: 106002,
  1098. serialNumber: '106002Table1ApplyReason',
  1099. tableId: "106002Table1",
  1100. tableName: "刀具申请主表",
  1101. columnProp: "applyReason",
  1102. headerAlign: "center",
  1103. align: "left",
  1104. columnLabel: "申请原因",
  1105. columnHidden: false,
  1106. columnImage: false,
  1107. columnSortable: false,
  1108. sortLv: 0,
  1109. status: true,
  1110. fixed: '',
  1111. columnWidth: 150
  1112. },
  1113. {
  1114. userId: this.$store.state.user.name,
  1115. functionId: 106002,
  1116. serialNumber: '106002Table1Remark',
  1117. tableId: "106002Table1",
  1118. tableName: "刀具申请主表",
  1119. columnProp: "remark",
  1120. headerAlign: "center",
  1121. align: "left",
  1122. columnLabel: "申请备注",
  1123. columnHidden: false,
  1124. columnImage: false,
  1125. columnSortable: false,
  1126. sortLv: 0,
  1127. status: true,
  1128. fixed: '',
  1129. columnWidth: 200
  1130. },
  1131. ],
  1132. columnList2: [
  1133. {
  1134. userId: this.$store.state.user.name,
  1135. functionId: 106002,
  1136. serialNumber: '106002Table2SeqNo',
  1137. tableId: '106002Table2',
  1138. tableName: '工具申请明细',
  1139. columnProp: 'seqNo',
  1140. headerAlign: 'center',
  1141. align: 'center',
  1142. columnLabel: '序号',
  1143. columnHidden: false,
  1144. columnImage: false,
  1145. columnSortable: false,
  1146. sortLv: 0,
  1147. status: true,
  1148. fixed: '',
  1149. columnWidth: 40
  1150. },
  1151. {
  1152. userId: this.$store.state.user.name,
  1153. functionId: 106002,
  1154. serialNumber: '106002Table2QuotationNo',
  1155. tableId: '106002Table2',
  1156. tableName: '工具申请明细',
  1157. columnProp: 'orderRef1',
  1158. headerAlign: 'center',
  1159. align: 'center',
  1160. columnLabel: '项目号',
  1161. columnHidden: false,
  1162. columnImage: false,
  1163. columnSortable: false,
  1164. sortLv: 0,
  1165. status: true,
  1166. fixed: '',
  1167. columnWidth: 100
  1168. },
  1169. {
  1170. userId: this.$store.state.user.name,
  1171. functionId: 106002,
  1172. serialNumber: '106002Table2ToolNo',
  1173. tableId: '106002Table2',
  1174. tableName: '工具申请明细',
  1175. columnProp: 'toolId',
  1176. headerAlign: 'center',
  1177. align: 'center',
  1178. columnLabel: '工具编码',
  1179. columnHidden: false,
  1180. columnImage: false,
  1181. columnSortable: false,
  1182. sortLv: 0,
  1183. status: true,
  1184. fixed: '',
  1185. columnWidth: 70
  1186. },
  1187. {
  1188. userId: this.$store.state.user.name,
  1189. functionId: 106002,
  1190. serialNumber: '106002Table2ToolDescription',
  1191. tableId: '106002Table2',
  1192. tableName: '工具申请明细',
  1193. columnProp: 'toolDesc',
  1194. headerAlign: 'center',
  1195. align: 'center',
  1196. columnLabel: '工具描述',
  1197. columnHidden: false,
  1198. columnImage: false,
  1199. columnSortable: false,
  1200. sortLv: 0,
  1201. status: true,
  1202. fixed: '',
  1203. columnWidth: 120
  1204. },
  1205. {
  1206. userId: this.$store.state.user.name,
  1207. functionId: 106002,
  1208. serialNumber: '106002Table2ApplyQty',
  1209. tableId: '106002Table2',
  1210. tableName: '工具申请明细',
  1211. columnProp: 'applyQty',
  1212. headerAlign: 'center',
  1213. align: 'center',
  1214. columnLabel: '申请数量',
  1215. columnHidden: false,
  1216. columnImage: false,
  1217. columnSortable: false,
  1218. sortLv: 0,
  1219. status: true,
  1220. fixed: '',
  1221. columnWidth: 80
  1222. },
  1223. {
  1224. userId: this.$store.state.user.name,
  1225. functionId: 106002,
  1226. serialNumber: '106002Table2UnitCost',
  1227. tableId: '106002Table2',
  1228. tableName: '工具申请明细',
  1229. columnProp: 'standardCost',
  1230. headerAlign: 'center',
  1231. align: 'center',
  1232. columnLabel: '工具成本',
  1233. columnHidden: false,
  1234. columnImage: false,
  1235. columnSortable: false,
  1236. sortLv: 0,
  1237. status: true,
  1238. fixed: '',
  1239. columnWidth: 80
  1240. },
  1241. {
  1242. userId: this.$store.state.user.name,
  1243. functionId: 106002,
  1244. serialNumber: '106002Table2QuotationNo',
  1245. tableId: '106002Table2',
  1246. tableName: '工具申请明细',
  1247. columnProp: 'plmPartNo',
  1248. headerAlign: 'center',
  1249. align: 'center',
  1250. columnLabel: 'PLM物料编码',
  1251. columnHidden: false,
  1252. columnImage: false,
  1253. columnSortable: false,
  1254. sortLv: 0,
  1255. status: true,
  1256. fixed: '',
  1257. columnWidth: 100
  1258. },
  1259. {
  1260. userId: this.$store.state.user.name,
  1261. functionId: 106002,
  1262. serialNumber: '106002Table2IfsPartNo',
  1263. tableId: '106002Table2',
  1264. tableName: '工具申请明细',
  1265. columnProp: 'ifsPartNo',
  1266. headerAlign: 'center',
  1267. align: 'center',
  1268. columnLabel: 'IFS物料编码',
  1269. columnHidden: false,
  1270. columnImage: false,
  1271. columnSortable: false,
  1272. sortLv: 0,
  1273. status: true,
  1274. fixed: '',
  1275. columnWidth: 100
  1276. },
  1277. {
  1278. userId: this.$store.state.user.name,
  1279. functionId: 106002,
  1280. serialNumber: '106002Table2PartDesc',
  1281. tableId: '106002Table2',
  1282. tableName: '工具申请明细',
  1283. columnProp: 'partDesc',
  1284. headerAlign: 'center',
  1285. align: 'center',
  1286. columnLabel: '物料名称',
  1287. columnHidden: false,
  1288. columnImage: false,
  1289. columnSortable: false,
  1290. sortLv: 0,
  1291. status: true,
  1292. fixed: '',
  1293. columnWidth: 160
  1294. },
  1295. {
  1296. userId: this.$store.state.user.name,
  1297. functionId: 106002,
  1298. serialNumber: '106002Table2CustomerPartNo',
  1299. tableId: '106002Table2',
  1300. tableName: '工具申请明细',
  1301. columnProp: 'customerPartNo',
  1302. headerAlign: 'center',
  1303. align: 'center',
  1304. columnLabel: '客户料号',
  1305. columnHidden: false,
  1306. columnImage: false,
  1307. columnSortable: false,
  1308. sortLv: 0,
  1309. status: true,
  1310. fixed: '',
  1311. columnWidth: 70
  1312. },
  1313. {
  1314. userId: this.$store.state.user.name,
  1315. functionId: 106002,
  1316. serialNumber: '106002Table2QuotationNo',
  1317. tableId: '106002Table2',
  1318. tableName: '工具申请明细',
  1319. columnProp: 'orderRef3',
  1320. headerAlign: 'center',
  1321. align: 'center',
  1322. columnLabel: '工艺路线版本',
  1323. columnHidden: false,
  1324. columnImage: false,
  1325. columnSortable: false,
  1326. sortLv: 0,
  1327. status: true,
  1328. fixed: '',
  1329. columnWidth: 70
  1330. },
  1331. {
  1332. userId: this.$store.state.user.name,
  1333. functionId: 106002,
  1334. serialNumber: '106002Table2QuotationNo',
  1335. tableId: '106002Table2',
  1336. tableName: '工具申请明细',
  1337. columnProp: 'orderRef5',
  1338. headerAlign: 'center',
  1339. align: 'center',
  1340. columnLabel: '替代编码',
  1341. columnHidden: false,
  1342. columnImage: false,
  1343. columnSortable: false,
  1344. sortLv: 0,
  1345. status: true,
  1346. fixed: '',
  1347. columnWidth: 70
  1348. }, {
  1349. userId: this.$store.state.user.name,
  1350. functionId: 106002,
  1351. serialNumber: '106002Table2QuotationNo',
  1352. tableId: '106002Table2',
  1353. tableName: '工具申请明细',
  1354. columnProp: 'operationNo',
  1355. headerAlign: 'center',
  1356. align: 'center',
  1357. columnLabel: '工序号',
  1358. columnHidden: false,
  1359. columnImage: false,
  1360. columnSortable: false,
  1361. sortLv: 0,
  1362. status: true,
  1363. fixed: '',
  1364. columnWidth: 70
  1365. }, {
  1366. userId: this.$store.state.user.name,
  1367. functionId: 106002,
  1368. serialNumber: '106002Table2QuotationNo',
  1369. tableId: '106002Table2',
  1370. tableName: '工具申请明细',
  1371. columnProp: 'operationName',
  1372. headerAlign: 'center',
  1373. align: 'center',
  1374. columnLabel: '工序',
  1375. columnHidden: false,
  1376. columnImage: false,
  1377. columnSortable: false,
  1378. sortLv: 0,
  1379. status: true,
  1380. fixed: '',
  1381. columnWidth: 70
  1382. },
  1383. ],
  1384. columnFileContentArray: [
  1385. {
  1386. columnProp: 'fileName',
  1387. headeralign: 'left',
  1388. align: 'left',
  1389. columnLabel: '文件名称',
  1390. columnHidden: false,
  1391. columnImage: false,
  1392. columnSortable: false,
  1393. sortLv: 0,
  1394. status: true,
  1395. fixed: false
  1396. // }, {
  1397. // columnProp: 'createdBy',
  1398. // headeralign: 'left',
  1399. // align: 'left',
  1400. // columnLabel: '上传人',
  1401. // columnHidden: false,
  1402. // columnImage: false,
  1403. // columnSortable: true,
  1404. // sortLv: 0,
  1405. // status: true,
  1406. // fixed: false
  1407. }, {
  1408. columnProp: 'createDate',
  1409. headeralign: 'left',
  1410. align: 'left',
  1411. columnLabel: '上传时间',
  1412. columnHidden: false,
  1413. columnImage: false,
  1414. columnSortable: true,
  1415. sortLv: 0,
  1416. status: true,
  1417. fixed: false
  1418. }, {
  1419. columnProp: 'orderRef3',
  1420. headeralign: 'left',
  1421. align: 'left',
  1422. columnLabel: '类型',
  1423. columnHidden: false,
  1424. columnImage: false,
  1425. columnSortable: true,
  1426. sortLv: 0,
  1427. status: true,
  1428. fixed: false
  1429. },
  1430. ],
  1431. approvalList: [],
  1432. rejectOpinion: '',
  1433. submitModalFlag: false,
  1434. processField: '',
  1435. }
  1436. },
  1437. watch: {
  1438. // columnList1: {
  1439. // deep: true,
  1440. // handler: function (newV, oldV) {
  1441. // debugger
  1442. //
  1443. // }
  1444. // }
  1445. },
  1446. mounted() {
  1447. this.$nextTick(() => {
  1448. this.height = window.innerHeight - 520;
  1449. this.fieldColumn()
  1450. })
  1451. },
  1452. methods: {
  1453. accessProcessField(key) {
  1454. return this.processField.indexOf(key) !== -1 || false
  1455. },
  1456. // 查询审批信息
  1457. getApprovalList() {
  1458. if (Object.keys(this.currentRow).length !== 0) {
  1459. let tempData = {
  1460. site: this.$store.state.user.site,
  1461. menuId: this.$route.meta.menuId,
  1462. documentNo: this.currentRow.applyNo
  1463. }
  1464. getApprovalList(tempData).then(({data}) => {
  1465. if (data && data.code === 0) {
  1466. this.approvalList = data.rows
  1467. } else {
  1468. this.approvalList = []
  1469. }
  1470. })
  1471. }
  1472. },
  1473. // 获取基础数据列表S
  1474. getBaseList(val, type) {
  1475. this.tagNo = val
  1476. this.tagNo2 = type
  1477. this.$nextTick(() => {
  1478. let strVal = ''
  1479. if (val === 2002) {
  1480. if (this.changeApplyHeaderFlag('quoter') === 'N' && this.currentRow.status === '审批中') {
  1481. this.$alert('没有权限在审批过程中修改!', '错误', {
  1482. confirmButtonText: '确定'
  1483. })
  1484. return false
  1485. }
  1486. strVal = this.dataForm.quoter
  1487. } else if (val === 2042) {
  1488. if (this.changeApplyHeaderFlag('tp') === 'N' && this.currentRow.status === '审批中') {
  1489. this.$alert('没有权限在审批过程中修改!', '错误', {
  1490. confirmButtonText: '确定'
  1491. })
  1492. return false
  1493. }
  1494. strVal = this.dataForm.tp
  1495. } else if (val === 2000) {
  1496. if (this.changeApplyHeaderFlag('purchaser') === 'N' && this.currentRow.status === '审批中') {
  1497. this.$alert('没有权限在审批过程中修改!', '错误', {
  1498. confirmButtonText: '确定'
  1499. })
  1500. return false
  1501. }
  1502. strVal = this.dataForm.purchaser
  1503. }
  1504. this.$refs.baseList.init(val, strVal)
  1505. })
  1506. },
  1507. /* 列表方法的回调 */
  1508. getBaseData(val) {
  1509. if (this.tagNo === 2002) {
  1510. this.dataForm.quoter = val.username
  1511. this.dataForm.quoterName = val.user_display
  1512. this.$nextTick(() => {
  1513. this.$triggerInputEvent(this.$refs.quoterName);
  1514. });
  1515. } else if (this.tagNo === 2042) {
  1516. this.dataForm.tp = val.username
  1517. this.dataForm.tpName = val.user_display
  1518. this.$nextTick(() => {
  1519. this.$triggerInputEvent(this.$refs.tpName);
  1520. });
  1521. } else if (this.tagNo === 2000) {
  1522. this.dataForm.purchaser = val.username
  1523. this.dataForm.purchaserName = val.user_display
  1524. this.$nextTick(() => {
  1525. this.$triggerInputEvent(this.$refs.purchaserName);
  1526. });
  1527. }
  1528. },
  1529. //导出excel
  1530. async createExportData() {
  1531. this.searchData.limit = -1
  1532. this.searchData.page = 1
  1533. await searchProjectToolApplyHeader(this.searchData).then(({data}) => {
  1534. this.exportList = data.page.list;
  1535. })
  1536. return this.exportList;
  1537. },
  1538. startDownload() {
  1539. // this.exportData = this.dataList
  1540. },
  1541. finishDownload() {
  1542. },
  1543. fields() {
  1544. let json = "{"
  1545. this.columnList1.forEach((item, index) => {
  1546. if (index == this.columnList1.length - 1) {
  1547. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1548. } else {
  1549. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1550. }
  1551. })
  1552. json += "}"
  1553. let s = eval("(" + json + ")")
  1554. return s
  1555. },
  1556. //导出excel
  1557. async createExportData2() {
  1558. return this.contactList;
  1559. },
  1560. startDownload2() {
  1561. // this.exportData = this.dataList
  1562. },
  1563. finishDownload2() {
  1564. },
  1565. fields2() {
  1566. let json = "{"
  1567. this.columnList2.forEach((item, index) => {
  1568. if (index == this.columnList2.length - 1) {
  1569. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1570. } else {
  1571. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1572. }
  1573. })
  1574. json += "}"
  1575. let s = eval("(" + json + ")")
  1576. return s
  1577. },
  1578. // 导出 end
  1579. // 获取数据列表
  1580. search() {
  1581. this.searchData.limit = this.pageSize
  1582. this.searchData.page = this.pageIndex
  1583. searchProjectToolApplyHeader(this.searchData).then(({data}) => {
  1584. if (data.code == 0) {
  1585. this.dataList1 = data.page.list
  1586. this.pageIndex = data.page.currPage
  1587. this.pageSize = data.page.pageSize
  1588. this.totalPage = data.page.totalCount
  1589. if (this.dataList1.length > 0) {
  1590. this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
  1591. this.currentRow = JSON.parse(JSON.stringify(this.dataList1[0]));
  1592. } else {
  1593. this.currentRow = {}
  1594. }
  1595. this.refreshCurrentTabTable()
  1596. }
  1597. this.dataListLoading = false
  1598. })
  1599. },
  1600. //单击切换订单
  1601. changeData(row) {
  1602. this.currentRow = JSON.parse(JSON.stringify(row));
  1603. this.currentRow2 = row;
  1604. this.refreshCurrentTabTable();
  1605. },
  1606. addUploadFileModal() {
  1607. let currentData = {
  1608. site: this.currentRow.site,
  1609. createBy: this.$store.state.user.name,
  1610. projectId: this.currentRow.applyNo,
  1611. projectName: '',
  1612. remark: '',
  1613. };
  1614. //打开组件 去做新增业务
  1615. this.$nextTick(() => {
  1616. this.$refs.projectUploadFile.init(currentData);
  1617. })
  1618. },
  1619. deleteFile(row) {
  1620. this.$confirm('确定要删除此文件?', '提示', {
  1621. confirmButtonText: '确定',
  1622. cancelButtonText: '取消',
  1623. type: 'warning'
  1624. }).then(() => {
  1625. deleteProjectFile(row).then(({data}) => {
  1626. if (data && data.code == 0) {
  1627. this.getFileContentData();
  1628. this.$message({
  1629. message: '操作成功',
  1630. type: 'success',
  1631. duration: 1500,
  1632. onClose: () => {
  1633. }
  1634. })
  1635. } else {
  1636. this.$alert(data.msg, '错误', {
  1637. confirmButtonText: '确定'
  1638. })
  1639. }
  1640. })
  1641. }).catch(() => {
  1642. })
  1643. },
  1644. tabClick(tab, event) {
  1645. // 刷新列表数据
  1646. this.refreshCurrentTabTable()
  1647. },
  1648. // 刷新页签的table数据
  1649. refreshCurrentTabTable() {
  1650. if (this.activeName == 'detail') {
  1651. this.searchToolApplyDetail();
  1652. }
  1653. if (this.activeName == 'down') {
  1654. // this.getFileContentData();
  1655. }
  1656. if (this.activeName === 'approvalInformation') {
  1657. this.getApprovalList()
  1658. }
  1659. },
  1660. searchToolApplyDetail() {
  1661. if (this.currentRow.applyNo) {
  1662. searchProjectToolApplyDetail(this.currentRow).then(({data}) => {
  1663. if (data.code == 0) {
  1664. this.detailList = data.rows
  1665. }
  1666. })
  1667. } else {
  1668. this.detailList = []
  1669. }
  1670. },
  1671. editModal(row) {
  1672. this.getNodeAuthority(row)
  1673. this.dataForm = {
  1674. site: row.site,
  1675. applyNo: row.applyNo,
  1676. applyBy: row.applyBy,
  1677. applyDate: row.applyDate,
  1678. applySumQty: row.applySumQty,
  1679. applyReason: row.applyReason,
  1680. remark: row.remark,
  1681. createBy: row.createBy,
  1682. department: row.department,
  1683. detailList: [],
  1684. status: row.status,
  1685. rejectOpinion: '',
  1686. nodeConclusion: '',
  1687. quoter: row.quoter,
  1688. quoterName: row.quoterName,
  1689. tp: row.tp,
  1690. tpName: row.tpName,
  1691. purchaser: row.purchaser,
  1692. purchaserName: row.purchaserName,
  1693. totalCost: row.totalCost,
  1694. menuId: this.$route.meta.menuId,
  1695. userName: this.$store.state.user.name,
  1696. nodeId: row.nodeId
  1697. }
  1698. this.openModelMessage()
  1699. searchProjectToolApplyDetail({
  1700. site: row.site,
  1701. applyNo: row.applyNo,
  1702. }).then(({data}) => {
  1703. if (data.code == 0) {
  1704. this.toolData = data.rows
  1705. }
  1706. })
  1707. this.visible = true
  1708. },
  1709. editModalU(row) {
  1710. this.getNodeAuthority(row)
  1711. this.dataForm = {
  1712. site: row.site,
  1713. applyNo: row.applyNo,
  1714. applyBy: row.applyBy,
  1715. applyDate: row.applyDate,
  1716. applySumQty: row.applySumQty,
  1717. applyReason: row.applyReason,
  1718. remark: row.remark,
  1719. createBy: row.createBy,
  1720. department: row.department,
  1721. detailList: [],
  1722. status: row.status,
  1723. rejectOpinion: '',
  1724. nodeConclusion: '',
  1725. quoter: row.quoter,
  1726. quoterName: row.quoterName,
  1727. tp: row.tp,
  1728. tpName: row.tpName,
  1729. purchaser: row.purchaser,
  1730. purchaserName: row.purchaserName,
  1731. totalCost: row.totalCost,
  1732. menuId: this.$route.meta.menuId,
  1733. userName: this.$store.state.user.name,
  1734. nodeId: row.nodeId
  1735. }
  1736. this.openModelMessage()
  1737. searchProjectToolApplyDetail({
  1738. site: row.site,
  1739. applyNo: row.applyNo,
  1740. }).then(({data}) => {
  1741. if (data.code == 0) {
  1742. this.toolData = data.rows
  1743. }
  1744. })
  1745. this.visibleU = true
  1746. },
  1747. comfirmApply(row) {
  1748. this.$confirm(`确定下达这个申请`, '提示', {
  1749. confirmButtonText: '确定',
  1750. cancelButtonText: '取消',
  1751. type: 'warning'
  1752. }).then(() => {
  1753. let tempData = {
  1754. site: row.site,
  1755. userName: this.$store.state.user.name,
  1756. applyNo: row.applyNo,
  1757. menuId: this.$route.meta.menuId
  1758. }
  1759. comfirmProjectToolApply(tempData).then(({data}) => {
  1760. if (data && data.code === 0) {
  1761. this.search()
  1762. // row.statusCode = '10'
  1763. // row.status = '下达'
  1764. this.$message({
  1765. message: '操作成功',
  1766. type: 'success',
  1767. duration: 1500,
  1768. onClose: () => {
  1769. }
  1770. })
  1771. } else {
  1772. this.$alert(data.msg, '错误', {
  1773. confirmButtonText: '确定'
  1774. })
  1775. }
  1776. })
  1777. })
  1778. },
  1779. cancelApply(row) {
  1780. this.$confirm(`确定删除这个申请`, '提示', {
  1781. confirmButtonText: '确定',
  1782. cancelButtonText: '取消',
  1783. type: 'warning'
  1784. }).then(() => {
  1785. cancelProjectToolApply(row).then(({data}) => {
  1786. if (data && data.code === 0) {
  1787. this.search();
  1788. this.$message({
  1789. message: '操作成功',
  1790. type: 'success',
  1791. duration: 1500,
  1792. onClose: () => {
  1793. }
  1794. })
  1795. } else {
  1796. this.$alert(data.msg, '错误', {
  1797. confirmButtonText: '确定'
  1798. })
  1799. }
  1800. })
  1801. })
  1802. },
  1803. //刷新派设备文档的列表
  1804. getFileContentData() {
  1805. let currentData = {orderRef2: this.currentRow.applyNo};
  1806. getFileContentList(currentData).then(({data}) => {
  1807. //区分请求成功和失败的状况
  1808. if (data && data.code == 200) {
  1809. this.fileContentList = data.rows;
  1810. } else {
  1811. this.fileContentList = [];
  1812. }
  1813. });
  1814. },
  1815. // 下载
  1816. downloadFile(row) {
  1817. // let inData={
  1818. // site:this.currentRow.site,
  1819. // username:this.$store.state.user.name,
  1820. // projectId:this.currentRow.projectId
  1821. // }
  1822. // getProjectUserRole(inData).then(({data}) => {
  1823. // if(this.$store.state.user.name=='admin'||data.row.downFlag=='Y') {
  1824. downLoadProjectFile(row)
  1825. .then(({data}) => {
  1826. // 不限制文件下载类型
  1827. const blob = new Blob([data], {type: 'application/octet-stream;charset=utf-8'})
  1828. // 下载文件名称
  1829. const fileName = row.fileName
  1830. // a标签下载
  1831. const linkNode = document.createElement('a')
  1832. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  1833. linkNode.style.display = 'none'
  1834. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  1835. console.log(linkNode)
  1836. // if(val == 'Y'){
  1837. // this.pdfVisible = true
  1838. // this.pdfUrl = linkNode.href
  1839. // }else {
  1840. document.body.appendChild(linkNode)
  1841. linkNode.click() // 模拟在按钮上的一次鼠标单击
  1842. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  1843. document.body.removeChild(linkNode)
  1844. // }
  1845. })
  1846. // }else {
  1847. // this.$alert('没有权限下载这个项目的文件!', '错误', {
  1848. // confirmButtonText: '确定'
  1849. // })
  1850. // }
  1851. // })
  1852. },
  1853. // 每页数
  1854. sizeChangeHandle(val) {
  1855. this.pageSize = val
  1856. this.pageIndex = 1
  1857. this.search()
  1858. },
  1859. // 当前页
  1860. currentChangeHandle(val) {
  1861. this.pageIndex = val
  1862. this.search()
  1863. },
  1864. openModelMessage() {
  1865. this.modelData = {
  1866. site: this.currentRow.site,
  1867. applyNo: this.currentRow.applyNo,
  1868. prNo: this.currentRow.prNo,
  1869. remark1: this.currentRow.remark1,
  1870. poNo: this.currentRow.poNo,
  1871. supplierName: this.currentRow.supplierName,
  1872. allCost: this.currentRow.allCost,
  1873. remark2: this.currentRow.remark2,
  1874. }
  1875. },
  1876. openMassageModel() {
  1877. if (Object.keys(this.currentRow).length === 0) {
  1878. this.$alert('未选择记录!', '错误', {
  1879. confirmButtonText: '确定'
  1880. })
  1881. return false;
  1882. }
  1883. this.modelData = {
  1884. site: this.currentRow.site,
  1885. applyNo: this.currentRow.applyNo,
  1886. prNo: this.currentRow.prNo,
  1887. remark1: this.currentRow.remark1,
  1888. poNo: this.currentRow.poNo,
  1889. supplierName: this.currentRow.supplierName,
  1890. allCost: this.currentRow.allCost,
  1891. remark2: this.currentRow.remark2,
  1892. }
  1893. this.modelFlag = true
  1894. },
  1895. changeSum(row) {
  1896. if (row.standardCost < 0 || row.standardCost == null || row.standardCost == '') {
  1897. row.standardCost = 0
  1898. // this.$alert('成本不能为负数或者不填', '错误', {
  1899. // confirmButtonText: '确定'
  1900. // })
  1901. }
  1902. this.dataForm.applySumQty = 0
  1903. this.dataForm.totalCost = 0
  1904. for (const item of this.toolData) {
  1905. // 累加之前先确保值存在,并将 null 或 undefined 转换为0
  1906. this.dataForm.applySumQty += Number(item.applyQty != null && item.applyQty !== '' ? item.applyQty : 0);
  1907. this.dataForm.totalCost += Number(item.applyQty != null && item.applyQty !== '' ? item.applyQty * item.standardCost : 0);
  1908. }
  1909. },
  1910. saveHeaderMessage() {
  1911. this.$confirm('确定是否保存', '提示', {
  1912. confirmButtonText: '确定',
  1913. cancelButtonText: '取消',
  1914. type: 'warning'
  1915. }).then(() => {
  1916. saveProjectHeaderMessage(this.modelData).then(({data}) => {
  1917. if (data && data.code === 0) {
  1918. this.modelFlag = false;
  1919. this.currentRow.prNo = this.modelData.prNo
  1920. this.currentRow.remark1 = this.modelData.remark1
  1921. this.currentRow.poNo = this.modelData.poNo
  1922. this.currentRow.supplierName = this.modelData.supplierName
  1923. this.currentRow.allCost = this.modelData.allCost
  1924. this.currentRow.totalCost = this.modelData.totalCost
  1925. this.currentRow.remark2 = this.modelData.remark2
  1926. this.$message({
  1927. message: '操作成功',
  1928. type: 'success',
  1929. duration: 1500,
  1930. onClose: () => {
  1931. }
  1932. })
  1933. } else {
  1934. this.$alert(data.msg, '错误', {
  1935. confirmButtonText: '确定'
  1936. })
  1937. }
  1938. })
  1939. })
  1940. },
  1941. saveHeaderMessage2() {
  1942. saveProjectHeaderMessage(this.modelData).then(({data}) => {
  1943. if (data && data.code === 0) {
  1944. this.modelFlag = false;
  1945. this.currentRow.prNo = this.modelData.prNo
  1946. this.currentRow.remark1 = this.modelData.remark1
  1947. this.currentRow.poNo = this.modelData.poNo
  1948. this.currentRow.supplierName = this.modelData.supplierName
  1949. this.currentRow.allCost = this.modelData.allCost
  1950. this.currentRow.totalCost = this.modelData.totalCost
  1951. this.currentRow.remark2 = this.modelData.remark2
  1952. this.$message({
  1953. message: '操作成功',
  1954. type: 'success',
  1955. duration: 1500,
  1956. onClose: () => {
  1957. }
  1958. })
  1959. } else {
  1960. this.$alert(data.msg, '错误', {
  1961. confirmButtonText: '确定'
  1962. })
  1963. }
  1964. })
  1965. },
  1966. // 同意提交
  1967. agreeSubmit() {
  1968. this.$confirm(`是否确认提交?`, '提示', {
  1969. confirmButtonText: '确定',
  1970. cancelButtonText: '取消',
  1971. type: 'warning'
  1972. }).then(() => {
  1973. this.dataForm.nodeConclusion = 'Y'
  1974. this.submitData()
  1975. })
  1976. },
  1977. // 打开提交模态框
  1978. submitDataModal() {
  1979. this.rejectOpinion = ''
  1980. this.submitModalFlag = true
  1981. },
  1982. // 驳回提交
  1983. rejectSubmit() {
  1984. this.$confirm(`是否确认驳回?`, '提示', {
  1985. confirmButtonText: '确定',
  1986. cancelButtonText: '取消',
  1987. type: 'warning'
  1988. }).then(() => {
  1989. this.dataForm.rejectOpinion = this.rejectOpinion
  1990. this.dataForm.nodeConclusion = 'N'
  1991. this.submitData()
  1992. })
  1993. },
  1994. // 提交
  1995. submitData() {
  1996. this.dataForm.userName = this.$store.state.user.name
  1997. this.dataForm.menuId = this.$route.meta.menuId
  1998. this.dataForm.detailList = this.toolData
  1999. submitChange(this.dataForm).then(({data}) => {
  2000. if (data && data.code === 0) {
  2001. this.saveHeaderMessage2()
  2002. for (let i = 0; i < this.dataList1.length; i++) {
  2003. if (this.dataList1[i].applyNo === this.dataForm.applyNo) {
  2004. this.dataList1[i].remark = this.dataForm.remark
  2005. this.dataList1[i].applySumQty = this.dataForm.applySumQty
  2006. this.dataList1[i].applyReason = this.dataForm.applyReason
  2007. }
  2008. }
  2009. this.search();
  2010. this.refreshCurrentTabTable()
  2011. this.submitModalFlag = false
  2012. this.visible = false
  2013. this.$message({
  2014. message: '操作成功',
  2015. type: 'success',
  2016. duration: 1500,
  2017. onClose: () => {
  2018. }
  2019. })
  2020. } else {
  2021. this.$alert(data.msg, '错误', {
  2022. confirmButtonText: '确定'
  2023. })
  2024. }
  2025. })
  2026. },
  2027. saveData() {
  2028. this.dataForm.detailList = this.toolData
  2029. editToolApplication(this.dataForm).then(({data}) => {
  2030. if (data && data.code === 0) {
  2031. this.saveHeaderMessage2()
  2032. for (let i = 0; i < this.dataList1.length; i++) {
  2033. if (this.dataList1[i].applyNo === this.dataForm.applyNo) {
  2034. this.dataList1[i].remark = this.dataForm.remark
  2035. this.dataList1[i].applySumQty = this.dataForm.applySumQty
  2036. this.dataList1[i].applyReason = this.dataForm.applyReason
  2037. this.dataList1[i].quoter = this.dataForm.quoter
  2038. this.dataList1[i].tp = this.dataForm.tp
  2039. this.dataList1[i].totalCost = this.dataForm.totalCost
  2040. this.dataList1[i].purchaser = this.dataForm.purchaser
  2041. this.dataList1[i].quoterName = this.dataForm.quoterName
  2042. this.dataList1[i].tpName = this.dataForm.tpName
  2043. this.dataList1[i].purchaserName = this.dataForm.purchaserName
  2044. }
  2045. }
  2046. this.visible = false
  2047. this.visibleU = false
  2048. this.refreshCurrentTabTable()
  2049. // this.$message({
  2050. // message: '操作成功',
  2051. // type: 'success',
  2052. // duration: 1500,
  2053. // onClose: () => {
  2054. // }
  2055. // })
  2056. } else {
  2057. this.$alert(data.msg, '错误', {
  2058. confirmButtonText: '确定'
  2059. })
  2060. }
  2061. })
  2062. },
  2063. jumpBM(row) {
  2064. if (this.$router.resolve(`/sampleManagement-technicalSpecificationList`).resolved.name === '404') {
  2065. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  2066. } else {
  2067. let inData = {
  2068. site: row.site,
  2069. testPartNo: row.orderRef2
  2070. }
  2071. getProjectPartNowBm(inData).then(({data}) => {
  2072. //区分请求成功和失败的状况
  2073. if (data && data.code === 0) {
  2074. if (data.rows == null || data.rows.length === 0) {
  2075. this.$alert('该物料没有benchmark', '警告', {confirmButtonText: '确定',});
  2076. }
  2077. this.$router.push({
  2078. name: `sampleManagement-technicalSpecificationList`,
  2079. params: {nowCodeNo: data.rows[0].nowBm},
  2080. })
  2081. } else {
  2082. }
  2083. });
  2084. }
  2085. },
  2086. // 获取流程的配置权限
  2087. async getNodeAuthority(row) {
  2088. let tempData = {
  2089. site: row.site,
  2090. stepId: row.stepId,
  2091. menuId: this.$route.meta.menuId
  2092. }
  2093. await getNodeAuthority(tempData).then(({data}) => {
  2094. if (data && data.code === 0) {
  2095. this.plmChangeApplyHeaderArr = data.rows.plm_project_tool_applyHeader;
  2096. this.plmChangeApplyDetailArr = data.rows.plm_project_tool_applyDetail;
  2097. // this.plmChangeRequestArr = data.rows.plm_change_request
  2098. // this.plmChangeRequestDetailArr = data.rows.plm_change_request_detail
  2099. // this.plmChangeCostImpactArr = data.rows.plm_change_cost_impact
  2100. // this.plmChangeFAItemArr = data.rows.plm_change_FA_item
  2101. // this.plmChangeExecutionInfoArr = data.rows.plm_change_execution_info
  2102. // this.plmChangeItemArr = data.rows.plm_change_item
  2103. // this.plmChangeCountersignatureItemArr = data.rows.plm_change_countersignature_item
  2104. }
  2105. })
  2106. },
  2107. fieldColumn() {
  2108. if (!this.accessField('10601001')) {
  2109. this.columnList2 = this.columnList2.filter(item => item.columnProp !== 'standardCost');
  2110. this.columnList1 = this.columnList1.filter(item => item.columnProp !== 'totalCost');
  2111. }
  2112. },
  2113. },
  2114. activated() {
  2115. if (this.$route.params.type === 'tokenLogin') {
  2116. console.log("进来啦")
  2117. if (this.$route.params.docNo) {
  2118. this.searchData.applyNo = this.$route.params.docNo
  2119. }
  2120. this.searchData.limit = this.pageSize
  2121. this.searchData.page = this.pageIndex
  2122. searchProjectToolApplyHeader(this.searchData).then(({data}) => {
  2123. if (data && data.code === 0) {
  2124. this.dataList1 = data.page.list
  2125. this.pageIndex = data.page.currPage
  2126. this.pageSize = data.page.pageSize
  2127. this.totalPage = data.page.totalCount
  2128. if (this.dataList1.length > 0) {
  2129. this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
  2130. this.currentRow = JSON.parse(JSON.stringify(this.dataList1[0]));
  2131. //进入审批界面
  2132. this.editModal(this.dataList1[0])
  2133. } else {
  2134. this.currentRow = {}
  2135. }
  2136. this.refreshCurrentTabTable()
  2137. }
  2138. this.dataListLoading = false
  2139. })
  2140. }
  2141. if (localStorage.getItem('ToolApplyData') != null && localStorage.getItem('ToolApplyData') !== undefined) {
  2142. let data = JSON.parse(localStorage.getItem('ToolApplyData'));
  2143. if (data) {
  2144. this.searchData.applyNo = data.applyNo
  2145. }
  2146. this.searchData.limit = this.pageSize
  2147. this.searchData.page = this.pageIndex
  2148. // console.log(this.searchData)
  2149. searchProjectToolApplyHeader(this.searchData).then(({data}) => {
  2150. if (data.code == 0) {
  2151. this.dataList1 = data.page.list
  2152. this.pageIndex = data.page.currPage
  2153. this.pageSize = data.page.pageSize
  2154. this.totalPage = data.page.totalCount
  2155. if (this.dataList1.length > 0) {
  2156. this.$refs.mainTable.setCurrentRow(this.dataList1[0]);
  2157. this.currentRow = JSON.parse(JSON.stringify(this.dataList1[0]));
  2158. //进入编辑界面
  2159. // this.editModalU(this.dataList1[0])
  2160. } else {
  2161. this.currentRow = {}
  2162. }
  2163. this.refreshCurrentTabTable()
  2164. }
  2165. this.dataListLoading = false
  2166. })
  2167. localStorage.removeItem('ToolApplyData');
  2168. }
  2169. },
  2170. }
  2171. </script>
  2172. <style scoped>
  2173. /deep/ .el-dialog__footer {
  2174. height: 50px !important;
  2175. }
  2176. </style>