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.

2251 lines
78 KiB

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