search-modal.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <el-dialog :visible.sync="innerVisible" width="1024px" title="筛选条件汇总" center :close-on-click-modal="false">
  3. <el-form>
  4. <el-row gutter="10">
  5. <el-row gutter="10">
  6. <el-input
  7. v-model="selectQueryValue"
  8. clearable
  9. size="mini"
  10. placeholder="关键字"
  11. maxlength="40"
  12. style="width:100%;padding:0px 10px;margin-bottom: 20px;"
  13. >
  14. <el-select
  15. slot="prepend"
  16. v-model="selectQueryKey"
  17. style="width: 140px"
  18. placeholder="关键字类型"
  19. >
  20. <el-option label="销售订单编号" value="orderCode" />
  21. <el-option label="发货申请单编号" value="outCode" />
  22. <el-option label="商品编号" value="good_code" />
  23. <el-option label="商品名称" value="good_name" />
  24. <el-option label="申请人部门" value="company_name" />
  25. <el-option label="申请人" value="apply_name" />
  26. <el-option label="采购单编号" value="cgdNo" />
  27. </el-select>
  28. </el-input>
  29. </el-row>
  30. <el-col :span="8">
  31. <el-form-item>
  32. <el-select v-model="formData.status" size="mini" placeholder="发货申请单状态" style="width:100%">
  33. <el-option
  34. v-for="opt in statusOptions"
  35. :key="opt.id"
  36. :value="opt.id"
  37. :label="opt.label"
  38. />
  39. </el-select>
  40. </el-form-item>
  41. </el-col>
  42. <el-col :span="8">
  43. <el-form-item>
  44. <el-select v-model="formData.send_status" size="mini" placeholder="发货工单状态" style="width:100%">
  45. <el-option
  46. v-for="opt in sendStatusOptions"
  47. :key="opt.value"
  48. :value="opt.value"
  49. :label="opt.label"
  50. />
  51. </el-select>
  52. </el-form-item>
  53. </el-col>
  54. <el-col :span="8">
  55. <el-form-item>
  56. <el-select
  57. v-model="formData.order_type"
  58. style="width:100%"
  59. size="mini"
  60. filterable
  61. clearable
  62. placeholder="商品类型"
  63. @change="
  64. pageInfo.curr = 1;
  65. parmValue.page = 1;
  66. searchList();
  67. "
  68. >
  69. <el-option
  70. v-for="item in xs_order_type_options"
  71. :key="'orderstatus' + item.id"
  72. :label="item.label"
  73. :value="item.id"
  74. />
  75. </el-select>
  76. </el-form-item>
  77. </el-col>
  78. </el-row>
  79. <el-row gutter="10">
  80. <el-col :span="8">
  81. <el-form-item>
  82. <el-select
  83. v-model="formData.order_source"
  84. style="width:100%"
  85. size="mini"
  86. filterable
  87. clearable
  88. placeholder="订单来源"
  89. @change="
  90. pageInfo.curr = 1;
  91. parmValue.page = 1;
  92. searchList();
  93. "
  94. >
  95. <el-option
  96. v-for="item in xs_order_source_options"
  97. :key="'orderstatus' + item.id"
  98. :label="item.label"
  99. :value="item.id"
  100. />
  101. </el-select>
  102. </el-form-item>
  103. </el-col>
  104. <el-col :span="8">
  105. <el-form-item>
  106. <search-supplier
  107. :size="'mini'"
  108. style="width:100%"
  109. :value="formData.supplierNo"
  110. :disabled="false"
  111. :placeholder="'供应商名称'"
  112. :code="formData.supplierNo"
  113. :is-detail="false"
  114. :no-disabled="true"
  115. @searchChange="supplierChange"
  116. />
  117. </el-form-item>
  118. </el-col>
  119. <el-col :span="8">
  120. <el-form-item>
  121. <search-customer
  122. :value="formData.companyNo"
  123. size="mini"
  124. :placeholder="'客户公司名称'"
  125. :names="customerName"
  126. :is-detail="true"
  127. @searchChange="customerChange"
  128. />
  129. </el-form-item>
  130. </el-col>
  131. </el-row>
  132. <el-row>
  133. <el-col span="24">
  134. <el-form-item>
  135. <div style="display:flex;justify-content:flex-end">
  136. <el-button size="mini" @click="onReset">重置</el-button>
  137. <el-button size="mini" type="primary" @click="onConfirm">确认</el-button>
  138. </div>
  139. </el-form-item>
  140. </el-col>
  141. </el-row>
  142. </el-form>
  143. </el-dialog>
  144. </template>
  145. <script>
  146. import { xs_order_source_options, xs_order_type_options } from '@/assets/js/statusList'
  147. const initalQuery = {
  148. status: '',
  149. companyNo: '',
  150. supplierNo: '',
  151. send_status: '',
  152. order_source: '',
  153. order_type: ''
  154. }
  155. export default {
  156. props: {
  157. visible: {
  158. type: Boolean,
  159. default: false
  160. }
  161. },
  162. data: () => ({
  163. customerName: '',
  164. selectQueryValue: '',
  165. selectQueryKey: 'orderCode',
  166. formData: { ...initalQuery },
  167. xs_order_source_options,
  168. xs_order_type_options,
  169. statusOptions: [
  170. { id: '0', label: '待发货' },
  171. { id: '1', label: '待库管发货' },
  172. { id: '2', label: '已发货待收货' },
  173. { id: '3', label: '已收货' },
  174. { id: '4', label: '已全部退货' }
  175. ],
  176. sendStatusOptions: [
  177. { value: '0', label: '不可拆单' },
  178. { value: '1', label: '可拆单' },
  179. { value: '2', label: '已拆单未发货' },
  180. { value: '3', label: '部分发货' },
  181. { value: '4', label: '全部发货' },
  182. { value: '5', label: '已收货' },
  183. { value: '6', label: '已退货' }
  184. ]
  185. }),
  186. computed: {
  187. innerVisible: {
  188. get() { return this.visible },
  189. set(newVal) { this.$emit('update:visible', newVal) }
  190. }
  191. },
  192. methods: {
  193. onConfirm() {
  194. this.innerVisible = false
  195. this.$emit('change', {
  196. ...this.formData,
  197. companyNo: this.getQeuryValue('companyNo'),
  198. supplierNo: this.getQeuryValue('supplierNo'),
  199. [this.selectQueryKey]: this.selectQueryValue
  200. })
  201. },
  202. getQeuryValue(queryKey) {
  203. const queryValue = this.formData[queryKey]
  204. return Array.isArray(queryValue) ? queryValue[0] : queryValue
  205. },
  206. async supplierChange(e) {
  207. const { code } = e
  208. this.formData.supplierNo = code ? [code] : []
  209. this.searchList()
  210. },
  211. async customerChange(e) {
  212. if (e && e.id) {
  213. this.formData.companyNo = [e.code]
  214. this.customerName = e.label
  215. } else {
  216. this.customerName = ''
  217. this.formData.companyNo = []
  218. }
  219. },
  220. onReset() {
  221. this.$emit('change', { ...initalQuery })
  222. this.selectQueryKey = 'orderCode'
  223. this.selectQueryValue = ''
  224. this.innerVisible = false
  225. }
  226. }
  227. }
  228. </script>