edit.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <div class="warehouseAllocationEdit-wrap">
  3. <a-page-header :ghost="false" @back="handleBack" class="warehouseAllocationEdit-back">
  4. <!-- 自定义的二级文字标题 -->
  5. <template slot="subTitle">
  6. <a id="warehouseAllocationEdit-back-btn" href="javascript:;" @click="handleBack">返回列表</a>
  7. </template>
  8. <!-- 操作区,位于 title 行的行尾 -->
  9. <template slot="extra">
  10. <a-button key="2" id="warehouseAllocationEdit-preview-btn">打印预览</a-button>
  11. <a-button key="1" type="primary" id="warehouseAllocationEdit-print-btn">快速打印</a-button>
  12. </template>
  13. </a-page-header>
  14. <!-- 基础信息 -->
  15. <a-card :bordered="false" class="warehouseAllocationEdit-cont">
  16. <a-collapse :activeKey="['1']">
  17. <a-collapse-panel key="1">
  18. <template slot="header">
  19. 基础信息
  20. <a-button type="primary" shape="circle" size="small" icon="edit" class="edit-circle-btn" id="warehouseAllocationEdit-circle-btn" @click.stop="handleEditInfo" />
  21. </template>
  22. <a-descriptions :column="3">
  23. <a-descriptions-item label="调出仓库">箭冠营销中心</a-descriptions-item>
  24. <a-descriptions-item label="调入仓库">箭冠营销中心</a-descriptions-item>
  25. </a-descriptions>
  26. </a-collapse-panel>
  27. </a-collapse>
  28. </a-card>
  29. <!-- 选择产品 -->
  30. <a-card :bordered="false" class="warehouseAllocationEdit-cont">
  31. <a-collapse :activeKey="['1']">
  32. <a-collapse-panel key="1" header="选择产品">
  33. <!-- 筛选条件 -->
  34. <div class="table-page-search-wrapper">
  35. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  36. <a-row :gutter="15">
  37. <a-col :md="6" :sm="24">
  38. <a-form-item label="产品编码" prop="name">
  39. <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品编码" allowClear />
  40. </a-form-item>
  41. </a-col>
  42. <a-col :md="6" :sm="24">
  43. <a-form-item label="产品名称" prop="name">
  44. <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品名称" allowClear />
  45. </a-form-item>
  46. </a-col>
  47. <a-col :md="6" :sm="24">
  48. <a-form-item label="原厂编码" prop="name">
  49. <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入原厂编码" allowClear />
  50. </a-form-item>
  51. </a-col>
  52. <template v-if="advanced">
  53. <a-col :md="6" :sm="24">
  54. <a-form-item label="产品品牌">
  55. <a-select placeholder="请选择" id="warehouseAllocationEdit-state" allowClear v-model="queryParam.dataSourceNo" :showSearch="true" option-filter-prop="children" :filter-option="filterOption">
  56. <a-select-option v-for="item in brandData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
  57. </a-select>
  58. </a-form-item>
  59. </a-col>
  60. <a-col :md="6" :sm="24">
  61. <a-form-item label="产品类别">
  62. <a-cascader :options="typeData" id="warehouseAllocationEdit-state" placeholder="请选择产品类别" allowClear v-model="queryParam.brand" />
  63. </a-form-item>
  64. </a-col>
  65. <a-col :md="6" :sm="24">
  66. <a-form-item label="调出仓位">
  67. <v-select
  68. v-model="queryParam.billStatus"
  69. ref="billStatus"
  70. id="warehouseAllocationEdit-billStatus"
  71. code="PAYMENT_TYPE"
  72. placeholder="请选择调出仓位"
  73. allowClear></v-select>
  74. </a-form-item>
  75. </a-col>
  76. </template>
  77. <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
  78. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="warehouseAllocationList-refresh">查询</a-button>
  79. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-reset">重置</a-button>
  80. <a @click="advanced=!advanced" style="margin-left: 8px">
  81. {{ advanced ? '收起' : '展开' }}
  82. <a-icon :type="advanced ? 'up' : 'down'"/>
  83. </a>
  84. </a-col>
  85. </a-row>
  86. </a-form>
  87. </div>
  88. <!-- 列表 -->
  89. <s-table
  90. class="sTable"
  91. ref="table"
  92. size="default"
  93. :rowKey="(record) => record.id"
  94. :columns="columns"
  95. :data="loadData"
  96. bordered>
  97. <!-- 调入仓位 -->
  98. <template slot="storageQuantity" slot-scope="text, record">
  99. <a-select id="warehouseAllocationEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse">
  100. <a-select-option v-for="item in typeData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
  101. </a-select>
  102. </template>
  103. <!-- 调出数量 -->
  104. <template slot="transferOutQuantity" slot-scope="text, record">
  105. <a-input-number
  106. id="warehouseAllocationEdit-storageQuantity"
  107. :value="record.storageQuantity"
  108. :precision="0"
  109. :min="0"
  110. :max="999999"
  111. placeholder="请输入" />
  112. </template>
  113. <!-- 操作 -->
  114. <template slot="action" slot-scope="text, record">
  115. <a-button type="primary" @click="handleAdd(record)" id="warehouseAllocationEdit-add-btn">添加</a-button>
  116. </template>
  117. </s-table>
  118. </a-collapse-panel>
  119. </a-collapse>
  120. </a-card>
  121. <!-- 已选产品 -->
  122. <a-card :bordered="false" class="warehouseAllocationEdit-cont">
  123. <a-collapse :activeKey="['1']">
  124. <a-collapse-panel key="1" header="已选产品">
  125. <!-- 总计 -->
  126. <a-alert type="info" showIcon style="margin-bottom:15px">
  127. <div slot="message">总成本:¥<strong>6.33</strong>,总数量: <strong>6</strong> ,总款数: <strong>6</strong> </div>
  128. </a-alert>
  129. <!-- 筛选条件 -->
  130. <a-row :gutter="15" justify="space-between">
  131. <a-col :span="18">
  132. <div class="table-page-search-wrapper">
  133. <a-form layout="inline" @keyup.enter.native="$refs.chooseTable.refresh(true)">
  134. <a-row :gutter="15">
  135. <a-col :md="6" :sm="24">
  136. <a-form-item label="产品编码" prop="name">
  137. <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品编码" allowClear />
  138. </a-form-item>
  139. </a-col>
  140. <a-col :md="6" :sm="24">
  141. <a-form-item label="产品名称" prop="name">
  142. <a-input id="warehouseAllocationEdit-name" v-model="queryParam.name" placeholder="请输入产品名称" allowClear />
  143. </a-form-item>
  144. </a-col>
  145. <a-col :md="6" :sm="24" style="margin-bottom: 24px;">
  146. <a-button type="primary" @click="$refs.chooseTable.refresh(true)" :disabled="disabled" id="warehouseAllocationList-refresh">查询</a-button>
  147. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="warehouseAllocationList-reset">重置</a-button>
  148. </a-col>
  149. </a-row>
  150. </a-form>
  151. </div>
  152. </a-col>
  153. <a-col :span="6">
  154. <a-button type="primary" id="warehouseAllocationEdit-pladd-btn">批量添加</a-button>
  155. <a-button style="margin-left: 8px" id="warehouseAllocationEdit-import-btn">导入明细</a-button>
  156. <a-button type="danger" style="margin-left: 8px" id="warehouseAllocationEdit-del-all-btn">整单删除</a-button>
  157. </a-col>
  158. </a-row>
  159. <!-- 列表 -->
  160. <s-table
  161. class="sTable"
  162. ref="chooseTable"
  163. size="default"
  164. :rowKey="(record) => record.id"
  165. :columns="chooseColumns"
  166. :data="chooseLoadData"
  167. bordered>
  168. <!-- 调入仓位 -->
  169. <template slot="storageQuantity" slot-scope="text, record">
  170. <a-select id="warehouseAllocationEdit-warehouse" placeholder="请选择" allowClear v-model="record.warehouse">
  171. <a-select-option v-for="item in typeData" :key="item.salesChannelNo" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
  172. </a-select>
  173. </template>
  174. <!-- 调出数量 -->
  175. <template slot="transferOutQuantity" slot-scope="text, record">
  176. <a-input-number
  177. id="warehouseAllocationEdit-storageQuantity"
  178. :value="record.storageQuantity"
  179. :precision="0"
  180. :min="0"
  181. :max="999999"
  182. placeholder="请输入" />
  183. </template>
  184. <!-- 操作 -->
  185. <template slot="action" slot-scope="text, record">
  186. <a-button type="danger" @click="handleDel(record)" id="warehouseAllocationEdit-del-btn">删除</a-button>
  187. </template>
  188. </s-table>
  189. </a-collapse-panel>
  190. </a-collapse>
  191. </a-card>
  192. <a-affix :offset-bottom="0">
  193. <div style="text-align: center;width: 100%;background-color: #fff;padding: 30px 0;box-shadow: 0 0 20px #dcdee2;">
  194. <a-button type="primary" id="warehouseAllocationEdit-submit" size="large" @click="handleSubmit" style="padding: 0 60px;">提交</a-button>
  195. </div>
  196. </a-affix>
  197. <!-- 选择基本信息弹框 -->
  198. <basic-info-modal :openModal="openModal" @ok="handleOk" @close="openModal=false" />
  199. </div>
  200. </template>
  201. <script>
  202. import { STable, VSelect } from '@/components'
  203. import basicInfoModal from './basicInfoModal.vue'
  204. export default{
  205. components: { STable, VSelect, basicInfoModal },
  206. data(){
  207. return{
  208. queryParam: {
  209. },
  210. brandData: [], // 产品品牌 下拉数据
  211. typeData: [], // 产品类别 下拉数据
  212. disabled: false, // 查询、重置按钮是否可操作
  213. advanced: false, // 高级搜索 展开/关闭
  214. // 表头
  215. columns: [
  216. { title: '产品编码', dataIndex: 'creatDate', align: 'center' },
  217. { title: '产品名称', dataIndex: 'custNahme', align: 'center', ellipsis: true },
  218. { title: '原厂编码', dataIndex: 'totalP', align: 'center' },
  219. { title: '品牌', dataIndex: 'custsNsame', align: 'center' },
  220. { title: '类别', dataIndex: 'custsNdame', align: 'center' },
  221. { title: '调出仓位', dataIndex: 'custsNafme', align: 'center' },
  222. { title: '调入仓位', scopedSlots: { customRender: 'storageQuantity' }, align: 'center' },
  223. { title: '库存数量', dataIndex: 'custsNagme', align: 'center' },
  224. { title: '单位', dataIndex: 'custsNsagme', align: 'center' },
  225. { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, align: 'center' },
  226. { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
  227. ],
  228. // 加载数据方法 必须为 Promise 对象
  229. loadData: parameter => {
  230. this.disabled = true
  231. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  232. // const data = res.data
  233. // const no = (data.pageNo - 1) * data.pageSize
  234. // for (var i = 0; i < data.list.length; i++) {
  235. // data.list[i].no = no + i + 1
  236. // }
  237. // this.disabled = false
  238. // return data
  239. // })
  240. const _this = this
  241. return new Promise(function(resolve, reject){
  242. const data = {
  243. pageNo: 1,
  244. pageSize: 10,
  245. list: [
  246. { id: '1', purchaseNo: 'jgqp11111111111', creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  247. ],
  248. count: 10
  249. }
  250. const no = (data.pageNo - 1) * data.pageSize
  251. for (var i = 0; i < data.list.length; i++) {
  252. data.list[i].no = no + i + 1
  253. }
  254. _this.disabled = false
  255. resolve(data)
  256. })
  257. },
  258. // 表头
  259. chooseColumns: [
  260. { title: '产品编码', dataIndex: 'creatDaite', align: 'center', sorter: true },
  261. { title: '产品名称', dataIndex: 'custNayme', align: 'center' },
  262. { title: '原厂编码', dataIndex: 'custNdayme', align: 'center' },
  263. { title: '品牌', dataIndex: 'mementPsay', align: 'center' },
  264. { title: '类别', dataIndex: 'mementPay', align: 'center' },
  265. { title: '调出仓位', scopedSlots: { customRender: 'storageQuantity' }, align: 'center' },
  266. { title: '调入仓位', dataIndex: 'custsNakme', align: 'center' },
  267. { title: '单位', dataIndex: 'custssNakme', align: 'center' },
  268. { title: '调出数量', scopedSlots: { customRender: 'transferOutQuantity' }, align: 'center' },
  269. { title: '操作', scopedSlots: { customRender: 'action' }, width: 150, align: 'center' }
  270. ],
  271. // 加载数据方法 必须为 Promise 对象
  272. chooseLoadData: parameter => {
  273. this.disabled = true
  274. // return customerBundleDelayList( Object.assign(parameter, this.queryParam) ).then(res => {
  275. // const data = res.data
  276. // const no = (data.pageNo - 1) * data.pageSize
  277. // for (var i = 0; i < data.list.length; i++) {
  278. // data.list[i].no = no + i + 1
  279. // }
  280. // this.disabled = false
  281. // return data
  282. // })
  283. const _this = this
  284. return new Promise(function(resolve, reject){
  285. const data = {
  286. pageNo: 1,
  287. pageSize: 10,
  288. list: [
  289. { id: '1', purchaseNo: 'jgqp11111111111', custssName: 0, creatDate: '产品1', custName: 'jgqp111123545', totalP: '箭冠品牌', totalNums: '产品分类1', totalPrice: '5', payType: '122' }
  290. ],
  291. count: 10
  292. }
  293. const no = (data.pageNo - 1) * data.pageSize
  294. for (var i = 0; i < data.list.length; i++) {
  295. data.list[i].no = no + i + 1
  296. }
  297. _this.disabled = false
  298. resolve(data)
  299. })
  300. },
  301. openModal: false, // 选择基本信息弹框是否显示
  302. }
  303. },
  304. methods: {
  305. // 重置
  306. resetSearchForm () {
  307. this.queryParam.orderBundleNo = ''
  308. this.queryParam.orderBundle.custMobile = ''
  309. this.queryParam.bundleName = ''
  310. this.queryParam.itemName = ''
  311. this.oldTime = undefined
  312. this.newTime = undefined
  313. this.$refs.table.refresh(true)
  314. },
  315. // 添加
  316. handleAdd(row){},
  317. // 删除
  318. handleDel(row){},
  319. // 编辑基本信息
  320. handleEditInfo(){
  321. this.openModal = true
  322. },
  323. // 基本信息 保存
  324. handleOk(){
  325. },
  326. // 提交
  327. handleSubmit(){},
  328. // 导入明细
  329. handleImport(){
  330. console.log(333)
  331. },
  332. // 返回列表
  333. handleBack(){
  334. this.$router.push({ path: '/allocationManagement/warehouseAllocation/list'})
  335. },
  336. filterOption(input, option) {
  337. return (
  338. option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
  339. )
  340. },
  341. },
  342. beforeRouteEnter (to, from, next) {
  343. next(vm => {
  344. vm.openModal = false
  345. })
  346. }
  347. }
  348. </script>
  349. <style lang="less">
  350. .warehouseAllocationEdit-wrap{
  351. .warehouseAllocationEdit-back{
  352. margin-bottom: 15px;
  353. }
  354. .warehouseAllocationEdit-cont{
  355. margin-bottom: 15px;
  356. .sub-title{
  357. font-size: 12px;
  358. color: #808695;
  359. margin-left: 10px;
  360. }
  361. .tag-txt{
  362. font-size: 12px;
  363. color: #ed1c24;
  364. }
  365. .edit-circle-btn{
  366. margin-left: 15px;
  367. i{
  368. vertical-align: text-bottom;
  369. }
  370. }
  371. .import-btn{
  372. margin-left: 15px;
  373. }
  374. }
  375. }
  376. </style>