edit.vue 17 KB

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