edit.vue 16 KB

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