123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560 |
- <template>
- <view class="content">
- <view class="">
- <u-subsection
- :list="list"
- :current="curNow"
- active-color="red"
- @change="sectionChange"></u-subsection>
- </view>
- <view class="" v-if="curNow == 0">
- <view class="confirm-view">
- <text class="text">起始点位:</text>
- <!-- focus -->
- <uni-easyinput
- style="margin: 0 11px"
- errorMessage
- v-model="sourceLocationId"
- :adjust-position="false"
- :class="recshow ? 'rec' : ''"
- class="uni-mt-5"
- trim="all"
- @focus="focusFunc"
- placeholder-style="font-size:16px;color: #a7a7a7;"
- placeholder="请输入起始点位"
- @input="input"></uni-easyinput>
- <button
- type="default"
- @click="goto('/pages/Warehousing/select/index?show=1')">
- 选择
- </button>
- </view>
- <!-- <view class="confirm-views">
- <view class="title" @click="inputDialogToggle">
- <view class="">
- <text>任务优先级:</text>
- </view>
- <view class="view_icon">
- <text>{{ value }}</text>
- <u-icon name="arrow-right" color="#6e6860" size="20"></u-icon>
- </view>
- </view>
- </view> -->
- <view class="confirm-view">
- <text class="text">终点点位:</text>
- <!-- focus -->
- <uni-easyinput
- style="margin: 0 11px"
- errorMessage
- v-model="targetLocationId"
- :class="recshowto ? 'rec' : ''"
- :adjust-position="false"
- @focus="focusFunvac"
- placeholder-style="font-size:16px;color: #a7a7a7;"
- placeholder="请输入终点点位"
- @input="inputEimt"></uni-easyinput>
- <button
- type="default"
- @click="goto('/pages/Warehousing/select/index?show=2')">
- 选择
- </button>
- </view>
- </view>
- <view class="" v-else>
- <uni-data-select
- v-model="value"
- :localdata="range"
- @change="change"></uni-data-select>
- <view class="confirm-view">
- <text class="text">{{ nameOut }}:</text>
- <!-- focus -->
- <uni-easyinput
- style="margin: 0 11px"
- errorMessage
- v-model="valueSian"
- :adjust-position="false"
- :class="recshowminu ? 'rec' : ''"
- class="uni-mt-5"
- trim="all"
- @focus="focusFuncemyi"
- placeholder-style="font-size:16px;color: #a7a7a7;"
- :placeholder="'请输入' + nameOut"
- @input="inputSupport"></uni-easyinput>
- <button type="default" v-show="rangeValue != 'in'" @click="naviga">
- 选择
- </button>
- </view>
- </view>
- <view class="border-buttons" @click="subfeom">
- <view class="buttons2">
- <text>移动</text>
- </view>
- </view>
- <uni-popup ref="inputDialog" type="dialog">
- <uni-popup-dialog
- ref="inputClose"
- title="任务优先级"
- value="对话框预置提示内容!"
- placeholder="请输入内容"
- @confirm="dialogInputConfirm">
- <u-radio-group
- placement="column"
- :borderBottom="true"
- v-model="value"
- iconPlacement="right">
- <u-radio
- :customStyle="{ marginBottom: '8px' }"
- v-for="(item, index) in radiolist1"
- :key="index"
- :label="item.name"
- :name="item.name"
- @change="radioChange"></u-radio>
- </u-radio-group>
- </uni-popup-dialog>
- </uni-popup>
- <xw-scan></xw-scan>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- valueSian: "",
- range: [
- { value: "in", text: "空桶暂存➡空托暂存" },
- { value: "out", text: "空托暂存➡入库缓存" },
- ],
- list: [
- {
- name: "其他移库",
- },
- {
- name: "空托移库",
- },
- ],
- curNow: 0,
- nameOut: "起始点位",
- valueSianid: "",
- recshow: false,
- sourceLocationIdcode: "",
- targetLocationIdcode: "",
- host: "",
- rangeValue: "in",
- sourceLocationId: "",
- targetLocationId: "",
- recshowminu: false,
- recshowto: false,
- type: "center",
- msgType: "success",
- messageText: "这是一条成功提示",
- value: "in",
- rangeValueto: "",
- value3: "",
- testdata: {},
- radiolist1: [
- {
- name: "普通",
- disabled: false,
- },
- {
- name: "紧急",
- disabled: false,
- },
- ],
- };
- },
- onShow() {
- let that = this;
- let pages = getCurrentPages();
- let currPage = pages[pages.length - 1];
- console.log("json", currPage.testdata);
- let json = currPage._data.testdata;
- this.testdata = json;
- },
- onUnload() {
- uni.$off("xwscan");
- },
- mounted() {
- let _this = this;
- uni.getStorage({
- key: "hostappst",
- success(res) {
- console.log("获取成功", res.data);
- _this.host = res.data;
- },
- });
- this.getData();
- },
- methods: {
- otherFun(obj) {
- console.log(obj);
- if (obj.show == 1) {
- this.sourceLocationId = obj.locationNo;
- this.sourceLocationIdcode = obj.id;
- } else if (obj.show == 2) {
- this.targetLocationId = obj.locationNo;
- this.targetLocationIdcode = obj.id;
- } else if (obj.show == 4) {
- this.valueSian = obj.locationNo;
- this.valueSianid = obj.id;
- }
- },
- focusFunc(e) {
- this.recshow = true;
- this.recshowto = false;
- uni.$off("xwscan");
- uni.$on("xwscan", (res) => {
- console.log("扫码结果:", res.code);
- this.sourceLocationId = res.code;
- this.sourceLocationIdcode = res.code;
- });
- console.log("focus事件");
- },
- focusFuncemyi(e) {
- this.recshowminu = true;
- uni.$off("xwscan");
- uni.$on("xwscan", (res) => {
- console.log("扫码结果:", res.code);
- this.valueSian = res.code;
- });
- console.log("focus事件");
- },
- change(e) {
- console.log("e", e, "1");
- this.rangeValue = e;
- if (e == "out") {
- this.valueSian = "";
- this.valueSianid = "";
- this.nameOut = "目标点位";
- } else {
- this.valueSian = "";
- this.valueSianid = "";
- this.nameOut = "起始点位";
- }
- },
- naviga() {
- if (this.rangeValue == "in") {
- this.rangeValueto = "emptyPalletSourceIn";
- } else {
- this.rangeValueto = "emptyPalletTargetOut";
- }
- uni.navigateTo({
- url:
- "/pages/Warehousing/select/index?show=4&rangeValue=" +
- this.rangeValueto,
- });
- },
- sectionChange(index) {
- console.log("index", index);
- this.curNow = index;
- },
- focusFunvac(e) {
- this.recshow = false;
- this.recshowto = true;
- uni.$off("xwscan");
- uni.$on("xwscan", (res) => {
- console.log("扫码结果:", res.code);
- this.targetLocationId = res.code;
- this.targetLocationIdcode = res.code;
- });
- console.log("focus事件");
- },
- goto(data) {
- uni.navigateTo({
- url: data,
- });
- },
- input(e) {
- console.log(e);
- this.sourceLocationIdcode = e;
- },
- inputEimt(e) {
- this.targetLocationIdcode = e;
- },
- inputSupport(e) {
- this.valueSianid = e;
- },
- subfeom() {
- let params = {
- locationId: this.valueSianid,
- moveType: this.rangeValue,
- };
- let dataobj = {
- sourceLocationId: this.sourceLocationIdcode,
- targetLocationId: this.targetLocationIdcode,
- };
- let that = this;
- uni.getStorage({
- key: "GetPhone_Token",
- success: function (res) {
- if (that.curNow == 0) {
- uni.request({
- url: `http://${that.host}` + "/ams/invLotLocId/moveLocInv",
- header: {
- Authorization: res.data,
- "content-type": "application/x-www-form-urlencoded",
- },
- data: dataobj,
- method: "POST",
- success(respenon) {
- console.log("chaoShiPanDuan", respenon);
- if (respenon.data.code == 200) {
- uni.showToast({
- title: respenon.data.msg,
- icon: "none",
- duration: 2000,
- });
- setTimeout(() => {
- uni.navigateTo({
- url: "/pages/index/tabbar/tabbar",
- });
- }, 1000);
- } else {
- uni.showToast({
- title: respenon.data.msg,
- icon: "none",
- });
- }
- console.log("res", res);
- },
- });
- } else {
- uni.request({
- url: `http://${that.host}` + "/ams/invLotLocId/moveEmptyPallet",
- header: {
- Authorization: res.data,
- "content-type": "application/x-www-form-urlencoded",
- },
- data: params,
- method: "POST",
- success(respenon) {
- console.log("chaoShiPanDuan", respenon);
- if (respenon.data.code == 200) {
- uni.showToast({
- title: respenon.data.msg,
- icon: "none",
- duration: 3000,
- });
- setTimeout(function () {
- uni.navigateTo({
- url: "/pages/index/tabbar/tabbar",
- });
- }, 1000);
- } else {
- uni.showToast({
- title: respenon.data.msg,
- icon: "none",
- });
- }
- console.log("res", res);
- },
- });
- }
- },
- });
- },
- inputDialogToggle() {
- this.$refs.inputDialog.open();
- },
- radioChange(val) {
- console.log(val);
- this.targetLocationId = val;
- },
- dialogInputConfirm(val) {
- console.log(this.value);
- setTimeout(() => {
- uni.hideLoading();
- console.log(val);
- this.value = this.value3;
- this.$refs.inputDialog.close();
- }, 100);
- },
- getData() {
- let that = this;
- let dataobj = {
- zoneId: 5,
- locationSceneCode: "emptyPalletSourceIn",
- };
- uni.getStorage({
- key: "GetPhone_Token",
- success: function (res) {
- // 恢复请求
- uni.request({
- url: `http://${that.host}` + "/inv/asn/getBaseLocationInfoList",
- header: {
- Authorization: res.data,
- },
- method: "GET",
- data: dataobj,
- success(res) {
- console.log("chaoShiPanDuan", res);
- if (res.data.code == 200) {
- res.data.data.forEach((item, index) => {
- if (that.rangeValue == "in") {
- that.valueSian = res.data.data[0].locationNo;
- that.valueSianid = res.data.data[0].id;
- }
- });
- } else if (respenon.data.code == 401) {
- uni.reLaunch({
- url: "/pages/index/login",
- });
- }
- console.log("res", res);
- },
- });
- },
- });
- },
- },
- };
- </script>
- <style scoped>
- /deep/.uni-select {
- font-size: 16px;
- border: 1px solid #e5e5e5;
- box-sizing: border-box;
- border-radius: 4px;
- padding: 13px 5px;
- padding-left: 10px;
- position: relative;
- display: flex;
- -webkit-user-select: none;
- user-select: none;
- flex-direction: row;
- align-items: center;
- border-bottom: solid 1px #e5e5e5;
- width: 100%;
- flex: 1;
- height: 35px;
- }
- /deep/.uni-select__input-placeholder {
- color: #6a6a6a;
- font-size: 16px;
- }
- /deep/.uni-icons {
- font-family: uniicons;
- text-decoration: none;
- text-align: center;
- font-size: 20px !important;
- }
- /deep/.u-subsection__item__text {
- font-size: 12px;
- line-height: 12px;
- display: flex;
- flex-direction: row;
- font-size: 15px !important;
- align-items: center;
- transition-property: color;
- transition-duration: 0.3s;
- }
- /deep/.is-input-border {
- display: flex;
- box-sizing: border-box;
- flex-direction: row;
- align-items: center;
- border-radius: 4px;
- background-color: rgb(245 245 245) !important;
- /* background: #24bdbd; */
- }
- /deep/.u-radio-label--right {
- flex-direction: row-reverse;
- justify-content: space-between;
- margin-bottom: 12px;
- }
- /deep/uni-button {
- color: #000;
- border: 1px solid #ff0000;
- border-radius: 31px;
- width: 21%;
- background-color: #f5f5f5;
- height: 42px;
- font-size: 16px;
- color: #ff0000;
- }
- /deep/.uni-easyinput__content-input[data-v-abe12412] {
- width: auto;
- position: relative;
- overflow: hidden;
- flex: 1;
- line-height: 1;
- font-size: 14px;
- height: 35px;
- /* border-bottom: 1px solid #ff0000 !important; */
- }
- /deep/.is-input-border {
- display: flex;
- box-sizing: border-box;
- flex-direction: row;
- align-items: center;
- border: none !important;
- border-radius: 4px;
- }
- </style>
- <style lang="scss" scoped>
- .content {
- // padding: 15px;
- .confirm-view {
- display: flex;
- padding: 15px;
- margin: 5px 0;
- align-items: center;
- border-bottom: 1px solid #d5d5d5;
- height: 56px;
- .text {
- font-size: 16px;
- color: #6e6860;
- font-weight: 500;
- }
- }
- .confirm-views {
- .title {
- display: flex;
- justify-content: space-between;
- font-size: 15px;
- color: #525151;
- padding: 15px;
- margin: 5px 0;
- align-items: center;
- border-bottom: 1px solid #d5d5d5;
- height: 56px;
- .view_icon {
- display: flex;
- align-content: center;
- align-items: center;
- }
- }
- }
- .border-buttons {
- display: flex;
- position: absolute;
- button: 0;
- bottom: 32px;
- padding: 0 15px;
- justify-content: space-between;
- width: 100%;
- text-align: center;
- .buttons2 {
- width: 100%;
- border: 1px solid #ff0505;
- border-radius: 34px;
- height: 42px;
- background: red;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 18px;
- color: white;
- font-weight: 500;
- }
- }
- }
- </style>
|