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.

2244 lines
76 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 查询条件 -->
  4. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  5. <el-form-item :label="'物料编码'">
  6. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'物料描述'">
  9. <el-input v-model="searchData.partDesc" clearable style="width: 210px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'物料规格型号'">
  12. <el-input v-model="searchData.spec" clearable style="width: 120px"></el-input>
  13. </el-form-item>
  14. <!-- <el-form-item :label="'ERP物料编码'">-->
  15. <!-- <el-input v-model="searchData.erpPartNo" clearable style="width: 120px"></el-input>-->
  16. <!-- </el-form-item>-->
  17. <el-form-item :label="'录入时间'">
  18. <el-date-picker
  19. style="width: 120px"
  20. v-model="searchData.startDate"
  21. type="date"
  22. value-format="yyyy-MM-dd"
  23. placeholder="选择日期">
  24. </el-date-picker>
  25. </el-form-item>
  26. <el-form-item style="margin-top: 23px;">
  27. <laber style="margin-left: 0px;font-size: 19px">&#10142</laber>
  28. </el-form-item>
  29. <el-form-item :label="' '">
  30. <el-date-picker
  31. style="width: 120px"
  32. v-model="searchData.endDate"
  33. type="date"
  34. value-format="yyyy-MM-dd"
  35. placeholder="选择日期">
  36. </el-date-picker>
  37. </el-form-item>
  38. <el-form-item :label="' '">
  39. <el-button @click="getDataList()">查询</el-button>
  40. <el-button type="primary" @click="addModal()">新增</el-button>
  41. <!-- <el-button type="primary" @click="delModal()">删除</el-button>-->
  42. <download-excel
  43. :fields="fields()"
  44. :data="exportData"
  45. type="xls"
  46. :name="exportName"
  47. :header="exportHeader"
  48. :footer="exportFooter"
  49. :fetch="createExportData"
  50. :before-generate="startDownload"
  51. :before-finish="finishDownload"
  52. worksheet="导出信息"
  53. class="el-button el-button--primary el-button--medium">
  54. {{ "导出" }}
  55. </download-excel>
  56. </el-form-item>
  57. </el-form>
  58. <!-- 物料列表 -->
  59. <el-table
  60. :height="height"
  61. :data="dataList"
  62. border
  63. ref="partTable"
  64. @row-click="partClickRow"
  65. @selection-change="selectionPart"
  66. @current-change="changeCurrentRow"
  67. v-loading="dataListLoading"
  68. style="width: 100%;">
  69. <el-table-column
  70. type="selection"
  71. header-align="center"
  72. align="center"
  73. :selectable="selectFlag"
  74. width="50">
  75. </el-table-column>
  76. <el-table-column
  77. v-for="(item,index) in columnList" :key="index"
  78. :sortable="item.columnSortable"
  79. :prop="item.columnProp"
  80. :header-align="item.headerAlign"
  81. :show-overflow-tooltip="item.showOverflowTooltip"
  82. :align="item.align"
  83. :fixed="item.fixed === ''?false:item.fixed"
  84. :min-width="item.columnWidth"
  85. :label="item.columnLabel">
  86. <template slot-scope="scope">
  87. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  88. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  89. </template>
  90. </el-table-column>
  91. <el-table-column
  92. fixed="right"
  93. header-align="center"
  94. align="center"
  95. width="100"
  96. label="操作">
  97. <template slot-scope="scope">
  98. <a type="text" size="small" @click="updateModal(scope.row)">编辑</a>
  99. </template>
  100. </el-table-column>
  101. </el-table>
  102. <selectDiv ref="selectDiv"></selectDiv>
  103. <!-- 分页插件 -->
  104. <el-pagination style="margin-top: 0px"
  105. @size-change="sizeChangeHandle"
  106. @current-change="currentChangeHandle"
  107. :current-page="pageIndex"
  108. :page-sizes="[20, 50, 100, 200, 500]"
  109. :page-size="pageSize"
  110. :total="totalPage"
  111. layout="total, sizes, prev, pager, next, jumper">
  112. </el-pagination>
  113. <!-- 物料新增/编辑模态框 -->
  114. <el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="960px">
  115. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  116. <el-form-item label="物料编码" prop="partNo" :rules="rules.partNo">
  117. <el-input v-model="modalData.partNo" clearable style="width: 120px"></el-input>
  118. </el-form-item>
  119. <el-form-item label="物料描述" prop="partDesc" :rules="rules.partDesc" style="margin-left: -10px">
  120. <el-input v-model="modalData.partDesc" clearable style="width: 330px"></el-input>
  121. </el-form-item>
  122. <el-form-item label="规格型号">
  123. <el-input v-model="modalData.spec" clearable style="width: 205px"></el-input>
  124. </el-form-item>
  125. <el-form-item label="物料类别" prop="partType" :rules="rules.partType">
  126. <el-select v-model="modalData.partType" style="width: 160px">
  127. <el-option label="Manufactured" value="Manufactured"></el-option>
  128. <el-option label="Manufactured recipe" value="Manufactured recipe"></el-option>
  129. <el-option label="Purchase raw" value="Purchase raw"></el-option>
  130. <el-option label="Purchased" value="Purchased"></el-option>
  131. </el-select>
  132. </el-form-item>
  133. <el-form-item label="是否在用" prop="active" :rules="rules.active">
  134. <el-select v-model="modalData.active" style="width: 60px">
  135. <el-option label="是" value="Y"></el-option>
  136. <el-option label="否" value="N"></el-option>
  137. </el-select>
  138. </el-form-item>
  139. </el-form>
  140. <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
  141. <el-form-item prop="codeDesc" :rules="rules.codeDesc">
  142. <span slot="label" @click="getBaseList(20)"><a herf="#">属性模板</a></span>
  143. <el-input v-model="modalData.codeNo" style="width: 120px"></el-input>
  144. <el-input v-model="modalData.codeDesc" disabled style="width: 330px"></el-input>
  145. </el-form-item>
  146. <el-form-item prop="umName" :rules="rules.umName">
  147. <span slot="label" @click="getBaseList(107)"><a herf="#">计量单位</a></span>
  148. <el-input v-model="modalData.umId" style="width: 120px"></el-input>
  149. <el-input v-model="modalData.umName" disabled style="width: 330px"></el-input>
  150. </el-form-item>
  151. </el-form>
  152. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  153. <el-form-item prop="familyName" :rules="rules.familyName">
  154. <span slot="label" @click="getBaseList(108)"><a herf="#">物料分类</a></span>
  155. <el-input v-model="modalData.familyId" style="width: 120px"></el-input>
  156. <el-input v-model="modalData.familyName" disabled style="width: 330px"></el-input>
  157. </el-form-item>
  158. <el-form-item prop="groupName" :rules="rules.groupName">
  159. <span slot="label" @click="getBaseList(109)"><a herf="#">物料分组</a></span>
  160. <el-input v-model="modalData.groupId" style="width: 120px"></el-input>
  161. <el-input v-model="modalData.groupName" disabled style="width: 330px"></el-input>
  162. </el-form-item>
  163. </el-form>
  164. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  165. <el-form-item>
  166. <span slot="label" @click="getBaseList(110)"><a herf="#">商品组1</a></span>
  167. <el-input v-model="modalData.productGroupId1" style="width: 120px"></el-input>
  168. <el-input v-model="modalData.productGroupName1" disabled style="width: 330px"></el-input>
  169. </el-form-item>
  170. <el-form-item>
  171. <span slot="label" @click="getBaseList(111)"><a herf="#">商品组2</a></span>
  172. <el-input v-model="modalData.productGroupId2" style="width: 120px"></el-input>
  173. <el-input v-model="modalData.productGroupName2" disabled style="width: 330px"></el-input>
  174. </el-form-item>
  175. </el-form>
  176. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  177. <el-form-item prop="productGroupId3" :rules="rules.productGroupId3">
  178. <span slot="label" @click="getBaseList(112)"><a herf="#">会计组</a></span>
  179. <el-input v-model="modalData.productGroupId3" style="width: 120px"></el-input>
  180. <el-input v-model="modalData.productGroupName3" disabled style="width: 330px"></el-input>
  181. </el-form-item>
  182. <el-form-item prop="productGroupId4" :rules="rules.productGroupId4">
  183. <span slot="label" @click="getBaseList(113)"><a herf="#">计划员</a></span>
  184. <el-input v-model="modalData.productGroupId4" style="width: 120px"></el-input>
  185. <el-input v-model="modalData.productGroupName4" disabled style="width: 330px"></el-input>
  186. </el-form-item>
  187. </el-form>
  188. <!-- <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">-->
  189. <!-- <el-form-item prop="manufacturerName" :rules="rules.manufacturerName">-->
  190. <!-- <span slot="label" @click="getBaseList(114)"><a herf="#">制造商</a></span>-->
  191. <!-- <el-input v-model="modalData.manufacturerName" style="width: 221px"></el-input>-->
  192. <!-- </el-form-item>-->
  193. <!-- </el-form>-->
  194. <!-- <el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">-->
  195. <!--&lt;!&ndash; <el-form-item prop="agentName" :rules="rules.agentName">&ndash;&gt;-->
  196. <!--&lt;!&ndash; <span slot="label" @click="getAgentList()"><a>代理商</a></span>&ndash;&gt;-->
  197. <!--&lt;!&ndash; <el-input v-model="modalData.agentName" style="width: 221px"></el-input>&ndash;&gt;-->
  198. <!--&lt;!&ndash; </el-form-item>&ndash;&gt;-->
  199. <!-- </el-form>-->
  200. <el-form :inline="true" label-position="top" :model="modalData" style="margin-left: 7px;margin-top: -5px;">
  201. <el-form-item label="备注">
  202. <el-input type="textarea" v-model="modalData.remark" :rows="3" resize='none' show-word-limit style="width: 921px;height: 60px"></el-input>
  203. </el-form-item>
  204. </el-form>
  205. <el-footer style="height:35px;margin-top: 55px;text-align:center">
  206. <el-button type="primary" @click="saveData()">保存</el-button>
  207. <el-button type="primary" @click="modalFlag = false">关闭</el-button>
  208. </el-footer>
  209. </el-dialog>
  210. <!-- 页签 -->
  211. <el-tabs v-model="activeTable" style="margin-top: 0px; width: 100%; min-height: 294px" type="border-card" @tab-click="tabClick" class="customer-tab">
  212. <!-- 物料属性页签 -->
  213. <el-tab-pane label="物料属性" name="part_item">
  214. <el-table
  215. :data="partItemList"
  216. :height="secondHeight"
  217. border
  218. v-loading="dataListLoading"
  219. style="width: 100%;">
  220. <el-table-column
  221. v-for="(item,index) in columnItemList" :key="index"
  222. :sortable="item.columnSortable"
  223. :prop="item.columnProp"
  224. :header-align="item.headerAlign"
  225. :show-overflow-tooltip="item.showOverflowTooltip"
  226. :align="item.align"
  227. :fixed="item.fixed==''?false:item.fixed"
  228. :min-width="item.columnWidth"
  229. :label="item.columnLabel">
  230. <template slot-scope="scope">
  231. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  232. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  233. </template>
  234. </el-table-column>
  235. <el-table-column
  236. header-align="center"
  237. align="center"
  238. width="150"
  239. fixed="right"
  240. label="操作">
  241. <template slot-scope="scope">
  242. <a type="text" size="small" @click="updateItemModal(scope.row)">编辑</a>
  243. </template>
  244. </el-table-column>
  245. </el-table>
  246. </el-tab-pane>
  247. <!-- 代理商页签 -->
  248. <el-tab-pane label="代理商" name="part_agent">
  249. <el-form label-position="top" style="margin-top: 5px; margin-left: 0px;">
  250. <el-form :inline="true" label-position="top" style="margin-top: 5px">
  251. <el-button type="primary" @click="savePartAgent()">新增</el-button>
  252. </el-form>
  253. </el-form>
  254. <el-table
  255. :data="partAgentList"
  256. :height="secondHeight"
  257. border
  258. style="width: 100%;">
  259. <el-table-column
  260. v-for="(item,index) in columnAgentList" :key="index"
  261. :sortable="item.columnSortable"
  262. :prop="item.columnProp"
  263. :header-align="item.headerAlign"
  264. :show-overflow-tooltip="item.showOverflowTooltip"
  265. :align="item.align"
  266. :fixed="item.fixed==''?false:item.fixed"
  267. :min-width="item.columnWidth"
  268. :label="item.columnLabel">
  269. <template slot-scope="scope">
  270. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  271. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  272. </template>
  273. </el-table-column>
  274. <el-table-column
  275. header-align="center"
  276. align="center"
  277. width="150"
  278. fixed="right"
  279. label="操作">
  280. <template slot-scope="scope">
  281. <a type="text" size="small" @click="deleteAgent2(scope.row)">删除</a>
  282. </template>
  283. </el-table-column>
  284. </el-table>
  285. </el-tab-pane>
  286. <!-- 文档页签 -->
  287. <el-tab-pane label="文档" name="part_file">
  288. <el-form label-position="top" style="margin-top: 5px; margin-left: 0px;">
  289. <el-form :inline="true" label-position="top" style="margin-top: 5px">
  290. <el-button type="primary" @click="uploadFile()">上传文件</el-button>
  291. </el-form>
  292. </el-form>
  293. <el-table
  294. :data="fileContentList"
  295. :height="secondHeight"
  296. border
  297. v-loading="dataListLoading"
  298. style="width: 100%; ">
  299. <el-table-column
  300. v-for="(item,index) in columnFileList" :key="index"
  301. :sortable="item.columnSortable"
  302. :prop="item.columnProp"
  303. :header-align="item.headerAlign"
  304. :show-overflow-tooltip="item.showOverflowTooltip"
  305. :align="item.align"
  306. :fixed="item.fixed==''?false:item.fixed"
  307. :min-width="item.columnWidth"
  308. :label="item.columnLabel">
  309. <template slot-scope="scope">
  310. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  311. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  312. </template>
  313. </el-table-column>
  314. <el-table-column
  315. fixed="right"
  316. header-align="center"
  317. align="center"
  318. width="100"
  319. label="操作">
  320. <template slot-scope="scope">
  321. <a @click="downloadFile(scope.row)">下载</a>
  322. <a type="text" size="small" @click="deleteFile(scope.row)">删除</a>
  323. </template>
  324. </el-table-column>
  325. </el-table>
  326. </el-tab-pane>
  327. </el-tabs>
  328. <!-- 物料属性值编辑模态框 -->
  329. <el-dialog title="属性项目" :close-on-click-modal="false" v-drag :visible.sync="itemModalFlag" width="310px">
  330. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  331. <el-form-item label="属性编码:">
  332. <el-input v-model="itemData.propertiesItemNo" disabled style="width: 120px"></el-input>
  333. </el-form-item>
  334. <el-form-item label="属性名称:">
  335. <el-input v-model="itemData.itemDesc" disabled style="width: 120px"></el-input>
  336. </el-form-item>
  337. </el-form>
  338. <el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;">
  339. <el-form-item label="文本值:">
  340. <el-input v-if="!itemChooseFlag" v-model="itemData.textValue" :disabled="itemTextDisableFlag" type="text" style="width: 120px"></el-input>
  341. <el-select v-if="itemChooseFlag" v-model="itemData.textValue" :disabled="itemTextDisableFlag" style="width: 120px" placeholder="请选择">
  342. <el-option v-for="item in availableValueList" :key="index" :label="item.availableValue" :value="item.availableValue"></el-option>
  343. </el-select>
  344. </el-form-item>
  345. <el-form-item label="数字值:">
  346. <el-input v-if="!itemChooseFlag" v-model="itemData.numValue" :disabled="itemNumberDisableFlag" type="number" style="width: 120px"></el-input>
  347. <el-select v-if="itemChooseFlag" v-model="itemData.numValue" :disabled="itemNumberDisableFlag" style="width: 120px" placeholder="请选择">
  348. <el-option v-for="item in availableValueList" :key="index" :label="item.availableValue" :value="item.availableValue"></el-option>
  349. </el-select>
  350. </el-form-item>
  351. </el-form>
  352. <span slot="footer" class="dialog-footer">
  353. <el-button type="primary" @click="itemSaveData()">保存</el-button>
  354. <el-button type="primary" @click="itemModalFlag=false">关闭</el-button>
  355. </span>
  356. </el-dialog>
  357. <!-- &lt;!&ndash; 代理商模态框 &ndash;&gt;-->
  358. <!-- <el-dialog title="代理商清单" :close-on-click-modal="false" v-drag :visible.sync="agentModelFlag" width="520px">-->
  359. <!-- <div class="rq">-->
  360. <!-- <el-form :inline="true" label-position="top" :model="agentData">-->
  361. <!-- <el-form-item :label="'代理商编码'">-->
  362. <!-- <el-input v-model="agentData.agentId" clearable style="width: 120px"></el-input>-->
  363. <!-- </el-form-item>-->
  364. <!-- <el-form-item :label="'代理商名称'">-->
  365. <!-- <el-input v-model="agentData.agentName" clearable style="width: 120px"></el-input>-->
  366. <!-- </el-form-item>-->
  367. <!-- <el-form-item :label="' '">-->
  368. <!-- <el-button type="primary" @click="getAgentList()">查询</el-button>-->
  369. <!-- </el-form-item>-->
  370. <!-- </el-form>-->
  371. <!-- <el-table-->
  372. <!-- :height="300"-->
  373. <!-- :data="agentList"-->
  374. <!-- ref="agentTable"-->
  375. <!-- @row-click="agentClickRow"-->
  376. <!-- @selection-change="selectionAgent"-->
  377. <!-- :row-key="getRowKeys"-->
  378. <!-- border-->
  379. <!-- v-loading="dataListLoading"-->
  380. <!-- style="width: 100%;">-->
  381. <!-- <el-table-column-->
  382. <!-- type="selection"-->
  383. <!-- header-align="center"-->
  384. <!-- align="center"-->
  385. <!-- :reserve-selection="true"-->
  386. <!-- width="50">-->
  387. <!-- </el-table-column>-->
  388. <!-- <el-table-column-->
  389. <!-- v-for="(item,index) in agentColumnList" :key="index"-->
  390. <!-- :sortable="item.columnSortable"-->
  391. <!-- :prop="item.columnProp"-->
  392. <!-- :header-align="item.headerAlign"-->
  393. <!-- :show-overflow-tooltip="item.showOverflowTooltip"-->
  394. <!-- :align="item.align"-->
  395. <!-- :fixed="item.fixed==''?false:item.fixed"-->
  396. <!-- :min-width="item.columnWidth"-->
  397. <!-- :label="item.columnLabel">-->
  398. <!-- <template slot-scope="scope">-->
  399. <!-- <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>-->
  400. <!-- <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>-->
  401. <!-- </template>-->
  402. <!-- </el-table-column>-->
  403. <!-- </el-table>-->
  404. <!-- </div>-->
  405. <!-- <el-footer style="height:40px;margin-top: 20px;text-align:center">-->
  406. <!-- <el-button type="primary" @click="confirmAgent()">确认</el-button>-->
  407. <!-- <el-button type="primary" @click="agentModelFlag = false">关闭</el-button>-->
  408. <!-- </el-footer>-->
  409. <!-- </el-dialog>-->
  410. <!-- 代理商-> 快速新增 -->
  411. <el-dialog title="新增" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="agentModelFlag" width="900px">
  412. <div style="font-size: 12px">
  413. <el-form :inline="true" label-position="top" :model="agentData">
  414. <el-form-item :label="'代理商编码'">
  415. <el-input v-model="agentData.agentId" clearable style="width: 120px"></el-input>
  416. </el-form-item>
  417. <el-form-item :label="'代理商名称'">
  418. <el-input v-model="agentData.agentName" clearable style="width: 120px"></el-input>
  419. </el-form-item>
  420. <el-form-item :label="' '">
  421. <el-button type="primary" @click="getAgentList()">查询</el-button>
  422. </el-form-item>
  423. </el-form>
  424. </div>
  425. <el-container style="margin-top: 0px;">
  426. <el-main style="width: 350px; padding: 1px">
  427. <span style="font-size: 12px" >可选代理商:</span>
  428. <el-table
  429. height="400px"
  430. :data="agentList1"
  431. border
  432. ref="agentTable1"
  433. @row-click="agentClickRow1"
  434. @selection-change="selectionAgent1"
  435. highlight-current-row
  436. style="width: 100%">
  437. <el-table-column
  438. type="selection"
  439. header-align="center"
  440. align="center"
  441. :selectable="selectFlag"
  442. width="50">
  443. </el-table-column>
  444. <el-table-column
  445. prop="agentId"
  446. header-align="center"
  447. align="center"
  448. min-width="80"
  449. label="代理商编码">
  450. </el-table-column>
  451. <el-table-column
  452. prop="agentName"
  453. header-align="center"
  454. align="center"
  455. min-width="120"
  456. label="代理商名称">
  457. </el-table-column>
  458. </el-table>
  459. </el-main>
  460. <el-main style="width: 111px;padding: -1px">
  461. <div style="margin-top: 182px;margin-left: 18px">
  462. <el-button type="primary" @click="addAgent()">添加>></el-button>
  463. </div>
  464. <div style="margin-top: 15px;margin-left: 18px">
  465. <el-button type="primary" @click="deleteAgent()">删除<<</el-button>
  466. </div>
  467. </el-main>
  468. <el-main style="width: 350px;padding: 1px">
  469. <span style="font-size: 12px" >已有代理商:</span>
  470. <el-table
  471. height="400px"
  472. :data="agentList2"
  473. border
  474. ref="agentTable2"
  475. @row-click="agentClickRow2"
  476. @selection-change="selectionAgent2"
  477. highlight-current-row
  478. style="width: 100%">
  479. <el-table-column
  480. type="selection"
  481. header-align="center"
  482. align="center"
  483. :selectable="selectFlag"
  484. width="50">
  485. </el-table-column>
  486. <el-table-column
  487. prop="agentId"
  488. header-align="center"
  489. align="center"
  490. min-width="80"
  491. label="代理商编码">
  492. </el-table-column>
  493. <el-table-column
  494. prop="agentName"
  495. header-align="center"
  496. align="center"
  497. min-width="120"
  498. label="代理商名称">
  499. </el-table-column>
  500. </el-table>
  501. </el-main>
  502. </el-container>
  503. <el-footer style="height:40px;margin-top: 20px;text-align:center">
  504. <el-button type="primary" @click="agentModelFlag = false">关闭</el-button>
  505. </el-footer>
  506. </el-dialog>
  507. <!-- chooseList模态框 -->
  508. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  509. <!-- 上传文件的modal -->
  510. <partUploadFile ref="partUploadFile" @refreshPageTables="getFileContentData()" v-drag></partUploadFile>
  511. </div>
  512. </template>
  513. <script>
  514. import {
  515. partInformationSearch, // 物料信息列表查询
  516. partInformationSave, // 物料信息新增
  517. partInformationEdit, // 物料信息编辑
  518. partInformationDelete, // 物料信息删除
  519. getPartItem, // 查询物料属性
  520. savePartItemValue, // 编辑属性值
  521. getAgentList, // 获取代理商列表
  522. getPartAgent, // 获取物料代理商
  523. getAgentListBy, // 根据条件查询可选代理商
  524. addPartAgent, // 新增物料代理商
  525. deletePartAgent, // 删除物料代理商
  526. deleteAgent // 删除物料代理商(单删)
  527. } from '@/api/part/partInformation.js'
  528. import {
  529. getFileContentList, // 获取物料单附件列表
  530. deleteQuotationFile, // 文件删除
  531. downLoadQuotationFile // 文件下载
  532. } from '@/api/quotation/quotationInformation.js'
  533. import Chooselist from '@/views/modules/common/Chooselist'
  534. import partUploadFile from "./part_upload_file"
  535. export default {
  536. components: {
  537. Chooselist,
  538. partUploadFile
  539. },
  540. watch: {
  541. searchData: {
  542. deep: true,
  543. handler: function (newV, oldV) {
  544. this.searchData.partNo = this.searchData.partNo.toUpperCase()
  545. this.searchData.erpPartNo = this.searchData.erpPartNo.toUpperCase()
  546. }
  547. },
  548. modalData: {
  549. deep: true,
  550. handler: function (newV, oldV) {
  551. this.modalData.partNo = this.modalData.partNo.toUpperCase()
  552. this.modalData.erpPartNo = this.modalData.erpPartNo.toUpperCase()
  553. }
  554. }
  555. },
  556. data () {
  557. return {
  558. // 导出
  559. exportData: [],
  560. exportName: '物料档案管理' + this.dayjs().format('YYYYMMDDHHmmss'),
  561. exportHeader: ['物料档案管理'],
  562. exportFooter: [],
  563. resultList: [],
  564. // ======== 行高 ========
  565. height: 200,
  566. secondHeight: 200,
  567. // ======== 分页 ========
  568. pageIndex: 1,
  569. pageSize: 50,
  570. totalPage: 0,
  571. selectedDataNum: 0,
  572. // 条件查询
  573. searchData: {
  574. site: this.$store.state.user.site,
  575. partNo: '',
  576. erpPartNo: '',
  577. startDate: '',
  578. endDate: '',
  579. partDesc: '',
  580. spec: '',
  581. page: 1,
  582. limit: 10
  583. },
  584. // 其它
  585. dataListLoading: false,
  586. // 初始页签
  587. activeTable: 'part_item',
  588. // ======== 数据对象 ========
  589. modalData: {
  590. flag: '',
  591. title: '',
  592. site: this.$store.state.user.site,
  593. partNo: '',
  594. partDesc: '',
  595. spec: '',
  596. partTypeDb: '',
  597. partType: '',
  598. familyId: '',
  599. familyName: '',
  600. groupId: '',
  601. groupName: '',
  602. umId: '',
  603. umName: '',
  604. active: '',
  605. remark: '',
  606. supplierId: '',
  607. supplierName: '',
  608. productGroupId1: '',
  609. productGroupName1: '',
  610. productGroupId2: '',
  611. productGroupName2: '',
  612. productGroupId3: '',
  613. productGroupName3: '',
  614. productGroupId4: '',
  615. productGroupName4: '',
  616. erpPartNo: '',
  617. codeNo: '',
  618. codeDesc: '',
  619. manufacturerId: '',
  620. manufacturerName: '',
  621. createDate: '',
  622. createBy: '',
  623. updateDate: '',
  624. updateBy: '',
  625. agentId: '',
  626. agentName: ''
  627. },
  628. itemData:{
  629. site: '',
  630. partNo: '',
  631. propertiesItemNo: '',
  632. itemDesc: '',
  633. textValue: '',
  634. numValue: '',
  635. recordType: 'B'
  636. },
  637. agentData: {
  638. site: this.$store.state.user.site,
  639. agentId: '',
  640. agentName: '',
  641. },
  642. // ======== 数据列表 ========
  643. dataList: [],
  644. partItemList: [],
  645. partAgentList: [],
  646. fileContentList: [],
  647. availableValueList:[],
  648. agentList: [],
  649. agentSelections: [],
  650. agentSelections1: [],
  651. agentSelections2: [],
  652. agentList1: [],
  653. agentList2: [],
  654. // ======== 列表表头 ========
  655. columnList: [
  656. {
  657. userId: this.$store.state.user.name,
  658. functionId: 104001,
  659. serialNumber: '104001Table1PartNo',
  660. tableId: '104001Table1',
  661. tableName: '物料信息表',
  662. columnProp: 'partNo',
  663. headerAlign: 'center',
  664. align: 'left',
  665. columnLabel: '物料编码',
  666. columnHidden: false,
  667. columnImage: false,
  668. columnSortable: false,
  669. sortLv: 0,
  670. status: true,
  671. fixed: '',
  672. columnWidth: 120
  673. },
  674. // {
  675. // userId: this.$store.state.user.name,
  676. // functionId: 104001,
  677. // serialNumber: '104001Table1ERPPartNo',
  678. // tableId: '104001Table1',
  679. // tableName: '物料信息表',
  680. // columnProp: 'erpPartNo',
  681. // headerAlign: 'center',
  682. // align: 'left',
  683. // columnLabel: 'ERP物料编码',
  684. // columnHidden: false,
  685. // columnImage: false,
  686. // columnSortable: false,
  687. // sortLv: 0,
  688. // status: true,
  689. // fixed: '',
  690. // columnWidth: 120
  691. // },
  692. {
  693. userId: this.$store.state.user.name,
  694. functionId: 104001,
  695. serialNumber: '104001Table1PartDesc',
  696. tableId: '104001Table1',
  697. tableName: '物料信息表',
  698. columnProp: 'partDesc',
  699. headerAlign: 'center',
  700. align: 'left',
  701. columnLabel: '物料描述',
  702. columnHidden: false,
  703. columnImage: false,
  704. columnSortable: false,
  705. sortLv: 0,
  706. status: true,
  707. fixed: '',
  708. columnWidth: 120
  709. },
  710. {
  711. userId: this.$store.state.user.name,
  712. functionId: 104001,
  713. serialNumber: '104001Table1Spec',
  714. tableId: '104001Table1',
  715. tableName: '物料信息表',
  716. columnProp: 'spec',
  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: 120
  727. },
  728. {
  729. userId: this.$store.state.user.name,
  730. functionId: 104001,
  731. serialNumber: '104001Table1UmId',
  732. tableId: '104001Table1',
  733. tableName: '物料信息表',
  734. columnProp: 'umName',
  735. headerAlign: 'center',
  736. align: 'left',
  737. columnLabel: '计量单位',
  738. columnHidden: false,
  739. columnImage: false,
  740. columnSortable: false,
  741. sortLv: 0,
  742. status: true,
  743. fixed: '',
  744. columnWidth: 60
  745. },
  746. {
  747. userId: this.$store.state.user.name,
  748. functionId: 104001,
  749. serialNumber: '104001Table1PartType',
  750. tableId: '104001Table1',
  751. tableName: '物料信息表',
  752. columnProp: 'partType',
  753. headerAlign: 'center',
  754. align: 'left',
  755. columnLabel: '物料类别',
  756. columnHidden: false,
  757. columnImage: false,
  758. columnSortable: false,
  759. sortLv: 0,
  760. status: true,
  761. fixed: '',
  762. columnWidth: 80
  763. },
  764. {
  765. userId: this.$store.state.user.name,
  766. functionId: 104001,
  767. serialNumber: '104001Table1FamilyName',
  768. tableId: '104001Table1',
  769. tableName: '物料信息表',
  770. columnProp: 'familyName',
  771. headerAlign: 'center',
  772. align: 'left',
  773. columnLabel: '物料分类',
  774. columnHidden: false,
  775. columnImage: false,
  776. columnSortable: false,
  777. sortLv: 0,
  778. status: true,
  779. fixed: '',
  780. columnWidth: 80
  781. },
  782. {
  783. userId: this.$store.state.user.name,
  784. functionId: 104001,
  785. serialNumber: '104001Table1GroupName',
  786. tableId: '104001Table1',
  787. tableName: '物料信息表',
  788. columnProp: 'groupName',
  789. headerAlign: 'center',
  790. align: 'left',
  791. columnLabel: '物料分组',
  792. columnHidden: false,
  793. columnImage: false,
  794. columnSortable: false,
  795. sortLv: 0,
  796. status: true,
  797. fixed: '',
  798. columnWidth: 80
  799. },
  800. {
  801. userId: this.$store.state.user.name,
  802. functionId: 104001,
  803. serialNumber: '104001Table1OtherGroup1',
  804. tableId: '104001Table1',
  805. tableName: '物料信息表',
  806. columnProp: 'productGroupName1',
  807. headerAlign: 'center',
  808. align: 'left',
  809. columnLabel: '商品组1',
  810. columnHidden: false,
  811. columnImage: false,
  812. columnSortable: false,
  813. sortLv: 0,
  814. status: true,
  815. fixed: '',
  816. columnWidth: 80
  817. },
  818. {
  819. userId: this.$store.state.user.name,
  820. functionId: 104001,
  821. serialNumber: '104001Table1OtherGroup2',
  822. tableId: '104001Table1',
  823. tableName: '物料信息表',
  824. columnProp: 'productGroupName2',
  825. headerAlign: 'center',
  826. align: 'left',
  827. columnLabel: '商品组2',
  828. columnHidden: false,
  829. columnImage: false,
  830. columnSortable: false,
  831. sortLv: 0,
  832. status: true,
  833. fixed: '',
  834. columnWidth: 80
  835. },
  836. {
  837. userId: this.$store.state.user.name,
  838. functionId: 104001,
  839. serialNumber: '104001Table1OtherGroup3',
  840. tableId: '104001Table1',
  841. tableName: '物料信息表',
  842. columnProp: 'productGroupName3',
  843. headerAlign: 'center',
  844. align: 'left',
  845. columnLabel: '会计组',
  846. columnHidden: false,
  847. columnImage: false,
  848. columnSortable: false,
  849. sortLv: 0,
  850. status: true,
  851. fixed: '',
  852. columnWidth: 80
  853. },
  854. {
  855. userId: this.$store.state.user.name,
  856. functionId: 104001,
  857. serialNumber: '104001Table1OtherGroup4',
  858. tableId: '104001Table1',
  859. tableName: '物料信息表',
  860. columnProp: 'productGroupName4',
  861. headerAlign: 'center',
  862. align: 'left',
  863. columnLabel: '计划员',
  864. columnHidden: false,
  865. columnImage: false,
  866. columnSortable: false,
  867. sortLv: 0,
  868. status: true,
  869. fixed: '',
  870. columnWidth: 80
  871. },
  872. {
  873. userId: this.$store.state.user.name,
  874. functionId: 104001,
  875. serialNumber: '104001Table1ItemNo',
  876. tableId: '104001Table1',
  877. tableName: '物料信息表',
  878. columnProp: 'codeDesc',
  879. headerAlign: 'center',
  880. align: 'left',
  881. columnLabel: '属性模板',
  882. columnHidden: false,
  883. columnImage: false,
  884. columnSortable: false,
  885. sortLv: 0,
  886. status: true,
  887. fixed: '',
  888. columnWidth: 100
  889. },
  890. {
  891. userId: this.$store.state.user.name,
  892. functionId: 104001,
  893. serialNumber: '104001Table1ManufacturerName',
  894. tableId: '104001Table1',
  895. tableName: '物料信息表',
  896. columnProp: 'manufacturerName',
  897. headerAlign: 'center',
  898. align: 'left',
  899. columnLabel: '制造商',
  900. columnHidden: false,
  901. columnImage: false,
  902. columnSortable: false,
  903. sortLv: 0,
  904. status: true,
  905. fixed: '',
  906. columnWidth: 160
  907. },
  908. {
  909. userId: this.$store.state.user.name,
  910. functionId: 104001,
  911. serialNumber: '104001Table1AgentName',
  912. tableId: '104001Table1',
  913. tableName: '物料信息表',
  914. columnProp: 'agentName',
  915. headerAlign: 'center',
  916. align: 'left',
  917. columnLabel: '代理商',
  918. columnHidden: false,
  919. columnImage: false,
  920. columnSortable: false,
  921. sortLv: 0,
  922. status: true,
  923. fixed: '',
  924. columnWidth: 160
  925. },
  926. {
  927. userId: this.$store.state.user.name,
  928. functionId: 104001,
  929. serialNumber: '104001Table1Remark',
  930. tableId: '104001Table1',
  931. tableName: '物料信息表',
  932. columnProp: 'remark',
  933. headerAlign: 'center',
  934. align: 'left',
  935. columnLabel: '备注',
  936. columnHidden: false,
  937. columnImage: false,
  938. columnSortable: false,
  939. sortLv: 0,
  940. status: true,
  941. fixed: '',
  942. columnWidth: 160
  943. },
  944. {
  945. userId: this.$store.state.user.name,
  946. functionId: 104001,
  947. serialNumber: '104001Table1Active',
  948. tableId: '104001Table1',
  949. tableName: '物料信息表',
  950. columnProp: 'active',
  951. headerAlign: 'center',
  952. align: 'center',
  953. columnLabel: '是否在用',
  954. columnHidden: false,
  955. columnImage: false,
  956. columnSortable: false,
  957. sortLv: 0,
  958. status: true,
  959. fixed: '',
  960. columnWidth: 60
  961. },
  962. {
  963. userId: this.$store.state.user.name,
  964. functionId: 104001,
  965. serialNumber: '104001Table1CreateDate',
  966. tableId: '104001Table1',
  967. tableName: '物料信息表',
  968. columnProp: 'createDate',
  969. headerAlign: 'center',
  970. align: 'center',
  971. columnLabel: '创建时间',
  972. columnHidden: false,
  973. columnImage: false,
  974. columnSortable: false,
  975. sortLv: 0,
  976. status: true,
  977. fixed: '',
  978. columnWidth: 160
  979. },
  980. {
  981. userId: this.$store.state.user.name,
  982. functionId: 104001,
  983. serialNumber: '104001Table1CreateBy',
  984. tableId: '104001Table1',
  985. tableName: '物料信息表',
  986. columnProp: 'createBy',
  987. headerAlign: 'center',
  988. align: 'center',
  989. columnLabel: '创建人',
  990. columnHidden: false,
  991. columnImage: false,
  992. columnSortable: false,
  993. sortLv: 0,
  994. status: true,
  995. fixed: '',
  996. columnWidth: 80
  997. },
  998. {
  999. userId: this.$store.state.user.name,
  1000. functionId: 104001,
  1001. serialNumber: '104001Table1UpdateDate',
  1002. tableId: '104001Table1',
  1003. tableName: '物料信息表',
  1004. columnProp: 'updateDate',
  1005. headerAlign: 'center',
  1006. align: 'center',
  1007. columnLabel: '更新时间',
  1008. columnHidden: false,
  1009. columnImage: false,
  1010. columnSortable: false,
  1011. sortLv: 0,
  1012. status: true,
  1013. fixed: '',
  1014. columnWidth: 160
  1015. },
  1016. {
  1017. userId: this.$store.state.user.name,
  1018. functionId: 104001,
  1019. serialNumber: '104001Table1UpdateBy',
  1020. tableId: '104001Table1',
  1021. tableName: '物料信息表',
  1022. columnProp: 'updateBy',
  1023. headerAlign: 'center',
  1024. align: 'center',
  1025. columnLabel: '更新人',
  1026. columnHidden: false,
  1027. columnImage: false,
  1028. columnSortable: false,
  1029. sortLv: 0,
  1030. status: true,
  1031. fixed: '',
  1032. columnWidth: 80
  1033. }
  1034. ],
  1035. columnItemList: [
  1036. {
  1037. userId: this.$store.state.user.name,
  1038. functionId: 104001,
  1039. serialNumber: '104001Table2PropertiesItemID',
  1040. tableId: "104001Table2",
  1041. tableName: "物料属性表",
  1042. columnProp: 'propertiesItemNo',
  1043. headerAlign: "center",
  1044. align: "center",
  1045. columnLabel: '属性编码',
  1046. columnHidden: false,
  1047. columnImage: false,
  1048. columnSortable: true,
  1049. sortLv: 0,
  1050. status: true,
  1051. fixed: '',
  1052. columnWidth: 90,
  1053. },
  1054. {
  1055. userId: this.$store.state.user.name,
  1056. functionId: 104001,
  1057. serialNumber: '104001Table2PropertiesItemDesc',
  1058. tableId: "104001Table2",
  1059. tableName: "物料属性表",
  1060. columnProp: 'itemDesc',
  1061. headerAlign: "center",
  1062. align: "center",
  1063. columnLabel: '属性名称',
  1064. columnHidden: false,
  1065. columnImage: false,
  1066. columnSortable: true,
  1067. sortLv: 0,
  1068. status: true,
  1069. fixed: '',
  1070. columnWidth: 90,
  1071. },
  1072. {
  1073. userId: this.$store.state.user.name,
  1074. functionId: 104001,
  1075. serialNumber: '104001Table2ValueType',
  1076. tableId: "104001Table2",
  1077. tableName: "物料属性表",
  1078. columnProp: 'valueType',
  1079. headerAlign: "center",
  1080. align: "center",
  1081. columnLabel: '属性类型',
  1082. columnHidden: false,
  1083. columnImage: false,
  1084. columnSortable: true,
  1085. sortLv: 0,
  1086. status: true,
  1087. fixed: '',
  1088. columnWidth: 70,
  1089. },
  1090. {
  1091. userId: this.$store.state.user.name,
  1092. functionId: 104001,
  1093. serialNumber: '104001Table2ValueChooseFlag',
  1094. tableId: "104001Table2",
  1095. tableName: "物料属性表",
  1096. columnProp: 'textValue',
  1097. headerAlign: "center",
  1098. align: "center",
  1099. columnLabel: '文本值',
  1100. columnHidden: false,
  1101. columnImage: false,
  1102. columnSortable: true,
  1103. sortLv: 0,
  1104. status: true,
  1105. fixed: '',
  1106. columnWidth: 70,
  1107. },
  1108. {
  1109. userId: this.$store.state.user.name,
  1110. functionId: 104001,
  1111. serialNumber: '104001Table2ValueChooseFlag',
  1112. tableId: "104001Table2",
  1113. tableName: "物料属性表",
  1114. columnProp: 'numValue',
  1115. headerAlign: "center",
  1116. align: "center",
  1117. columnLabel: '数字值',
  1118. columnHidden: false,
  1119. columnImage: false,
  1120. columnSortable: true,
  1121. sortLv: 0,
  1122. status: true,
  1123. fixed: '',
  1124. columnWidth: 70,
  1125. },
  1126. ],
  1127. columnAgentList: [
  1128. {
  1129. userId: this.$store.state.user.name,
  1130. functionId: 104001,
  1131. serialNumber: '104001Table3AgentId',
  1132. tableId: "104001Table3",
  1133. tableName: "物料代理商表",
  1134. columnProp: 'agentId',
  1135. headerAlign: "center",
  1136. align: "center",
  1137. columnLabel: '代理商编码',
  1138. columnHidden: false,
  1139. columnImage: false,
  1140. columnSortable: true,
  1141. sortLv: 0,
  1142. status: true,
  1143. fixed: '',
  1144. },
  1145. {
  1146. userId: this.$store.state.user.name,
  1147. functionId: 104001,
  1148. serialNumber: '104001Table3AgentName',
  1149. tableId: "104001Table3",
  1150. tableName: "物料代理商表",
  1151. columnProp: 'agentName',
  1152. headerAlign: "center",
  1153. align: "center",
  1154. columnLabel: '代理商名称',
  1155. columnHidden: false,
  1156. columnImage: false,
  1157. columnSortable: true,
  1158. sortLv: 0,
  1159. status: true,
  1160. fixed: '',
  1161. },
  1162. {
  1163. userId: this.$store.state.user.name,
  1164. functionId: 104001,
  1165. serialNumber: '104001Table3Active',
  1166. tableId: '104001Table3',
  1167. tableName: '物料代理商表',
  1168. columnProp: 'active',
  1169. headerAlign: 'center',
  1170. align: 'center',
  1171. columnLabel: '是否在用',
  1172. columnHidden: false,
  1173. columnImage: false,
  1174. columnSortable: false,
  1175. sortLv: 0,
  1176. status: true,
  1177. fixed: '',
  1178. },
  1179. {
  1180. userId: this.$store.state.user.name,
  1181. functionId: 104001,
  1182. serialNumber: '104001Table3CreateDate',
  1183. tableId: '104001Table3',
  1184. tableName: '物料代理商表',
  1185. columnProp: 'createDate',
  1186. headerAlign: 'center',
  1187. align: 'center',
  1188. columnLabel: '创建时间',
  1189. columnHidden: false,
  1190. columnImage: false,
  1191. columnSortable: false,
  1192. sortLv: 0,
  1193. status: true,
  1194. fixed: '',
  1195. },
  1196. {
  1197. userId: this.$store.state.user.name,
  1198. functionId: 104001,
  1199. serialNumber: '104001Table3CreateBy',
  1200. tableId: '104001Table3',
  1201. tableName: '物料代理商表',
  1202. columnProp: 'createBy',
  1203. headerAlign: 'center',
  1204. align: 'center',
  1205. columnLabel: '创建人',
  1206. columnHidden: false,
  1207. columnImage: false,
  1208. columnSortable: false,
  1209. sortLv: 0,
  1210. status: true,
  1211. fixed: '',
  1212. },
  1213. {
  1214. userId: this.$store.state.user.name,
  1215. functionId: 104001,
  1216. serialNumber: '104001Table3UpdateDate',
  1217. tableId: '104001Table3',
  1218. tableName: '物料代理商表',
  1219. columnProp: 'updateDate',
  1220. headerAlign: 'center',
  1221. align: 'center',
  1222. columnLabel: '更新时间',
  1223. columnHidden: false,
  1224. columnImage: false,
  1225. columnSortable: false,
  1226. sortLv: 0,
  1227. status: true,
  1228. fixed: '',
  1229. },
  1230. {
  1231. userId: this.$store.state.user.name,
  1232. functionId: 104001,
  1233. serialNumber: '104001Table3UpdateBy',
  1234. tableId: '104001Table3',
  1235. tableName: '物料代理商表',
  1236. columnProp: 'updateBy',
  1237. headerAlign: 'center',
  1238. align: 'center',
  1239. columnLabel: '更新人',
  1240. columnHidden: false,
  1241. columnImage: false,
  1242. columnSortable: false,
  1243. sortLv: 0,
  1244. status: true,
  1245. fixed: '',
  1246. }
  1247. ],
  1248. columnFileList: [
  1249. {
  1250. userId: this.$store.state.user.name,
  1251. functionId: 104001,
  1252. serialNumber: '104001Table4FileName',
  1253. tableId: '104001Table4',
  1254. tableName: '文件信息表',
  1255. columnProp: 'fileName',
  1256. headerAlign: 'center',
  1257. align: 'center',
  1258. columnLabel: '文件名称',
  1259. columnHidden: false,
  1260. columnImage: false,
  1261. columnSortable: false,
  1262. sortLv: 0,
  1263. status: true,
  1264. fixed: '',
  1265. },
  1266. {
  1267. userId: this.$store.state.user.name,
  1268. functionId: 104001,
  1269. serialNumber: '104001Table4FileRemark',
  1270. tableId: '104001Table4',
  1271. tableName: '文件信息表',
  1272. columnProp: 'fileRemark',
  1273. headerAlign: 'center',
  1274. align: 'center',
  1275. columnLabel: '备注',
  1276. columnHidden: false,
  1277. columnImage: false,
  1278. columnSortable: false,
  1279. sortLv: 0,
  1280. status: true,
  1281. fixed: '',
  1282. },
  1283. {
  1284. userId: this.$store.state.user.name,
  1285. functionId: 104001,
  1286. serialNumber: '104001Table4CreateDate',
  1287. tableId: '104001Table4',
  1288. tableName: '文件信息表',
  1289. columnProp: 'createDate',
  1290. headerAlign: 'center',
  1291. align: 'center',
  1292. columnLabel: '上传时间',
  1293. columnHidden: false,
  1294. columnImage: false,
  1295. columnSortable: false,
  1296. sortLv: 0,
  1297. status: true,
  1298. fixed: '',
  1299. },
  1300. {
  1301. userId: this.$store.state.user.name,
  1302. functionId: 104001,
  1303. serialNumber: '104001Table4CreatedBy',
  1304. tableId: '104001Table4',
  1305. tableName: '文件信息表',
  1306. columnProp: 'createdBy',
  1307. headerAlign: 'center',
  1308. align: 'center',
  1309. columnLabel: '上传人',
  1310. columnHidden: false,
  1311. columnImage: false,
  1312. columnSortable: false,
  1313. sortLv: 0,
  1314. status: true,
  1315. fixed: '',
  1316. }
  1317. ],
  1318. agentColumnList: [
  1319. {
  1320. columnProp: 'agentId',
  1321. headerAlign: "center",
  1322. align: "center",
  1323. columnLabel: '代理商编码',
  1324. columnHidden: false,
  1325. columnImage: false,
  1326. columnSortable: false,
  1327. sortLv: 0,
  1328. status: true,
  1329. fixed: '',
  1330. },
  1331. {
  1332. columnProp: 'agentName',
  1333. headerAlign: "center",
  1334. align: "center",
  1335. columnLabel: '代理商名称',
  1336. columnHidden: false,
  1337. columnImage: false,
  1338. columnSortable: false,
  1339. sortLv: 0,
  1340. status: true,
  1341. fixed: '',
  1342. },
  1343. ],
  1344. // ======== 必填规则 ========
  1345. rules: {
  1346. partNo: [
  1347. {
  1348. required: true,
  1349. message: ' ',
  1350. trigger: 'change'
  1351. }
  1352. ],
  1353. partDesc: [
  1354. {
  1355. required: true,
  1356. message: ' ',
  1357. trigger: 'change'
  1358. }
  1359. ],
  1360. umName: [
  1361. {
  1362. required: true,
  1363. message: ' ',
  1364. trigger: 'change'
  1365. }
  1366. ],
  1367. familyName: [
  1368. {
  1369. required: true,
  1370. message: ' ',
  1371. trigger: 'change'
  1372. }
  1373. ],
  1374. groupName: [
  1375. {
  1376. required: true,
  1377. message: ' ',
  1378. trigger: 'change'
  1379. }
  1380. ],
  1381. codeDesc: [
  1382. {
  1383. required: true,
  1384. message: ' ',
  1385. trigger: 'change'
  1386. }
  1387. ],
  1388. manufacturerName: [
  1389. {
  1390. required: true,
  1391. message: ' ',
  1392. trigger: 'change'
  1393. }
  1394. ],
  1395. active: [
  1396. {
  1397. required: true,
  1398. message: ' ',
  1399. trigger: 'change'
  1400. }
  1401. ],
  1402. agentName: [
  1403. {
  1404. required: true,
  1405. message: ' ',
  1406. trigger: 'change'
  1407. }
  1408. ],
  1409. partType: [
  1410. {
  1411. required: true,
  1412. message: ' ',
  1413. trigger: 'change'
  1414. }
  1415. ],
  1416. productGroupId3: [
  1417. {
  1418. required: true,
  1419. message: ' ',
  1420. trigger: 'change'
  1421. }
  1422. ],
  1423. productGroupId4: [
  1424. {
  1425. required: true,
  1426. message: ' ',
  1427. trigger: 'change'
  1428. }
  1429. ],
  1430. },
  1431. // ======== 复选数据集 ========
  1432. partSelections: [],
  1433. // ======== 选中的当前行数据 ========
  1434. partCurrentRow: {},
  1435. // ======== 模态框开关控制 ========
  1436. modalFlag: false,
  1437. modalDisableFlag: false,
  1438. itemChooseFlag: false,
  1439. itemTextDisableFlag: false,
  1440. itemNumberDisableFlag: false,
  1441. itemModalDisableFlag: false,
  1442. itemModalFlag: false,
  1443. agentModelFlag: false
  1444. }
  1445. },
  1446. mounted () {
  1447. this.$nextTick(() => {
  1448. this.height = window.innerHeight / 2 - 30
  1449. /*第二个表格高度的动态调整*/
  1450. this.secondHeight = window.innerHeight / 2 - 206
  1451. })
  1452. },
  1453. created () {
  1454. this.getDataList()
  1455. },
  1456. methods: {
  1457. // ======== 分页相关方法 ========
  1458. /**
  1459. * 每页数
  1460. * @param val
  1461. */
  1462. sizeChangeHandle (val) {
  1463. this.pageSize = val
  1464. this.pageIndex = 1
  1465. this.getDataList()
  1466. },
  1467. /**
  1468. * 当前页
  1469. * @param val
  1470. */
  1471. currentChangeHandle (val) {
  1472. this.pageIndex = val
  1473. this.getDataList()
  1474. },
  1475. // ======== 页签切换相关方法 ========
  1476. /**
  1477. * 未知
  1478. * @returns {boolean}
  1479. */
  1480. selectFlag () {
  1481. return true;
  1482. },
  1483. /**
  1484. * 列表表格选择替换
  1485. * @param tab
  1486. * @param event
  1487. */
  1488. tabClick (tab, event) {
  1489. // 刷新列表数据
  1490. this.refreshCurrentTabTable()
  1491. },
  1492. /**
  1493. * 当前值发生变化的时候修改
  1494. * @param row
  1495. * @param oldRow
  1496. */
  1497. changeCurrentRow (row, oldRow) {
  1498. // 判断是否是获取焦点的事件
  1499. if (row) {
  1500. this.partCurrentRow = JSON.parse(JSON.stringify(row))
  1501. //刷新当前页表
  1502. this.refreshCurrentTabTable()
  1503. }
  1504. },
  1505. /**
  1506. * 刷新页签的table数据
  1507. */
  1508. refreshCurrentTabTable () {
  1509. if (this.activeTable === 'part_item') {
  1510. this.getPartItem()
  1511. } else if (this.activeTable === 'part_agent') {
  1512. this.getPartAgent()
  1513. } else if (this.activeTable === 'part_file') {
  1514. this.getFileContentData()
  1515. }
  1516. },
  1517. // ======== 列表数据刷新方法 ========
  1518. /**
  1519. * 查询物料属性
  1520. */
  1521. getPartItem () {
  1522. let tempData = {
  1523. site: this.$store.state.user.site,
  1524. partNo: this.partCurrentRow.partNo,
  1525. codeNo: this.partCurrentRow.codeNo,
  1526. recordType: 'B'
  1527. }
  1528. getPartItem(tempData).then(({data}) => {
  1529. if (data && data.code === 0) {
  1530. this.partItemList = data.rows
  1531. } else {
  1532. this.partItemList = []
  1533. }
  1534. })
  1535. },
  1536. /**
  1537. * 查询物料代理商
  1538. */
  1539. getPartAgent () {
  1540. let tempData = {
  1541. site: this.$store.state.user.site,
  1542. partNo: this.partCurrentRow.partNo,
  1543. //agentId: this.partCurrentRow.agentId
  1544. }
  1545. getPartAgent(tempData).then(({data}) => {
  1546. if (data && data.code === 0) {
  1547. this.partAgentList = data.rows
  1548. } else {
  1549. this.partAgentList = []
  1550. }
  1551. })
  1552. },
  1553. // ======== 列表数据刷新方法 ========
  1554. /**
  1555. * 获取数据列表
  1556. */
  1557. getDataList () {
  1558. this.searchData.limit = this.pageSize
  1559. this.searchData.page = this.pageIndex
  1560. partInformationSearch(this.searchData).then(({data}) => {
  1561. if (data.code === 0) {
  1562. this.dataList = data.page.list
  1563. this.pageIndex = data.page.currPage
  1564. this.pageSize = data.page.pageSize
  1565. this.totalPage = data.page.totalCount
  1566. this.$refs.selectDiv.setLengthAll( this.dataList.length)
  1567. // 判断是否全部存在数据
  1568. if(this.totalPage > 0){
  1569. // 设置选中行
  1570. this.$refs.partTable.setCurrentRow(this.dataList[0])
  1571. // 加载当前的页签的table
  1572. this.refreshCurrentTabTable()
  1573. this.partClickRow(this.dataList[0])
  1574. }
  1575. }
  1576. this.dataListLoading = false
  1577. })
  1578. },
  1579. // ======== 新增/编辑模态框 ========
  1580. /**
  1581. * 物料信息新增模态框
  1582. */
  1583. addModal () {
  1584. this.modalData = {
  1585. flag: '1',
  1586. title: '物料新增',
  1587. site: this.$store.state.user.site,
  1588. partNo: '',
  1589. partDesc: '',
  1590. spec: '',
  1591. partTypeDb: '',
  1592. partType: 'Manufactured',
  1593. familyId: '',
  1594. familyName: '',
  1595. groupId: '',
  1596. groupName: '',
  1597. umId: '',
  1598. umName: '',
  1599. active: 'Y',
  1600. remark: '',
  1601. supplierId: '',
  1602. supplierName: '',
  1603. productGroupId1: '',
  1604. productGroupName1: '',
  1605. productGroupId2: '',
  1606. productGroupName2: '',
  1607. productGroupId3: '',
  1608. productGroupName3: '',
  1609. productGroupId4: '',
  1610. productGroupName4: '',
  1611. erpPartNo: '',
  1612. codeNo: '',
  1613. codeDesc: '',
  1614. manufacturerId: '',
  1615. manufacturerName: '',
  1616. agentId: '',
  1617. agentName: '',
  1618. createBy: this.$store.state.user.name
  1619. }
  1620. this.modalDisableFlag = false
  1621. this.modalFlag = true
  1622. },
  1623. /**
  1624. * 物料信息编辑模态框
  1625. * @param row
  1626. */
  1627. updateModal (row) {
  1628. this.modalData = {
  1629. flag: '2',
  1630. title: '物料编辑',
  1631. site: row.site,
  1632. partNo: row.partNo,
  1633. partDesc: row.partDesc,
  1634. spec: row.spec,
  1635. partTypeDb: row.partTypeDb,
  1636. partType: row.partType,
  1637. familyId: row.familyId,
  1638. familyName: row.familyName,
  1639. groupId: row.groupId,
  1640. groupName: row.groupName,
  1641. umId: row.umId,
  1642. umName: row.umName,
  1643. active: row.active,
  1644. remark: row.remark,
  1645. supplierId: row.supplierId,
  1646. supplierName: row.supplierName,
  1647. productGroupId1: row.productGroupId1,
  1648. productGroupName1: row.productGroupName1,
  1649. productGroupId2: row.productGroupId2,
  1650. productGroupName2: row.productGroupName2,
  1651. productGroupId3: row.productGroupId3,
  1652. productGroupName3: row.productGroupName3,
  1653. productGroupId4: row.productGroupId4,
  1654. productGroupName4: row.productGroupName4,
  1655. erpPartNo: row.erpPartNo,
  1656. codeNo: row.codeNo,
  1657. codeDesc: row.codeDesc,
  1658. manufacturerId: row.manufacturerId,
  1659. manufacturerName: row.manufacturerName,
  1660. agentId: row.agentId,
  1661. agentName: row.agentName,
  1662. updateBy: this.$store.state.user.name
  1663. }
  1664. this.modalDisableFlag = true
  1665. this.modalFlag = true
  1666. },
  1667. /**
  1668. * 选择代理商
  1669. */
  1670. getAgentList () {
  1671. // // 先清空缓存选中
  1672. // this.$nextTick(() => this.$refs.agentTable.clearSelection())
  1673. // // 拿到选中的代理商id
  1674. // let tempDataList = this.modalData.agentId.split(';')
  1675. // 查询所有代理商
  1676. getAgentListBy(this.agentData).then(({data}) => {
  1677. if (data && data.code === 0) {
  1678. this.agentList1 = data.rows
  1679. // this.agentList.forEach(val => {
  1680. // // 回显选中的代理商
  1681. // if (tempDataList.includes(val.agentId)) {
  1682. // this.$nextTick(() => this.$refs.agentTable.toggleRowSelection(val, true))
  1683. // }
  1684. // })
  1685. // this.agentModelFlag = true
  1686. } else {
  1687. this.$alert(data.msg, '错误', {
  1688. confirmButtonText: '确定'
  1689. })
  1690. }
  1691. })
  1692. },
  1693. /**
  1694. * 代理商多选
  1695. * @param row
  1696. */
  1697. agentClickRow (row) {
  1698. this.$refs.agentTable.toggleRowSelection(row);
  1699. },
  1700. /**
  1701. * 获得选中的代理商
  1702. * @param val
  1703. */
  1704. selectionAgent (val) {
  1705. this.agentSelections = val
  1706. },
  1707. /**
  1708. * 返回列表唯一值
  1709. * @param row
  1710. * @returns {string|[{trigger: string, message: string, required: boolean}]|*}
  1711. */
  1712. getRowKeys (row) {
  1713. // 唯一值,一般都为id
  1714. return row.agentId
  1715. },
  1716. /**
  1717. * 确认多选代理商
  1718. * @returns {boolean}
  1719. */
  1720. confirmAgent () {
  1721. this.modalData.agentId = ''
  1722. this.modalData.agentName = ''
  1723. for (let i = 0; i < this.agentSelections.length; i++) {
  1724. this.modalData.agentId = this.modalData.agentId + ";" + this.agentSelections[i].agentId
  1725. this.modalData.agentName = this.modalData.agentName + ";" + this.agentSelections[i].agentName
  1726. }
  1727. this.modalData.agentId = this.modalData.agentId.substring(1)
  1728. this.modalData.agentName = this.modalData.agentName.substring(1)
  1729. this.agentModelFlag = false
  1730. },
  1731. savePartAgent () {
  1732. this.agentSelections1 = null
  1733. this.agentSelections2 = null
  1734. getAgentList(this.partCurrentRow).then(({data}) => {
  1735. this.agentList1 = data.row1
  1736. this.agentList2 = data.row2
  1737. })
  1738. this.agentData = {
  1739. site: this.$store.state.user.site,
  1740. agentId: '',
  1741. agentName: '',
  1742. }
  1743. this.agentModelFlag = true
  1744. },
  1745. // 可选代理商
  1746. agentClickRow1 (row) {
  1747. this.$refs.agentTable1.toggleRowSelection(row);
  1748. },
  1749. // 已有代理商
  1750. agentClickRow2 (row) {
  1751. this.$refs.agentTable2.toggleRowSelection(row);
  1752. },
  1753. selectionAgent1 (val) {
  1754. this.agentSelections1 = val
  1755. },
  1756. selectionAgent2 (val) {
  1757. this.agentSelections2 = val
  1758. },
  1759. // 添加代理商
  1760. addAgent () {
  1761. if(this.agentSelections1 == null || this.agentSelections1.length === 0){
  1762. this.$message.warning('请选择可选代理商!')
  1763. return
  1764. }
  1765. let inData = {
  1766. site: this.$store.state.user.site,
  1767. partNo: this.partCurrentRow.partNo,
  1768. agentList: this.agentSelections1
  1769. }
  1770. addPartAgent(inData).then(({data}) => {
  1771. if (data && data.code === 0) {
  1772. getAgentList(this.partCurrentRow).then(({data}) => {
  1773. this.agentList1 = data.row1
  1774. this.agentList2 = data.row2
  1775. })
  1776. this.agentSelections1 = []
  1777. } else {
  1778. this.$alert(data.msg, '错误', {
  1779. confirmButtonText: '确定'
  1780. })
  1781. }
  1782. })
  1783. },
  1784. // 删除物料代理商
  1785. deleteAgent () {
  1786. if(this.agentSelections2 == null || this.agentSelections2.length === 0){
  1787. this.$message.warning('请选择已有代理商!')
  1788. return
  1789. }
  1790. let inData = {
  1791. site: this.$store.state.user.site,
  1792. partNo: this.partCurrentRow.partNo,
  1793. agentList: this.agentSelections2
  1794. }
  1795. deletePartAgent(inData).then(({data}) => {
  1796. if (data && data.code === 0) {
  1797. getAgentList(this.partCurrentRow).then(({data}) => {
  1798. this.agentList1 = data.row1
  1799. this.agentList2 = data.row2
  1800. })
  1801. this.agentSelections2 = []
  1802. } else {
  1803. this.$alert(data.msg, '错误', {
  1804. confirmButtonText: '确定'
  1805. })
  1806. }
  1807. })
  1808. },
  1809. // 单删
  1810. deleteAgent2 (row) {
  1811. this.$confirm(`是否删除该代理商?`, '提示', {
  1812. confirmButtonText: '确定',
  1813. cancelButtonText: '取消',
  1814. type: 'warning'
  1815. }).then(() => {
  1816. deleteAgent(row).then(({data}) => {
  1817. if (data && data.code === 0) {
  1818. this.getPartAgent()
  1819. this.$message({
  1820. message: '操作成功',
  1821. type: 'success',
  1822. duration: 1500,
  1823. onClose: () => {}
  1824. })
  1825. } else {
  1826. this.$alert(data.msg, '错误', {
  1827. confirmButtonText: '确定'
  1828. })
  1829. }
  1830. })
  1831. }).catch(() => {
  1832. })
  1833. },
  1834. // 关闭后刷新列表
  1835. refreshDetailList(){
  1836. this.getPartAgent()
  1837. },
  1838. // ======== 新增/编辑/删除方法 ========
  1839. /**
  1840. * 物料信息新增/编辑
  1841. */
  1842. saveData () {
  1843. if (this.modalData.partNo === '' || this.modalData.partNo == null) {
  1844. this.$message.warning('请填写物料编码!')
  1845. return
  1846. }
  1847. if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
  1848. this.$message.warning('请填写物料描述!')
  1849. return
  1850. }
  1851. if (this.modalData.partType === '' || this.modalData.partType == null) {
  1852. this.$message.warning('请选择物料类别!')
  1853. return
  1854. }
  1855. if (this.modalData.active === '' || this.modalData.active == null) {
  1856. this.$message.warning('请选择是否在用!')
  1857. return
  1858. }
  1859. if (this.modalData.codeNo === '' || this.modalData.codeNo == null) {
  1860. this.$message.warning('请选择属性模板!')
  1861. return
  1862. }
  1863. if (this.modalData.umId === '' || this.modalData.umId == null) {
  1864. this.$message.warning('请选择计量单位!')
  1865. return
  1866. }
  1867. if (this.modalData.familyId === '' || this.modalData.familyId == null) {
  1868. this.$message.warning('请选择分类!')
  1869. return
  1870. }
  1871. if (this.modalData.groupId === '' || this.modalData.groupId == null) {
  1872. this.$message.warning('请选择分组!')
  1873. return
  1874. }
  1875. if (this.modalData.productGroupId3 === '' || this.modalData.productGroupId3 == null) {
  1876. this.$message.warning('请选择会计组!')
  1877. return
  1878. }
  1879. if (this.modalData.productGroupId4 === '' || this.modalData.productGroupId4 == null) {
  1880. this.$message.warning('请选择计划员!')
  1881. return
  1882. }
  1883. if (this.modalData.flag === '1') {
  1884. partInformationSave(this.modalData).then(({data}) => {
  1885. if (data && data.code === 0) {
  1886. this.getDataList()
  1887. this.modalFlag = false
  1888. this.$message({
  1889. message: '操作成功',
  1890. type: 'success',
  1891. duration: 1500,
  1892. onClose: () => {}
  1893. })
  1894. } else {
  1895. this.$alert(data.msg, '错误', {
  1896. confirmButtonText: '确定'
  1897. })
  1898. }
  1899. })
  1900. } else {
  1901. partInformationEdit(this.modalData).then(({data}) => {
  1902. if (data && data.code === 0) {
  1903. this.getDataList()
  1904. this.modalFlag = false
  1905. this.$message({
  1906. message: '操作成功',
  1907. type: 'success',
  1908. duration: 1500,
  1909. onClose: () => {}
  1910. })
  1911. } else {
  1912. this.$alert(data.msg, '错误', {
  1913. confirmButtonText: '确定'
  1914. })
  1915. }
  1916. })
  1917. }
  1918. },
  1919. /**
  1920. * 物料信息删除
  1921. */
  1922. delModal () {
  1923. if(this.partSelections.length === 0){
  1924. this.$message.warning('请勾选要删除的物料信息!')
  1925. return
  1926. }
  1927. this.$confirm(`是否删除这 `+ this.partSelections.length +` 条物料信息?`, '提示', {
  1928. confirmButtonText: '确定',
  1929. cancelButtonText: '取消',
  1930. type: 'warning'
  1931. }).then(() => {
  1932. let tempData = {
  1933. informationList: this.partSelections
  1934. }
  1935. partInformationDelete(tempData).then(({data}) => {
  1936. if (data && data.code === 0) {
  1937. this.getDataList()
  1938. this.partSelections = []
  1939. this.$message({
  1940. message: '操作成功',
  1941. type: 'success',
  1942. duration: 1500,
  1943. onClose: () => {}
  1944. })
  1945. } else {
  1946. this.$alert(data.msg, '错误', {
  1947. confirmButtonText: '确定'
  1948. })
  1949. }
  1950. })
  1951. }).catch(() => {
  1952. })
  1953. },
  1954. // ======== 列表操作方法 ========
  1955. /**
  1956. * 单机选中物料信息
  1957. * @param row
  1958. */
  1959. partClickRow (row) {
  1960. this.$refs.partTable.toggleRowSelection(row)
  1961. this.partCurrentRow = JSON.parse(JSON.stringify(row))
  1962. },
  1963. /**
  1964. * 复选物料信息
  1965. * @param val
  1966. */
  1967. selectionPart (val) {
  1968. this.partSelections = val
  1969. this.$refs.selectDiv.setLengthselected(this.partSelections.length)
  1970. },
  1971. // ======== 属性页签相关方法 ========
  1972. /**
  1973. * 编辑属性值模态框
  1974. */
  1975. updateItemModal (row) {
  1976. this.itemData = {
  1977. site: row.site,
  1978. partNo: row.partNo,
  1979. propertiesItemNo: row.propertiesItemNo,
  1980. itemDesc: row.itemDesc,
  1981. textValue: row.textValue,
  1982. numValue: row.numValue,
  1983. recordType: 'B'
  1984. }
  1985. this.availableValueList = row.availableValueList
  1986. if (row.valueChooseFlag === 'Y') {
  1987. this.itemChooseFlag = true
  1988. } else {
  1989. this.itemChooseFlag = false
  1990. }
  1991. this.itemTextDisableFlag = true
  1992. this.itemNumberDisableFlag = true
  1993. if (row.valueTypeDb !== 'T') {
  1994. this.itemNumberDisableFlag = false
  1995. } else {
  1996. this.itemTextDisableFlag = false
  1997. }
  1998. this.itemModalDisableFlag = true
  1999. this.itemModalFlag = true
  2000. },
  2001. /**
  2002. * 编辑属性值方法
  2003. * @returns {boolean}
  2004. */
  2005. itemSaveData () {
  2006. if(this.itemData.partNo === '' || this.itemData.partNo == null){
  2007. this.$message.warning('未选择物料!')
  2008. return false
  2009. }
  2010. if(this.itemData.propertiesItemNo === ''|| this.itemData.propertiesItemNo == null){
  2011. this.$message.warning('未选择属性!')
  2012. return false
  2013. }
  2014. savePartItemValue(this.itemData).then(({data}) => {
  2015. if (data && data.code === 0) {
  2016. this.itemModalFlag = false
  2017. this.getPartItem()
  2018. this.$message({
  2019. message: '操作成功',
  2020. type: 'success',
  2021. duration: 1500,
  2022. onClose: () => {}
  2023. })
  2024. } else {
  2025. this.$alert(data.msg, '错误', {
  2026. confirmButtonText: '确定'
  2027. })
  2028. }
  2029. })
  2030. },
  2031. // ======== 附件的相关方法 ========
  2032. /**
  2033. * 获取物料附件列表
  2034. */
  2035. getFileContentData () {
  2036. let currentData = {
  2037. orderRef1: this.$store.state.user.site,
  2038. orderRef2: this.partCurrentRow.partNo
  2039. }
  2040. getFileContentList(currentData).then(({data}) => {
  2041. if (data && data.code === 0) {
  2042. this.fileContentList = data.rows
  2043. } else {
  2044. this.fileContentList = []
  2045. }
  2046. })
  2047. },
  2048. /**
  2049. * 上传文件
  2050. */
  2051. uploadFile () {
  2052. let currentData = {
  2053. titleCon: '物料附件上传',
  2054. site: this.$store.state.user.site,
  2055. createBy: this.$store.state.user.name,
  2056. partNo: this.partCurrentRow.partNo
  2057. }
  2058. //打开组件 去做新增业务
  2059. this.$nextTick(() => {
  2060. this.$refs.partUploadFile.init(currentData);
  2061. })
  2062. },
  2063. /**
  2064. * 文件删除
  2065. * @param row
  2066. */
  2067. deleteFile (row) {
  2068. this.$confirm('确定要删除此文件?', '提示', {
  2069. confirmButtonText: '确定',
  2070. cancelButtonText: '取消',
  2071. type: 'warning'
  2072. }).then(() => {
  2073. deleteQuotationFile(row).then(({data}) => {
  2074. if (data && data.code === 0) {
  2075. this.getFileContentData()
  2076. this.$message({
  2077. message: '操作成功',
  2078. type: 'success',
  2079. duration: 1500,
  2080. onClose: () => {}
  2081. })
  2082. } else {
  2083. this.$alert(data.msg, '错误', {
  2084. confirmButtonText: '确定'
  2085. })
  2086. }
  2087. })
  2088. }).catch(() => {
  2089. })
  2090. },
  2091. /**
  2092. * 文件下载
  2093. * @param row
  2094. */
  2095. downloadFile (row) {
  2096. downLoadQuotationFile(row).then(({data}) => {
  2097. // 不限制文件下载类型
  2098. const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'})
  2099. // 下载文件名称
  2100. const fileName = row.fileName
  2101. // a标签下载
  2102. const linkNode = document.createElement('a')
  2103. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  2104. linkNode.style.display = 'none'
  2105. linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL
  2106. document.body.appendChild(linkNode)
  2107. linkNode.click() // 模拟在按钮上的一次鼠标单击
  2108. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  2109. document.body.removeChild(linkNode)
  2110. })
  2111. },
  2112. // ======== chooseList相关方法 ========
  2113. /**
  2114. * 获取基础数据列表S
  2115. * @param val
  2116. * @param type
  2117. */
  2118. getBaseList (val, type) {
  2119. this.tagNo = val
  2120. this.$nextTick(() => {
  2121. let strVal = ''
  2122. if (val === 107) {
  2123. strVal = this.modalData.umId
  2124. } else if (val === 108) {
  2125. strVal = this.modalData.familyId
  2126. } else if (val === 109) {
  2127. strVal = this.modalData.groupId
  2128. } else if (val === 110) {
  2129. strVal = this.modalData.productGroupId1
  2130. } else if (val === 111) {
  2131. strVal = this.modalData.productGroupId2
  2132. } else if (val === 112) {
  2133. strVal = this.modalData.productGroupId3
  2134. } else if (val === 113) {
  2135. strVal = this.modalData.productGroupId4
  2136. } else if (val === 114) {
  2137. strVal = this.modalData.manufacturerId
  2138. } else if (val === 20) {
  2139. strVal = this.modalData.codeNo
  2140. }
  2141. this.$refs.baseList.init(val, strVal)
  2142. })
  2143. },
  2144. /**
  2145. * 列表方法的回调
  2146. * @param val
  2147. */
  2148. getBaseData (val) {
  2149. if (this.tagNo === 107) {
  2150. this.modalData.umId = val.um_id
  2151. this.modalData.umName = val.um_name
  2152. } else if (this.tagNo === 108) {
  2153. this.modalData.familyId = val.family_id
  2154. this.modalData.familyName = val.family_name
  2155. } else if (this.tagNo === 109) {
  2156. this.modalData.groupId = val.group_id
  2157. this.modalData.groupName = val.group_name
  2158. } else if (this.tagNo === 110) {
  2159. this.modalData.productGroupId1 = val.product_group_id
  2160. this.modalData.productGroupName1 = val.product_group_name
  2161. } else if (this.tagNo === 111) {
  2162. this.modalData.productGroupId2 = val.product_group_id
  2163. this.modalData.productGroupName2 = val.product_group_name
  2164. } else if (this.tagNo === 112) {
  2165. this.modalData.productGroupId3 = val.product_group_id
  2166. this.modalData.productGroupName3 = val.product_group_name
  2167. } else if (this.tagNo === 113) {
  2168. this.modalData.productGroupId4 = val.product_group_id
  2169. this.modalData.productGroupName4 = val.product_group_name
  2170. } else if (this.tagNo === 114) {
  2171. this.modalData.manufacturerId = val.manufacturer_id
  2172. this.modalData.manufacturerName = val.manufacturer_name
  2173. } else if (this.tagNo === 20) {
  2174. this.modalData.codeNo = val.Code_no
  2175. this.$set(this.modalData, 'codeDesc', val.Code_desc)
  2176. }
  2177. },
  2178. // ======== 导出相关方法 ========
  2179. /**
  2180. * 导出excel
  2181. */
  2182. async createExportData () {
  2183. this.searchData.limit = -1
  2184. this.searchData.page = 1
  2185. await partInformationSearch(this.searchData).then(({data}) => {
  2186. this.resultList = data.page.list
  2187. })
  2188. return this.resultList
  2189. },
  2190. startDownload () {
  2191. },
  2192. finishDownload () {
  2193. },
  2194. fields () {
  2195. let json = '{'
  2196. this.columnList.forEach((item, index) => {
  2197. if (index == this.columnList.length - 1) {
  2198. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
  2199. } else {
  2200. json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
  2201. }
  2202. })
  2203. json += '}'
  2204. let s = eval('(' + json + ')')
  2205. return s
  2206. }
  2207. }
  2208. }
  2209. </script>
  2210. <style scoped lang="scss">
  2211. /deep/ .customer-tab .el-tabs__content {
  2212. padding: 0px !important;
  2213. height: 459px;
  2214. }
  2215. /deep/ .customer-tab .el-tabs__content {
  2216. height: 294px;
  2217. }
  2218. </style>