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.

2166 lines
78 KiB

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