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.

2079 lines
70 KiB

11 months ago
​
​
​
​
​
​
4 months ago
11 months ago
​
11 months ago
​
6 months ago
​
11 months ago
​
​
​
​
​
​
4 months ago
​
​
4 months ago
11 months ago
​
5 months ago
3 months ago
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
6 months ago
​
​
6 months ago
​
6 months ago
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
11 months ago
​
​
​
​
​
6 months ago
11 months ago
​
6 months ago
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
4 months ago
7 months ago
​
​
​
​
​
6 months ago
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
7 months ago
7 months ago
7 months ago
​
​
​
​
​
​
​
7 months ago
​
​
​
​
5 months ago
4 months ago
​
7 months ago
5 months ago
4 months ago
​
​
​
4 months ago
​
7 months ago
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
3 months ago
3 months ago
3 months ago
​
​
​
​
​
3 months ago
​
3 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
9 months ago
​
​
​
11 months ago
​
​
​
​
11 months ago
​
​
​
6 months ago
5 months ago
​
11 months ago
11 months ago
7 months ago
11 months ago
​
​
11 months ago
11 months ago
​
​
​
​
​
​
4 months ago
11 months ago
11 months ago
​
​
​
4 months ago
​
6 months ago
​
11 months ago
6 months ago
11 months ago
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
7 months ago
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
7 months ago
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
4 months ago
11 months ago
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
7 months ago
​
6 months ago
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
11 months ago
​
​
​
​
​
​
​
​
​
​
7 months ago
11 months ago
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
​
​
​
​
​
​
​
11 months ago
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
7 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
7 months ago
​
7 months ago
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
7 months ago
​
​
​
5 months ago
7 months ago
7 months ago
​
​
​
3 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
4 months ago
​
​
6 months ago
​
4 months ago
​
​
​
11 months ago
​
11 months ago
​
7 months ago
11 months ago
​
​
11 months ago
​
11 months ago
11 months ago
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 months ago
3 months ago
​
​
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
11 months ago
​
4 months ago
11 months ago
​
​
​
5 months ago
​
​
​
5 months ago
​
​
​
4 months ago
​
​
​
​
4 months ago
​
​
​
​
6 months ago
11 months ago
​
​
​
4 months ago
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
5 months ago
​
4 months ago
​
​
​
4 months ago
​
​
​
11 months ago
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
6 months ago
​
4 months ago
6 months ago
​
​
4 months ago
6 months ago
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
11 months ago
11 months ago
​
​
11 months ago
​
​
​
​
​
​
​
11 months ago
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
5 months ago
​
11 months ago
​
​
​
11 months ago
​
11 months ago
​
​
11 months ago
11 months ago
​
11 months ago
​
11 months ago
​
​
11 months ago
3 months ago
​
​
​
​
3 months ago
​
​
​
​
11 months ago
​
​
3 months ago
11 months ago
​
​
11 months ago
​
11 months ago
​
​
11 months ago
​
​
​
11 months ago
​
​
​
​
​
11 months ago
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
11 months ago
​
​
​
​
​
7 months ago
​
7 months ago
​
​
​
3 months ago
3 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
6 months ago
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
3 months ago
3 months ago
​
​
3 months ago
​
​
​
4 months ago
6 months ago
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
11 months ago
  1. <template>
  2. <div class="customer-css" >
  3. <!-- 查询时间和产品 -->
  4. <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;" >
  5. <el-row>
  6. <el-col :span="24" style="">
  7. <el-form-item >
  8. <span style="cursor: pointer" slot="label" @click="getBaseList(520)"><a href="#">供应商编码</a></span>
  9. <el-input v-model="searchData.supplierNo" style="width: 130px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'供应商名称:'">
  12. <el-input v-model="searchData.supplierName" style="width: 130px"></el-input>
  13. </el-form-item>
  14. <el-form-item :label="'是否在用:'">
  15. <el-select v-model="searchData.active" style="width: 130px">
  16. <el-option label="Y" value="Y"></el-option>
  17. <el-option label="N" value="N"></el-option>
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item :label="'活跃状态:'">
  21. <el-select v-model="searchData.status" style="width: 130px">
  22. <el-option label="Active" value="Active"></el-option>
  23. <el-option label="Inactive" value="Inactive"></el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item>
  27. <span style="cursor: pointer" slot="label" @click="getBaseList(530, 'mainPlanner')"><a href="#">Planner</a></span>
  28. <el-input v-model="searchData.planner" clearable readonly style="width: 130px"></el-input>
  29. </el-form-item>
  30. <el-form-item :label="' '" >
  31. <el-button class="customer-bun-min" type="primary" @click="getMainData" style="">查询</el-button>
  32. <el-button @click="addSupplier()" type="primary" style="margin-left: 2px">新增</el-button>
  33. <!-- <el-button @click="handleTestCurrentLoginSite" type="primary" style="margin-left: 2px">测试</el-button>-->
  34. <el-button @click="exportExcel()" type="primary" style="margin-left: 2px">{{'导出'}}</el-button>
  35. </el-form-item>
  36. </el-col>
  37. </el-row>
  38. </el-form>
  39. <el-table
  40. :height="height"
  41. :data="mainDataList"
  42. border
  43. ref="mainTable"
  44. highlight-current-row
  45. @row-click="changeData"
  46. v-loading="dataListLoading"
  47. style="margin-top: 0px; width: 100%;">
  48. <el-table-column
  49. v-for="(item,index) in columnArray1" :key="index"
  50. :sortable="item.columnSortable"
  51. :prop="item.columnProp"
  52. :header-align="item.headerAlign"
  53. :show-overflow-tooltip="item.showOverflowTooltip"
  54. :align="item.align"
  55. :fixed="item.fixed==''?false:item.fixed"
  56. :min-width="item.columnWidth"
  57. :label="item.columnLabel">
  58. <template slot-scope="scope">
  59. <span v-if="!item.columnHidden">
  60. <span v-if="item.columnProp === 'paymentTermDesc'">
  61. {{ scope.row.paymentTermDesc || scope.row.paymentTerm }}
  62. </span>
  63. <span v-else-if="item.columnProp === 'deliveryTermDesc'">
  64. {{ scope.row.deliveryTermDesc || scope.row.deliveryTerm }}
  65. </span>
  66. <span v-else-if="item.columnProp === 'status'" :class="getStatusClass(scope.row.status)">
  67. {{ scope.row.status }}
  68. </span>
  69. <span v-else-if="item.columnProp === 'handlingCharge'">
  70. {{ formatSupplierNumberDisplay(scope.row[item.columnProp]) }}
  71. </span>
  72. <span v-else-if="item.columnProp === 'defaultOriginPort'">
  73. {{ portNameByCode(scope.row.defaultOriginPort) }}
  74. </span>
  75. <span v-else>{{ scope.row[item.columnProp] }}</span>
  76. </span>
  77. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  78. style="width: 100px; height: 100px"/></span>
  79. </template>
  80. </el-table-column>
  81. <!-- 操作列 -->
  82. <el-table-column
  83. fixed="right"
  84. header-align="center"
  85. align="center"
  86. width="160"
  87. label="操作">
  88. <template slot-scope="scope">
  89. <el-link style="cursor: pointer" @click="editSupplier(scope.row)">编辑 |</el-link>
  90. <el-link style="cursor: pointer" @click="deleteSupplier(scope.row)">删除</el-link>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. <!-- 分页插件 -->
  95. <el-pagination style="margin-top: 0px"
  96. @size-change="sizeChangeHandle"
  97. @current-change="currentChangeHandle"
  98. :current-page="pageIndex"
  99. :page-sizes="[20, 50, 100, 200, 500]"
  100. :page-size="pageSize"
  101. :total="totalPage"
  102. layout="total, sizes, prev, pager, next, jumper">
  103. </el-pagination>
  104. <el-tabs v-model="activeName" style="margin-top: 0px; width: 99%;" @tab-click="tabClick" class="customer-tab" type="border-card">
  105. <!-- <el-tab-pane label="Share" name="share" style="">-->
  106. <!-- <share ref="share"></share>-->
  107. <!-- </el-tab-pane>-->
  108. <el-tab-pane label="地址" name="AddressTab" style="">
  109. <AddressTab ref="AddressTab"></AddressTab>
  110. </el-tab-pane>
  111. <el-tab-pane label="等级变更记录" name="groupChangeList" style="">
  112. <el-table
  113. :height="height"
  114. :data="supplierGroupRequestList"
  115. border
  116. ref="table3"
  117. highlight-current-row
  118. v-loading="dataListLoading"
  119. style="margin-top: 0px; width: 100%;">
  120. <!-- <el-table-column-->
  121. <!-- fixed="left"-->
  122. <!-- header-align="center"-->
  123. <!-- align="center"-->
  124. <!-- width="220"-->
  125. <!-- :label="'操作'">-->
  126. <!-- <template slot-scope="scope">-->
  127. <!-- </template>-->
  128. <!-- </el-table-column>-->
  129. <el-table-column
  130. v-for="(item,index) in columnArray3" :key="index"
  131. :sortable="item.columnSortable"
  132. :prop="item.columnProp"
  133. :header-align="item.headerAlign"
  134. :show-overflow-tooltip="item.showOverflowTooltip"
  135. :align="item.align"
  136. :fixed="item.fixed==''?false:item.fixed"
  137. :min-width="item.columnWidth"
  138. :label="item.columnLabel">
  139. <template slot-scope="scope">
  140. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  141. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  142. style="width: 100px; height: 80px"/></span>
  143. </template>
  144. </el-table-column>
  145. </el-table>
  146. </el-tab-pane>
  147. <el-tab-pane label="供应商合同" name="contract" style="">
  148. <contract ref="contract"></contract>
  149. </el-tab-pane>
  150. <el-tab-pane label="供应商文档" name="documents" style="">
  151. <documents ref="documents"></documents>
  152. </el-tab-pane>
  153. </el-tabs>
  154. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  155. <!-- 供应商编辑对话框 -->
  156. <el-dialog :visible.sync="supplierDialogVisible" width="600px" top="3vh" :close-on-click-modal="false" v-drag class="supplier-dialog">
  157. <template slot="title">
  158. <span class="el-dialog__title">{{ isAdd ? '新增供应商' : '编辑供应商' }}</span>
  159. <!-- SRM0006:有权限者在标题栏看到“修改ShortOffice”复选框,勾选后解锁输入框 - rqrq -->
  160. <el-checkbox
  161. v-if="!isAdd && hasShortOfficeEditPermission"
  162. v-model="shortOfficeEditable"
  163. style="margin-left: 12px">修改ShortOffice</el-checkbox>
  164. </template>
  165. <div class="dialog-content">
  166. <el-form
  167. :model="currentSupplier"
  168. :rules="supplierRules"
  169. ref="supplierForm"
  170. label-position="top"
  171. class="supplier-form">
  172. <div class="form-section">
  173. <el-row :gutter="24">
  174. <el-col :span="6">
  175. <el-form-item label="供应商编码" prop="supplierNo">
  176. <el-input v-model="currentSupplier.supplierNo" disabled></el-input>
  177. </el-form-item>
  178. </el-col>
  179. <el-col :span="6">
  180. <el-form-item label="ShortOffice" prop="cShortOffice">
  181. <el-input v-model="currentSupplier.cShortOffice" :disabled="!isAdd && !shortOfficeEditable"></el-input>
  182. </el-form-item>
  183. </el-col>
  184. <el-col :span="6">
  185. <el-form-item label="ShortNpc" >
  186. <el-input v-model="currentSupplier.cShortNpc" ></el-input>
  187. </el-form-item>
  188. </el-col>
  189. <el-col :span="6">
  190. <el-form-item label="是否在用">
  191. <el-select v-model="currentSupplier.active" placeholder="是否在用" style="width: 100%">
  192. <el-option label="Y" value="Y"></el-option>
  193. <el-option label="N" value="N"></el-option>
  194. </el-select>
  195. </el-form-item>
  196. </el-col>
  197. </el-row>
  198. <el-row :gutter="24">
  199. <el-col :span="12">
  200. <el-form-item label="供应商名称" prop="supplierName">
  201. <el-input v-model="currentSupplier.supplierName"></el-input>
  202. </el-form-item>
  203. </el-col>
  204. <el-col :span="6">
  205. <el-form-item label="活跃状态" prop="status">
  206. <el-select v-model="currentSupplier.status" placeholder="请选择" style="width: 100%">
  207. <el-option label="Active" value="Active"></el-option>
  208. <el-option label="Inactive" value="Inactive"></el-option>
  209. </el-select>
  210. </el-form-item>
  211. </el-col>
  212. <el-col :span="6">
  213. <el-form-item label="供应商等级">
  214. <sys-dict-select
  215. v-model="currentSupplier.supplierGroup"
  216. dict-type="supplier_group"
  217. placeholder="请选择"
  218. width="100%"
  219. />
  220. </el-form-item>
  221. </el-col>
  222. </el-row>
  223. <el-row :gutter="24">
  224. <!-- <el-col :span="6">-->
  225. <!-- <el-form-item label="供应商等级">-->
  226. <!-- <el-input v-model="currentSupplier.abc"></el-input>-->
  227. <!-- </el-form-item>-->
  228. <!-- </el-col>-->
  229. <el-col :span="6">
  230. <el-form-item>
  231. <span style="cursor: pointer" slot="label" @click="getBaseList(529, 'buyer')"><a href="#">采购员</a></span>
  232. <el-input v-model="currentSupplier.buyer" readonly style="width: 130px"></el-input>
  233. </el-form-item>
  234. </el-col>
  235. <el-col :span="6">
  236. <el-form-item>
  237. <span style="cursor: pointer" slot="label" @click="getBaseList(528, 'sourcingStaff')"><a href="#">Sourcing专员</a></span>
  238. <el-input v-model="currentSupplier.sourcingStaff" readonly style="width: 130px"></el-input>
  239. </el-form-item>
  240. </el-col>
  241. <el-col :span="6">
  242. <el-form-item prop="planner">
  243. <span style="cursor: pointer" slot="label" @click="getBaseList(530, 'planner')"><a href="#">Planner</a></span>
  244. <el-input v-model="currentSupplier.planner" readonly style="width: 130px"></el-input>
  245. </el-form-item>
  246. </el-col>
  247. <el-col :span="6">
  248. <el-form-item label="供应商文档清单模板" prop="supplierDocType">
  249. <el-select v-model="currentSupplier.supplierDocType" placeholder="请选择" filterable style="width: 100%">
  250. <el-option
  251. v-for="item in supplierDocTypeOptions"
  252. :key="item"
  253. :label="item"
  254. :value="item">
  255. </el-option>
  256. </el-select>
  257. </el-form-item>
  258. </el-col>
  259. </el-row>
  260. </div>
  261. <div class="form-section">
  262. <el-row :gutter="24">
  263. <el-col :span="6">
  264. <el-form-item>
  265. <span style="cursor: pointer" slot="label" @click="getBaseList(522)"><a href="#">税率编号</a></span>
  266. <el-input v-model="currentSupplier.taxCode" style="width: 130px"></el-input>
  267. </el-form-item>
  268. </el-col>
  269. <el-col :span="6">
  270. <el-form-item>
  271. <span style="cursor: pointer" slot="label" @click="getBaseList(523)"><a href="#">付款条款</a></span>
  272. <el-input v-model="currentSupplier.paymentTerm" style="width: 130px"></el-input>
  273. </el-form-item>
  274. </el-col>
  275. <el-col :span="6">
  276. <el-form-item>
  277. <span style="cursor: pointer" slot="label" @click="getBaseList(524)"><a href="#">交货条款</a></span>
  278. <el-input v-model="currentSupplier.deliveryTerm" style="width: 130px"></el-input>
  279. </el-form-item>
  280. </el-col>
  281. <el-col :span="6">
  282. <!-- 最低出货金额改为字典选择,保存 sys_dict_data.dict_value;空表示未配置 - rqrq -->
  283. <el-form-item label="最低出货金额">
  284. <sys-dict-select
  285. v-model="currentSupplier.minShipAccount"
  286. dict-type="min_ship_account"
  287. placeholder="请选择"
  288. width="100%"
  289. />
  290. </el-form-item>
  291. </el-col>
  292. <el-col :span="6">
  293. <el-form-item label="小单费">
  294. <el-input v-model="currentSupplier.handlingCharge" type="number"></el-input>
  295. </el-form-item>
  296. </el-col>
  297. <el-col :span="6">
  298. <el-form-item label="始发港">
  299. <el-select v-model="currentSupplier.defaultOriginPort" clearable filterable placeholder="请选择始发港" style="width: 100%">
  300. <el-option
  301. v-for="p in originPortOptions"
  302. :key="p.portCode"
  303. :label="p.portName"
  304. :value="p.portCode">
  305. </el-option>
  306. </el-select>
  307. </el-form-item>
  308. </el-col>
  309. </el-row>
  310. </div>
  311. <div class="form-section">
  312. <el-row :gutter="24">
  313. <el-col :span="6">
  314. <el-form-item >
  315. <span style="cursor: pointer" slot="label" @click="getBaseList(513)"><a herf="#">货币</a></span>
  316. <el-input v-model="currentSupplier.currency" style="width: 130px"></el-input>
  317. </el-form-item>
  318. </el-col>
  319. <el-col :span="12">
  320. <el-form-item label="银行名称">
  321. <el-input v-model="currentSupplier.bankName"></el-input>
  322. </el-form-item>
  323. </el-col>
  324. <el-col :span="6">
  325. <el-form-item label="银行账号">
  326. <el-input v-model="currentSupplier.bankAccount"></el-input>
  327. </el-form-item>
  328. </el-col>
  329. </el-row>
  330. </div>
  331. <div class="form-section">
  332. <el-row :gutter="24">
  333. <el-col :span="6">
  334. <el-form-item label="联系人">
  335. <el-input v-model="currentSupplier.contact"></el-input>
  336. </el-form-item>
  337. </el-col>
  338. <el-col :span="6">
  339. <el-form-item label="联系人电话">
  340. <el-input v-model="currentSupplier.phoneNo"></el-input>
  341. </el-form-item>
  342. </el-col>
  343. <el-col :span="6">
  344. <el-form-item label="联系人电话2">
  345. <el-input v-model="currentSupplier.phoneNo2"></el-input>
  346. </el-form-item>
  347. </el-col>
  348. <el-col :span="6">
  349. <el-form-item label="联系人电话3">
  350. <el-input v-model="currentSupplier.phoneNo3"></el-input>
  351. </el-form-item>
  352. </el-col>
  353. </el-row>
  354. </div>
  355. <div class="form-section">
  356. <el-row :gutter="24">
  357. <el-col :span="12">
  358. <el-form-item label="邮箱">
  359. <el-input v-model="currentSupplier.email"></el-input>
  360. </el-form-item>
  361. </el-col>
  362. <el-col :span="12">
  363. <el-form-item label="邮箱2">
  364. <el-input v-model="currentSupplier.email2"></el-input>
  365. </el-form-item>
  366. </el-col>
  367. </el-row>
  368. </div>
  369. <div class="form-section">
  370. <el-row :gutter="24">
  371. <el-col :span="6">
  372. <el-form-item label="传真号">
  373. <el-input v-model="currentSupplier.faxNo"></el-input>
  374. </el-form-item>
  375. </el-col>
  376. <el-col :span="6">
  377. <el-form-item label="其他联系方式1">
  378. <el-input v-model="currentSupplier.otherContact1"></el-input>
  379. </el-form-item>
  380. </el-col>
  381. <el-col :span="6">
  382. <el-form-item label="其他联系方式2">
  383. <el-input v-model="currentSupplier.otherContact2"></el-input>
  384. </el-form-item>
  385. </el-col>
  386. <el-col :span="6">
  387. <el-form-item label="其他联系方式3">
  388. <el-input v-model="currentSupplier.otherContact3"></el-input>
  389. </el-form-item>
  390. </el-col>
  391. </el-row>
  392. </div>
  393. <div class="form-section">
  394. <el-row :gutter="24">
  395. <el-col :span="24">
  396. <el-form-item label="地址">
  397. <el-input v-model="currentSupplier.address"></el-input>
  398. </el-form-item>
  399. </el-col>
  400. </el-row>
  401. </div>
  402. <div class="form-section">
  403. <el-row :gutter="24">
  404. <el-col :span="24">
  405. <el-form-item label="备注">
  406. <el-input v-model="currentSupplier.memo" type="textarea" :rows="2" resize="none" ></el-input>
  407. </el-form-item>
  408. </el-col>
  409. </el-row>
  410. </div>
  411. </el-form>
  412. </div>
  413. <div slot="footer" class="dialog-footer" style="margin-top: 20px">
  414. <el-button type="primary" @click="saveSupplier()">保存</el-button>
  415. <el-button @click="supplierDialogVisible = false">取消</el-button>
  416. </div>
  417. </el-dialog>
  418. </div>
  419. </template>
  420. <script>
  421. /* 组件 */
  422. import {
  423. searchSupplierGroupRequestList,
  424. searchSrmSupplierList,
  425. createSrmSupplier,
  426. generateSupplierNo,
  427. updateSrmSupplier,
  428. deleteSrmSupplier,
  429. listSupplierDocTypeBySite,
  430. testCurrentLoginSite
  431. } from '@/api/srm/srmSupplier.js'
  432. import excel from '@/utils/excel-util.js'
  433. import { getPermissionValue } from '@/api/sys/specialSecurity.js'
  434. import { searchPortList } from '@/api/port/portInfo.js'
  435. import Chooselist from '@/views/modules/common/Chooselist_eam'
  436. import SysDictSelect from '@/components/dict/SysDictSelect.vue'
  437. import contract from './com_srmSupplier_Contract'
  438. import share from './com_srmSupplier_share'
  439. import documents from './com_srmSupplier_DocumentDefinition'
  440. import AddressTab from './com_srmSupplier_Address'
  441. export default {
  442. data () {
  443. return {
  444. functionId: this.$route.meta.menuId,
  445. height: 200,
  446. currentRow: {},
  447. searchData: {
  448. supplierNo: '',
  449. supplierName: '',
  450. active: '',
  451. status: '',
  452. currency:'',
  453. taxCode:'',
  454. paymentTerm:'',
  455. deliveryTerm:'',
  456. planner: '',
  457. site: this.$store.state.user.site,
  458. page: 1,
  459. limit: 10
  460. },
  461. pageIndex: 1,
  462. pageSize: 50,
  463. totalPage: 0,
  464. tagNo: '',
  465. currentFieldType: '', // 当前字段类型('buyer' / 'sourcingStaff' / 'planner' / 'mainPlanner')
  466. mainDataList: [],
  467. supplierGroupRequestList: [],
  468. supplierDocTypeOptions: [],
  469. // 始发港下拉选项(来源 port_Info,is_departure_port='Y')
  470. originPortOptions: [],
  471. dataListLoading: false,
  472. activeName: 'AddressTab',
  473. columnArray1: [
  474. {
  475. userId: this.$store.state.user.name,
  476. functionId: this.functionId,
  477. serialNumber: '811001Table1SupplierNo',
  478. tableId: '811001Table1',
  479. tableName: '供应商信息',
  480. columnProp: 'supplierNo',
  481. headerAlign: 'center',
  482. align: 'center',
  483. columnLabel: '供应商编码',
  484. columnWidth: '100',
  485. columnHidden: false,
  486. columnImage: false,
  487. columnSortable: false,
  488. sortLv: 0,
  489. status: true,
  490. fixed: false
  491. },
  492. {
  493. userId: this.$store.state.user.name,
  494. functionId: this.functionId,
  495. serialNumber: '811001Table1SupplierName',
  496. tableId: '811001Table1',
  497. tableName: '供应商信息',
  498. columnProp: 'supplierName',
  499. headerAlign: 'center',
  500. align: 'left',
  501. columnLabel: '供应商名称',
  502. columnWidth: '300',
  503. columnHidden: false,
  504. columnImage: false,
  505. columnSortable: false,
  506. sortLv: 0,
  507. status: true,
  508. fixed: false
  509. },
  510. {
  511. userId: this.$store.state.user.name,
  512. functionId: this.functionId,
  513. serialNumber: '811001Table1SupplierGroup',
  514. tableId: '811001Table1',
  515. tableName: '供应商信息',
  516. columnProp: 'groupDesc',
  517. headerAlign: 'center',
  518. align: 'center',
  519. columnLabel: '供应商等级',
  520. columnWidth: '100',
  521. columnHidden: false,
  522. columnImage: false,
  523. columnSortable: false,
  524. sortLv: 0,
  525. status: true,
  526. fixed: false
  527. },
  528. {
  529. userId: this.$store.state.user.name,
  530. functionId: this.functionId,
  531. serialNumber: '811001Table1SupplierGroup',
  532. tableId: '811001Table1',
  533. tableName: '供应商信息',
  534. columnProp: 'status',
  535. headerAlign: 'center',
  536. align: 'center',
  537. columnLabel: '活跃状态',
  538. columnWidth: '100',
  539. columnHidden: false,
  540. columnImage: false,
  541. columnSortable: false,
  542. sortLv: 0,
  543. status: true,
  544. fixed: false
  545. },
  546. {
  547. userId: this.$store.state.user.name,
  548. functionId: this.functionId,
  549. serialNumber: '811001Table1ShortOffice',
  550. tableId: '811001Table1',
  551. tableName: '供应商信息',
  552. columnProp: 'cShortOffice',
  553. headerAlign: 'center',
  554. align: 'center',
  555. columnLabel: 'ShortOffice',
  556. columnWidth: '100',
  557. columnHidden: false,
  558. columnImage: false,
  559. columnSortable: false,
  560. sortLv: 0,
  561. status: true,
  562. fixed: false
  563. },
  564. {
  565. userId: this.$store.state.user.name,
  566. functionId: this.functionId,
  567. serialNumber: '811001Table1ShortNpc',
  568. tableId: '811001Table1',
  569. tableName: '供应商信息',
  570. columnProp: 'cShortNpc',
  571. headerAlign: 'center',
  572. align: 'center',
  573. columnLabel: 'ShortNpc',
  574. columnWidth: '100',
  575. columnHidden: false,
  576. columnImage: false,
  577. columnSortable: false,
  578. sortLv: 0,
  579. status: true,
  580. fixed: false
  581. },
  582. {
  583. userId: this.$store.state.user.name,
  584. functionId: this.functionId,
  585. serialNumber: '811001Table1ProductionLeadTime',
  586. tableId: '811001Table1',
  587. tableName: '供应商信息',
  588. columnProp: 'productionLeadTime',
  589. headerAlign: 'center',
  590. align: 'center',
  591. columnLabel: 'PRODUCTION LEAD TIME',
  592. columnWidth: '160',
  593. columnHidden: false,
  594. columnImage: false,
  595. columnSortable: false,
  596. sortLv: 0,
  597. status: true,
  598. fixed: false
  599. },
  600. {
  601. userId: this.$store.state.user.name,
  602. functionId: this.functionId,
  603. serialNumber: '811001Table1DefaultOriginPort',
  604. tableId: '811001Table1',
  605. tableName: '供应商信息',
  606. columnProp: 'defaultOriginPort',
  607. headerAlign: 'center',
  608. align: 'center',
  609. columnLabel: '默认始发港',
  610. columnWidth: '120',
  611. columnHidden: false,
  612. columnImage: false,
  613. columnSortable: false,
  614. sortLv: 0,
  615. status: true,
  616. fixed: false
  617. },
  618. {
  619. userId: this.$store.state.user.name,
  620. functionId: this.functionId,
  621. serialNumber: '811001Table1SupplierDocType',
  622. tableId: '811001Table1',
  623. tableName: '供应商信息',
  624. columnProp: 'supplierDocType',
  625. headerAlign: 'center',
  626. align: 'center',
  627. columnLabel: '供应商文档清单模板',
  628. columnWidth: '150',
  629. columnHidden: false,
  630. columnImage: false,
  631. columnSortable: false,
  632. sortLv: 0,
  633. status: true,
  634. fixed: false
  635. },
  636. {
  637. userId: this.$store.state.user.name,
  638. functionId: this.functionId,
  639. serialNumber: '811001Table1Buyer',
  640. tableId: '811001Table1',
  641. tableName: '供应商信息',
  642. columnProp: 'buyer',
  643. headerAlign: 'center',
  644. align: 'left',
  645. columnLabel: '采购员',
  646. columnWidth: '100',
  647. columnHidden: false,
  648. columnImage: false,
  649. columnSortable: false,
  650. sortLv: 0,
  651. status: true,
  652. fixed: false
  653. },
  654. {
  655. userId: this.$store.state.user.name,
  656. functionId: this.functionId,
  657. serialNumber: '811001Table1SourcingStaff',
  658. tableId: '811001Table1',
  659. tableName: '供应商信息',
  660. columnProp: 'sourcingStaff',
  661. headerAlign: 'center',
  662. align: 'left',
  663. columnLabel: 'Sourcing专员',
  664. columnWidth: '120',
  665. columnHidden: false,
  666. columnImage: false,
  667. columnSortable: false,
  668. sortLv: 0,
  669. status: true,
  670. fixed: false
  671. },
  672. {
  673. userId: this.$store.state.user.name,
  674. functionId: this.functionId,
  675. serialNumber: '811001Table1Planner',
  676. tableId: '811001Table1',
  677. tableName: '供应商信息',
  678. columnProp: 'planner',
  679. headerAlign: 'center',
  680. align: 'left',
  681. columnLabel: 'Planner',
  682. columnWidth: '120',
  683. columnHidden: false,
  684. columnImage: false,
  685. columnSortable: false,
  686. sortLv: 0,
  687. status: true,
  688. fixed: false
  689. },
  690. {
  691. userId: this.$store.state.user.name,
  692. functionId: this.functionId,
  693. serialNumber: '811001Table1Tax',
  694. tableId: '811001Table1',
  695. tableName: '供应商信息',
  696. columnProp: 'taxCode',
  697. headerAlign: 'center',
  698. align: 'center',
  699. columnLabel: '税率编号',
  700. columnWidth: '100',
  701. columnHidden: false,
  702. columnImage: false,
  703. columnSortable: false,
  704. sortLv: 0,
  705. status: true,
  706. fixed: false
  707. },
  708. {
  709. userId: this.$store.state.user.name,
  710. functionId: this.functionId,
  711. serialNumber: '811001Table1TaxDesc',
  712. tableId: '811001Table1',
  713. tableName: '供应商信息',
  714. columnProp: 'taxDesc',
  715. headerAlign: 'center',
  716. align: 'left',
  717. columnLabel: '税率说明',
  718. columnWidth: '120',
  719. columnHidden: false,
  720. columnImage: false,
  721. columnSortable: false,
  722. sortLv: 0,
  723. status: true,
  724. fixed: false
  725. },
  726. {
  727. userId: this.$store.state.user.name,
  728. functionId: this.functionId,
  729. serialNumber: '811001Table1SupplierTaxRate',
  730. headerAlign: 'center',
  731. align: 'center',
  732. columnLabel: '税率文本',
  733. columnWidth: '100',
  734. columnHidden: false,
  735. columnImage: false,
  736. columnSortable: false,
  737. sortLv: 0,
  738. status: true,
  739. fixed: false
  740. },
  741. {
  742. userId: this.$store.state.user.name,
  743. functionId: this.functionId,
  744. serialNumber: '811001Table1PaymentTerm',
  745. tableId: '811001Table1',
  746. tableName: '供应商信息',
  747. columnProp: 'paymentTermDesc',
  748. headerAlign: 'center',
  749. align: 'center',
  750. columnLabel: '付款条款',
  751. columnWidth: '120',
  752. columnHidden: false,
  753. columnImage: false,
  754. columnSortable: false,
  755. sortLv: 0,
  756. status: true,
  757. fixed: false
  758. },
  759. {
  760. userId: this.$store.state.user.name,
  761. functionId: this.functionId,
  762. serialNumber: '811001Table1DeliveryTerm',
  763. tableId: '811001Table1',
  764. tableName: '供应商信息',
  765. columnProp: 'deliveryTermDesc',
  766. headerAlign: 'center',
  767. align: 'center',
  768. columnLabel: '交货条款',
  769. columnWidth: '120',
  770. columnHidden: false,
  771. columnImage: false,
  772. columnSortable: false,
  773. sortLv: 0,
  774. status: true,
  775. fixed: false
  776. },
  777. {
  778. userId: this.$store.state.user.name,
  779. functionId: this.functionId,
  780. serialNumber: '811001Table1MinShipAccount',
  781. tableId: '811001Table1',
  782. tableName: '供应商信息',
  783. columnProp: 'minShipAccount',
  784. headerAlign: 'center',
  785. align: 'center',
  786. columnLabel: '最低出货金额',
  787. columnWidth: '120',
  788. columnHidden: false,
  789. columnImage: false,
  790. columnSortable: false,
  791. sortLv: 0,
  792. status: true,
  793. fixed: false
  794. },
  795. {
  796. userId: this.$store.state.user.name,
  797. functionId: this.functionId,
  798. serialNumber: '811001Table1HandlingCharge',
  799. tableId: '811001Table1',
  800. tableName: '供应商信息',
  801. columnProp: 'handlingCharge',
  802. headerAlign: 'center',
  803. align: 'center',
  804. columnLabel: '小单费',
  805. columnWidth: '120',
  806. columnHidden: false,
  807. columnImage: false,
  808. columnSortable: false,
  809. sortLv: 0,
  810. status: true,
  811. fixed: false
  812. },
  813. {
  814. userId: this.$store.state.user.name,
  815. functionId: this.functionId,
  816. serialNumber: '811001Table1Currency',
  817. tableId: '811001Table1',
  818. tableName: '供应商信息',
  819. columnProp: 'currency',
  820. headerAlign: 'center',
  821. align: 'center',
  822. columnLabel: '货币',
  823. columnWidth: '80',
  824. columnHidden: false,
  825. columnImage: false,
  826. columnSortable: false,
  827. sortLv: 0,
  828. status: true,
  829. fixed: false
  830. },
  831. {
  832. userId: this.$store.state.user.name,
  833. functionId: this.functionId,
  834. serialNumber: '811001Table1Contact',
  835. tableId: '811001Table1',
  836. tableName: '供应商信息',
  837. columnProp: 'contact',
  838. headerAlign: 'center',
  839. align: 'left',
  840. columnLabel: '联系人',
  841. columnWidth: '150',
  842. columnHidden: false,
  843. columnImage: false,
  844. columnSortable: false,
  845. sortLv: 0,
  846. status: true,
  847. fixed: false
  848. },
  849. {
  850. userId: this.$store.state.user.name,
  851. functionId: this.functionId,
  852. serialNumber: '811001Table1PhoneNo',
  853. tableId: '811001Table1',
  854. tableName: '供应商信息',
  855. columnProp: 'phoneNo',
  856. headerAlign: 'center',
  857. align: 'left',
  858. columnLabel: '联系人电话',
  859. columnWidth: '150',
  860. columnHidden: false,
  861. columnImage: false,
  862. columnSortable: false,
  863. sortLv: 0,
  864. status: true,
  865. fixed: false
  866. },
  867. {
  868. userId: this.$store.state.user.name,
  869. functionId: this.functionId,
  870. serialNumber: '811001Table1PhoneNo2',
  871. tableId: '811001Table1',
  872. tableName: '供应商信息',
  873. columnProp: 'phoneNo2',
  874. headerAlign: 'center',
  875. align: 'left',
  876. columnLabel: '联系人电话2',
  877. columnWidth: '150',
  878. columnHidden: false,
  879. columnImage: false,
  880. columnSortable: false,
  881. sortLv: 0,
  882. status: true,
  883. fixed: false
  884. },
  885. {
  886. userId: this.$store.state.user.name,
  887. functionId: this.functionId,
  888. serialNumber: '811001Table1PhoneNo3',
  889. tableId: '811001Table1',
  890. tableName: '供应商信息',
  891. columnProp: 'phoneNo3',
  892. headerAlign: 'center',
  893. align: 'left',
  894. columnLabel: '联系人电话3',
  895. columnWidth: '150',
  896. columnHidden: false,
  897. columnImage: false,
  898. columnSortable: false,
  899. sortLv: 0,
  900. status: true,
  901. fixed: false
  902. },
  903. {
  904. userId: this.$store.state.user.name,
  905. functionId: this.functionId,
  906. serialNumber: '811001Table1Email',
  907. tableId: '811001Table1',
  908. tableName: '供应商信息',
  909. columnProp: 'email',
  910. headerAlign: 'center',
  911. align: 'left',
  912. columnLabel: '邮箱',
  913. columnWidth: '150',
  914. columnHidden: false,
  915. columnImage: false,
  916. columnSortable: false,
  917. sortLv: 0,
  918. status: true,
  919. fixed: false
  920. },
  921. {
  922. userId: this.$store.state.user.name,
  923. functionId: this.functionId,
  924. serialNumber: '811001Table1Email2',
  925. tableId: '811001Table1',
  926. tableName: '供应商信息',
  927. columnProp: 'email2',
  928. headerAlign: 'center',
  929. align: 'left',
  930. columnLabel: '邮箱2',
  931. columnWidth: '150',
  932. columnHidden: false,
  933. columnImage: false,
  934. columnSortable: false,
  935. sortLv: 0,
  936. status: true,
  937. fixed: false
  938. },
  939. {
  940. userId: this.$store.state.user.name,
  941. functionId: this.functionId,
  942. serialNumber: '811001Table1FaxNo',
  943. tableId: '811001Table1',
  944. tableName: '供应商信息',
  945. columnProp: 'faxNo',
  946. headerAlign: 'center',
  947. align: 'left',
  948. columnLabel: '传真号',
  949. columnWidth: '150',
  950. columnHidden: false,
  951. columnImage: false,
  952. columnSortable: false,
  953. sortLv: 0,
  954. status: true,
  955. fixed: false
  956. },
  957. {
  958. userId: this.$store.state.user.name,
  959. functionId: this.functionId,
  960. serialNumber: '811001Table1OtherContact1',
  961. tableId: '811001Table1',
  962. tableName: '供应商信息',
  963. columnProp: 'otherContact1',
  964. headerAlign: 'center',
  965. align: 'left',
  966. columnLabel: '其他联系方式1',
  967. columnWidth: '150',
  968. columnHidden: false,
  969. columnImage: false,
  970. columnSortable: false,
  971. sortLv: 0,
  972. status: true,
  973. fixed: false
  974. },
  975. {
  976. userId: this.$store.state.user.name,
  977. functionId: this.functionId,
  978. serialNumber: '811001Table1OtherContact2',
  979. tableId: '811001Table1',
  980. tableName: '供应商信息',
  981. columnProp: 'otherContact2',
  982. headerAlign: 'center',
  983. align: 'left',
  984. columnLabel: '其他联系方式2',
  985. columnWidth: '150',
  986. columnHidden: false,
  987. columnImage: false,
  988. columnSortable: false,
  989. sortLv: 0,
  990. status: true,
  991. fixed: false
  992. },
  993. {
  994. userId: this.$store.state.user.name,
  995. functionId: this.functionId,
  996. serialNumber: '811001Table1OtherContact3',
  997. tableId: '811001Table1',
  998. tableName: '供应商信息',
  999. columnProp: 'otherContact3',
  1000. headerAlign: 'center',
  1001. align: 'left',
  1002. columnLabel: '其他联系方式3',
  1003. columnWidth: '150',
  1004. columnHidden: false,
  1005. columnImage: false,
  1006. columnSortable: false,
  1007. sortLv: 0,
  1008. status: true,
  1009. fixed: false
  1010. },
  1011. {
  1012. userId: this.$store.state.user.name,
  1013. functionId: this.functionId,
  1014. serialNumber: '811001Table1Address',
  1015. tableId: '811001Table1',
  1016. tableName: '供应商信息',
  1017. columnProp: 'address',
  1018. headerAlign: 'center',
  1019. align: 'left',
  1020. columnLabel: '地址',
  1021. columnWidth: '250',
  1022. columnHidden: false,
  1023. columnImage: false,
  1024. columnSortable: false,
  1025. sortLv: 0,
  1026. status: true,
  1027. fixed: false
  1028. },
  1029. {
  1030. userId: this.$store.state.user.name,
  1031. functionId: this.functionId,
  1032. serialNumber: '811001Table1BankName',
  1033. tableId: '811001Table1',
  1034. tableName: '供应商信息',
  1035. columnProp: 'bankName',
  1036. headerAlign: 'center',
  1037. align: 'left',
  1038. columnLabel: '银行名称',
  1039. columnWidth: '150',
  1040. columnHidden: false,
  1041. columnImage: false,
  1042. columnSortable: false,
  1043. sortLv: 0,
  1044. status: true,
  1045. fixed: false
  1046. },
  1047. {
  1048. userId: this.$store.state.user.name,
  1049. functionId: this.functionId,
  1050. serialNumber: '811001Table1BankAccount',
  1051. tableId: '811001Table1',
  1052. tableName: '供应商信息',
  1053. columnProp: 'bankAccount',
  1054. headerAlign: 'center',
  1055. align: 'left',
  1056. columnLabel: '银行账号',
  1057. columnWidth: '100',
  1058. columnHidden: false,
  1059. columnImage: false,
  1060. columnSortable: false,
  1061. sortLv: 0,
  1062. status: true,
  1063. fixed: false
  1064. },
  1065. {
  1066. userId: this.$store.state.user.name,
  1067. functionId: this.functionId,
  1068. serialNumber: '811001Table1TaxNo',
  1069. tableId: '811001Table1',
  1070. tableName: '供应商信息',
  1071. columnProp: 'taxNo',
  1072. headerAlign: 'center',
  1073. align: 'left',
  1074. columnLabel: '纳税人识别号',
  1075. columnWidth: '140',
  1076. columnHidden: false,
  1077. columnImage: false,
  1078. columnSortable: false,
  1079. sortLv: 0,
  1080. status: true,
  1081. fixed: false
  1082. },
  1083. {
  1084. userId: this.$store.state.user.name,
  1085. functionId: this.functionId,
  1086. serialNumber: '811001Table1Memo',
  1087. tableId: '811001Table1',
  1088. tableName: '供应商信息',
  1089. columnProp: 'memo',
  1090. headerAlign: 'center',
  1091. align: 'left',
  1092. columnLabel: '备注',
  1093. columnWidth: '100',
  1094. columnHidden: false,
  1095. columnImage: false,
  1096. columnSortable: false,
  1097. sortLv: 0,
  1098. status: true,
  1099. fixed: false
  1100. },
  1101. {
  1102. userId: this.$store.state.user.name,
  1103. functionId: this.functionId,
  1104. serialNumber: '811001Table1CreateDate',
  1105. tableId: '811001Table1',
  1106. tableName: '供应商信息',
  1107. columnProp: 'createDate',
  1108. headerAlign: 'center',
  1109. align: 'left',
  1110. columnLabel: '创建日期',
  1111. columnWidth: '120',
  1112. columnHidden: false,
  1113. columnImage: false,
  1114. columnSortable: false,
  1115. sortLv: 0,
  1116. status: true,
  1117. fixed: false
  1118. },
  1119. {
  1120. userId: this.$store.state.user.name,
  1121. functionId: this.functionId,
  1122. serialNumber: '811001Table1UpdateDate',
  1123. tableId: '811001Table1',
  1124. tableName: '供应商信息',
  1125. columnProp: 'updateDate',
  1126. headerAlign: 'center',
  1127. align: 'left',
  1128. columnLabel: '更新日期',
  1129. columnWidth: '120',
  1130. columnHidden: false,
  1131. columnImage: false,
  1132. columnSortable: false,
  1133. sortLv: 0,
  1134. status: true,
  1135. fixed: false
  1136. },
  1137. {
  1138. userId: this.$store.state.user.name,
  1139. functionId: this.functionId,
  1140. serialNumber: '811001Table1CreateBy',
  1141. tableId: '811001Table1',
  1142. tableName: '供应商信息',
  1143. columnProp: 'createBy',
  1144. headerAlign: 'center',
  1145. align: 'left',
  1146. columnLabel: '创建者',
  1147. columnWidth: '100',
  1148. columnHidden: false,
  1149. columnImage: false,
  1150. columnSortable: false,
  1151. sortLv: 0,
  1152. status: true,
  1153. fixed: false
  1154. },
  1155. {
  1156. userId: this.$store.state.user.name,
  1157. functionId: this.functionId,
  1158. serialNumber: '811001Table1UpdateBy',
  1159. tableId: '811001Table1',
  1160. tableName: '供应商信息',
  1161. columnProp: 'updateBy',
  1162. headerAlign: 'center',
  1163. align: 'left',
  1164. columnLabel: '更新者',
  1165. columnWidth: '100',
  1166. columnHidden: false,
  1167. columnImage: false,
  1168. columnSortable: false,
  1169. sortLv: 0,
  1170. status: true,
  1171. fixed: false
  1172. },
  1173. {
  1174. userId: this.$store.state.user.name,
  1175. functionId: this.functionId,
  1176. serialNumber: '811001Table1Active',
  1177. tableId: '811001Table1',
  1178. tableName: '供应商信息',
  1179. columnProp: 'active',
  1180. headerAlign: 'center',
  1181. align: 'center',
  1182. columnLabel: '是否在用',
  1183. columnWidth: '100',
  1184. columnHidden: false,
  1185. columnImage: false,
  1186. columnSortable: false,
  1187. sortLv: 0,
  1188. status: true,
  1189. fixed: false
  1190. }
  1191. ],
  1192. columnArray3: [
  1193. {
  1194. userId: this.$store.state.user.name,
  1195. functionId: this.functionId,
  1196. serialNumber: '811001Table3RequestNo',
  1197. tableId: '811001Table3',
  1198. tableName: '供应商等级变更记录',
  1199. columnProp: 'requestNo',
  1200. headerAlign: 'center',
  1201. align: 'left',
  1202. columnLabel: '请求编号',
  1203. columnWidth: '100',
  1204. columnHidden: false,
  1205. columnImage: false,
  1206. columnSortable: false,
  1207. sortLv: 0,
  1208. status: true,
  1209. fixed: false
  1210. },
  1211. {
  1212. userId: this.$store.state.user.name,
  1213. functionId: this.functionId,
  1214. serialNumber: '811001Table3RequestDate',
  1215. tableId: '811001Table3',
  1216. tableName: '供应商等级变更记录',
  1217. columnProp: 'requestDate',
  1218. headerAlign: 'center',
  1219. align: 'left',
  1220. columnLabel: '请求日期',
  1221. columnWidth: '100',
  1222. columnHidden: false,
  1223. columnImage: false,
  1224. columnSortable: false,
  1225. sortLv: 0,
  1226. status: true,
  1227. fixed: false
  1228. },
  1229. {
  1230. userId: this.$store.state.user.name,
  1231. functionId: this.functionId,
  1232. serialNumber: '811001Table3OldSupplierGroup',
  1233. tableId: '811001Table3',
  1234. tableName: '供应商等级变更记录',
  1235. columnProp: 'oldSupplierGroup',
  1236. headerAlign: 'center',
  1237. align: 'left',
  1238. columnLabel: '旧供应商等级',
  1239. columnWidth: '100',
  1240. columnHidden: false,
  1241. columnImage: false,
  1242. columnSortable: false,
  1243. sortLv: 0,
  1244. status: true,
  1245. fixed: false
  1246. },
  1247. {
  1248. userId: this.$store.state.user.name,
  1249. functionId: this.functionId,
  1250. serialNumber: '811001Table3NewSupplierGroup',
  1251. tableId: '811001Table3',
  1252. tableName: '供应商等级变更记录',
  1253. columnProp: 'newSupplierGroup',
  1254. headerAlign: 'center',
  1255. align: 'left',
  1256. columnLabel: '新供应商等级',
  1257. columnWidth: '100',
  1258. columnHidden: false,
  1259. columnImage: false,
  1260. columnSortable: false,
  1261. sortLv: 0,
  1262. status: true,
  1263. fixed: false
  1264. },
  1265. {
  1266. userId: this.$store.state.user.name,
  1267. functionId: this.functionId,
  1268. serialNumber: '811001Table3Reason',
  1269. tableId: '811001Table3',
  1270. tableName: '供应商等级变更记录',
  1271. columnProp: 'reason',
  1272. headerAlign: 'center',
  1273. align: 'left',
  1274. columnLabel: '原因',
  1275. columnWidth: '200',
  1276. columnHidden: false,
  1277. columnImage: false,
  1278. columnSortable: false,
  1279. sortLv: 0,
  1280. status: true,
  1281. fixed: false
  1282. },
  1283. {
  1284. userId: this.$store.state.user.name,
  1285. functionId: this.functionId,
  1286. serialNumber: '811001Table3Status',
  1287. tableId: '811001Table3',
  1288. tableName: '供应商等级变更记录',
  1289. columnProp: 'status',
  1290. headerAlign: 'center',
  1291. align: 'left',
  1292. columnLabel: '是否在用',
  1293. columnWidth: '100',
  1294. columnHidden: false,
  1295. columnImage: false,
  1296. columnSortable: false,
  1297. sortLv: 0,
  1298. status: true,
  1299. fixed: false
  1300. },
  1301. {
  1302. userId: this.$store.state.user.name,
  1303. functionId: this.functionId,
  1304. serialNumber: '811001Table3RequestBy',
  1305. tableId: '811001Table3',
  1306. tableName: '供应商等级变更记录',
  1307. columnProp: 'requestBy',
  1308. headerAlign: 'center',
  1309. align: 'left',
  1310. columnLabel: '请求者',
  1311. columnWidth: '100',
  1312. columnHidden: false,
  1313. columnImage: false,
  1314. columnSortable: false,
  1315. sortLv: 0,
  1316. status: true,
  1317. fixed: false
  1318. }
  1319. ],
  1320. exportName: '供应商信息' + this.dayjs().format('YYYYMMDDHHmmss'),
  1321. // 供应商对话框相关
  1322. supplierDialogVisible: false,
  1323. isAdd: true,
  1324. // SRM0006 特殊权限:是否允许修改已创建供应商的 ShortOffice - rqrq
  1325. hasShortOfficeEditPermission: false,
  1326. // 编辑弹窗内 ShortOffice 是否已解锁(每次打开默认锁定)- rqrq
  1327. shortOfficeEditable: false,
  1328. currentSupplier: {
  1329. cShortOffice: '',
  1330. cShortNpc: '',
  1331. supplierNo: '',
  1332. supplierName: '',
  1333. supplierDocType: '',
  1334. active: 'Y',
  1335. supplierGroup:'',
  1336. abc: '',
  1337. sourcingStaff: '',
  1338. currency:'',
  1339. taxCode:'',
  1340. paymentTerm:'',
  1341. deliveryTerm:'',
  1342. minShipAccount: '',
  1343. handlingCharge: 0,
  1344. contract:'',
  1345. phoneNo: '',
  1346. phoneNo2:'',
  1347. phoneNo3:'',
  1348. email: '',
  1349. email2:'',
  1350. faxNo: '',
  1351. otherContact1:'',
  1352. otherContact2:'',
  1353. otherContact3:'',
  1354. bankName:'',
  1355. bankAccount:'',
  1356. address: '',
  1357. createDate: '',
  1358. createBy: '',
  1359. updateDate: '',
  1360. updateBy: '',
  1361. memo:'',
  1362. planner: '',
  1363. defaultOriginPort: '',
  1364. site: this.$store.state.user.site,
  1365. },
  1366. supplierRules: {
  1367. supplierNo: [
  1368. { required: true, message: ' ', trigger: 'blur' }
  1369. ],
  1370. cShortOffice: [
  1371. { required: true, message: '请输入ShortOffice', trigger: 'blur' }
  1372. ],
  1373. supplierName: [
  1374. { required: true, message: ' ', trigger: 'blur' }
  1375. ],
  1376. supplierDocType: [
  1377. { required: true, message: '请选择供应商文档清单模板', trigger: ['blur', 'change'] }
  1378. ],
  1379. planner: [
  1380. { required: true, message: '请选择Planner', trigger: ['blur', 'change'] }
  1381. ]
  1382. }
  1383. }
  1384. },
  1385. /* 组件 */
  1386. components: {
  1387. Chooselist,
  1388. SysDictSelect,
  1389. contract,
  1390. documents,
  1391. share,
  1392. AddressTab
  1393. },
  1394. mounted () {
  1395. this.$nextTick(() => {
  1396. this.height = (window.innerHeight - 220) / 2
  1397. this.loadMainOrReminder()
  1398. this.checkShortOfficePermission()
  1399. })
  1400. },
  1401. watch: {
  1402. '$route.query.docExpireSupplierIds'(val, oldVal) {
  1403. if (val === oldVal) return
  1404. if (this._suppressDocExpireRouteWatch) {
  1405. this._suppressDocExpireRouteWatch = false
  1406. return
  1407. }
  1408. this.loadMainOrReminder()
  1409. }
  1410. },
  1411. methods: {
  1412. getStatusClass (status) {
  1413. return {
  1414. 'status-active': status === 'Active',
  1415. 'status-inactive': status === 'Inactive'
  1416. }
  1417. },
  1418. // 查询 SRM0006 特殊权限:是否允许修改已创建供应商的 ShortOffice - rqrq
  1419. checkShortOfficePermission () {
  1420. const username = this.$store.state.user.name || ''
  1421. if (!username) {
  1422. this.hasShortOfficeEditPermission = false
  1423. return
  1424. }
  1425. getPermissionValue(username, 'SRM0006').then(({ data }) => {
  1426. if (data && data.code === 0) {
  1427. this.hasShortOfficeEditPermission = String(data.value).trim() === 'Y'
  1428. } else {
  1429. this.hasShortOfficeEditPermission = false
  1430. }
  1431. }).catch(error => {
  1432. console.error('查询修改ShortOffice权限失败:', error)
  1433. this.hasShortOfficeEditPermission = false
  1434. })
  1435. },
  1436. // 加载始发港下拉选项(port_Info 中 is_departure_port='Y')
  1437. loadOriginPortOptions () {
  1438. searchPortList({ isDeparturePort: 'Y' }).then(({ data }) => {
  1439. if (data && data.code === 0) {
  1440. this.originPortOptions = Array.isArray(data.rows) ? data.rows : []
  1441. } else {
  1442. this.originPortOptions = []
  1443. }
  1444. }).catch(() => {
  1445. this.originPortOptions = []
  1446. })
  1447. },
  1448. // 始发港保存的是港口编码,列表/展示时映射为港口名称;无匹配则回退原值
  1449. portNameByCode (code) {
  1450. if (code === null || code === undefined || code === '') {
  1451. return ''
  1452. }
  1453. const hit = this.originPortOptions.find(p => p.portCode === code)
  1454. return hit ? hit.portName : code
  1455. },
  1456. /**
  1457. * 查询列表小单费去尾零。
  1458. * 业务意图:handling_charge 按“去尾零”展示,整数显示为 1 而不是 1.000。
  1459. * 最低出货金额已改为字典字符串,列表直接显示字段值,不走本方法。
  1460. * 边界:空值显示空;非数字原样返回。
  1461. */
  1462. formatSupplierNumberDisplay (value) {
  1463. if (value === null || value === undefined || value === '') {
  1464. return ''
  1465. }
  1466. const num = Number(value)
  1467. if (!Number.isFinite(num)) {
  1468. return String(value)
  1469. }
  1470. return String(num)
  1471. },
  1472. loadMainOrReminder () {
  1473. const raw = this.$route.query.docExpireSupplierIds
  1474. if (raw !== undefined && raw !== null && String(raw).trim() !== '') {
  1475. const ids = String(raw).split(',').map(s => parseInt(s.trim(), 10)).filter(n => !isNaN(n))
  1476. if (ids.length) {
  1477. this.$set(this.searchData, 'supplierIdList', ids)
  1478. this.pageIndex = 1
  1479. this.getMainData({ clearReminderIdFilterAfter: true })
  1480. return
  1481. }
  1482. }
  1483. this.getMainData()
  1484. },
  1485. getBaseList (val, type) {
  1486. this.tagNo = val
  1487. this.currentFieldType = type // 保存当前字段类型
  1488. this.$nextTick(() => {
  1489. let strVal = ''
  1490. let conSql = ''
  1491. if (val === 520) {
  1492. strVal = this.searchData.supplierNo || ''
  1493. }
  1494. if (val === 513){
  1495. strVal = this.currentSupplier.currency
  1496. }
  1497. if (val === 522){
  1498. strVal = this.currentSupplier.taxCode
  1499. }
  1500. if (val === 523){
  1501. strVal = this.currentSupplier.paymentTerm
  1502. }
  1503. if (val === 524){
  1504. strVal = this.currentSupplier.deliveryTerm
  1505. }
  1506. if (val === 529 && type === 'buyer'){
  1507. strVal = this.currentSupplier.buyer || ''
  1508. // 防止 Druid 拦截 where 1=1
  1509. conSql = " and username <> '' "
  1510. }
  1511. if (val === 528 && type === 'sourcingStaff'){
  1512. strVal = this.currentSupplier.sourcingStaff || ''
  1513. // 防止 Druid 拦截 where 1=1
  1514. conSql = " and username <> '' "
  1515. }
  1516. if (val === 530 && type === 'planner'){
  1517. strVal = this.currentSupplier.planner || ''
  1518. // 防止 Druid 拦截 where 1=1;角色过滤由 tagNo=530 的 SQLCode 承担
  1519. conSql = " and username <> '' "
  1520. }
  1521. if (val === 530 && type === 'mainPlanner') {
  1522. strVal = this.searchData.planner || ''
  1523. // 防止 Druid 拦截 where 1=1;角色过滤由 tagNo=530 的 SQLCode 承担
  1524. conSql = " and username <> '' "
  1525. }
  1526. console.log('getBaseList调用:', { val, type, strVal, conSql })
  1527. this.$refs.baseList.init(val, strVal, conSql)
  1528. })
  1529. },
  1530. /* 列表方法的回调 */
  1531. getBaseData (val) {
  1532. console.log('Chooselist返回的数据:', val, 'tagNo:', this.tagNo)
  1533. if (this.tagNo === 520) {
  1534. // 供应商编码字段 - SQL返回: supplier_no, supplier_name
  1535. const supplierNoVal = val.supplier_no || ''
  1536. this.searchData.supplierNo = supplierNoVal
  1537. console.log('供应商编码赋值:', supplierNoVal)
  1538. }
  1539. if(this.tagNo == 513){
  1540. // 货币字段
  1541. const currencyVal = val.Currency || val.currency || val.CurrencyID || val.currency_id || ''
  1542. this.currentSupplier.currency = currencyVal
  1543. console.log('货币赋值:', currencyVal)
  1544. }
  1545. if (this.tagNo === 522) {
  1546. // 税率编号字段 - SQL返回: tax_code, tax_desc
  1547. const taxCodeVal = val.tax_code || val.TaxCode || val.taxCode || ''
  1548. this.currentSupplier.taxCode = taxCodeVal
  1549. console.log('税率编号赋值:', taxCodeVal)
  1550. }
  1551. if (this.tagNo === 523) {
  1552. // 付款条款字段 - SQL返回: payment_term_id, payment_term
  1553. const paymentTermVal = val.payment_term_id || val.PaymentTermID || val.paymentTermID || ''
  1554. this.currentSupplier.paymentTerm = paymentTermVal
  1555. console.log('付款条款赋值:', paymentTermVal)
  1556. }
  1557. if (this.tagNo === 524) {
  1558. // 交货条款字段 - SQL返回: delivery_term_id, delivery_term
  1559. const deliveryTermVal = val.delivery_term_id || val.DeliveryTermID || val.deliveryTermID || ''
  1560. this.currentSupplier.deliveryTerm = deliveryTermVal
  1561. console.log('交货条款赋值:', deliveryTermVal)
  1562. }
  1563. if (this.tagNo === 529 && this.currentFieldType === 'buyer') {
  1564. this.currentSupplier.buyer = val.UserName
  1565. console.log('采购员赋值:', this.currentSupplier.buyer)
  1566. }
  1567. if (this.tagNo === 528 && this.currentFieldType === 'sourcingStaff') {
  1568. this.currentSupplier.sourcingStaff = val.UserName
  1569. console.log('Sourcing专员赋值:', this.currentSupplier.sourcingStaff)
  1570. }
  1571. if (this.tagNo === 530 && this.currentFieldType === 'planner') {
  1572. this.currentSupplier.planner = val.UserName || val.userName || val.username || ''
  1573. console.log('Planner赋值:', this.currentSupplier.planner)
  1574. }
  1575. if (this.tagNo === 530 && this.currentFieldType === 'mainPlanner') {
  1576. this.searchData.planner = val.User_display || val.user_display || val.userDisplay || val.UserName || val.userName || val.username || ''
  1577. console.log('Planner查询赋值:', this.searchData.planner)
  1578. }
  1579. },
  1580. // 加载供应商文档类型下拉 - rqrq
  1581. loadSupplierDocTypeOptions () {
  1582. const site = (this.currentSupplier.site || this.$store.state.user.site || '').trim()
  1583. if (!site) {
  1584. this.supplierDocTypeOptions = []
  1585. return
  1586. }
  1587. listSupplierDocTypeBySite({ site }).then(({ data }) => {
  1588. if (data && data.code === 0) {
  1589. const rows = Array.isArray(data.rows) ? data.rows : []
  1590. const options = rows
  1591. .map(item => typeof item === 'string' ? item : (item.supplierDocType || item.supplier_doc_type || ''))
  1592. .filter(item => item && String(item).trim() !== '')
  1593. this.supplierDocTypeOptions = Array.from(new Set(options))
  1594. const currentType = this.currentSupplier.supplierDocType
  1595. if (currentType && this.supplierDocTypeOptions.indexOf(currentType) === -1) {
  1596. this.supplierDocTypeOptions.unshift(currentType)
  1597. }
  1598. // 新增弹窗打开时,供应商文档清单模板默认选中第一条
  1599. if (this.isAdd && !this.currentSupplier.supplierDocType && this.supplierDocTypeOptions.length > 0) {
  1600. this.currentSupplier.supplierDocType = this.supplierDocTypeOptions[0]
  1601. }
  1602. } else {
  1603. this.supplierDocTypeOptions = []
  1604. this.$message.error((data && data.msg) || '加载供应商文档清单失败')
  1605. }
  1606. }).catch(() => {
  1607. this.supplierDocTypeOptions = []
  1608. this.$message.error('加载供应商文档清单失败')
  1609. })
  1610. },
  1611. getMainData (opts) {
  1612. const clearReminderIdFilterAfter = opts && opts.clearReminderIdFilterAfter === true
  1613. this.searchData.limit = this.pageSize
  1614. this.searchData.page = this.pageIndex
  1615. searchSrmSupplierList(this.searchData).then(({data}) => {
  1616. if (data.code === 0) {
  1617. this.mainDataList = data.page.list
  1618. this.pageIndex = data.page.currPage
  1619. this.pageSize = data.page.pageSize
  1620. this.totalPage = data.page.totalCount
  1621. this.$nextTick(() => {
  1622. if (this.$refs.mainTable) {
  1623. this.$refs.mainTable.clearSelection()
  1624. }
  1625. })
  1626. if (clearReminderIdFilterAfter) {
  1627. this.activeName = 'documents'
  1628. }
  1629. //判断是否全部存在数据
  1630. if (this.mainDataList.length > 0) {
  1631. //设置选中行
  1632. this.$refs.mainTable.setCurrentRow(this.mainDataList[0])
  1633. this.changeData(this.mainDataList[0])
  1634. }else {
  1635. this.changeData(null)
  1636. }
  1637. if (clearReminderIdFilterAfter) {
  1638. this.$delete(this.searchData, 'supplierIdList')
  1639. const q = Object.assign({}, this.$route.query)
  1640. delete q.docExpireSupplierIds
  1641. this._suppressDocExpireRouteWatch = true
  1642. this.$router.replace({ name: this.$route.name, query: q, params: this.$route.params })
  1643. }
  1644. }
  1645. this.dataListLoading = false
  1646. })
  1647. },
  1648. tabClick (tab, event) {
  1649. this.refreshCurrentTabTable()
  1650. },
  1651. // 每页数
  1652. sizeChangeHandle (val) {
  1653. this.pageSize = val
  1654. this.pageIndex = 1
  1655. this.getMainData()
  1656. },
  1657. // 当前页
  1658. currentChangeHandle (val) {
  1659. this.pageIndex = val
  1660. this.getMainData()
  1661. },
  1662. changeData (row) {
  1663. this.currentRow = JSON.parse(JSON.stringify(row))
  1664. this.refreshCurrentTabTable()
  1665. },
  1666. refreshCurrentTabTable () {
  1667. const hasCurrentSupplier = !!(this.currentRow &&
  1668. this.currentRow.site &&
  1669. this.currentRow.supplierNo)
  1670. if (!hasCurrentSupplier) {
  1671. // 主记录为空时清空所有子页签数据,避免传空条件查出全量 - rqrq
  1672. this.supplierGroupRequestList = []
  1673. if (this.$refs.contract && Array.isArray(this.$refs.contract.dataList)) {
  1674. this.$refs.contract.dataList = []
  1675. }
  1676. if (this.$refs.documents && Array.isArray(this.$refs.documents.dataList)) {
  1677. this.$refs.documents.dataList = []
  1678. }
  1679. if (this.$refs.documents && Array.isArray(this.$refs.documents.extraProjectDocumentList)) {
  1680. this.$refs.documents.extraProjectDocumentList = []
  1681. }
  1682. if (this.$refs.documents && Array.isArray(this.$refs.documents.fileList2)) {
  1683. this.$refs.documents.fileList2 = []
  1684. }
  1685. if (this.$refs.AddressTab && Array.isArray(this.$refs.AddressTab.dataList)) {
  1686. this.$refs.AddressTab.dataList = []
  1687. }
  1688. if (this.$refs.share && Array.isArray(this.$refs.share.dataList)) {
  1689. this.$refs.share.dataList = []
  1690. }
  1691. return
  1692. }
  1693. if (this.activeName === 'share') {
  1694. this.refreshShareTable()
  1695. }
  1696. if (this.activeName === 'groupChangeList') {
  1697. let inData = {
  1698. site: this.currentRow.site,
  1699. supplierNo: this.currentRow.supplierNo
  1700. }
  1701. searchSupplierGroupRequestList(inData).then(({data}) => {
  1702. // 区分请求成功和失败的状况
  1703. if (data && data.code == 0) {
  1704. this.supplierGroupRequestList = data.rows
  1705. } else {
  1706. this.supplierGroupRequestList = []
  1707. }
  1708. })
  1709. }
  1710. if (this.activeName === 'contract') {
  1711. this.refreshContractTable()
  1712. }
  1713. if (this.activeName === 'documents') {
  1714. this.refreshDocumentsTable()
  1715. }
  1716. if (this.activeName === 'AddressTab') {
  1717. this.refreshAddressTable()
  1718. }
  1719. },
  1720. /**
  1721. * 主表导出。
  1722. * 复用当前查询条件,单独传 page=1、limit=-1 一次取全部,不改写列表当前分页状态。
  1723. * site 以前端查询条件为准,漏传时回落到当前登录 site。
  1724. */
  1725. async exportExcel () {
  1726. const params = Object.assign({}, this.searchData, {
  1727. page: 1,
  1728. limit: -1,
  1729. site: this.searchData.site || this.$store.state.user.site
  1730. })
  1731. excel.exportTable({
  1732. url: '/srmSupplier/searchSrmSupplierList',
  1733. columnMapping: this.columnArray1, // 可以直接用table,不需要的列就剔除
  1734. mergeSetting: [], // 需要合并的列
  1735. params: params,
  1736. fileName: this.exportName + '.xlsx',
  1737. rowFetcher: res => res.data,
  1738. columnFormatter: [],
  1739. dropColumns: []// 需要剔除的列,例如dropColumns: ["netWeight"],即剔除净重列
  1740. })
  1741. },
  1742. refreshContractTable () {
  1743. let inData = {
  1744. site: this.currentRow.site,
  1745. supplierNo: this.currentRow.supplierNo,
  1746. supplierName: this.currentRow.supplierName,
  1747. height: Number(this.height) - 20
  1748. }
  1749. this.$refs.contract.init(inData)
  1750. },
  1751. refreshDocumentsTable () {
  1752. let inData = {
  1753. site: this.currentRow.site,
  1754. objectNo: this.currentRow.supplierNo,
  1755. supplierNo: this.currentRow.supplierNo,
  1756. supplierName: this.currentRow.supplierName,
  1757. supplierDocType: this.currentRow.supplierDocType,
  1758. objectType: 'supplier',
  1759. height: Number(this.height) - 20
  1760. }
  1761. this.$refs.documents.init(inData)
  1762. },
  1763. refreshAddressTable () {
  1764. let inData = {
  1765. supplierId: this.currentRow.supplierNo, // 使用实际的供应商编码作为supplierId
  1766. site: this.currentRow.site,
  1767. supplierNo: this.currentRow.supplierNo,
  1768. height: Number(this.height) - 20
  1769. }
  1770. this.$nextTick(() => {
  1771. const addressComp = this.$refs.AddressTab
  1772. if (addressComp && typeof addressComp.init === 'function') {
  1773. addressComp.init(inData)
  1774. }
  1775. })
  1776. },
  1777. refreshShareTable() {
  1778. let inData = {
  1779. site: this.currentRow.site,
  1780. supplierNo: this.currentRow.supplierNo,
  1781. supplierName: this.currentRow.supplierName,
  1782. height: Number(this.height) - 20
  1783. }
  1784. this.$refs.share.init(inData)
  1785. },
  1786. // 新增供应商
  1787. addSupplier() {
  1788. this.isAdd = true
  1789. this.shortOfficeEditable = false
  1790. this.currentSupplier = {
  1791. supplierNo: '',
  1792. supplierName: '',
  1793. supplierDocType: '',
  1794. active: 'Y',
  1795. status: 'Active',
  1796. supplierGroup: '',
  1797. abc: '',
  1798. buyer: '',
  1799. sourcingStaff: '',
  1800. currency:'',
  1801. taxCode:'',
  1802. paymentTerm:'',
  1803. deliveryTerm:'',
  1804. minShipAccount: '',
  1805. handlingCharge: 0,
  1806. contract:'',
  1807. phoneNo: '',
  1808. phoneNo2:'',
  1809. phoneNo3:'',
  1810. email: '',
  1811. email2:'',
  1812. faxNo: '',
  1813. otherContact1:'',
  1814. otherContact2:'',
  1815. otherContact3:'',
  1816. bankName:'',
  1817. bankAccount:'',
  1818. address: '',
  1819. createDate: '',
  1820. createBy: '',
  1821. updateDate: '',
  1822. updateBy: '',
  1823. memo:'',
  1824. planner: '',
  1825. defaultOriginPort: '',
  1826. site: this.$store.state.user.site,
  1827. }
  1828. this.loadSupplierDocTypeOptions()
  1829. this.supplierDialogVisible = true
  1830. // 新增时默认生成下一个 SP+数字 供应商编码 - 由后端按现有最大序号自增
  1831. generateSupplierNo().then(({ data }) => {
  1832. if (data && data.code === 0) {
  1833. this.currentSupplier.supplierNo = data.supplierNo || ''
  1834. } else {
  1835. this.$message.error((data && data.msg) || '生成供应商编码失败')
  1836. }
  1837. }).catch(() => {
  1838. this.$message.error('生成供应商编码失败')
  1839. })
  1840. },
  1841. // 编辑供应商
  1842. editSupplier() {
  1843. if (!this.currentRow) {
  1844. this.$message.warning('请选择一个供应商修改')
  1845. return
  1846. }
  1847. this.isAdd = false
  1848. this.shortOfficeEditable = false
  1849. this.currentSupplier = {
  1850. ...this.currentRow,
  1851. // 列表展示使用 user_display,编辑回填需恢复为账号
  1852. buyer: this.currentRow.buyerAccount || this.currentRow.buyer || '',
  1853. sourcingStaff: this.currentRow.sourcingStaffAccount || this.currentRow.sourcingStaff || '',
  1854. planner: this.currentRow.plannerAccount || this.currentRow.planner || '',
  1855. // 最低出货金额为字典值,空串表示未选;小单费空值按 0 回填 - rqrq
  1856. minShipAccount: this.currentRow.minShipAccount === null || this.currentRow.minShipAccount === undefined
  1857. ? ''
  1858. : this.currentRow.minShipAccount,
  1859. handlingCharge: this.currentRow.handlingCharge === null || this.currentRow.handlingCharge === undefined || this.currentRow.handlingCharge === ''
  1860. ? 0
  1861. : this.currentRow.handlingCharge
  1862. }
  1863. this.loadSupplierDocTypeOptions()
  1864. this.supplierDialogVisible = true
  1865. },
  1866. // 保存供应商
  1867. saveSupplier() {
  1868. this.$refs.supplierForm.validate((valid) => {
  1869. if (valid) {
  1870. const apiCall = this.isAdd ? createSrmSupplier(this.currentSupplier) : updateSrmSupplier(this.currentSupplier)
  1871. apiCall.then(({data}) => {
  1872. if (data && data.code === 0) {
  1873. this.$message.success(this.isAdd ? '新增供应商成功' : '修改供应商成功')
  1874. this.supplierDialogVisible = false
  1875. this.getMainData() // 重新加载数据
  1876. } else {
  1877. this.$message.error(data.msg || '操作失败')
  1878. }
  1879. }).catch(error => {
  1880. this.$message.error('操作失败: ' + error.message)
  1881. })
  1882. } else {
  1883. this.$message.warning('请填写必填字段')
  1884. }
  1885. })
  1886. },
  1887. // 删除供应商
  1888. deleteSupplier(row) {
  1889. this.$confirm('你确定删除该供应商?', '确认删除', {
  1890. confirmButtonText: '确认',
  1891. cancelButtonText: '取消',
  1892. type: 'warning'
  1893. }).then(() => {
  1894. deleteSrmSupplier(row.id).then(({data}) => {
  1895. if (data && data.code === 0) {
  1896. this.$message.success('供应商删除成功')
  1897. this.getMainData() // 重新加载数据
  1898. } else {
  1899. this.$message.error(data.msg || '删除失败')
  1900. }
  1901. }).catch(error => {
  1902. this.$message.error('删除失败: ' + error.message)
  1903. })
  1904. })
  1905. },
  1906. handleTestCurrentLoginSite () {
  1907. testCurrentLoginSite({}).then(({ data }) => {
  1908. if (data && data.code === 0) {
  1909. const site = data.site || ''
  1910. this.$message.success(`当前登录工厂(site): ${site || '(空)'}`)
  1911. return
  1912. }
  1913. this.$message.error((data && data.msg) || '获取当前登录工厂失败')
  1914. }).catch((error) => {
  1915. this.$message.error('获取当前登录工厂失败: ' + error.message)
  1916. })
  1917. }
  1918. },
  1919. created() {
  1920. // 查询报表的类型
  1921. this.getMainData()
  1922. this.loadOriginPortOptions()
  1923. }
  1924. }
  1925. </script>
  1926. <!--当前页面的标签样式-->
  1927. <style scoped lang="scss">
  1928. /deep/ .customer-tab .el-tabs__content {
  1929. padding: 5px !important;
  1930. }
  1931. /* 供应商对话框整体样式 */
  1932. .supplier-dialog {
  1933. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  1934. }
  1935. .supplier-dialog .el-dialog {
  1936. margin-top: 5vh !important;
  1937. margin-bottom: 5vh !important;
  1938. }
  1939. .supplier-dialog .el-dialog__header {
  1940. padding: 20px 25px 15px 25px;
  1941. border-bottom: 1px solid #E4E7ED;
  1942. }
  1943. .supplier-dialog .el-dialog__body {
  1944. padding: 25px 25px 25px 25px;
  1945. max-height: 75vh;
  1946. overflow-y: auto;
  1947. min-height: 400px;
  1948. }
  1949. .dialog-content {
  1950. width: 100%;
  1951. }
  1952. /* 供应商表单样式 */
  1953. .supplier-form {
  1954. width: 100%;
  1955. }
  1956. .supplier-form .el-form-item {
  1957. margin-bottom: 1px;
  1958. }
  1959. .supplier-form .el-form-item__label {
  1960. font-weight: 500;
  1961. color: #303133;
  1962. line-height: 32px;
  1963. padding-right: 12px;
  1964. }
  1965. .supplier-form .el-form-item__content {
  1966. line-height: normal;
  1967. }
  1968. /* 表单分组样式 */
  1969. .form-section {
  1970. margin-bottom: 5px;
  1971. }
  1972. .form-section:last-child {
  1973. margin-bottom: 5px;
  1974. }
  1975. /* 输入框样式 */
  1976. .supplier-form .el-input,
  1977. .supplier-form .el-textarea,
  1978. .supplier-form .el-date-editor {
  1979. width: 100%;
  1980. }
  1981. /* 文本域样式优化 */
  1982. .supplier-form .el-textarea__inner {
  1983. resize: none;
  1984. font-family: inherit;
  1985. line-height: 1.5;
  1986. }
  1987. /* 对话框底部按钮居中 */
  1988. .dialog-footer-center {
  1989. text-align: center;
  1990. padding: 15px 0 5px 0;
  1991. border-top: 1px solid #E4E7ED;
  1992. margin-top: 15px;
  1993. }
  1994. .dialog-footer-center .el-button {
  1995. margin: 0 10px;
  1996. min-width: 90px;
  1997. height: 36px;
  1998. padding: 0 20px;
  1999. font-size: 14px;
  2000. }
  2001. /* 响应式调整 */
  2002. @media (max-width: 1200px) {
  2003. .supplier-dialog {
  2004. width: 95% !important;
  2005. }
  2006. .supplier-dialog .el-dialog__body {
  2007. padding: 20px 20px 15px 20px;
  2008. }
  2009. }
  2010. @media (max-width: 768px) {
  2011. .supplier-form .el-col {
  2012. margin-bottom: 20px;
  2013. }
  2014. .form-section {
  2015. margin-bottom: 35px;
  2016. }
  2017. .supplier-form .el-form-item__label {
  2018. line-height: 28px;
  2019. height: 28px;
  2020. }
  2021. }
  2022. .status-active {
  2023. color: #ff0000;
  2024. }
  2025. .status-inactive {
  2026. color: #67c23a;
  2027. }
  2028. </style>