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.

859 lines
30 KiB

3 years ago
​
​
​
​
​
2 years ago
​
3 years ago
​
​
2 years ago
​
3 years ago
​
​
2 years ago
2 years ago
3 years ago
​
2 years ago
3 years ago
​
​
​
​
​
2 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
2 years ago
3 years ago
3 years ago
​
3 years ago
3 years ago
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
3 years ago
2 years ago
​
​
​
​
​
​
2 years ago
2 years ago
​
​
3 years ago
​
​
2 years ago
​
​
3 years ago
​
2 years ago
3 years ago
2 years ago
​
​
3 years ago
​
2 years ago
3 years ago
​
​
​
​
​
​
2 years ago
2 years ago
3 years ago
2 years ago
3 years ago
​
3 years ago
3 years ago
​
​
2 years ago
​
2 years ago
2 years ago
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
2 years ago
2 years ago
​
3 years ago
​
​
​
​
​
​
2 years ago
3 years ago
2 years ago
3 years ago
​
​
​
2 years ago
​
​
​
3 years ago
2 years ago
2 years ago
3 years ago
​
2 years ago
3 years ago
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
2 years ago
3 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
2 years ago
3 years ago
​
​
​
​
​
2 years ago
​
​
3 years ago
2 years ago
​
​
​
​
3 years ago
​
2 years ago
3 years ago
​
​
​
​
​
2 years ago
​
​
3 years ago
2 years ago
​
​
​
​
3 years ago
​
2 years ago
3 years ago
​
​
​
​
​
2 years ago
​
​
3 years ago
2 years ago
​
​
​
​
3 years ago
​
2 years ago
3 years ago
​
​
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
3 years ago
2 years ago
​
​
​
​
3 years ago
​
2 years ago
3 years ago
​
​
​
​
​
2 years ago
​
​
3 years ago
2 years ago
​
​
​
​
3 years ago
​
2 years ago
3 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
2 years ago
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
2 years ago
​
​
3 years ago
2 years ago
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
2 years ago
​
3 years ago
2 years ago
​
​
​
3 years ago
​
​
2 years ago
3 years ago
​
​
​
​
​
2 years ago
​
​
3 years ago
2 years ago
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
3 years ago
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
2 years ago
2 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
3 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
2 years ago
3 years ago
2 years ago
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
2 years ago
3 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
3 years ago
2 years ago
3 years ago
​
2 years ago
3 years ago
​
2 years ago
3 years ago
​
​
​
2 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
2 years ago
2 years ago
3 years ago
​
​
2 years ago
3 years ago
3 years ago
2 years ago
​
​
​
​
​
​
3 years ago
2 years ago
3 years ago
​
​
2 years ago
2 years ago
3 years ago
​
​
3 years ago
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
3 years ago
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <template>
  2. <div class="mod-config">
  3. <!-- 工具申请界面-->
  4. <el-form label-position="top" :model="searchData">
  5. <el-row :gutter="18">
  6. <el-col :span="2">
  7. <el-form-item label="项目编号">
  8. <el-input v-model="searchData.projectId" clearable />
  9. </el-form-item>
  10. </el-col>
  11. <el-col :span="2">
  12. <el-form-item label="项目类型">
  13. <dict-data-select dict-type="project_info_type_db" filterable clearable :use-default-value="false" v-model="searchData.projectType"></dict-data-select>
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="2">
  17. <el-form-item label="项目负责人">
  18. <el-input v-model="searchData.projectOwnerName" clearable/>
  19. </el-form-item>
  20. </el-col>
  21. <el-col :span="4">
  22. <el-form-item label="项目名称">
  23. <el-input v-model="searchData.projectName" clearable/>
  24. </el-form-item>
  25. </el-col>
  26. <el-col :span="4">
  27. <el-form-item label=" ">
  28. <el-button plain type="primary" @click="initDataBtn" >查 询</el-button>
  29. <el-button type="primary" @click="applyModel">刀模申请</el-button>
  30. </el-form-item>
  31. </el-col>
  32. </el-row>
  33. </el-form>
  34. <el-table
  35. :data="dataList"
  36. :height="height"
  37. border
  38. @selection-change="selectionChangeHandle"
  39. v-loading="dataListLoading"
  40. style="width: 100%; ">
  41. <el-table-column
  42. type="selection"
  43. align="center"
  44. width="30">
  45. </el-table-column>
  46. <el-table-column
  47. v-for="(item,index) in columnList1" :key="index"
  48. :sortable="item.columnSortable"
  49. :prop="item.columnProp"
  50. :header-align="item.headerAlign"
  51. :show-overflow-tooltip="item.showOverflowTooltip"
  52. :align="item.align"
  53. :fixed="item.fixed==''?false:item.fixed"
  54. :min-width="item.columnWidth"
  55. :label="item.columnLabel">
  56. <template slot-scope="scope">
  57. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  58. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  59. style="width: 100px; height: 80px"/></span>
  60. </template>
  61. </el-table-column>
  62. <!-- <el-table-column-->
  63. <!-- header-align="center"-->
  64. <!-- align="center"-->
  65. <!-- width="150"-->
  66. <!-- fixed="right"-->
  67. <!-- label="操作">-->
  68. <!-- <template slot-scope="scope">-->
  69. <!-- <a type="text" size="small" @click="updateModel(scope.row)">修改</a>-->
  70. <!-- <a type="text" size="small" @click="deleteData(scope.row)">删除</a>-->
  71. <!-- </template>-->
  72. <!-- </el-table-column>-->
  73. </el-table>
  74. <el-pagination
  75. @size-change="sizeChangeHandle"
  76. @current-change="currentChangeHandle"
  77. :current-page="pageIndex"
  78. :page-sizes="[20, 50, 100, 1000]"
  79. :page-size="pageSize"
  80. :total="totalPage"
  81. layout="total, sizes, prev, pager, next, jumper">
  82. </el-pagination>
  83. <el-dialog
  84. width="800px" v-drag
  85. :title="'刀模申请'"
  86. :close-on-click-modal="false"
  87. :visible.sync="visible">
  88. <el-form :inline="true" label-position="top" label-width="100px" >
  89. <el-form-item :label="'申请编号'">
  90. <el-input v-model="dataForm.applyNo" style="width: 130px" disabled></el-input>
  91. </el-form-item>
  92. <el-form-item :label="'申请总数'">
  93. <el-input v-model="dataForm.applySumQty" style="width: 130px" disabled></el-input>
  94. </el-form-item>
  95. <el-form-item :label="'总成本'">
  96. <el-input v-model="dataForm.totalCost" style="width: 130px" disabled></el-input>
  97. </el-form-item>
  98. <el-form-item :label="'申请人'" required="required">
  99. <el-input v-model="dataForm.applyBy" style="width: 130px" ></el-input>
  100. </el-form-item>
  101. <el-form-item :label="'申请日期'" required="required">
  102. <el-date-picker
  103. value-format="yyyy-MM-dd"
  104. style="width: 100%"
  105. v-model="dataForm.applyDate"
  106. type="date"
  107. placeholder="结束日期">
  108. </el-date-picker>
  109. </el-form-item>
  110. <el-form-item label="部门" required="required">
  111. <dict-data-select :site="$store.state.user.site" v-model="dataForm.department" dict-type="tool_application_department" style="width: 130px"></dict-data-select>
  112. </el-form-item>
  113. <el-form-item required="required">
  114. <span slot="label" style="" @click="getBaseList(103,1)"><a herf="#">报价员</a></span>
  115. <el-input v-model="dataForm.quoterName" ref="quoterName" placeholder="请选择人员" readonly style="width: 130px" ></el-input>
  116. </el-form-item>
  117. <el-form-item required="required">
  118. <span slot="label" style="" @click="getBaseList(103,2)"><a herf="#">TP</a></span>
  119. <el-input v-model="dataForm.tpName" ref="tpName" placeholder="请选择人员" readonly style="width: 130px" ></el-input>
  120. </el-form-item>
  121. <el-form-item required="required">
  122. <span slot="label" style="" @click="getBaseList(103,3)"><a herf="#">采购员</a></span>
  123. <el-input v-model="dataForm.purchaserName" ref="purchaserName" placeholder="请选择人员" readonly style="width: 130px" ></el-input>
  124. </el-form-item>
  125. <el-form-item label=" " >
  126. <el-checkbox v-model="jumpFlag">跳转至申请记录</el-checkbox>
  127. </el-form-item>
  128. </el-form>
  129. <el-form :inline="true" label-position="top" label-width="100px" >
  130. <el-form-item :label="'申请原因'">
  131. <!-- <el-input v-model="dataForm.applyReason" style="width: 770px" ></el-input>-->
  132. <el-input type="textarea" style="width: 770px" resize="none" :autosize="{minRows: 3, maxRows: 3}"
  133. v-model="dataForm.applyReason"/>
  134. </el-form-item>
  135. </el-form>
  136. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 60px">
  137. <el-form-item :label="'备注'">
  138. <!-- <el-input v-model="dataForm.remark" style="width: 770px" ></el-input>-->
  139. <el-input type="textarea" style="width: 770px" resize="none" :autosize="{minRows: 3, maxRows: 3}"
  140. v-model="dataForm.remark"/>
  141. </el-form-item>
  142. </el-form>
  143. <div class="rq" style="margin-top: 60px">
  144. <el-table
  145. height="250"
  146. :data="toolData"
  147. border
  148. ref="toolTable"
  149. v-loading="dataListLoading"
  150. style="width: 100%;">
  151. <el-table-column label="项目号" width="90" prop="projectId" show-overflow-tooltip/>
  152. <el-table-column label="工具编码" width="100" prop="toolId" show-overflow-tooltip/>
  153. <el-table-column label="工具描述" width="120" prop="toolDescription" show-overflow-tooltip/>
  154. <el-table-column label="工具数量" width="60" prop="toolQty" show-overflow-tooltip/>
  155. <el-table-column label="申请数量" width="70" prop="applyQty" show-overflow-tooltip>
  156. <template slot-scope="scope">
  157. <el-input v-model="scope.row.applyQty" type="number" @change="changeSum(scope.row)" placeholder="请输入数量" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')"
  158. style="width:98%"></el-input>
  159. </template>
  160. </el-table-column>
  161. <el-table-column label="工具成本" width="70" prop="standardCost" show-overflow-tooltip>
  162. <template slot-scope="scope">
  163. <el-input v-model="scope.row.standardCost" type="number" @change="changeSum(scope.row)" placeholder="请输入数量"
  164. style="width:98%"></el-input>
  165. </template>
  166. </el-table-column>
  167. <el-table-column label="物料编码" width="100" prop="partNo" show-overflow-tooltip/>
  168. <el-table-column label="物料名称" width="160" prop="partName" show-overflow-tooltip/>
  169. <el-table-column label="Ifs料号" width="100" prop="finalPartNo" show-overflow-tooltip/>
  170. <el-table-column label="客户料号" width="100" prop="customerPartNo" show-overflow-tooltip/>
  171. <el-table-column label="工艺版本" width="80" prop="routingRevision" show-overflow-tooltip/>
  172. <el-table-column label="工艺类型" width="80" prop="routingType" show-overflow-tooltip/>
  173. <el-table-column label="替代编码" width="80" prop="alternativeNo" show-overflow-tooltip/>
  174. <el-table-column label="替代名称" width="80" prop="alternativeDescription" show-overflow-tooltip/>
  175. <el-table-column label="工序号" width="60" prop="operationNo" show-overflow-tooltip/>
  176. <el-table-column label="工序名称" width="80" prop="operationName" show-overflow-tooltip/>
  177. <!-- <el-table-column label="工具成本" width="60" prop="standardCost" show-overflow-tooltip/>-->
  178. <!-- <el-table-column label="单位报价成本" width="90" prop="quotationUnitCost" show-overflow-tooltip/>-->
  179. <!-- <el-table-column label="预计使用寿命" width="90" prop="expectedServiceLife" show-overflow-tooltip/>-->
  180. </el-table>
  181. </div>
  182. <span slot="footer" class="dialog-footer">
  183. <el-button type="primary" @click="saveData()">{{'保存'}}</el-button>
  184. <el-button type="primary" @click="visible = false">{{'取消'}}</el-button>
  185. </span>
  186. </el-dialog>
  187. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  188. <ChooseUser ref="userList" @getBaseData="getUserData"></ChooseUser>
  189. </div>
  190. </template>
  191. <script>
  192. import {projectInfoForToolApply,
  193. getProjectPartToolForApply,
  194. saveProjectToolApply,
  195. } from "@/api/tool/toolApply.js"
  196. import Chooselist from '@/views/modules/common/Chooselist'
  197. import DictDataSelect from "../sys/dict-data-select.vue"
  198. import ChooseUser from '@/views/modules/common/ChooseUser'
  199. export default {
  200. components: {
  201. Chooselist, DictDataSelect,ChooseUser,
  202. },
  203. data() {
  204. return {
  205. height: 200,
  206. dataList: [],
  207. searchFlag:false,
  208. // 搜索条件对象
  209. searchData:{
  210. page: 1,
  211. limit: 100,
  212. site:this.$store.state.user.site,
  213. projectId:'',
  214. projectType:'',
  215. projectOwnerName:'',
  216. projectName:'',
  217. userName:this.$store.state.user.name,
  218. },
  219. exportList:[],
  220. pageIndex: 1,
  221. pageSize: 100,
  222. totalPage: 0,
  223. visible:false,
  224. dataListLoading: false,
  225. currentRow:'',
  226. columnList1: [
  227. {
  228. userId: this.$store.state.user.name,
  229. functionId: 106001001,
  230. serialNumber: '106001001Table1ProjectId',
  231. tableId: "106001001Table1",
  232. tableName: "项目信息主表",
  233. columnProp: "projectId",
  234. headerAlign: "center",
  235. align: "center",
  236. columnLabel: "项目号",
  237. columnHidden: false,
  238. columnImage: false,
  239. columnSortable: false,
  240. sortLv: 0,
  241. status: true,
  242. fixed: '',
  243. columnWidth: 100
  244. },
  245. {
  246. userId: this.$store.state.user.name,
  247. functionId: 106001001,
  248. serialNumber: '106001001Table1ProjectType',
  249. tableId: "106001001Table1",
  250. tableName: "项目信息主表",
  251. columnProp: "projectType",
  252. headerAlign: "center",
  253. align: "left",
  254. columnLabel: "项目类型",
  255. columnHidden: false,
  256. columnImage: false,
  257. columnSortable: false,
  258. sortLv: 0,
  259. status: true,
  260. fixed: '',
  261. columnWidth: 100
  262. },
  263. {
  264. userId: this.$store.state.user.name,
  265. functionId: 106001001,
  266. serialNumber: '106001001Table1ProjectName',
  267. tableId: "106001001Table1",
  268. tableName: "项目信息主表",
  269. columnProp: "projectName",
  270. headerAlign: "center",
  271. align: "left",
  272. columnLabel: "项目名称",
  273. columnHidden: false,
  274. columnImage: false,
  275. columnSortable: false,
  276. sortLv: 0,
  277. status: true,
  278. fixed: '',
  279. columnWidth: 200
  280. },
  281. {
  282. userId: this.$store.state.user.name,
  283. functionId: 106001001,
  284. serialNumber: '106001001Table1Status',
  285. tableId: "106001001Table1",
  286. tableName: "项目信息主表",
  287. columnProp: "status",
  288. headerAlign: "center",
  289. align: "left",
  290. columnLabel: "项目状态",
  291. columnHidden: false,
  292. columnImage: false,
  293. columnSortable: false,
  294. sortLv: 0,
  295. status: true,
  296. fixed: '',
  297. columnWidth: 100
  298. },
  299. {
  300. userId: this.$store.state.user.name,
  301. functionId: 106001001,
  302. serialNumber: '106001001Table1Priority',
  303. tableId: "106001001Table1",
  304. tableName: "项目信息主表",
  305. columnProp: "priorityDesc",
  306. headerAlign: "center",
  307. align: "left",
  308. columnLabel: "优先级",
  309. columnHidden: false,
  310. columnImage: false,
  311. columnSortable: false,
  312. sortLv: 0,
  313. status: true,
  314. fixed: '',
  315. columnWidth: 100
  316. },
  317. // {
  318. // userId: this.$store.state.user.name,
  319. // functionId: 106001001,
  320. // serialNumber: '106001001Table1BuNo',
  321. // tableId: "106001001Table1",
  322. // tableName: "项目信息主表",
  323. // columnProp: "buNo",
  324. // headerAlign: "center",
  325. // align: "left",
  326. // columnLabel: "BU编码",
  327. // columnHidden: false,
  328. // columnImage: false,
  329. // columnSortable: false,
  330. // sortLv: 0,
  331. // status: true,
  332. // fixed: '',
  333. // columnWidth: 100
  334. // },
  335. // {
  336. // userId: this.$store.state.user.name,
  337. // functionId: 106001001,
  338. // serialNumber: '106001001Table1BuDesc',
  339. // tableId: "106001001Table1",
  340. // tableName: "项目信息主表",
  341. // columnProp: "buDesc",
  342. // headerAlign: "center",
  343. // align: "left",
  344. // columnLabel: "BU名称",
  345. // columnHidden: false,
  346. // columnImage: false,
  347. // columnSortable: false,
  348. // sortLv: 0,
  349. // status: true,
  350. // fixed: '',
  351. // columnWidth: 100
  352. // },
  353. {
  354. userId: this.$store.state.user.name,
  355. functionId: 106001001,
  356. serialNumber: '106001001Table1ProjectOwnerName',
  357. tableId: "106001001Table1",
  358. tableName: "项目信息主表",
  359. columnProp: "projectOwnerName",
  360. headerAlign: "center",
  361. align: "left",
  362. columnLabel: "项目负责人",
  363. columnHidden: false,
  364. columnImage: false,
  365. columnSortable: false,
  366. sortLv: 0,
  367. status: true,
  368. fixed: '',
  369. columnWidth: 100
  370. },
  371. {
  372. userId: this.$store.state.user.name,
  373. functionId: 106001001,
  374. serialNumber: '106001001Table1ProjectSource',
  375. tableId: "106001001Table1",
  376. tableName: "项目信息主表",
  377. columnProp: "projectSourceDesc",
  378. headerAlign: "center",
  379. align: "left",
  380. columnLabel: "项目来源",
  381. columnHidden: false,
  382. columnImage: false,
  383. columnSortable: false,
  384. sortLv: 0,
  385. status: true,
  386. fixed: '',
  387. columnWidth: 100
  388. },
  389. {
  390. userId: this.$store.state.user.name,
  391. functionId: 106001001,
  392. serialNumber: '106001001Table1CustomerId',
  393. tableId: "106001001Table1",
  394. tableName: "项目信息主表",
  395. columnProp: "customerId",
  396. headerAlign: "center",
  397. align: "left",
  398. columnLabel: "客户代码",
  399. columnHidden: false,
  400. columnImage: false,
  401. columnSortable: false,
  402. sortLv: 0,
  403. status: true,
  404. fixed: '',
  405. columnWidth: 100
  406. },
  407. {
  408. userId: this.$store.state.user.name,
  409. functionId: 106001001,
  410. serialNumber: '106001001Table1CustomerName',
  411. tableId: "106001001Table1",
  412. tableName: "项目信息主表",
  413. columnProp: "customerName",
  414. headerAlign: "center",
  415. align: "left",
  416. columnLabel: "客户名称",
  417. columnHidden: false,
  418. columnImage: false,
  419. columnSortable: false,
  420. sortLv: 0,
  421. status: true,
  422. fixed: '',
  423. columnWidth: 150
  424. },
  425. {
  426. userId: this.$store.state.user.name,
  427. functionId: 106001001,
  428. serialNumber: '106001001Table1CreateDate',
  429. tableId: "106001001Table1",
  430. tableName: "项目信息主表",
  431. columnProp: "createDate",
  432. headerAlign: "center",
  433. align: "left",
  434. columnLabel: "创建时间",
  435. columnHidden: false,
  436. columnImage: false,
  437. columnSortable: false,
  438. sortLv: 0,
  439. status: true,
  440. fixed: '',
  441. columnWidth: 120
  442. },
  443. {
  444. userId: this.$store.state.user.name,
  445. functionId: 106001001,
  446. serialNumber: '106001001Table1CreateBy',
  447. tableId: "106001001Table1",
  448. tableName: "项目信息主表",
  449. columnProp: "createBy",
  450. headerAlign: "center",
  451. align: "left",
  452. columnLabel: "创建人",
  453. columnHidden: false,
  454. columnImage: false,
  455. columnSortable: false,
  456. sortLv: 0,
  457. status: true,
  458. fixed: '',
  459. columnWidth: 80
  460. },
  461. {
  462. userId: this.$store.state.user.name,
  463. functionId: 106001001,
  464. serialNumber: '106001001Table1UpdateDate',
  465. tableId: "106001001Table1",
  466. tableName: "项目信息主表",
  467. columnProp: "updateDate",
  468. headerAlign: "center",
  469. align: "left",
  470. columnLabel: "修改时间",
  471. columnHidden: false,
  472. columnImage: false,
  473. columnSortable: false,
  474. sortLv: 0,
  475. status: true,
  476. fixed: '',
  477. columnWidth: 120
  478. },
  479. {
  480. userId: this.$store.state.user.name,
  481. functionId: 106001001,
  482. serialNumber: '106001001Table1UpdateBy',
  483. tableId: "106001001Table1",
  484. tableName: "项目信息主表",
  485. columnProp: "updateBy",
  486. headerAlign: "center",
  487. align: "left",
  488. columnLabel: "修改人",
  489. columnHidden: false,
  490. columnImage: false,
  491. columnSortable: false,
  492. sortLv: 0,
  493. status: true,
  494. fixed: '',
  495. columnWidth: 80
  496. },
  497. ],
  498. jumpFlag:true,
  499. dataForm:{
  500. site: '',
  501. applyNo: '',
  502. applyBy:'',
  503. applyDate:'',
  504. applySumQty:'',
  505. applyReason:'',
  506. remark:'',
  507. createBy:'',
  508. department:'',
  509. quoter: '',
  510. quoterName: '',
  511. tp: '',
  512. tpName: '',
  513. purchaser: '',
  514. totalCost:'',
  515. purchaserName: '',
  516. detailList:[],
  517. },
  518. toolData:[],
  519. dataListSelections:[],
  520. dataRole: {
  521. partTypeDesc: [
  522. {
  523. required: true,
  524. message: ' ',
  525. trigger: 'change'
  526. }
  527. ],
  528. partName: [
  529. {
  530. required: true,
  531. message: ' ',
  532. trigger: 'change'
  533. }
  534. ],
  535. },
  536. // 导出 start
  537. exportData: [],
  538. exportName: '项目物料'+this.dayjs().format('YYYYMMDDHHmmss'),
  539. exportHeader: ["项目物料"],
  540. exportFooter: [],
  541. // 导出 end
  542. }
  543. },
  544. mounted() {
  545. this.$nextTick(() => {
  546. this.height = window.innerHeight - 190;
  547. })
  548. },
  549. methods: {
  550. getUserList (type) {
  551. if(this.ifDisableFlag){
  552. return false
  553. }
  554. this.tagNo1 = type
  555. this.$nextTick(() => {
  556. let strVal = ''
  557. if(type==1) {
  558. strVal = this.dataForm.quoter
  559. }
  560. if(type==2) {
  561. strVal = this.dataForm.tp
  562. }
  563. if(type==3) {
  564. strVal = this.dataForm.purchaser
  565. }
  566. this.$refs.userList.init(this.searchData.site,'%%', strVal)
  567. })
  568. },
  569. /* 列表方法的回调 */
  570. getUserData (val) {
  571. if(this.tagNo1==1) {
  572. this.dataForm.quoter = val.username
  573. this.dataForm.quoterName = val.userDisplay
  574. this.$nextTick(() => {
  575. this.$triggerInputEvent(this.$refs.quoterName);
  576. });
  577. }
  578. if(this.tagNo1==2) {
  579. this.dataForm.tp = val.username
  580. this.dataForm.tpName = val.userDisplay
  581. this.$nextTick(() => {
  582. this.$triggerInputEvent(this.$refs.tpName);
  583. });
  584. }
  585. if(this.tagNo1==3) {
  586. this.dataForm.purchaser = val.username
  587. this.dataForm.purchaserName = val.userDisplay
  588. this.$nextTick(() => {
  589. this.$triggerInputEvent(this.$refs.purchaserName);
  590. });
  591. }
  592. },
  593. // 获取基础数据列表S
  594. getBaseList (val, type) {
  595. this.tagNo = val
  596. this.tagNo1 = type
  597. this.$nextTick(() => {
  598. let strVal = ''
  599. if (val === 103) {
  600. if(type==1) {
  601. strVal = this.dataForm.quoter
  602. }
  603. if(type==2) {
  604. strVal = this.dataForm.tp
  605. }
  606. if(type==3) {
  607. strVal = this.dataForm.purchaser
  608. }
  609. }
  610. this.$refs.baseList.init(val, strVal)
  611. })
  612. },
  613. /* 列表方法的回调 */
  614. getBaseData (val) {
  615. if (this.tagNo === 103) {
  616. if(this.tagNo1==1) {
  617. this.dataForm.quoter = val.username
  618. this.dataForm.quoterName = val.user_display
  619. this.$nextTick(() => {
  620. this.$triggerInputEvent(this.$refs.quoterName);
  621. });
  622. }
  623. if(this.tagNo1==2) {
  624. this.dataForm.tp = val.username
  625. this.dataForm.tpName = val.user_display
  626. this.$nextTick(() => {
  627. this.$triggerInputEvent(this.$refs.tpName);
  628. });
  629. }
  630. if(this.tagNo1==3) {
  631. this.dataForm.purchaser = val.username
  632. this.dataForm.purchaserName = val.user_display
  633. this.$nextTick(() => {
  634. this.$triggerInputEvent(this.$refs.purchaserName);
  635. });
  636. }
  637. }
  638. },
  639. selectionChangeHandle (val) {
  640. this.dataListSelections = val
  641. },
  642. // 每页数
  643. sizeChangeHandle (val) {
  644. this.pageSize = val
  645. this.pageIndex = 1
  646. this.search()
  647. },
  648. // 当前页
  649. currentChangeHandle (val) {
  650. this.pageIndex = val
  651. this.search()
  652. },
  653. initDataBtn(){
  654. this.initData();
  655. },
  656. // 初始化数据
  657. initData(){
  658. this.searchData.limit = this.pageSize
  659. this.searchData.page = this.pageIndex
  660. projectInfoForToolApply(this.searchData).then(({data}) => {
  661. if (data.code == 0) {
  662. this.dataList = data.page.list
  663. this.pageIndex = data.page.currPage
  664. this.pageSize = data.page.pageSize
  665. this.totalPage = data.page.totalCount
  666. }
  667. this.dataListLoading = false
  668. })
  669. },
  670. applyModel() {
  671. if(this.dataListSelections.length===0){
  672. this.$alert('请选择项目!', '错误', {
  673. confirmButtonText: '确定'
  674. })
  675. return false;
  676. }
  677. getProjectPartToolForApply(this.dataListSelections).then(({data}) => {
  678. if (data.code == 0) {
  679. this.toolData=data.rows
  680. }
  681. })
  682. this.dataForm={
  683. site: this.$store.state.user.site,
  684. applyNo: '',
  685. applyBy:this.$store.state.user.name,
  686. applyDate:new Date(),
  687. applySumQty:0,
  688. applyReason:'',
  689. remark:'',
  690. createBy:this.$store.state.user.name,
  691. department: '',
  692. quoter: '',
  693. quoterName: '',
  694. tp: '',
  695. tpName: '',
  696. purchaser: '',
  697. totalCost: '',
  698. purchaserName: '',
  699. detailList:[],
  700. };
  701. this.visible=true;
  702. this.jumpFlag=true;
  703. },
  704. changeSum(row){
  705. if(row.standardCost<0||row.standardCost==null||row.standardCost==''){
  706. row.standardCost=''
  707. this.$alert('成本不能为负数或者不填', '错误', {
  708. confirmButtonText: '确定'
  709. })
  710. }
  711. this.dataForm.applySumQty =0
  712. this.dataForm.totalCost =0
  713. for (const item of this.toolData) {
  714. // 累加之前先确保值存在,并将 null 或 undefined 转换为0
  715. this.dataForm.applySumQty += Number(item.applyQty != null && item.applyQty !== '' ? item.applyQty : 0);
  716. this.dataForm.totalCost += Number(item.applyQty != null && item.applyQty !== '' ? item.applyQty*item.standardCost : 0);
  717. }
  718. },
  719. saveData(){
  720. // for (let i = 0; i < this.toolData.length; i++) {
  721. // if(this.toolData[i].toolQuantity<this.toolData[i].applyQty){
  722. // this.$alert( '工具:'+this.toolData[i].toolNo +' 实际申请数量大于表单工具数量!', '错误', {
  723. // confirmButtonText: '确定'
  724. // })
  725. // return false;
  726. // }
  727. // }
  728. if(this.dataForm.applySumQty===0){
  729. this.$alert('未填写申请数量!', '错误', {
  730. confirmButtonText: '确定'
  731. })
  732. return false;
  733. }
  734. if(this.dataForm.applyBy===''||this.dataForm.applyBy==null){
  735. this.$alert('未选择申请人!', '错误', {
  736. confirmButtonText: '确定'
  737. })
  738. return false;
  739. }
  740. if(this.dataForm.applyDate===''||this.dataForm.applyDate==null){
  741. this.$alert('未选择申请日期!', '错误', {
  742. confirmButtonText: '确定'
  743. })
  744. return false;
  745. }
  746. if(this.dataForm.department===''||this.dataForm.department==null){
  747. this.$alert('未选择部门!', '错误', {
  748. confirmButtonText: '确定'
  749. })
  750. return false;
  751. }
  752. if(this.dataForm.quoter===''||this.dataForm.quoter==null){
  753. this.$alert('未选择报价员!', '错误', {
  754. confirmButtonText: '确定'
  755. })
  756. return false;
  757. }
  758. if(this.dataForm.tp===''||this.dataForm.tp==null){
  759. this.$alert('未选择TP!', '错误', {
  760. confirmButtonText: '确定'
  761. })
  762. return false;
  763. }
  764. if(this.dataForm.purchaser===''||this.dataForm.purchaser==null){
  765. this.$alert('未选择采购员!', '错误', {
  766. confirmButtonText: '确定'
  767. })
  768. return false;
  769. }
  770. this.$confirm('确定要保存?', '提示', {
  771. confirmButtonText: '确定',
  772. cancelButtonText: '取消',
  773. type: 'warning'
  774. }).then(() => {
  775. for (let i = 0; i < this.toolData.length; i++) {
  776. if (this.toolData[i].applyQty===''||this.toolData[i].applyQty==null){
  777. this.toolData[i].applyQty=0
  778. }
  779. }
  780. this.dataForm.detailList=this.toolData.filter(item => item.applyQty > 0).filter(item => item.standardCost > 0)
  781. saveProjectToolApply(this.dataForm).then(({data}) => {
  782. if (data && data.code == 0) {
  783. this.visible=false;
  784. this.initDataBtn();
  785. this.$message({
  786. message: '操作成功',
  787. type: 'success',
  788. duration: 1500,
  789. onClose: () => {
  790. }
  791. })
  792. if(this.jumpFlag){
  793. this.$nextTick(function () {
  794. setTimeout(() => {
  795. let inData = {
  796. site: this.$store.state.user.site,
  797. applyNo: data.applyNo,
  798. username: this.$store.state.user.name
  799. };
  800. localStorage.setItem('ToolApplyData', JSON.stringify(inData))
  801. this.$router.push('tooling-searchToolApply')
  802. },500)
  803. })
  804. }
  805. } else {
  806. this.$alert(data.msg, '错误', {
  807. confirmButtonText: '确定'
  808. })
  809. }
  810. })
  811. }).catch(() => {
  812. })
  813. },
  814. //导出excel
  815. //导出excel
  816. async createExportData() {
  817. // this.searchData.limit = -1
  818. // this.searchData.page = 1
  819. // await projectInfoSearch(this.searchData).then(({data}) => {
  820. // this.exportList= data.page.list;
  821. // })
  822. //
  823. // return this.exportList;
  824. },
  825. startDownload() {
  826. // this.exportData = this.dataList
  827. },
  828. finishDownload() {
  829. },
  830. fields() {
  831. let json = "{"
  832. this.columnList1.forEach((item, index) => {
  833. if (index == this.columnList1.length - 1) {
  834. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  835. } else {
  836. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  837. }
  838. })
  839. json += "}"
  840. let s = eval("(" + json + ")")
  841. return s
  842. },
  843. },
  844. }
  845. </script>
  846. <style scoped>
  847. </style>