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.

2175 lines
78 KiB

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